#3685: Feature request: warn about variable redefinition in muttrc
------------------------------+----------------------
 Reporter:  michael.orlitzky  |      Owner:  mutt-dev
     Type:  enhancement       |     Status:  new
 Priority:  minor             |  Milestone:
Component:  user interface    |    Version:
 Keywords:                    |
------------------------------+----------------------
 In light of #3684, I think it would be helpful to warn about variable
 redefinitions within the scope of a single muttrc. This can prevent
 headaches for users, and invalid bugs for the devs.

 First of all, it should be possible (and expected) for users to override
 settings in `/etc/mutt/Muttrc` with `~/.muttrc` or `~/.mutt/muttrc`. So
 there's no need to warn for that.

 But, within the scope of one file, if mutt sees, for example,

 {{{
 set foo = yes
 ...
 set foo = no
 }}}

 Then a warning will alert the user to the fact that he's most likely made
 a mistake. Even the following should be a warning,

 {{{
 set foo = yes
 ...
 set foo = yes
 }}}

 because the user may later delete one of those lines, thinking that it
 will revert '''foo''' back to its hypothetical default setting of
 '''no'''.

 There is the issue of "include" files. Suppose I have two files included
 from `~/.muttrc`,

 {{{
 source "~/.mutt/foo-on"
 source "~/.mutt/foo-off"
 }}}

 which set the value of foo to on/off respectively. This should throw a
 warning, but that precludes a few approaches to handling the include
 files. For example, they can't be processed from the top down like a tree.
 Otherwise, `foo-on` wouldn't see any conflicts with its parent
 (~/.muttrc), and likewise, `foo-off` wouldn't see any conflicts with its
 parent (~/.muttrc). If `foo-on` and `foo-off` are inlined into `~/.muttrc`
 before it is processed, then I believe that could work.

 If this is even possible depends on the implementation details, so I won't
 speculate, just offer the test cases above.

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/3685>
Mutt <http://www.mutt.org/>
The Mutt mail user agent

Reply via email to