[ no cc to fefe ]

Hi,

* Sven Guckes [02-10-09 14:24:56 +0200] wrote:
[...]
> wish:        add an option to set the favourite
>              directory for saving attachments in.

Because mutt sucks in this particular sence I made a patch
which is kind of ``works for me''. It's attached.

How it works: It prepends the value of $attach_dir _before_
prompting so that one can change it from case to case.

   bye, Rocco [ not cc'ing to mutt-dev ]
--- globals.h.orig      Sun Aug  4 13:03:23 2002
+++ globals.h   Sun Aug  4 13:03:42 2002
@@ -34,6 +34,7 @@
 WHERE char *AliasFmt;
 WHERE char *AttachSep;
 WHERE char *Attribution;
+WHERE char *AttachDir;
 WHERE char *AttachFormat;
 WHERE char *Charset;
 WHERE char *ComposeFormat;
--- init.h.orig Sun Aug  4 13:03:57 2002
+++ init.h      Sun Aug  4 13:05:27 2002
@@ -193,6 +193,11 @@
   ** If set, Mutt will prompt you for carbon-copy (Cc) recipients before
   ** editing the body of an outgoing message.
   */  
+  { "attach_dir",       DT_PATH, R_NONE, UL &AttachDir, UL "~"},
+  /*
+  ** .pp
+  ** Default location where attached files should be saved to.
+  */
   { "attach_format",   DT_STR,  R_NONE, UL &AttachFormat, UL "%u%D%I %t%4n %T%.40d%> 
[%.7m/%.10M, %.6e%?C?, %C?, %s] " },
   /*
   ** .pp
--- recvattach.c.orig   Wed Sep 26 12:33:09 2001
+++ recvattach.c        Sun Aug  4 13:07:50 2002
@@ -379,7 +379,16 @@
   int append = 0;
 
   if (body->filename)
-    strfcpy (buf, body->filename, sizeof (buf));
+  {
+    if (AttachDir)
+    {
+      snprintf (buf, sizeof (buf), "%s/", AttachDir);
+      strncat (buf, body->filename, _POSIX_PATH_MAX -
+               strlen (body->filename) - strlen (AttachDir)
+               - 1);
+    }
+    else strfcpy (buf, body->filename, sizeof (buf));
+  }
   else if(body->hdr &&
          body->encoding != ENCBASE64 &&
          body->encoding != ENCQUOTEDPRINTABLE &&

Reply via email to