bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#6915: Please consider making left-margin-width etc buffer local inst


From: Lennart Borgman
Subject: bug#6915: Please consider making left-margin-width etc buffer local instead of major mode local
Date: Thu, 26 Aug 2010 22:01:14 +0200

On Thu, Aug 26, 2010 at 3:05 PM, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Thu, Aug 26, 2010 at 14:40, Lennart Borgman
> <lennart.borgman@gmail.com> wrote:
>
>> If there is only one major mode in the buffer this is perhaps the case, yes.
>
> This is what happens now, and in the foreseeable future, in the vast
> majority of buffers. Or do you anticipate the need to use mumamo in
> all kinds of buffers?

No, just for multi major mode buffers. (But for web programming these
are common, of course.)

>> Emacs was not very good prepared for several major modes in a buffer.
>
> Agreed.
>
>> I suppose this will change in the future, but we are not there yet.
>
> Why?

I just mean that Emacs hopefully will adopt some multi major mode
framework (and some changes needed for that).

>>  - Emulator mode buffer local variable.

Viper, cua-mode, etc. In some cases there are state variables per buffer.

>>  - Modified state buffer local variables.

Just an example, maybe a bad one though... - I meant any variable
describing changes of the buffer content.

> I lack context (or knowledge) to understand what you mean here.

The examples was only a try to evoke some thoughts about variable
position locallity.


>> I try to move this a bit forward by pointing to cases where a major
>> mode local variable probably is seen by users more like something
>> belonging to the buffer contents.
>
> Yes, I understand, but I think here is where I disagree. A priori, I
> don't know why margins would be related more to buffer contents than
> to buffer mode.

I am a bit hesitating about this (that is why I was expressing this
wish less strongly). I know quite little about margin use in Emacs.
The only uses I know of are:

- linum-mode.
- mumamo-margin-info-mode (alt display chunk start-end inf margin)
- wrap-to-fill-column-mode (display text dark room style in the middle
of the buffer)

The last two are mine, so I do not know much at all about this. What
other uses are there in Emacs of the margin widths?

However for all of these a buffer local value of the margin width
makes perfect sense. Also in multi major mode it would be very
disturbing to change the margin width when moving from one major mode
chunk to another.

What arguments are there for having the margin width as a major mode
local value?


>> Yes, of course mumamo can take care of these cases, but it comes at a cost.
>
> Making variables permanent buffer-local also has a cost. Surprise and
> bugs, if the user or other modes weren't expecting it, for example.

You mean other major modes? As I have explained earlier those examples
are better to catch. (Stefan was hesitating about this.)

>> (And it definitively can not be taken care of the way that was
>> suggested in the answer you are commenting on.)
>
> I trust you on this. But perhaps what is lacking is something at the
> Emacs API level.

Yes. of course. I expect that to happen later on (see my examples
above for possible needs). But please remember that the current "api"
is adding the property permanent-local.

> What I mean is that making permanent buffer-local every variable that
> mumamo needs so isn't necessarily the best answer.
>
>     Juanma





reply via email to

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