<<< Date Index >>>     <<< Thread Index >>>

Re: canonicalizing and de-canonicalizing



* Thu Oct 30 2008 Kyle Wheeler <kyle-mutt-dev@xxxxxxxxxxxxxx>
> On Thursday, October 30 at 04:50 PM, quoth Aron Griffis:
>> Would it be worth making this configurable?  I ask because
>> I access three separate accounts from one mutt session, and
>> I might prefer them always to be fully shown in the list
>> regardless of my current $folder setting.
>
> Well, if it were to be merged with mainline mutt, it might be better to 
> make the two behaviors separate % designations in $browser_format. But 
> for my own personal use, I'm happy with this as-is.

So here is another patch.
%e is a pretty version of %f in $folder_format.

-- 
tamo
diff -r 5ea9f336dd60 browser.c
--- a/browser.c Mon Oct 20 11:50:38 2008 -0700
+++ b/browser.c Fri Oct 31 23:08:42 2008 +0900
@@ -172,6 +172,7 @@
        mutt_format_s (dest, destlen, fmt, "");
       break;
       
+    case 'e':
     case 'f':
     {
       char *s;
@@ -181,6 +182,13 @@
       else
 #endif
        s = NONULL (folder->ff->name);
+
+      if (op == 'e')
+      {
+       strfcpy (tmp, s, sizeof (tmp));
+       mutt_pretty_mailbox (tmp, sizeof (tmp));
+       s = tmp;
+      }
 
       snprintf (fn, sizeof (fn), "%s%s", s,
                folder->ff->st ? (S_ISLNK (folder->ff->st->st_mode) ? "@" :     
        
diff -r 5ea9f336dd60 init.h
--- a/init.h    Mon Oct 20 11:50:38 2008 -0700
+++ b/init.h    Fri Oct 31 23:08:42 2008 +0900
@@ -660,7 +660,8 @@
   ** .dl
   ** .dt %C  .dd current file number
   ** .dt %d  .dd date/time folder was last modified
-  ** .dt %f  .dd filename
+  ** .dt %e  .dd pretty filename
+  ** .dt %f  .dd filename (pretty if local)
   ** .dt %F  .dd file permissions
   ** .dt %g  .dd group name (or numeric gid, if missing)
   ** .dt %l  .dd number of hard links