From 2ee9e2418d5f5549a13f0ed99e86d33c4466b111 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Fri, 15 Sep 2017 14:36:42 +0100 Subject: [PATCH] restore ~/.config/mutt to config search path Some people are still using this dir. It will be deprecated in the future. Also, drop the dated/versioned config files. Nobody was using them. ~/.mutt/neomutt-20170912 --- doc/manual.xml.head | 38 ++++++-------------------------------- init.c | 36 +++++++++--------------------------- muttlib.c | 9 --------- 3 files changed, 15 insertions(+), 68 deletions(-) diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 32b4b5afc..3d3816976 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -2897,9 +2897,6 @@ color sidebar_divider color8 default NeoMutt config file search order - - neomuttrc-20170912 - neomuttrc @@ -2938,10 +2935,6 @@ color sidebar_divider color8 default - - /etc/xdg/neomutt/neomuttrc-20170912 - NeoMutt release version - /etc/xdg/neomutt/neomuttrc @@ -2949,10 +2942,6 @@ color sidebar_divider color8 default /etc/xdg/neomutt/Muttrc Note the case of the filename - - /etc/neomuttrc-20170912 - NeoMutt release version - /etc/neomuttrc @@ -2960,10 +2949,6 @@ color sidebar_divider color8 default /etc/Muttrc Note the case of the filename - - /usr/share/neomutt/neomuttrc-20170912 - NeoMutt release version - /usr/share/neomutt/neomuttrc @@ -2983,7 +2968,7 @@ color sidebar_divider color8 default XDG_CONFIG_HOME environment variable, which defaults to ~/.config/neomutt. Next, it looks in - ~(your home directory). Finally, it tries + ~ (your home directory). Finally, it tries ~/.neomutt. You may specify your own location for the user config file using the @@ -2994,18 +2979,13 @@ color sidebar_divider color8 default NeoMutt user config file locations - + File Location - Notes - - ~/.config/neomutt/neomuttrc-20170912 - NeoMutt release version - ~/.config/neomutt/neomuttrc @@ -3013,18 +2993,16 @@ color sidebar_divider color8 default ~/.config/neomutt/muttrc - ~/.neomutt/neomuttrc-20170912 - NeoMutt release version + ~/.config/mutt/neomuttrc - ~/.neomutt/neomuttrc + ~/.config/mutt/muttrc - ~/.neomutt/muttrc + ~/.neomutt/neomuttrc - ~/.mutt/neomuttrc-20170912 - NeoMutt release version + ~/.neomutt/muttrc ~/.mutt/neomuttrc @@ -3032,10 +3010,6 @@ color sidebar_divider color8 default ~/.mutt/muttrc - - ~/.neomuttrc-20170912 - NeoMutt release version - ~/.neomuttrc diff --git a/init.c b/init.c index 0c3c54c58..2aff16170 100644 --- a/init.c +++ b/init.c @@ -4042,34 +4042,24 @@ static int execute_commands(struct ListHead *p) static char *find_cfg(const char *home, const char *xdg_cfg_home) { const char *names[] = { - "neomuttrc-" PACKAGE_VERSION, "neomuttrc", "muttrc", NULL, + "neomuttrc", "muttrc", NULL, }; const char *locations[][2] = { - { - xdg_cfg_home, "neomutt/", - }, - { - home, ".neomutt/", - }, - { - home, ".mutt/", - }, - { - home, ".", - }, - { - NULL, NULL, - }, + { xdg_cfg_home, "neomutt/" }, + { xdg_cfg_home, "mutt/" }, + { home, ".neomutt/" }, + { home, ".mutt/" }, + { home, "." }, + { NULL, NULL }, }; + for (int i = 0; locations[i][0] || locations[i][1]; i++) { - int j; - if (!locations[i][0]) continue; - for (j = 0; names[j]; j++) + for (int j = 0; names[j]; j++) { char buffer[STRING]; @@ -4384,10 +4374,6 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands) if (mutt_set_xdg_path(XDG_CONFIG_DIRS, buffer, sizeof(buffer))) break; - snprintf(buffer, sizeof(buffer), "%s/neomuttrc-%s", SYSCONFDIR, PACKAGE_VERSION); - if (access(buffer, F_OK) == 0) - break; - snprintf(buffer, sizeof(buffer), "%s/neomuttrc", SYSCONFDIR); if (access(buffer, F_OK) == 0) break; @@ -4396,10 +4382,6 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands) if (access(buffer, F_OK) == 0) break; - snprintf(buffer, sizeof(buffer), "%s/neomuttrc-%s", PKGDATADIR, PACKAGE_VERSION); - if (access(buffer, F_OK) == 0) - break; - snprintf(buffer, sizeof(buffer), "%s/neomuttrc", PKGDATADIR); if (access(buffer, F_OK) == 0) break; diff --git a/muttlib.c b/muttlib.c index e93413190..379909f74 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1758,15 +1758,6 @@ int mutt_set_xdg_path(enum XdgType type, char *buf, size_t bufsize) while ((token = strsep(&xdg, ":"))) { - if (snprintf(buf, bufsize, "%s/%s/neomuttrc-%s", token, PACKAGE, PACKAGE_VERSION) < 0) - continue; - mutt_expand_path(buf, bufsize); - if (access(buf, F_OK) == 0) - { - rc = 1; - break; - } - if (snprintf(buf, bufsize, "%s/%s/neomuttrc", token, PACKAGE) < 0) continue; mutt_expand_path(buf, bufsize); -- 2.40.0