unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* rmail and mime encoded patches annoyance
@ 2023-05-19  6:11 Alfred M. Szmidt
  2023-05-19  6:45 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Alfred M. Szmidt @ 2023-05-19  6:11 UTC (permalink / raw)
  To: emacs-devel

Hi,

Was working through a set of patches, and sorta got a bit fed up, more
often than not patches are sent as MIME attachment, and show up as:

[2:text/plain Show Save:patch-foo-bar-baz.lisp (6kB)]

in the RMAIL buffer.  But if you edit such a message
(rmail-edit-current-message); it is very cumbersome to edit it
attachments, since they will be in base64, and you need to decode
manually.  Plus, when viewing the message later .. it will no longer
be expanded.

Is there some way of "decoding the message" permantnetly into ASCII or
something, so that it now longer is MIME encoded?  So you get "What I
See Is What I Edit" behaviour..  This would then also be useful when
one replies to such messages with inline comments to a patch.

/Alfred



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19  6:11 rmail and mime encoded patches annoyance Alfred M. Szmidt
@ 2023-05-19  6:45 ` Eli Zaretskii
  2023-05-19  7:17   ` Alfred M. Szmidt
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2023-05-19  6:45 UTC (permalink / raw)
  To: Alfred M. Szmidt; +Cc: emacs-devel

> From: "Alfred M. Szmidt" <ams@gnu.org>
> Date: Fri, 19 May 2023 02:11:03 -0400
> 
> Is there some way of "decoding the message" permantnetly into ASCII or
> something, so that it now longer is MIME encoded?  So you get "What I
> See Is What I Edit" behaviour..  This would then also be useful when
> one replies to such messages with inline comments to a patch.

Not that I know of, no.  MIME capabilities in Rmail are minimal, and
do 90% of the job very well, but not much more.

FWIW, I almost never use rmail-edit, and don't really understand why
it's useful, let alone when a MIME patch is attached to it.  If what
you need is to edit the patch before applying it, then (a) that is not
really recommended, since you will be applying code attributed to
someone else with your own changes; and (b) you could always copy the
patch to another buffer, edit it there, and then apply.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19  6:45 ` Eli Zaretskii
@ 2023-05-19  7:17   ` Alfred M. Szmidt
  2023-05-19 10:51     ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Alfred M. Szmidt @ 2023-05-19  7:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

   > Is there some way of "decoding the message" permantnetly into ASCII or
   > something, so that it now longer is MIME encoded?  So you get "What I
   > See Is What I Edit" behaviour..  This would then also be useful when
   > one replies to such messages with inline comments to a patch.

   Not that I know of, no.  MIME capabilities in Rmail are minimal, and
   do 90% of the job very well, but not much more.

   FWIW, I almost never use rmail-edit, and don't really understand why
   it's useful, let alone when a MIME patch is attached to it.  If what
   you need is to edit the patch before applying it, 

It is more for commenting about the patch, in this case.  One could
start a new reply, but those aren't presitent, and sometimes patches
take a week or two to go over.

Similar, I use this for longer responses, where I edit the message and
add my reply/comments/... and then save the RMAIL buffer.  And when
you're done, you just reply with the notes you did.

