From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: rms@gnu.org
Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: Re: Specifying mode in file variables trouble
Date: Thu, 25 Sep 2008 23:34:50 +0200 [thread overview]
Message-ID: <48DC03FA.7010509@gmail.com> (raw)
In-Reply-To: <E1Kiuuf-0004MS-HF@fencepost.gnu.org>
Richard M. Stallman wrote:
> I have thought about three different
> cases:
>
> - Buffer local variables that should never survive moving between chunks
> with different major modes.
>
> - Those that always should survive (but be killed when switching major
> modes when mumamo is not used).
>
> - Those that will be killed when moving to a chunk with a different
> major mode, but will be resurrected when point again reaches a chunk
> with the same major mode. (They are what I call "per major mode".)
>
> I agree that these three behaviors should suffice. (We also want
> variables that survive all changes in major mode, and that's what
> `permanent-local' does now.)
>
> Do we need all these behaviors?
>
> I doubt that the first behavior is needed, except for a few variables
> used specially in the implementation of mumamo. Mumamo can easily
> implement that behavior for those few variables.
Maybe it would be meaningful for a parser that is supporting completion
in the chunk?
> Can you find any other use cases for which the first behavior is needed?
> If not, let's forget it.
>
> I think the second and third behaviors are both useful. So the next step
> is to design conditions under which each one should happen.
>
> To do that, we need to see the _pattern_ of when each behavior is
> desired. So please collect use cases for them.
>
> Here's a proposal that came to me, suggested by what I know about
> use-case patterns.
>
> * If a variable is bound locally by one of the major modes used within
> mumamo, or by the mode hooks it runs, then kill it when moving to a
> chunk in another major mode.
Do you mean the third case aboove here? I think this is a good idea.
This is what I have implemented now in the latest sources (and that I
sent here).
> * Any other buffer-local variable should survive through motion between
> chunks.
I am not sure about this one, but I think it would be better to use the
third case for these variables too (and that is what I do now) if not
their 'permanent-buffer local property is non-nil.
> Can you find any use cases where this would not be right?
Let say that the user for example want to use another indentation step
for a specific chunk type. Then my comment above would perhaps apply.
But you may of course say instead that such cases should be handled by
adding this to the major mode hook.
---
I am a bit worried by this complexity for the users. One way to avoid it
would perhaps to introduce the concept of a new "persistent level"
between 'permanent-local=t and 'permanent-local=nil. A level that would
be like 'permanent-local=t but just for the current buffer. Maybe
permanent-local could take the current buffer as a value for this level?
next prev parent reply other threads:[~2008-09-25 21:34 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-20 0:44 Specifying mode in file variables trouble Lennart Borgman (gmail)
2008-09-20 0:48 ` Lennart Borgman (gmail)
2008-09-20 0:59 ` Miles Bader
2008-09-20 1:06 ` Lennart Borgman (gmail)
2008-09-21 6:32 ` Richard M. Stallman
2008-09-21 12:33 ` Lennart Borgman (gmail)
2008-09-21 23:34 ` Richard M. Stallman
2008-09-22 0:38 ` Lennart Borgman (gmail)
2008-09-22 4:39 ` Richard M. Stallman
2008-09-22 13:14 ` Lennart Borgman (gmail)
2008-09-22 14:12 ` Stefan Monnier
2008-09-22 14:26 ` Lennart Borgman (gmail)
2008-09-23 4:40 ` Richard M. Stallman
2008-09-23 9:29 ` Lennart Borgman (gmail)
2008-09-23 19:47 ` Richard M. Stallman
2008-09-22 23:11 ` Lennart Borgman (gmail)
2008-09-23 4:40 ` Richard M. Stallman
2008-09-23 9:47 ` Lennart Borgman (gmail)
2008-09-23 19:47 ` Richard M. Stallman
2008-09-23 20:43 ` Lennart Borgman (gmail)
2008-09-24 13:47 ` Richard M. Stallman
2008-09-24 13:47 ` Richard M. Stallman
2008-09-24 17:21 ` Lennart Borgman (gmail)
2008-09-25 5:49 ` Richard M. Stallman
2008-09-25 6:28 ` tomas
2008-09-25 6:41 ` Paul R
2008-09-25 7:55 ` tomas
2008-09-25 8:35 ` Paul R
2008-09-25 16:42 ` Lennart Borgman
2008-09-27 4:39 ` Richard M. Stallman
2008-10-21 19:16 ` Lennart Borgman (gmail)
2008-10-22 5:21 ` tomas
2008-10-22 6:21 ` Richard M. Stallman
2008-09-23 19:47 ` Richard M. Stallman
2008-09-23 20:37 ` Lennart Borgman (gmail)
2008-09-24 13:47 ` Richard M. Stallman
2008-09-24 16:23 ` Lennart Borgman (gmail)
2008-09-25 5:50 ` Richard M. Stallman
2008-09-24 23:09 ` Lennart Borgman (gmail)
2008-09-23 4:40 ` Richard M. Stallman
2008-09-23 9:57 ` Lennart Borgman (gmail)
2008-09-23 16:03 ` Stefan Monnier
2008-09-23 17:22 ` Lennart Borgman (gmail)
2008-09-23 20:33 ` Stefan Monnier
2008-09-23 20:48 ` Lennart Borgman (gmail)
2008-09-23 21:27 ` Stefan Monnier
2008-09-23 21:30 ` Lennart Borgman (gmail)
2008-09-24 20:57 ` Richard M. Stallman
2008-09-24 21:29 ` Lennart Borgman (gmail)
2008-09-25 17:46 ` Richard M. Stallman
2008-09-25 21:34 ` Lennart Borgman (gmail) [this message]
2008-09-26 4:45 ` Richard M. Stallman
2008-09-26 4:45 ` Richard M. Stallman
2008-09-25 17:46 ` Selecting mumamo modes Richard M. Stallman
2008-09-25 21:12 ` Lennart Borgman (gmail)
2008-09-26 4:45 ` Richard M. Stallman
2008-10-21 19:20 ` Lennart Borgman (gmail)
2008-09-23 19:47 ` Specifying mode in file variables trouble Richard M. Stallman
2008-09-23 20:26 ` Lennart Borgman (gmail)
2008-09-24 20:56 ` Richard M. Stallman
2008-09-24 21:21 ` Lennart Borgman (gmail)
2008-09-25 17:46 ` Richard M. Stallman
2008-09-25 21:36 ` Lennart Borgman (gmail)
2008-09-26 4:45 ` Richard M. Stallman
2008-09-24 20:57 ` Richard M. Stallman
2008-09-24 21:45 ` Lennart Borgman (gmail)
2008-09-20 19:03 ` Stefan Monnier
2008-09-20 23:34 ` Lennart Borgman (gmail)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48DC03FA.7010509@gmail.com \
--to=lennart.borgman@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.