(t
(setq p-address address)))
- ;; Remove elements of the mailbox part that are not relevant for
- ;; display, even if they are required during transport.
(when p-name
- ;; Outer double quotes.
- (when (string-match "^\"\\(.*\\)\"$" p-name)
- (setq p-name (match-string 1 p-name)))
-
+ ;; Remove elements of the mailbox part that are not relevant for
+ ;; display, even if they are required during transport:
+ ;;
;; Backslashes.
- (setq p-name (replace-regexp-in-string "\\\\" "" p-name)))
+ (setq p-name (replace-regexp-in-string "\\\\" "" p-name))
+
+ ;; Outer single and double quotes, which might be nested.
+ (loop
+ with start-of-loop
+ do (setq start-of-loop p-name)
+
+ when (string-match "^\"\\(.*\\)\"$" p-name)
+ do (setq p-name (match-string 1 p-name))
+
+ when (string-match "^'\\(.*\\)'$" p-name)
+ do (setq p-name (match-string 1 p-name))
+
+ until (string= start-of-loop p-name)))
;; If the address is 'foo@bar.com <foo@bar.com>' then show just
;; 'foo@bar.com'.
;; compatible with the existing implementation. This just sets it
;; to after the first header.
(notmuch-show-insert-headers headers)
- ;; Headers should include a blank line (backwards compatibility).
- (insert "\n")
(save-excursion
(goto-char content-start)
;; If the subject of this message is the same as that of the
(setq notmuch-show-previous-subject bare-subject)
(setq body-start (point-marker))
+ ;; A blank line between the headers and the body.
+ (insert "\n")
(notmuch-show-insert-body msg (plist-get msg :body) depth)
;; Ensure that the body ends with a newline.
(unless (bolp)
(notmuch-show-next-open-message))
;; Set the header line to the subject of the first open message.
- (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))
+ (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject)))
(notmuch-show-mark-read)))
(defun notmuch-show-get-depth ()
(notmuch-show-get-prop :depth))
+(defun notmuch-show-get-pretty-subject ()
+ (notmuch-prettify-subject (notmuch-show-get-subject)))
+
(defun notmuch-show-set-tags (tags)
"Set the tags of the current message."
(notmuch-show-set-prop :tags tags)