unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: MON KEY <monkey@sandpframing.com>,
	Juanma Barranquero <lekktu@gmail.com>,
	6241@debbugs.gnu.org
Subject: bug#6241: Please make buffer-offer-save permanent local
Date: Thu, 27 May 2010 20:27:57 -0400	[thread overview]
Message-ID: <jwvhbls514t.fsf-monnier+inbox@gnu.org> (raw)
In-Reply-To: <AANLkTinWI2Q-LdLGycrt-4t4uDXvn0rcdt12DaoEKTNL@mail.gmail.com> (Lennart Borgman's message of "Fri, 28 May 2010 00:25:20 +0200")

> 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





  reply	other threads:[~2010-05-28  0:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21 17:33 bug#6241: Please make buffer-offer-save permanent local Lennart Borgman
2010-05-25 16:49 ` Stefan Monnier
2010-05-25 17:24   ` Juanma Barranquero
2010-05-25 18:09     ` Stefan Monnier
2010-05-25 18:53       ` Lennart Borgman
2010-05-27  1:28 ` MON KEY
2010-05-27  1:35   ` Lennart Borgman
2010-05-27 21:56     ` MON KEY
2010-05-27 22:25       ` Lennart Borgman
2010-05-28  0:27         ` Stefan Monnier [this message]
2010-05-28  0:39           ` Lennart Borgman
2011-07-13 21:59             ` Lars Magne Ingebrigtsen
2011-07-16 19:02               ` Stefan Monnier
2011-07-16 20:00                 ` Lars Magne Ingebrigtsen
2010-05-28  4:38           ` MON KEY
2010-05-28  4:48         ` MON KEY
2010-05-28 10:39           ` Lennart Borgman

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvhbls514t.fsf-monnier+inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=6241@debbugs.gnu.org \
    --cc=lekktu@gmail.com \
    --cc=lennart.borgman@gmail.com \
    --cc=monkey@sandpframing.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).