(plist-put msg :height height)
height))))
-(defun notmuch-show-insert-headerline (headers date tags depth duplicate file-count)
+(defun notmuch-show-insert-headerline (msg-plist depth tags)
"Insert a notmuch style headerline based on HEADERS for a
message at DEPTH in the current thread."
- (let ((start (point))
- (from (notmuch-sanitize
+ (let* ((start (point))
+ (headers (plist-get msg-plist :headers))
+ (duplicate (or (plist-get msg-plist :duplicate) 0))
+ (file-count (length (plist-get msg-plist :filename)))
+ (date (or (and notmuch-show-relative-dates
+ (plist-get msg-plist :date_relative))
+ (plist-get headers :Date)))
+ (from (notmuch-sanitize
(notmuch-show-clean-address (plist-get headers :From)))))
(when (string-match "\\cR" from)
;; If the From header has a right-to-left character add
(make-variable-buffer-local 'notmuch-show-previous-subject)
(defun notmuch-show-choose-duplicate (duplicate)
+ "Display message file with index DUPLICATE in place of the current one.
+
+Message file indices are based on the order the files are
+discovered by `notmuch new' (and hence are somewhat arbitrary),
+and correspond to those passed to the \"\\-\\-duplicate\" arguments
+to the CLI.
+
+When called interactively, the function will prompt for the index
+of the file to display. An error will be signaled if the index
+is out of range."
(interactive "Nduplicate: ")
(let ((count (length (notmuch-show-get-prop :filename))))
(when (or (> duplicate count)
(defun notmuch-show-insert-msg (msg depth)
"Insert the message MSG at depth DEPTH in the current thread."
(let* ((headers (plist-get msg :headers))
- (duplicate (or (plist-get msg :duplicate) 0))
- (files (length (plist-get msg :filename)))
;; Indentation causes the buffer offset of the start/end
;; points to move, so we must use markers.
message-start message-end
headers-start headers-end
(bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
(setq message-start (point-marker))
- (notmuch-show-insert-headerline headers
- (or (and notmuch-show-relative-dates
- (plist-get msg :date_relative))
- (plist-get headers :Date))
- (plist-get msg :tags) depth duplicate files)
+ (notmuch-show-insert-headerline msg depth (plist-get msg :tags))
(setq content-start (point-marker))
;; Set `headers-start' to point after the 'Subject:' header to be
;; compatible with the existing implementation. This just sets it
(interactive (let ((query-string (if current-prefix-arg
"Pipe all open messages to command: "
"Pipe message to command: ")))
- (list current-prefix-arg (read-string query-string))))
+ (list current-prefix-arg (read-shell-command query-string))))
(let (shell-command)
(if entire-thread
(setq shell-command