emacs-devel
[Top][All Lists]
Advanced

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

Re: Specifying mode in file variables trouble


From: Lennart Borgman (gmail)
Subject: Re: Specifying mode in file variables trouble
Date: Wed, 24 Sep 2008 23:45:46 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Richard M. Stallman wrote:
>     > The mechanism is just part of this.  We also need an interface.  There
>     > are lots of minor mode definitions, and we want them to be simple and
>     > clean.
>     > 
>     > So please propose a change in minor mode definitions so as to do the
>     > job.  Then we can evaluate it and maybe propose better alternatives.
> 
>     I think the suggestions above may be sufficient, but that might be just
>     because of lack of imagination/knowledge of Emacs ;-)
> 
> Please show how you would change a few of the existing minor mode definitions
> to specify what to do here.

Good question. I am however not sure about it. What I am trying to do is
discuss the structures needed - though I sometimes gives them as
implementation examples.

The only thing I am quite sure about is that for what I call "per buffer
variables" we can use (put 'PER-BUF-VAR 'permanent-local t).

But when it comes to "per major modes" I am a bit confused. I just
realize that I made a mistake in my last post. I have (implicitly)
spoken about two different types of "per major modes" variables; those
that are reset every time a major mode function is called and those that
should be resurrected when point comes to a major mode with the same
major mode.

I have tried to make this distinction because the user may want to set
some buffer local variable for a major mode even in mumamo. I am not
sure this is a good distinction however.

I can see two ways to resolve it: either say that all such variables
should be set in major mode hooks. Or just resurrect all buffer local
variables (with some necessary exceptions) when arriving to a chunk with
the same major mode. If switching to a new major mode just where setting
some local variables this could be used instead of calling the major
mode function when moving between chunks (after the major mode has been
called once in the buffer and the buffer local values have been saved),
but it is not clear to me whether this would work. What do you think?




reply via email to

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