summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog4
-rw-r--r--mailscripts.el10
2 files changed, 13 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index a38fe6d..7363245 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,10 @@ mailscripts (0.20-2) UNRELEASED; urgency=medium
- new command: notmuch-slurp-debbug-at-point
- notmuch-slurp-this-debbug: if fail to extract bug number from
subject line, prompt user for one
+ - notmuch-slurp-debbug: invoke notmuch to determine the thread-id
+ rather than passing the search query directly to `notmuch-show'.
+ That is not how `notmuch-show' is meant to be called and can result
+ in strange behaviour.
-- Sean Whitton <spwhitton@spwhitton.name> Sat, 23 May 2020 10:49:57 -0700
diff --git a/mailscripts.el b/mailscripts.el
index 36f5732..50e3b89 100644
--- a/mailscripts.el
+++ b/mailscripts.el
@@ -54,7 +54,15 @@ If NO-OPEN, don't open the thread."
(interactive "sBug number: ")
(call-process-shell-command (concat "notmuch-slurp-debbug " bug))
(unless no-open
- (notmuch-show (concat "Bug#" bug))))
+ (let* ((search (concat "Bug#" bug))
+ (thread-id (car (process-lines notmuch-command
+ "search"
+ "--output=threads"
+ "--limit=1"
+ "--format=text"
+ "--format-version=4" search))))
+ (notmuch-show thread-id nil nil nil
+ (concat "*notmuch-show-" search "*")))))
;;;###autoload
(defun notmuch-slurp-debbug-at-point ()