[Top][All Lists]

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

Re: please make line-move-visual nil

From: Stefan Monnier
Subject: Re: please make line-move-visual nil
Date: Sun, 14 Jun 2009 16:45:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux)

> Why do you consider the latter a mistake?

There are at least 3 kinds of variables:
- global variables (which can be made buffer-local with make-local-variable)
- automatically buffer-local vars (e.g. made with make-variable-buffer-local)
- always buffer-local vars, e.g. default-directory
  (these can be tricky to distinguish from the previous kind).

Normal variables (and the most flexible) are the first kind.  The other
kind should only ever be used when there's a really good reason for it.

> And `goal-column', `fill-column, `fill-prefix', `left-margin',
> `comment-column', `tab-width', `require-final-newline'? Are they
> also mistakes?

These are old, so they may have been mistakes, but since I wasn't there
back then, I can only say that it's due to historical reasons.

> Put it another way: Which variables that have to do with wrapping, filling,
> truncating, target columns, and line/buffer endings are *NOT* always
> buffer-local? Which are not mistakes?

paragraph-start and friends?
Buffer-localness has nothing to do with whether a variable is linked to
filling or whatever other activity.  Instead it has to do with how that
variable is set, which kinds of values it holds, whether it is
meaningful to talk about a "global" value for that variable, ...

> And what's the _reason_ you call them mistakes?

It's a lot easier to `make-local-variable' than to undo

Also make-variable-buffer-local can have tricky behaviors: e.g. if you
`setq' a variable before loading the file that calls
make-variable-buffer-local, it will be set globally, which would
probably not be the intention.

> "historical", "mistake" - but why shouldn't they be always buffer-local? What
> are the criteria for your judgment?

To me the main question is "why should the be automatically buffer-local
when it's so easy to call make-local-variable?".

> Why don't we expect `comment-column' (for instance) to
> simply be made buffer-local by each major mode that needs that?

I actually do expect just that.  And in most cases, I expect major modes
to not change comment-column (it usually reflects a user's preference,
rather than the nature of the language handled by the major mode).


reply via email to

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