X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=7fc342a567f336b6f9e69c8aee24af412d9ccc5d;hp=8cf7261e6f4fac2d16a9c7c2aafc96866b29d90c;hb=f3cba19f882471a396a6b6175a709ccd1f6f34a0;hpb=adde6dfaef9348a6ea5e1fe3651e85dacff775b7 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 8cf7261e..7fc342a5 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -298,7 +298,7 @@ This is basically just `format-kbd-macro' but we also convert ESC to M-." "Prepend cons cells describing prefix-arg ACTUAL-KEY and ACTUAL-KEY to TAIL It does not prepend if ACTUAL-KEY is already listed in TAIL." - (let ((key-string (concat prefix (format-kbd-macro actual-key)))) + (let ((key-string (concat prefix (key-description actual-key)))) ;; We don't include documentation if the key-binding is ;; over-ridden. Note, over-riding a binding automatically hides the ;; prefixed version too. @@ -313,7 +313,7 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL." ;; Documentation for command (push (cons key-string (or (and (symbolp binding) (get binding 'notmuch-doc)) - (notmuch-documentation-first-line binding))) + (and (functionp binding) (notmuch-documentation-first-line binding)))) tail))) tail) @@ -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: