From: Mark Walters Date: Wed, 5 Dec 2012 12:20:54 +0000 (+0000) Subject: emacs: stash bugfix X-Git-Tag: 0.15_rc1~128 X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=5382eebcdcdb50625c038c6caa89968d2f403bd1;p=notmuch 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. --- diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 3e8647db..9c4ee718 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -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." - (kill-new text) - (message "Stashed: %s" text)) + (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!"))) ;;