mu4e: small code cleanups

Update some old code (we have 28.1 now); mostly:
- (= (length lst) x) ===> (length== lst x)
- (cdr (assoc ...)) ==> alist-get
This commit is contained in:
Dirk-Jan C. Binnema
2026-04-07 20:43:53 +03:00
committed by Seth Ladygo
parent 65b3dbb5c9
commit 0ca6389c03
8 changed files with 26 additions and 31 deletions

View File

@ -235,7 +235,7 @@ any further, go the next message."
(scroll-up)
(error
(when mu4e-view-scroll-to-next
(mu4e-view-headers-next)))))
(mu4e-headers-next)))))
(defun mu4e-scroll-up ()
"Scroll text of selected window up one line."
@ -716,7 +716,7 @@ render. After inserting, highlight the headers."
(defun mu4e--view-gnus-insert-header (field val)
"Insert a header FIELD with value VAL."
(let* ((info (cdr (assoc field mu4e-header-info)))
(let* ((info (alist-get field mu4e-header-info))
(key (or (plist-get info :name)
;; Fallback for fields not in mu4e-header-info
;; (e.g. :user-agent): derive from the keyword name.
@ -728,8 +728,8 @@ render. After inserting, highlight the headers."
(defun mu4e--view-gnus-insert-header-custom (msg field)
"Insert MSG's custom FIELD."
(let* ((info (cdr-safe (or (assoc field mu4e-header-info-custom)
(mu4e-error "Custom field %S not found" field))))
(let* ((info (or (alist-get field mu4e-header-info-custom)
(mu4e-error "Custom field %S not found" field)))
(key (plist-get info :name))
(func (or (plist-get info :function)
(mu4e-error "No :function defined for custom field %S %S"