diff options
author | Mark Walters <markwalters1009@gmail.com> | 2012-12-05 12:20:54 +0000 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-12-06 17:12:47 -0400 |
commit | 5382eebcdcdb50625c038c6caa89968d2f403bd1 (patch) | |
tree | 8ae821f46b524e34fef25130e3248e4118b4b699 /emacs | |
parent | 11365abb90b63af785f5b8ad73e0cbcefc567dce (diff) |
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.
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/notmuch-lib.el | 10 |
1 files changed, 8 insertions, 2 deletions
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!"))) ;; |