Discussion:
Can I set a separate default save folder for attachments
(too old to reply)
cjsmall
2021-09-02 20:50:42 UTC
Permalink
Mutt 1.13.2
Xubuntu 20.04

In my .muttrc file I have "set folder=~/lib/Mail" and all my saved mail resides under this location. I was wondering if there is a setting that would apply separately to attachments. I almost always want to save attachments in "~/Downloads" and have to manually add this path to the save line each time.

Alternately, maybe there is a way to make a single key alias for "~/Downloads" just as "=" or '+' substitutes for the folder string.

Not a big problem, but I wanted to check whether I was missing something obvious. Thanks.
Tavis Ormandy
2021-09-03 02:48:23 UTC
Permalink
Post by cjsmall
Alternately, maybe there is a way to make a single key alias for "~/Downloads" just as "=" or '+' substitutes for the folder string.
Not a big problem, but I wanted to check whether I was missing something obvious. Thanks.
macro attach s "<save-entry>~/Downloads/"
Does that solve it?
I guess this is better, so as not to overwrite the filename:

macro attach s "<save-entry><Home>~/Downloads/<End>"

Tavis.
--
_o) $ lynx lock.cmpxchg8b.com
/\\ _o) _o) $ finger ***@sdf.org
_\_V _( ) _( ) @taviso
cjsmall
2021-09-03 03:10:12 UTC
Permalink
Post by Tavis Ormandy
[...]
macro attach s "<save-entry>~/Downloads/"
macro attach s "<save-entry><Home>~/Downloads/<End>"
Tavis: Thanks for the simple solution. It works! Regarding the <Home> and <End>, I see that they cause the attachment name to be inserted on the save line, but I really don't understand why or how. If you can enlighten me as to what is happening here, I'd appreciate it. Regards.
Rich
2021-09-03 03:34:58 UTC
Permalink
Post by Tavis Ormandy
[...]
macro attach s "<save-entry>~/Downloads/"
macro attach s "<save-entry><Home>~/Downloads/<End>"
Tavis: Thanks for the simple solution. It works! Regarding the
<Home> and <End>, I see that they cause the attachment name to be
inserted on the save line, but I really don't understand why or how.
If you can enlighten me as to what is happening here, I'd appreciate
it. Regards.
They don't. Mutt inserts the attachment name automatically. <Home>
simply moves the insertion cursor to the start of the name, then
"~/Downloads/" is entered as if you had typed those characters, then
<End> moves the insertion cursor back to the very end of the filename
field.
cjsmall
2021-09-03 15:43:09 UTC
Permalink
They don't. Mutt inserts the attachment name automatically. <Home>
simply moves the insertion cursor to the start of the name, then
"~/Downloads/" is entered as if you had typed those characters, then
<End> moves the insertion cursor back to the very end of the filename
field.
OK, I see now. That's what you meant previously by overwriting the attachment name. Without the <Home>/<End> the name was being inserted and then overwritten by "~/Download/" which is why I wasn't seeing it with your first example. Thanks for the great solution and the explanation.

I wrote all my mutt macros probably 15-20 years ago and have been using them pretty much unchanged since then. I'm really rusty at this point! :-)
Loading...