mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
emacs: show: modify insert-part-header to save the button text
This just make notmuch-show-insert-part-header save the basic button text for parts as an attribute. This makes it simpler for the button action (added in a later patch) to reword the label as appropriate (eg append "(not shown)" or not as appropriate).
This commit is contained in:
parent
8ba6016889
commit
fff2ea2ba9
1 changed files with 9 additions and 9 deletions
|
@ -483,17 +483,17 @@ message at DEPTH in the current thread."
|
||||||
(fset 'notmuch-show-part-button-map notmuch-show-part-button-map)
|
(fset 'notmuch-show-part-button-map notmuch-show-part-button-map)
|
||||||
|
|
||||||
(defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)
|
(defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)
|
||||||
(let ((button))
|
(let ((button)
|
||||||
|
(base-label (concat (when name (concat name ": "))
|
||||||
|
declared-type
|
||||||
|
(unless (string-equal declared-type content-type)
|
||||||
|
(concat " (as " content-type ")"))
|
||||||
|
comment)))
|
||||||
|
|
||||||
(setq button
|
(setq button
|
||||||
(insert-button
|
(insert-button
|
||||||
(concat "[ "
|
(concat "[ " base-label " ]")
|
||||||
(if name (concat name ": ") "")
|
:base-label base-label
|
||||||
declared-type
|
|
||||||
(if (not (string-equal declared-type content-type))
|
|
||||||
(concat " (as " content-type ")")
|
|
||||||
"")
|
|
||||||
(or comment "")
|
|
||||||
" ]")
|
|
||||||
:type 'notmuch-show-part-button-type
|
:type 'notmuch-show-part-button-type
|
||||||
:notmuch-part nth
|
:notmuch-part nth
|
||||||
:notmuch-filename name
|
:notmuch-filename name
|
||||||
|
|
Loading…
Reference in a new issue