all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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: Wed, 24 Sep 2008 23:21:04 +0200	[thread overview]
Message-ID: <48DAAF40.9030704@gmail.com> (raw)
In-Reply-To: <E1KibPt-0001h7-Rn@fencepost.gnu.org>

Richard M. Stallman wrote:
>     There are three main scopes (maybe there are more) for minor modes:
> 
>     - Global
>     - Per buffer
> 
> I think I know what those two mean.
> 
>     - Per major mode
> 
> What does that mean?  I don't know of that.

I mean minor modes that are used with specific major modes. Or any minor
mode that is turned on in a major mode hook.

>     Global minor modes are not a problem here.
> 
> Usually they are not; but if a minor mode is itself global,
> you can make a buffer-local binding for the variable.
> 
> Perhaps when you speak of "global" and "per buffer"
> you mean how the variable is bound, rather than how the mode
> normally works.

In this case, yes.

>     I have suggested long ago using the existing mechanism for
>     distinguishing between local variables that are per buffer and those
>     that are per major mode.
> 
> I don't understand that distinction, but I know that just about any
> variable in Emacs _can_ be given a buffer-local binding by a major
> mode command.  So is the distinction meaningful?

I think so. For example flymake works on the file regardless of the
major mode. If mumamo is used in the buffer then flymake should still
work on the file - which is in a sense the same as the whole buffer here.

> 			     In other words: the minor modes that are per
>     buffer should use
> 
>        (put 'PER-BUFFER-VARIABLE 'permanent-local t)
> 
>     on their buffer local variables. (I do that now in mumamo.el for some of
>     the most important.)
> 
> I am not sure that change is correct.  When the variable is not marked
> as permanent-local, that could mean we want major mode commands to
> reset this minor mode.  Of course, moving between chunks in mumamo
> should not reset it.

For cases like flymake we know that the minor mode is per buffer/file. I
think that will be true for many parsers (but we will have to help them
over "bad" chunks, ie chunks they do not expect to see).

The same is also true for emulators like viper.

For the cases above I think using (put 'PER-BUF-VAR 'permanent-local t)
is the right thing. In other cases we can't do even if we want the minor
modes (buffer local variables) to survive when point is moved to a new
chunk.

For that case I have implemented mumamo-survive, a list of variable
symbols that should survive when moving between chunks. Of course that
is a rather rough approximation. To refine it a bit I have now also
added save/restore of buffer local variables per major modes (see
earlier messages in this thread).

> Can you tell us some of the variables for which you added that property?
> 
> Perhaps we want to have a different value for the `permanent-local' property
> that applies only to mumamo.

Yes, perhaps. I think however we should first consider the structures
above and see if they are enough. (Then we can maybe implement them
using specific properties instead.)




  reply	other threads:[~2008-09-24 21:21 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)
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) [this message]
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=48DAAF40.9030704@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.