]> granicus.if.org Git - neomutt/commitdiff
notmuch: sync vfolder_format to folder_format
authorRichard Russon <rich@flatcap.org>
Wed, 7 Sep 2016 15:21:08 +0000 (16:21 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 7 Sep 2016 15:21:08 +0000 (16:21 +0100)
The expandos used by NotMuch's vfolder_format didn't match those of
Mutt's folder_format.  This caused confusion.

vfolder_format expandos:
    %C  current file number
    %f  folder name (description)
    %m  number of messages in the mailbox *
    %n  number of unread messages in the mailbox *
    %N  N if mailbox has new mail, blank otherwise

Default setting:
    set vfolder_format = "%2C %N %?n?%4n/&     ?%4m %f"

README.notmuch
browser.c
doc/manual.xml.head
init.h

index b1067277bac2b32115e63da937c479f1ce1670db..a36d1b2ae9ca6cf70df877f3c473f2f9778fffd9 100644 (file)
@@ -261,17 +261,18 @@ notmuch support for mutt
    vfolder_format = <string>
 
       This variable allows you to customize the file browser display for virtual
-      folders to your personal taste.  This string is similar to $index_format,
-      but has its own set of printf(3)-like sequences:
+      folders to your personal taste.  This string is similar to $folder_format,
 
+       %C   current folder number
        %f   folder name (description)
-       %n   number of all messages
-       %N   number of new messages
+       %m   number of messages in the mailbox *
+       %n   number of unread messages in the mailbox *
+       %N   N if mailbox has new mail, blank otherwise
        %>X  right justify the rest of the string and pad with character ``X''
        %|X  pad to the end of the line with character ``X''
        %*X  soft-fill with character ``X'' as pad
 
-      Default is "%6n(%6N) %f ".
+      Default is "%2C %?n?%4n/&     ?%4m %N %f"
 
    index_format and pager_format
 
index ea3dcf696bec8c3166f55e9cf4911d4d67437c1d..83d899443c1e3ae22f59b7f85338b8b4e203c7bc 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -380,18 +380,6 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co
       break;
 
     case 'N':
-#ifdef USE_NOTMUCH
-      if (mx_is_notmuch (folder->ff->name))
-      {
-       if (!optional)
-       {
-         snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
-         snprintf (dest, destlen, tmp, folder->ff->new);
-       } else if (!folder->ff->new)
-         optional = 0;
-       break;
-      }
-#endif
       snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
       snprintf (dest, destlen, tmp, folder->ff->new ? 'N' : ' ');
       break;
index 11d3612f0fa82154d1b7a3697425740636ee8feb..c08759e425e5535cc393084fd8447ab2877df9ba 100644 (file)
@@ -11795,7 +11795,6 @@ bind index \CG get-message
     <itemizedlist>
       <title>Dependencies:</title>
       <listitem><para>mutt-1.7.0</para></listitem>
-      <listitem><para><link linkend="sidebar">sidebar patch</link></para></listitem>
       <listitem><para><link linkend="quasi-delete">quasi-delete patch</link></para></listitem>
       <listitem><para><link linkend="index-color">index-color patch</link></para></listitem>
       <listitem><para>Notmuch libraries</para></listitem>
@@ -11915,6 +11914,69 @@ virtual-mailboxes "My INBOX" "notmuch://?query=tag:inbox"
       </para>
     </sect3>
 
+    <sect3 id="notmuch-vfolder-format">
+      <title>Format String for the NotMuch Browser</title>
+
+        <para>
+          Default: <literallayout><literal>%2C %?n?%4n/&amp;     ?%4m %f</literal></literallayout>
+        </para>
+
+        <para>
+          This variable allows you to customize the browser display to your personal taste.
+          This string is similar to <link linkend="index-format">$index_format</link>, but has
+          its own set of <literal>printf(3)</literal>-like sequences:
+        </para>
+
+        <informaltable>
+          <tgroup cols="2">
+            <tbody>
+              <row>
+                <entry>%C</entry>
+                <entry>current file number</entry>
+              </row>
+              <row>
+                <entry>%f</entry>
+                <entry>folder name (description)</entry>
+              </row>
+              <row>
+                <entry>%m</entry>
+                <entry>number of messages in the mailbox *</entry>
+              </row>
+              <row>
+                <entry>%n</entry>
+                <entry>number of unread messages in the mailbox *</entry>
+              </row>
+              <row>
+                <entry>%N</entry>
+                <entry>N if mailbox has new mail, blank otherwise</entry>
+              </row>
+              <row>
+                <entry>%&gt;X</entry>
+                <entry>right justify the rest of the string and pad with character 
+                <quote>X</quote></entry>
+              </row>
+              <row>
+                <entry>%|X</entry>
+                <entry>pad to the end of the line with character 
+                <quote>X</quote></entry>
+              </row>
+              <row>
+                <entry>%*X</entry>
+                <entry>soft-fill with character 
+                <quote>X</quote>as pad</entry>
+              </row>
+            </tbody>
+          </tgroup>
+        </informaltable>
+
+        <para>
+        For an explanation of <quote>soft-fill</quote>, see the <link linkend="index-format">$index_format</link> documentation.
+        </para>
+
+        <para>
+        * = can be optionally printed if nonzero
+        </para>
+    </sect3>
   </sect2>
 
   <sect2 id="notmuch-variables">
@@ -12159,8 +12221,8 @@ set nm_hidden_tags = "unread,draft,flagged,passed,replied,attachment,signed,encr
 <emphasis role="comment"># This option specifies timeout for Notmuch database. Default is 5 seconds.</emphasis>
 set nm_open_timeout = 5
  
-<emphasis role="comment"># This variable specifies notmuch query type, supported types: 'threads' and</emphasis>
-# 'messages'.
+<emphasis role="comment"># This variable specifies notmuch query type, supported types: 'threads' and
+# 'messages'.</emphasis>
 set nm_query_type = messages
  
 <emphasis role="comment"># Add messages stored to the mutt record (see $record in the mutt docs)
@@ -12175,7 +12237,7 @@ set nm_unread_tag = unread
  
 <emphasis role="comment"># This variable allows you to customize the file browser display for virtual
 # folders to your personal taste.</emphasis>
-set vfolder_format = "%6n(%6N) %f"
+set vfolder_format = "%2C %?n?%4n/&amp;     ?%4m %N %f"
  
 <emphasis role="comment"># When set, mutt will use the first virtual mailbox (see virtual-mailboxes)
 # as a spoolfile.</emphasis>
diff --git a/init.h b/init.h
index 0656a5bb9354596e7e562039666e7f3080861b34..d0296a155770559d5a15d44674c3d522658bac1a 100644 (file)
--- a/init.h
+++ b/init.h
@@ -4021,22 +4021,12 @@ struct option_t MuttVars[] = {
   ** given in the built-in editor.
   */
 #ifdef USE_NOTMUCH
-  { "vfolder_format",  DT_STR,  R_INDEX, UL &VirtFolderFormat, UL " %6n(%6N) %f " },
+  { "vfolder_format",  DT_STR,  R_INDEX, UL &VirtFolderFormat, UL "%2C %?n?%4n/&     ?%4m %f" },
   /*
   ** .pp
   ** This variable allows you to customize the file browser display for virtual
-  ** folders to your ** personal taste.  This string is similar to $$index_format,
-  ** but has its own set of \fCprintf(3)\fP-like sequences:
-  ** .dl
-  ** .dt %f  .dd folder name (description)
-  ** .dt %n  .dd number of all messages
-  ** .dt %N  .dd number of new messages
-  ** .dt %>X .dd right justify the rest of the string and pad with character ``X''
-  ** .dt %|X .dd pad to the end of the line with character ``X''
-  ** .dt %*X .dd soft-fill with character ``X'' as pad
-  ** .de
-  ** .pp
-  ** For an explanation of ``soft-fill'', see the $$index_format documentation.
+  ** folders to your personal taste.  This string uses many of the same
+  ** expandos as $$folder_format.
   */
   { "virtual_spoolfile", DT_BOOL, R_NONE, OPTVIRTSPOOLFILE, 0 },
   /*