]> granicus.if.org Git - neomutt/commitdiff
document new commands
authorRichard Russon <rich@flatcap.org>
Thu, 10 Mar 2016 22:52:33 +0000 (22:52 +0000)
committerRichard Russon <rich@flatcap.org>
Mon, 4 Apr 2016 02:33:19 +0000 (03:33 +0100)
README.ifdef
doc/manual.xml.head
doc/muttrc.ifdef
doc/vimrc.ifdef

index 5bb1d6b45b8554887a59a392d633d45e143f92e1..d2eeaa85bf3e48451ab526a425480199bf66fffa 100644 (file)
@@ -15,22 +15,28 @@ Patch
 Introduction
 ------------
 
-    The "ifdef" command tests whether Mutt understands the name of a variable,
-    function of command. If it does, then it executes a config command.
+    The "ifdef" patch introduces three new commands to Mutt and allow you to
+    share one config file between versions of Mutt that may have different
+    features compiled in.
 
-    This useful command allows you to share one config file between versions of
-    Mutt that may have different features compiled in.
+        ifdef  symbol config-command [args...]  # If a symbol is defined
+        ifndef symbol config-command [args...]  # If a symbol is not defined
+        finish                                  # Finish reading the current file
 
-    The command is of the form:
+    Here a symbol can be a $variable, <function>, command or compile-time
+    symbol, such as "USE_IMAP".
 
-        ifdef <item> <config-command>
+    'finish' is particularly useful when combined with 'ifndef'. e.g.
 
-    where "item" can be the name of a $variable, <function> or command.
+        # Sidebar config file
+        ifndef USE_SIDEBAR finish
 
 Commands
 --------
 
-        ifdef item "config-command [args]"
+        ifdef  symbol "config-command [args]"
+        ifndef symbol "config-command [args]"
+        finish
 
 See Also
 --------
index f52f5bbf161eabc6bbb70315bf75dda51ae2f5da..661d7e66a3f8feb98163da57cd8836778a07967f 100644 (file)
@@ -8105,29 +8105,35 @@ please have a look at the mixmaster documentation.
        <sect2 id="ifdef-intro">
                <title>Introduction</title>
 
-        <para>
-               The <quote>ifdef</quote> command tests whether Mutt understands the
-               name of a variable, function of command.  If it does, then it executes
-               a config command.
-        </para>
+               <para>
+                       The <quote>ifdef</quote> patch introduces three new commands to
+                       Mutt and allow you to share one config file between versions of Mutt
+                       that may have different features compiled in.
+               </para>
+
+<screen>
+ifdef  symbol config-command [args...]  <emphasis role="comment"># If a symbol is defined</emphasis>
+ifndef symbol config-command [args...]  <emphasis role="comment"># If a symbol is not defined</emphasis>
+finish                                  <emphasis role="comment"># Finish reading the current file</emphasis>
+</screen>
+
+               <para>
+                       Here a symbol can be a <link linkend="variables">$variable</link>,
+                       <link linkend="functions">&lt;function&gt;</link>,
+                       <link linkend="commands">command</link> or compile-time symbol, such
+                       as <quote>USE_IMAP</quote>.
+               </para>
 
         <para>
-               This useful command allows you to share one config file between
-               versions of Mutt that may have different features compiled in.
+            <literal>finish</literal> is particularly useful when combined with
+            <literal>ifndef</literal>. e.g.
         </para>
 
-               <para>The command is of the form:</para>
-
 <screen>
-ifdef &lt;item&gt; &lt;config-command&gt;
+<emphasis role="comment"># Sidebar config file</emphasis>
+ifndef USE_SIDEBAR finish
 </screen>
 
-               <para>
-                       where <quote>item</quote> can be the name of a
-                       <link linkend="variables">$variable</link>,
-                       <link linkend="functions">&lt;function&gt;</link> or
-                       <link linkend="commands">command</link>.
-               </para>
        </sect2>
 
 <!--
@@ -8147,11 +8153,19 @@ ifdef &lt;item&gt; &lt;config-command&gt;
                <cmdsynopsis>
                        <command>ifdef</command>
                        <arg choice="plain">
