]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-lib.el
emacs: Move notmuch-search-interactive-region to notmuch-lib as notmuch-interactive...
[notmuch] / emacs / notmuch-lib.el
index 546ab6fda41f654e8e64d1a85408f64fc6f78ffe..7fc342a567f336b6f9e69c8aee24af412d9ccc5d 100644 (file)
@@ -1008,6 +1008,15 @@ status."
 (defvar notmuch-show-process-crypto nil)
 (make-variable-buffer-local 'notmuch-show-process-crypto)
 
+(defun notmuch-interactive-region ()
+  "Return the bounds of the current interactive region.
+
+This returns (BEG END), where BEG and END are the bounds of the
+region if the region is active, or both `point' otherwise."
+  (if (region-active-p)
+      (list (region-beginning) (region-end))
+    (list (point) (point))))
+
 (provide 'notmuch-lib)
 
 ;; Local Variables: