djcb / mu

maildir indexer/searcher + emacs mail client + guile bindings
http://www.djcbsoftware.nl/code/mu
GNU General Public License v3.0
1.62k stars 391 forks source link

[mu4e bug] MIME-part prefixed action broken #2776

Closed foudfou closed 4 weeks ago

foudfou commented 1 month ago

Describe the bug

Prefix on MIME-part actions (<Number> A or C-u <Number> A) doesn't work anymore.

Before upgrade: 4 A o on a message with 4 attachments would open the 4th MIME attachment, as described in the documentation.

After upgrade: 4 A already prompts MIME-part(s) to operate on:

How to Reproduce

  1. emacs -Q with minimal configuration
  2. view a message with attachments
  3. 4 A prompts for MIME-part(s) to operate on

Prefixed functions seem to work otherwise fine in emacs.

I think this regression was introduced in 993f1652, where mu4e-view-mime-part-action lost its prefix part:

  (interactive "NNumber of MIME-part: ")
;; became:
  ;; (interactive
  ;;  (list (read-number "Number of MIME-part: ")))
  (interactive)

I see the intent is to now support multiple parts. I would happily provide a PR but I'm unsure of the best approach: should we go with

(interactive "p") ;; p -- Prefix arg converted to number.  Does not do I/O.

and fallback to reading from the minibuffer?

Environment

Arch linux, emacs 29.4, mu 1.12.6. Unfortunately I don't have traces of the previous mu version.

Checklist

Thank you!

foudfou commented 1 month ago

Oh I realize we're already checking if an argument was provided when computing ids. So I guess what's left is only

  (interactive "P") ; P -- Prefix arg in raw form.  Does not do I/O.

At least that's resulting in the expected behavior.

djcb commented 4 weeks ago

Yeah, that should do the trick I think. I'll install that, and mention you in the commit message. Thank you!