-                               <replaceable class="parameter">item</replaceable>
+                               <replaceable class="parameter">symbol</replaceable>
+                       </arg>
+                       <arg choice="plain">
+                               <replaceable class="parameter">"config-command [args]"</replaceable>
+                       </arg>
+                       <command>ifndef</command>
+                       <arg choice="plain">
+                               <replaceable class="parameter">symbol</replaceable>
                        </arg>
                        <arg choice="plain">
                                <replaceable class="parameter">"config-command [args]"</replaceable>
                        </arg>
+                       <command>finish</command>
                </cmdsynopsis>
        </sect2>
 
@@ -8172,17 +8186,22 @@ ifdef &lt;item&gt; &lt;config-command&gt;
 <screen>
 <emphasis role="comment"># Example Mutt config file for the 'ifdef' feature.
  
+# This feature introduces three useful commands which allow you to share
+# one config file between versions of Mutt that may have different
+# features compiled in.
+#      ifdef  symbol config-command [args...]
+#      ifndef symbol config-command [args...]
+#      finish                                
 # The 'ifdef' command tests whether Mutt understands the name of
-# a variable, function of command.  If it does, then it executes a
-# config command.
+# a variable, function, command or compile-time symbol.
+# If it does, then it executes a config command.
  
-# This useful command allows you to share one config file between
-# versions of Mutt that may have different features compiled in.
+# The 'ifndef' command tests whether a symbol does NOT exist.
+# The 'finish' command tells Mutt to stop reading current config file.
  
-# The command is of the form:
-#       ifdef item 'config-command params'
-# where item is a Mutt variable, function or command
-#
 # If the 'trash' variable exists, set it.</emphasis>
 ifdef trash 'set trash=~/Mail/trash'
  
@@ -8192,6 +8211,10 @@ ifdef tag-pattern 'bind index &lt;F6&gt; tag-pattern'
 <emphasis role="comment"># If the 'imap-fetch-mail' command exists, read my IMAP config.</emphasis>
 ifdef imap-fetch-mail 'source ~/.mutt/imap.rc'
  
+<emphasis role="comment"># If the compile-time symbol 'USE_SIDEBAR' does not exist, then
+# stop reading the current config file.</emphasis>
+ifndef USE_SIDEBAR finish
 <emphasis role="comment"># vim: syntax=muttrc</emphasis>
 </screen>
        </sect2>
index 65494d6b8057bfd761f27d6cee6fd7875ac50255..f618d5db6d3513cd25e3479f8a6780689d31c9a3 100644 (file)
@@ -1,16 +1,21 @@
 # Example Mutt config file for the 'ifdef' feature.
 
+# This feature introduces three useful commands which allow you to share
+# one config file between versions of Mutt that may have different
+# features compiled in.
+
+#      ifdef  symbol config-command [args...]
+#      ifndef symbol config-command [args...]
+#      finish                                
+
 # The 'ifdef' command tests whether Mutt understands the name of
-# a variable, function of command.  If it does, then it executes a
-# config command.
+# a variable, function, command or compile-time symbol.
+# If it does, then it executes a config command.
 
-# This useful command allows you to share one config file between
-# versions of Mutt that may have different features compiled in.
+# The 'ifndef' command tests whether a symbol does NOT exist.
+
+# The 'finish' command tells Mutt to stop reading current config file.
 
-# The command is of the form:
-#       ifdef item 'config-command params'
-# where item is a Mutt variable, function or command
-#
 # If the 'trash' variable exists, set it.
 ifdef trash 'set trash=~/Mail/trash'
 
@@ -20,4 +25,8 @@ ifdef tag-pattern 'bind index <F6> tag-pattern'
 # If the 'imap-fetch-mail' command exists, read my IMAP config.
 ifdef imap-fetch-mail 'source ~/.mutt/imap.rc'
 
+# If the compile-time symbol 'USE_SIDEBAR' does not exist, then
+# stop reading the current config file.
+ifndef USE_SIDEBAR finish
+
 # vim: syntax=muttrc
index ca545e66a2c311f872e10eedd99c55f9d74eee4b..342c75e7a25c41325d39ef38636219f80dd23359 100644 (file)
@@ -1,5 +1,7 @@
 " Vim syntax file for the mutt ifdef patch
 
 syntax keyword muttrcCommand    ifdef
+syntax keyword muttrcCommand    ifndef
+syntax keyword muttrcCommand    finish
 
 " vim: syntax=vim