mu icon indicating copy to clipboard operation
mu copied to clipboard

[mu4e bug] MIME-part prefixed action broken

Open foudfou opened this issue 1 year ago • 1 comments

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

  • [x] you are running either an 1.10.x/1.12.x release or master (otherwise please upgrade)
  • [x] you can reproduce the problem without 3rd party extensions (including Doom/Evil, various extensions etc.)
  • [x] you have read all of the above

Thank you!

foudfou avatar Oct 23 '24 17:10 foudfou

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.

foudfou avatar Oct 23 '24 21:10 foudfou

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

djcb avatar Oct 28 '24 19:10 djcb