mu4e module: bookmark duplicates on config reload
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- emacs-lisp
- Domain
- tooling
Research direction
Start at modules/email/mu4e/config.el:180-181 and compare the current add-to-list call with mu4e 1.14's mu4e-bookmark-define API. Reload the Doom configuration repeatedly, then open mu4e and verify that "Flagged messages" appears only once; preserve the fallback behavior if older mu4e versions must remain supported.
Written by the indexing model from the issue text.
Description
Describe your issue
The +mu4e module's bookmark entry accumulates duplicates on every Doom config reload (doom/reload or SPC h r r). After N reloads, "Flagged messages" appears N+1 times in the bookmark list.
Root Cause
Format mismatch between Doom's add-to-list and mu4e 1.14's mu4e-bookmarks variable.
mu4e 1.14 defines mu4e-bookmarks as a defcustom using plist format:
(defcustom mu4e-bookmarks
'(( :name "Unread messages"
:query "flag:unread AND NOT flag:trashed"
:key ?u)
...)
Doom's module (modules/email/mu4e/config.el:180) adds the bookmark in old 3-element list format:
(add-to-list 'mu4e-bookmarks
'("flag:flagged" "Flagged messages" ?f) t)
add-to-list uses equal for comparison. Since ("flag:flagged" "Flagged messages" ?f) (old format) is not equal to (:name "Flagged messages" :query "flag:flagged" :key ?f) (plist format), add-to-list fails to detect the existing entry and appends a duplicate.
On each config reload:
- mu4e reinitializes
mu4e-bookmarksto its defcustom default (plist format, no "Flagged messages") - Doom's
after!block runsadd-to-list→ adds "Flagged messages" in old format - This accumulates if the variable isn't fully reset between reloads
Additionally, mu4e-bookmark-define (mu4e 1.14's new API) cannot remove old-format entries because it compares keys with (plist-get bm :key), which returns nil on old-format lists.
Affected Code
modules/email/mu4e/config.el:180-181:
(add-to-list 'mu4e-bookmarks
'("flag:flagged" "Flagged messages" ?f) t)
Suggested Fix
Replace with mu4e-bookmark-define (mu4e 1.14+):
(mu4e-bookmark-define "flag:flagged" "Flagged messages" ?f)
Or if backward compatibility with mu4e < 1.14 is needed:
(if (fboundp 'mu4e-bookmark-define)
(mu4e-bookmark-define "flag:flagged" "Flagged messages" ?f)
(add-to-list 'mu4e-bookmarks
'("flag:flagged" "Flagged messages" ?f) t))
Workaround
Add deduplication after bookmark definitions in user config:
(setq mu4e-bookmarks
(cl-delete-duplicates mu4e-bookmarks
:key (lambda (bm) (cond ((keywordp (car bm)) (plist-get bm :key))
((listp bm) (nth 2 bm))
(t nil)))
:test #'=))
Note: (listp bm) alone is insufficient — plists are also lists, so (nth 2 bm) on (:name ... :query ... :key ?f) returns the keyword :query, causing (wrong-type-argument number-or-marker-p :query) with :test #'=. The (keywordp (car bm)) check distinguishes plist from old format.
Steps to reproduce
- Add custom Bookmark(s) to config.el
- Sync/reload emacs configuration
- Open mu4e
System information
- mu4e 1.14.2-pre1 (built from source)
Disclosures
- This issue was written with/by AI.
- Dominant language
- Emacs Lisp
- Stars
- 61
- Forks
- 38
- Avg merge
- 11h 40m
- Merged PRs (30d)
- 5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from doomemacs/modules
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
:lang rust +tree-sitter: rustic-beginning-of-function fails with void-function rust-in-str-or-cmnt Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
:os tty
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
:ui vc-gutter
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
:checkers spell
Difficulty 3/5 1-2 days Newbie friendliness 48/100
All issues in doomemacs/modules
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hemilabs/ui-monorepo#2332 ·
-
Help-Wanted Needs-Triage Package-Update
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/winget-pkgs#438662 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
olcf/olcf-test-harness#278 · 1 comment ·