mu4e-lists: cosmetics

Minor cleanups
This commit is contained in:
Dirk-Jan C. Binnema
2025-02-06 18:42:32 +02:00
parent aad5fc7df5
commit 990cb768f2

View File

@ -1,6 +1,6 @@
;;; mu4e-lists.el --- Get names for mailing lists -*- lexical-binding: t -*- ;;; mu4e-lists.el --- Dealing with mailing lists -*- lexical-binding: t -*-
;; Copyright (C) 2011-2023 Dirk-Jan C. Binnema ;; Copyright (C) 2011-2025 Dirk-Jan C. Binnema
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
@ -28,9 +28,8 @@
;;; Code: ;;; Code:
(require 'mu4e-message) (require 'mu4e-message)
(require 'mu4e-helpers) (require 'mu4e-helpers)
;;; Helpers ;;; Helpers
(defmacro mu4e-message-id-url(base-url) (defmacro mu4e-message-id-url(base-url)
"Construct lambda to get an archive URL for message. "Construct lambda to get an archive URL for message.
This is based on some BASE-URL to which the message-id is concatenated; This is based on some BASE-URL to which the message-id is concatenated;
@ -38,11 +37,11 @@ e.g. public-inbox-based archives."
`(lambda (msg) (concat ,base-url "/" (plist-get msg :message-id)))) `(lambda (msg) (concat ,base-url "/" (plist-get msg :message-id))))
(defmacro mu4e-x-seq-url (base-url) (defmacro mu4e-x-seq-url (base-url)
"Construct x-seq archive URL for MSG or nil if not found." "Construct x-seq archive URL for MSG or nil if not found.
Use BASE-URL as the prefix."
`(lambda (msg) `(lambda (msg)
(when-let* ((xseq (mu4e-fetch-field msg "X-Seq"))) (when-let* ((xseq (mu4e-fetch-field msg "X-Seq")))
(concat ,base-url "/" xseq)))) (concat ,base-url "/" xseq))))
;;; Configuration ;;; Configuration
(defvar mu4e-mailing-lists (defvar mu4e-mailing-lists
`( (:list-id "bbdb-info.lists.sourceforge.net" :name "BBDB") `( (:list-id "bbdb-info.lists.sourceforge.net" :name "BBDB")
@ -141,10 +140,9 @@ Based on the current value of `mu4e-mailing-lists' and
Return nil if not found." Return nil if not found."
(unless mu4e--lists-hash (mu4e-mailing-list-info-refresh)) (unless mu4e--lists-hash (mu4e-mailing-list-info-refresh))
(gethash list-id mu4e--lists-hash)) (gethash list-id mu4e--lists-hash))
(defun mu4e-get-mailing-list-shortname (list-id) (defun mu4e-get-mailing-list-shortname (list-id)
"Get the shortname for a mailing-list with list-id LIST-ID. "Get the short-name for a mailing-list with list-id LIST-ID.
Either we know about this mailing list, or otherwise Either we know about this mailing list, or otherwise
we guess one." we guess one."
(or ;; 1. perhaps we have it in one of our lists? (or ;; 1. perhaps we have it in one of our lists?