mirror of https://github.com/djcb/mu.git
mu4e: better error for non-supported header fields
Some fields (eg. :attachments and :user-agent) require a full message and are not supported in headers-mode. Document this and give a clearer error message when they are added to `mu4e-headers-fields'. Fixes issue #933.
This commit is contained in:
parent
e294016e85
commit
01fe899c37
|
@ -851,7 +851,8 @@ after the end of the search results."
|
||||||
(let* ((field (car item)) (width (cdr item))
|
(let* ((field (car item)) (width (cdr item))
|
||||||
(info (cdr (assoc field
|
(info (cdr (assoc field
|
||||||
(append mu4e-header-info mu4e-header-info-custom))))
|
(append mu4e-header-info mu4e-header-info-custom))))
|
||||||
(sortable (plist-get info :sortable))
|
(require-full (plist-get info :require-full))
|
||||||
|
(sortable (plist-get info :sortable))
|
||||||
;; if sortable, it is either t (when field is sortable itself)
|
;; if sortable, it is either t (when field is sortable itself)
|
||||||
;; or a symbol (if another field is used for sorting)
|
;; or a symbol (if another field is used for sorting)
|
||||||
(sortfield (when sortable (if (booleanp sortable) field sortable)))
|
(sortfield (when sortable (if (booleanp sortable) field sortable)))
|
||||||
|
@ -862,6 +863,8 @@ after the end of the search results."
|
||||||
(if (eq mu4e-headers-sort-direction 'descending) downarrow uparrow)))
|
(if (eq mu4e-headers-sort-direction 'descending) downarrow uparrow)))
|
||||||
(name (concat (plist-get info :shortname) arrow))
|
(name (concat (plist-get info :shortname) arrow))
|
||||||
(map (make-sparse-keymap)))
|
(map (make-sparse-keymap)))
|
||||||
|
(when require-full
|
||||||
|
(mu4e-error "Field %S is not supported in mu4e-headers-mode" field))
|
||||||
(when sortable
|
(when sortable
|
||||||
(define-key map [header-line mouse-1]
|
(define-key map [header-line mouse-1]
|
||||||
(lambda (&optional e)
|
(lambda (&optional e)
|
||||||
|
|
|
@ -689,6 +689,7 @@ mu4e-compose-mode."
|
||||||
( :name "Attachments"
|
( :name "Attachments"
|
||||||
:shortname "Atts"
|
:shortname "Atts"
|
||||||
:help "Message attachments"
|
:help "Message attachments"
|
||||||
|
:require-full t
|
||||||
:sortable nil))
|
:sortable nil))
|
||||||
(:bcc .
|
(:bcc .
|
||||||
( :name "Bcc"
|
( :name "Bcc"
|
||||||
|
@ -749,11 +750,13 @@ mu4e-compose-mode."
|
||||||
( :name "Signature"
|
( :name "Signature"
|
||||||
:shortname "Sgn"
|
:shortname "Sgn"
|
||||||
:help "Check for the cryptographic signature"
|
:help "Check for the cryptographic signature"
|
||||||
|
:require-full t
|
||||||
:sortable nil))
|
:sortable nil))
|
||||||
(:decryption .
|
(:decryption .
|
||||||
( :name "Decryption"
|
( :name "Decryption"
|
||||||
:shortname "Dec"
|
:shortname "Dec"
|
||||||
:help "Check the cryptographic decryption status"
|
:help "Check the cryptographic decryption status"
|
||||||
|
:require-full t
|
||||||
:sortable nil))
|
:sortable nil))
|
||||||
(:size .
|
(:size .
|
||||||
( :name "Size"
|
( :name "Size"
|
||||||
|
@ -784,6 +787,7 @@ mu4e-compose-mode."
|
||||||
( :name "User-Agent"
|
( :name "User-Agent"
|
||||||
:shortname "UA"
|
:shortname "UA"
|
||||||
:help "Program used for writing this message"
|
:help "Program used for writing this message"
|
||||||
|
:require-full t
|
||||||
:sortable t)))
|
:sortable t)))
|
||||||
"An alist of all possible header fields and information about them.
|
"An alist of all possible header fields and information about them.
|
||||||
This is used in the user-interface (the column headers in the header list, and
|
This is used in the user-interface (the column headers in the header list, and
|
||||||
|
@ -799,7 +803,12 @@ sort by this field. This can be either a boolean (nil or t), or a
|
||||||
symbol for /another/ field. For example, the `:human-date' field
|
symbol for /another/ field. For example, the `:human-date' field
|
||||||
uses `:date' for that.
|
uses `:date' for that.
|
||||||
|
|
||||||
Note, `:sortable' does not work for custom header fields.")
|
Fields with which have the property `:require-full' set to
|
||||||
|
non-nil require a full message; in practice this means that you
|
||||||
|
cannot use such fieds as part of `mu4e-headers-fields', but only
|
||||||
|
in `mu4e-view-fields.'
|
||||||
|
|
||||||
|
Note, `:sortable' is not supported for custom header fields.")
|
||||||
|
|
||||||
|
|
||||||
(defvar mu4e-header-info-custom
|
(defvar mu4e-header-info-custom
|
||||||
|
|
Loading…
Reference in New Issue