[Top][All Lists]

[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: Tue, 23 Sep 2008 11:57:38 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071031 Thunderbird/ Mnenhy/

Richard M. Stallman wrote:
>     The principal problem here is probably that Imenu should work across all
>     chunks with the same major modes and preserve its chunk specifric values
>     when moving between those chunks.
> Imenu is much more complex than a typical minor mode.  I think it
> would be useful to first look at simple cases such as Auto Fill mode.
> Does Auto Fill mode work ok with mumamo now?
> We should first look for a solution that enables Mumamo to DTRT
> automatically with most minor modes.
> If that is not possible, than let's look for way to make minor
> mode definitions specify the info that mumamo needs.
> Let's design this for maximum simplicity and cleanness of the minor
> mode definitions, rather than for maximum power and flexibility.
> I'd rather see a feature that does only what most minor modes need
> and is very simple.

How about the solutin I sent with mumamo-save-buffer-locals and dito
restore? I suggested something like this

  (mumamo-save-buffer-locals major-mode)
  (funcall new-major-mode)
  (mumamo-restore-buffer-locals new-major-mode)

There is however a problem with this and the major mode hook. Things in
this hook might want to change some buffer local variables.

I think putting the restore part first in the mode solves some part of
the problem. For this to work however delay-mode-hooks must be temporary
 set to nil (see the sources for `run-mode-hooks'). I have no idea what
delayed-mode-hooks is used for so I do not know if setting
delay-mode-hooks to nil may cause problems here.

> If Imenu needs something more complex, we could also have a second
> feature which is more complex and less clean, and Imenu could use
> that.

reply via email to

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