aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-08-04 08:48:07 -0300
committerDavid Bremner <david@tethera.net>2022-08-07 07:05:49 -0300
commit05c85290ca43a22d99bc65f5b40e6b8027081ce8 (patch)
tree4776202a3de9f00d688a662f9caf4a1339b4c146
parent67f535332c43e735a8fd28171a1ef4d82dc56b96 (diff)
emacs/show: provide a more friendly function to get duplicate num
There is not much code here, but at least we can fix the indexing as 1 based.
-rw-r--r--emacs/notmuch-show.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 527db4bb..e9a9ac2c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1813,7 +1813,7 @@ current thread."
(defun notmuch-show-get-filename ()
"Return the filename of the current message."
- (let ((duplicate (or (notmuch-show-get-prop :duplicate) 1)))
+ (let ((duplicate (notmuch-show-get-duplicate)))
(nth (1- duplicate) (notmuch-show-get-prop :filename))))
(defun notmuch-show-get-header (header &optional props)
@@ -1826,6 +1826,10 @@ current thread."
(defun notmuch-show-get-date ()
(notmuch-show-get-header :Date))
+(defun notmuch-show-get-duplicate ()
+ ;; if no duplicate property exists, assume first file
+ (or (notmuch-show-get-prop :duplicate) 1))
+
(defun notmuch-show-get-timestamp ()
(notmuch-show-get-prop :timestamp))