branch: externals/denote
commit 5193b10b257bfb09b198f14b38bad22ffd7e169d
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Make denote-grep-files-referenced-in-region throw an error if there is no
active region
---
denote.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/denote.el b/denote.el
index 73a74213be..a7053e3a58 100644
--- a/denote.el
+++ b/denote.el
@@ -5431,7 +5431,12 @@ just the identifier (as described in `denote-link' and
related), links
written by an Org dynamic block (see the `denote-org' package), or even
file listings such as those of `dired' and the command-line `ls' program."
(interactive
- (list (denote-grep-query-prompt :region) (region-beginning) (region-end)))
+ (if (region-active-p)
+ (list
+ (denote-grep-query-prompt :region)
+ (region-beginning)
+ (region-end))
+ (user-error "No region is active; aborting")))
(if-let* ((files (denote-grep--get-files-referenced-in-region start end)))
(denote-make-links-buffer query files nil
denote-grep-display-buffer-action)
(user-error "No files referenced in region")))