unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: stash bugfix
@ 2012-12-02 10:11 Mark Walters
  2012-12-02 11:04 ` Tomi Ollila
  2012-12-03  1:34 ` Austin Clements
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Walters @ 2012-12-02 10:11 UTC (permalink / raw)
  To: notmuch

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.

---
While messing around with notmuch-pick key bindings I found the
following bug. The easiest way I have found to trigger it is cc
(stash-cc) in show mode on a message with no cc header.

Best wishes

Mark

 emacs/notmuch-lib.el |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 1d0ec17..c7d8e02 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -183,8 +183,11 @@ 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))
+    (message "Warning: Nothing to stash!")))
 
 ;;
 
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-06 21:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-02 10:11 [PATCH] emacs: stash bugfix Mark Walters
2012-12-02 11:04 ` Tomi Ollila
2012-12-03  1:34 ` Austin Clements
2012-12-03  9:27   ` Mark Walters
2012-12-03 15:20     ` Austin Clements
2012-12-05 12:20       ` [PATCH v2] " Mark Walters
2012-12-05 16:01         ` Austin Clements
2012-12-06 21:25         ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).