emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: comint-carriage-motion, and option nomenclature


From: Miles Bader
Subject: Re: comint-carriage-motion, and option nomenclature
Date: Wed, 28 Aug 2002 08:39:45 -0400
User-agent: Mutt/1.3.28i

I've thought about this some more, and I think that my problem with your
suggestion is _not_ with changing the sense of the default value, but rather
the choice of variable name, in particular, the use of the verb `enable'.

A variable name containing `enable' is sort of the mirror image of one
containing `inhibit' -- it suggests that the normal state is `off', and that
you can set this variable to `on' to override that.  The reason is that both
of those verbs refer to the _change in state_ of the variable, so they're
essentially saying `setting this to true changes the state'.

Such variables are great for cases where there really is an obvious `normal'
state, which you sometimes want to override.  However, as you point out, the
carriage-motion case may not really fit this model.

By contrast, consider variable names like `comint-handle-carriage-motion' or
`comint-interpet-carriage' motion.  In these, the verb refers not to the
state change when you set the variable, but rather the action performed when
it's true.  To me, names like thisseem much more neutral, and better suited
to cases where either on or off are reasonable defaults.

I wouldn't object to using either of those names or something similar for
comint-carriage-motion, and changing the sense to positive == enabled.

In general, I think:

 (1) Variable names containing verbs like `enable' or `inhibit', which imply
     a change to the normal case, should only be used when there's an obvious
     default state.  Such variables should be named so that the normal state
     corresponds to a `nil' setting, and setting the variable to non-nil
     overrides this.

 (2) All other variables _shouldn't_ use verbs like `enable' or `inhibit'.

-Miles
-- 
P.S.  All information contained in the above letter is false,
      for reasons of military security.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]