aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Ollila <tomi.ollila@iki.fi>2017-04-08 21:33:43 +0300
committerDavid Bremner <david@tethera.net>2017-05-30 08:54:35 -0300
commit427fa5e6e66eb238783f6cace56cbdcafc9c648d (patch)
tree5479bb04495868157218e5f85f516f6e43e8a2ce
parent5f71a4d3e15fa2ff7d4bcc9b8bfb8a2057b26ad7 (diff)
emacs: with prefix argument, notmuch-show-stash-date stashes timestamp
Using timestamp of a message is useful in many Xapian queries.
-rw-r--r--emacs/notmuch-show.el18
1 files changed, 14 insertions, 4 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index c670160d..e7c22da0 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1674,6 +1674,9 @@ current thread."
(defun notmuch-show-get-date ()
(notmuch-show-get-header :Date))
+(defun notmuch-show-get-timestamp ()
+ (notmuch-show-get-prop :timestamp))
+
(defun notmuch-show-get-from ()
(notmuch-show-get-header :From))
@@ -2239,10 +2242,17 @@ thread from search."
(interactive)
(notmuch-common-do-stash (notmuch-show-get-cc)))
-(defun notmuch-show-stash-date ()
- "Copy date of current message to kill-ring."
- (interactive)
- (notmuch-common-do-stash (notmuch-show-get-date)))
+(put 'notmuch-show-stash-date 'notmuch-prefix-doc
+ "Copy timestamp of current message to kill-ring.")
+(defun notmuch-show-stash-date (&optional stash-timestamp)
+ "Copy date of current message to kill-ring.
+
+If invoked with a prefix argument, copy timestamp of current
+message to kill-ring."
+ (interactive "P")
+ (if stash-timestamp
+ (notmuch-common-do-stash (format "%d" (notmuch-show-get-timestamp)))
+ (notmuch-common-do-stash (notmuch-show-get-date))))
(defun notmuch-show-stash-filename ()
"Copy filename of current message to kill-ring."