]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-lib.el
emacs: stash bugfix
[notmuch] / emacs / notmuch-lib.el
index 3e8647db78c8710e7d3bb0926e8b52729866b3ac..9c4ee71811ed8e91b8378c96d2601533e39c5ad7 100644 (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."
-  (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!")))
 
 ;;