summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJameson Rollins <jrollins@finestructure.net>2010-09-18 15:48:21 -0400
committerCarl Worth <cworth@cworth.org>2010-11-11 17:28:32 -0800
commit128b6259ee327adf9189b81034b3b6962e8b9dbc (patch)
treed716c04151f5c2b215eb0e43c3757dcf3b3b7bed
parentea1c2bb5c5ab7115e3259d2e66e19398ce4cc19f (diff)
emacs: mv notmuch-{show,common}-do-stash
Here we move the notmuch-show/notmuch-show-do-stash function to notmuch-lib/notmuch-common-do-stash. Nothing in this function is notmuch-show mode specific, so this move will make it cleaner to be used by other modes (such as notmuch-search).
-rw-r--r--emacs/notmuch-lib.el8
-rw-r--r--emacs/notmuch-show.el20
2 files changed, 16 insertions, 12 deletions
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index dfdcd05..9d4e00f 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -94,6 +94,13 @@ the user hasn't set this variable with the old or new value."
;;
+(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))
+
+;;
+
;; XXX: This should be a generic function in emacs somewhere, not
;; here.
(defun point-invisible-p ()
@@ -110,3 +117,4 @@ within the current window."
(assq prop buffer-invisibility-spec)))))
(provide 'notmuch-lib)
+
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 0d3c4c2..d8773e6 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1088,49 +1088,45 @@ buffer."
(interactive)
(notmuch-show-archive-thread-internal nil))
-(defun notmuch-show-do-stash (text)
- (kill-new text)
- (message "Saved: %s" text))
-
(defun notmuch-show-stash-cc ()
"Copy CC field of current message to kill-ring."
(interactive)
- (notmuch-show-do-stash (notmuch-show-get-cc)))
+ (notmuch-common-do-stash (notmuch-show-get-cc)))
(defun notmuch-show-stash-date ()
"Copy date of current message to kill-ring."
(interactive)
- (notmuch-show-do-stash (notmuch-show-get-date)))
+ (notmuch-common-do-stash (notmuch-show-get-date)))
(defun notmuch-show-stash-filename ()
"Copy filename of current message to kill-ring."
(interactive)
- (notmuch-show-do-stash (notmuch-show-get-filename)))
+ (notmuch-common-do-stash (notmuch-show-get-filename)))
(defun notmuch-show-stash-from ()
"Copy From address of current message to kill-ring."
(interactive)
- (notmuch-show-do-stash (notmuch-show-get-from)))
+ (notmuch-common-do-stash (notmuch-show-get-from)))
(defun notmuch-show-stash-message-id ()
"Copy message ID of current message to kill-ring."
(interactive)
- (notmuch-show-do-stash (notmuch-show-get-message-id)))
+ (notmuch-common-do-stash (notmuch-show-get-message-id)))
(defun notmuch-show-stash-subject ()
"Copy Subject field of current message to kill-ring."
(interactive)
- (notmuch-show-do-stash (notmuch-show-get-subject)))
+ (notmuch-common-do-stash (notmuch-show-get-subject)))
(defun notmuch-show-stash-tags ()
"Copy tags of current message to kill-ring as a comma separated list."
(interactive)
- (notmuch-show-do-stash (mapconcat 'identity (notmuch-show-get-tags) ",")))
+ (notmuch-common-do-stash (mapconcat 'identity (notmuch-show-get-tags) ",")))
(defun notmuch-show-stash-to ()
"Copy To address of current message to kill-ring."
(interactive)
- (notmuch-show-do-stash (notmuch-show-get-to)))
+ (notmuch-common-do-stash (notmuch-show-get-to)))
;; Commands typically bound to buttons.