]> granicus.if.org Git - neomutt/commitdiff
Add some more support for version-dependant configuration files.
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 30 Sep 1998 06:16:07 +0000 (06:16 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 30 Sep 1998 06:16:07 +0000 (06:16 +0000)
doc/manual.sgml
init.c

index 3b63871c19752cc1a9df5c6530800749fad54468..5ce1f66d2737555b5cfaad6407dd4b13da81ef8e 100644 (file)
@@ -534,15 +534,18 @@ See also the <ref id="postpone" name="&dollar;postpone"> quad-option.
 <sect>Configuration
 <p>
 
-While the default configuration (or ``preferences'') make Mutt usable right
-out of the box, it is often desirable to tailor Mutt to suit your own tastes.
-When Mutt is first invoked, it will attempt to read the ``system''
-configuration file (defaults set by your local system administrator), unless
-the ``-n'' <ref id="commandline" name="command line"> option is
-specified.  This file is typically
-<tt>/usr/local/share/Muttrc</tt> or <tt>/usr/local/lib/Muttrc</tt>.  Next,
-it looks for a file in your home directory named <tt/.muttrc/.  In this file
-is where you place <ref id="commands" name="commands"> to configure Mutt.
+While the default configuration (or ``preferences'') make Mutt
+usable right out of the box, it is often desirable to tailor Mutt to
+suit your own tastes. When Mutt is first invoked, it will attempt to
+read the ``system'' configuration file (defaults set by your local
+system administrator), unless the ``-n'' <ref id="commandline"
+name="command line"> option is specified.  This file is typically
+<tt>/usr/local/share/Muttrc</tt> or <tt>/usr/local/lib/Muttrc</tt>.
+If your home directory has a subdirectory named <tt/.mutt/, mutt
+will next look for a file named <tt>.mutt/muttrc</tt>. Otherwise, it
+looks for a file in your home directory named <tt/.muttrc/.  In this
+file is where you place <ref id="commands" name="commands"> to
+configure Mutt.
 
 In addition, mutt supports version specific configuration files that are
 parsed instead of the default files as explained above.  For instance, if
diff --git a/init.c b/init.c
index 94f9ec4c3f214291cb512e5123f5a46e00ce1a3f..6f9f401d9b09b92938fb07e3e84cc1a43bb4adb8 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1611,9 +1611,17 @@ void mutt_init (int skip_sys_rc, LIST *commands)
 
   if (!Muttrc)
   {
-    snprintf (buffer, sizeof (buffer), "%s/.muttrc-%s", NONULL(Homedir), VERSION);
-    if (access (buffer, F_OK) == -1)
-      snprintf (buffer, sizeof (buffer), "%s/.muttrc", NONULL(Homedir));
+    snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(Homedir), VERSION);
+    if (access(buffer, F_OK) == -1)
+    {
+      snprintf (buffer, sizeof (buffer), "%s/.muttrc-%s", NONULL(Homedir), VERSION);
+      if (access (buffer, F_OK) == -1)
+      {
+       snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(Homedir));
+       if (access (buffer, F_OK) == -1)
+         snprintf (buffer, sizeof (buffer), "%s/.muttrc", NONULL(Homedir));
+      }
+    }
     default_rc = 1;
     Muttrc = safe_strdup (buffer);
   }