Alas MIME is more and more prevailant, Rmail Edit sorta has gotten
more and more cumbersome to use. :(

   then (a) that is not really recommended, since you will be applying
   code attributed to someone else with your own changes; and (b) you
   could always copy the patch to another buffer, edit it there, and
   then apply.

Doing that multiple times a day gets old quick; was hoping to find a
better way.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19  7:17   ` Alfred M. Szmidt
@ 2023-05-19 10:51     ` Eli Zaretskii
  2023-05-19 11:08       ` Alfred M. Szmidt
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2023-05-19 10:51 UTC (permalink / raw)
  To: Alfred M. Szmidt; +Cc: emacs-devel

> From: "Alfred M. Szmidt" <ams@gnu.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 19 May 2023 03:17:27 -0400
> 
>    FWIW, I almost never use rmail-edit, and don't really understand why
>    it's useful, let alone when a MIME patch is attached to it.  If what
>    you need is to edit the patch before applying it, 
> 
> It is more for commenting about the patch, in this case.  One could
> start a new reply, but those aren't presitent, and sometimes patches
> take a week or two to go over.

I don't understand: if you reply with the attachment displayed (i.e.,
after you pres the "Show" button on the MIME attachment header line),
"C-c C-y" will yank the decoded attachment's text as well, and you can
then comment on it like you do with any other text of the original
message.

> Similar, I use this for longer responses, where I edit the message and
> add my reply/comments/... and then save the RMAIL buffer.  And when
> you're done, you just reply with the notes you did.

I still don't understand why you need to use rmail-edit for that.
What's wrong with adding your reply/comments in the response message
after rmail-reply?  If you want to save the response for editing or
replying later, there's FCC, or you can use BCC to send a copy to
yourself.

>    then (a) that is not really recommended, since you will be applying
>    code attributed to someone else with your own changes; and (b) you
>    could always copy the patch to another buffer, edit it there, and
>    then apply.
> 
> Doing that multiple times a day gets old quick; was hoping to find a
> better way.

Like I say above: I don't understand why you'd need to do that even
once a day.  I don't, and you can believe me that I review a lot of
patches sent as attachments, and not only for Emacs.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19 10:51     ` Eli Zaretskii
@ 2023-05-19 11:08       ` Alfred M. Szmidt
  2023-05-19 11:25         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Alfred M. Szmidt @ 2023-05-19 11:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Buffers aren't permanent.  I'd need to save the buffer to a file, to
later re-open, and then send -- possibly also remove the file when
done.  RMAIL already keeps tabs on what messages I've replied to or
not, or have edited.  And I get all of that just in one go, when I
edit a message.  I can label messages, and show only specific ones
based on labels.

Adding FCC/BCC is an extra additional step that is very easy to
forget, which also involves actually sending your email, and fetching
your email -- so a permanent network connection.

All the suggestions are additional work, work which did not exist
before MIME.  It is neither incremental, nor inuitive if you are
already familiar with rmail-edit.

I too review lots of patches (about 20-30 per day), and this is only
annoying when people send them as something that is not "text", and
was hoping to minimize that work using a workflow that has worked for
decades -- so I'm not that interested in other ways of working, rather
figuring out how one could fix rmail-edit so that it continues to
work.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19 11:08       ` Alfred M. Szmidt
@ 2023-05-19 11:25         ` Eli Zaretskii
  2023-05-19 11:31           ` Alfred M. Szmidt
  2023-05-19 11:39           ` Alfred M. Szmidt
  0 siblings, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2023-05-19 11:25 UTC (permalink / raw)
  To: Alfred M. Szmidt; +Cc: emacs-devel

> From: "Alfred M. Szmidt" <ams@gnu.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 19 May 2023 07:08:17 -0400
> 
> Buffers aren't permanent.  I'd need to save the buffer to a file, to
> later re-open, and then send -- possibly also remove the file when
> done.  RMAIL already keeps tabs on what messages I've replied to or
> not, or have edited.  And I get all of that just in one go, when I
> edit a message.  I can label messages, and show only specific ones
> based on labels.
> 
> Adding FCC/BCC is an extra additional step that is very easy to
> forget, which also involves actually sending your email, and fetching
> your email -- so a permanent network connection.
> 
> All the suggestions are additional work, work which did not exist
> before MIME.  It is neither incremental, nor inuitive if you are
> already familiar with rmail-edit.

I see where you are coming from, but I'm using the facilities I
described all the time, and never had any problems with them.  OTOH,
what you are after doesn't exist.  So my suggestion is to change your
MO to use the facilities I described, because they are ready to be
used and quite convenient.

Of course, if you decide instead to extend rmail-edit to support your
use patterns, I'm sure we will be interested in considering your
changes for inclusion in rmail.el/rmailmm.el

TIA



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19 11:25         ` Eli Zaretskii
@ 2023-05-19 11:31           ` Alfred M. Szmidt
  2023-05-19 11:38             ` Eli Zaretskii
  2023-05-19 11:39           ` Alfred M. Szmidt
  1 sibling, 1 reply; 11+ messages in thread
From: Alfred M. Szmidt @ 2023-05-19 11:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Shouldn't it be possible to convert / strip a MIME message to "ASCII"
(i.e., something similar you get when you expand all attachments, and
yank it)?

If not, ideas on how to achive that?

That way, you can "un-MIME" a message, and use all normal tools.  Not
ideal, but less work than anything else so far..



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19 11:31           ` Alfred M. Szmidt
@ 2023-05-19 11:38             ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2023-05-19 11:38 UTC (permalink / raw)
  To: Alfred M. Szmidt; +Cc: emacs-devel

> From: "Alfred M. Szmidt" <ams@gnu.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 19 May 2023 07:31:25 -0400
> 
> Shouldn't it be possible to convert / strip a MIME message to "ASCII"
> (i.e., something similar you get when you expand all attachments, and
> yank it)?
> 
> If not, ideas on how to achive that?
> 
> That way, you can "un-MIME" a message, and use all normal tools.  Not
> ideal, but less work than anything else so far..

AFAIR, currently the "un-MIME" thing happens at display time.  We
never change the original mbox buffer, we only expand the MIME
attachments in the display buffer.

If (AFAIU) you want to "un-MIME" the original message in the mbox
format, I'm not sure I know enough about email standards to know the
answer to your questions.  E.g., what do you do with all the MIME
headers and "Next_Part" stuff, and how do you keep the fragile mbox
structure intact while making all those edits.

Anyway, the code to un-MIME MIME attachments is in rmailmm.el, so you
should start by looking there.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19 11:25         ` Eli Zaretskii
  2023-05-19 11:31           ` Alfred M. Szmidt
@ 2023-05-19 11:39           ` Alfred M. Szmidt
  2023-05-19 16:53             ` Bob Rogers
  1 sibling, 1 reply; 11+ messages in thread
From: Alfred M. Szmidt @ 2023-05-19 11:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

A _very_ ugly solution.

Edit the message in question, remove the MIME-Version: field, convert
the sections you care about using base64-decode-region.  Save.  Rmail
will complain slightly about the message not being a valid MIME
message, but .. meh.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19 11:39           ` Alfred M. Szmidt
@ 2023-05-19 16:53             ` Bob Rogers
  2023-05-21  0:46               ` Francesco Potortì
  0 siblings, 1 reply; 11+ messages in thread
From: Bob Rogers @ 2023-05-19 16:53 UTC (permalink / raw)
  To: Alfred M. Szmidt; +Cc: Eli Zaretskii, emacs-devel

   From: "Alfred M. Szmidt" <ams@gnu.org>
   Date: Fri, 19 May 2023 07:39:31 -0400

   A _very_ ugly solution.

   Edit the message in question, remove the MIME-Version: field, convert
   the sections you care about using base64-decode-region.  Save.  Rmail
   will complain slightly about the message not being a valid MIME
   message, but .. meh.

Seems to me that all you really need to do is to convert the
content-transfer-encoding of the attachment from "base64" to (say)
"8bit" to make it readable, in which case it would still be valid MIME.

					-- Bob Rogers
					   http://www.rgrjr.com/



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: rmail and mime encoded patches annoyance
  2023-05-19 16:53             ` Bob Rogers
@ 2023-05-21  0:46               ` Francesco Potortì
  0 siblings, 0 replies; 11+ messages in thread
From: Francesco Potortì @ 2023-05-21  0:46 UTC (permalink / raw)
  To: Bob Rogers; +Cc: emacs-devel, Eli Zaretskii, Alfred M. Szmidt

>   From: "Alfred M. Szmidt" <ams@gnu.org>
>   Date: Fri, 19 May 2023 07:39:31 -0400
>
>   A _very_ ugly solution.
>
>   Edit the message in question, remove the MIME-Version: field, convert
>   the sections you care about using base64-decode-region.  Save.  Rmail
>   will complain slightly about the message not being a valid MIME
>   message, but .. meh.

Bob Rogers:
>Seems to me that all you really need to do is to convert the
>content-transfer-encoding of the attachment from "base64" to (say)
>"8bit" to make it readable, in which case it would still be valid MIME.

I have routinely done something like that using macros for the last several years.

When I receive email with attached files that I need, I save the files where they belong, then I edit the email to remove the attachments and ubstitutte them with text  placeholders containing the file names.  Then I archive the email,  which is now much smaller than the original.  I have a macro which does this work for me in most common cases, and a couple of additional macros which care about converting base64 to utf-8 in some corner cases.



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-05-21  0:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19  6:11 rmail and mime encoded patches annoyance Alfred M. Szmidt
2023-05-19  6:45 ` Eli Zaretskii
2023-05-19  7:17   ` Alfred M. Szmidt
2023-05-19 10:51     ` Eli Zaretskii
2023-05-19 11:08       ` Alfred M. Szmidt
2023-05-19 11:25         ` Eli Zaretskii
2023-05-19 11:31           ` Alfred M. Szmidt
2023-05-19 11:38             ` Eli Zaretskii
2023-05-19 11:39           ` Alfred M. Szmidt
2023-05-19 16:53             ` Bob Rogers
2023-05-21  0:46               ` Francesco Potortì

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).