GNU bug report logs - #6241
Please make buffer-offer-save permanent local

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Fri, 21 May 2010 17:35:01 UTC

Severity: minor

Tags: fixed

Merged with 13792

Fixed in version 24.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #36 received at 6241 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 6241 <at> debbugs.gnu.org, MON KEY <monkey <at> sandpframing.com>,
	Juanma Barranquero <lekktu <at> gmail.com>
Subject: Re: bug#6241: Please make buffer-offer-save permanent local
Date: Thu, 27 May 2010 20:27:57 -0400
> I think that `buffer-offer-save' belongs to the content.  It protect
> the contents from being thrown away by the user of mistake.  And that
> is a very important function, far above major modes need.  Don't you
> think so?

That's the question, indeed.  Note that the question is only relevant
for non-file buffers (since the variable is ignored for file-buffers).

>> Likewise, I imagine there are some immediate corner cases where
>> tramp'd buffers wouldn't appreciate buffer-offer-save being
>> permanent local.

Not sure what you mean by "tramp'd buffers", but AFAICT such buffers
would most likely be file-buffers and are hence unaffected.

I'd tend to agree with Lennart, if for nothing else that it's easier to
circumvent an annoying permanent-local than it is to fake one.
I.e. if a var is permanent-local and you need it to be killed by
kill-all-local-variables, you can do something like:

  (add-hook 'change-major-mode-hook
            (lambda () (kill-local-variable 'foobar)))

whereas if it is not permanent-local and you need it to survive a change
of major-mode, you have to jump through a few more hoops (a
change-major-mode-hook to stash the variable's content somewhere, plus
an after-change-major-mode-hook to reset it after the fact, plus
additional code to handle the case when after-change-major-mode-hook is
not run, ...).

So, now that the question of "should it ideally be permanent-local?" is
resolved, the remaining question is: "what would be the impact of such
a change", which requires examining all uses of the variable and
assessing the effect of the change for each case.


        Stefan




This bug report was last modified 12 years and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.