Currently notmuch-show looks at the prefix-arg directly via
current-prefix-arg. This changes it to use the interactive
specification.
One test (for elide-toggle functionality) set the prefix arg
directly. Update this test to set the new argument directly.
(make-text-button (first link) (second link)
:type 'notmuch-button-type
'action `(lambda (arg)
(make-text-button (first link) (second link)
:type 'notmuch-button-type
'action `(lambda (arg)
- (notmuch-show ,(third link)))
+ (notmuch-show ,(third link) current-prefix-arg))
'follow-link t
'help-echo "Mouse-1, RET: search for this message"
'face goto-address-mail-face)))))
;;;###autoload
'follow-link t
'help-echo "Mouse-1, RET: search for this message"
'face goto-address-mail-face)))))
;;;###autoload
-(defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name)
+(defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-context buffer-name)
"Run \"notmuch show\" with the given thread ID and display results.
"Run \"notmuch show\" with the given thread ID and display results.
+ELIDE-TOGGLE, if non-nil, inverts the default elide behavior.
+
The optional PARENT-BUFFER is the notmuch-search buffer from
which this notmuch-show command was executed, (so that the
next thread from that buffer can be show when done with this
The optional PARENT-BUFFER is the notmuch-search buffer from
which this notmuch-show command was executed, (so that the
next thread from that buffer can be show when done with this
which the message thread is shown. If it is nil (which occurs
when the command is called interactively) the argument to the
function is used."
which the message thread is shown. If it is nil (which occurs
when the command is called interactively) the argument to the
function is used."
- (interactive "sNotmuch show: ")
+ (interactive "sNotmuch show: \nP")
(let ((buffer-name (generate-new-buffer-name
(or buffer-name
(concat "*notmuch-" thread-id "*")))))
(let ((buffer-name (generate-new-buffer-name
(or buffer-name
(concat "*notmuch-" thread-id "*")))))
(setq notmuch-show-process-crypto notmuch-crypto-process-mime)
;; Set the default value for
;; `notmuch-show-elide-non-matching-messages' in this buffer. If
(setq notmuch-show-process-crypto notmuch-crypto-process-mime)
;; Set the default value for
;; `notmuch-show-elide-non-matching-messages' in this buffer. If
- ;; there is a prefix argument, invert the default.
+ ;; elide-toggle is set, invert the default.
(setq notmuch-show-elide-non-matching-messages notmuch-show-only-matching-messages)
(setq notmuch-show-elide-non-matching-messages notmuch-show-only-matching-messages)
(setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages)))
(setq notmuch-show-thread-id thread-id
(setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages)))
(setq notmuch-show-thread-id thread-id
"Return a list of authors for the current region"
(notmuch-search-properties-in-region :subject beg end))
"Return a list of authors for the current region"
(notmuch-search-properties-in-region :subject beg end))
-(defun notmuch-search-show-thread ()
+(defun notmuch-search-show-thread (&optional elide-toggle)
"Display the currently selected thread."
"Display the currently selected thread."
(let ((thread-id (notmuch-search-find-thread-id))
(subject (notmuch-search-find-subject)))
(if (> (length thread-id) 0)
(notmuch-show thread-id
(let ((thread-id (notmuch-search-find-thread-id))
(subject (notmuch-search-find-subject)))
(if (> (length thread-id) 0)
(notmuch-show thread-id
(current-buffer)
notmuch-search-query-string
;; Name the buffer based on the subject.
(current-buffer)
notmuch-search-query-string
;; Name the buffer based on the subject.
test_emacs '(let ((notmuch-show-only-matching-messages nil))
(notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")
(notmuch-test-wait)
test_emacs '(let ((notmuch-show-only-matching-messages nil))
(notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")
(notmuch-test-wait)
- (let ((current-prefix-arg t))
- (notmuch-search-show-thread))
+ (notmuch-search-show-thread t)
(notmuch-test-wait)
(test-visible-output))'
test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-on
(notmuch-test-wait)
(test-visible-output))'
test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-on