emacs: stash bugfix

Currently an attempt to stash a non-existent field (eg cc when not
present) throws an error. Catch this case and give the user a warning
message.
This commit is contained in:
Mark Walters 2012-12-05 12:20:54 +00:00 committed by David Bremner
parent 11365abb90
commit 5382eebcdc

View file

@ -168,8 +168,14 @@ user-friendly queries."
(defun notmuch-common-do-stash (text)
"Common function to stash text in kill ring, and display in minibuffer."
(if text
(progn
(kill-new text)
(message "Stashed: %s" text))
;; There is nothing to stash so stash an empty string so the user
;; doesn't accidentally paste something else somewhere.
(kill-new "")
(message "Nothing to stash!")))
;;