diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-12 00:45:36 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-12 00:45:36 -0500 |
| commit | 18ba99fda928769adb235bd85b485c8be94c3ddd (patch) | |
| tree | e27f938fd55afa09a7d320d750205e785cfe5b93 /modules | |
| parent | 8cb30ef6efd06464ab1153b99261a3f626149f97 (diff) | |
| download | dotemacs-18ba99fda928769adb235bd85b485c8be94c3ddd.tar.gz dotemacs-18ba99fda928769adb235bd85b485c8be94c3ddd.zip | |
fix(mail): clear the marks after saving from the attachment selector
`cj/mu4e-attachment-selection-save-marked' left the `[x]' marks set after a successful save, so a second `s' silently re-saved the same files. It now unmarks every row and re-renders once the save returns, so the buffer stays open for another batch (and `q'/RET still exit). The save-marked test asserts the marks are cleared.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mu4e-attachments.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/mu4e-attachments.el b/modules/mu4e-attachments.el index 8f711000..4acdfd6a 100644 --- a/modules/mu4e-attachments.el +++ b/modules/mu4e-attachments.el @@ -208,7 +208,10 @@ The result is an alist of display labels to MIME part plists." (cj/mu4e--attachment-selection-render)) (defun cj/mu4e-attachment-selection-save-marked () - "Save marked attachments from the selection buffer." + "Save the marked attachments, then clear the marks. +Clearing the marks keeps a second `s' from silently re-saving the same set; +quit the buffer with `q' or RET when done. With no marks set, this is a +`user-error'." (interactive) (let ((parts (mapcar (lambda (entry) (plist-get entry :part)) (seq-filter (lambda (entry) @@ -218,6 +221,9 @@ The result is an alist of display labels to MIME part plists." (user-error "No attachments selected")) (let ((paths (cj/mu4e--save-attachment-parts parts cj/mu4e-attachment-selection-directory))) + (dolist (entry cj/mu4e-attachment-selection-entries) + (setf (plist-get entry :selected) nil)) + (cj/mu4e--attachment-selection-render) (message "Saved %d attachment%s to %s" (length paths) (if (= (length paths) 1) "" "s") |
