From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6241: Please make buffer-offer-save permanent local Date: Thu, 27 May 2010 20:27:57 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1275008261 24946 80.91.229.12 (28 May 2010 00:57:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 May 2010 00:57:41 +0000 (UTC) Cc: MON KEY , Juanma Barranquero , 6241@debbugs.gnu.org To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 28 02:57:40 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OHntH-0002Mb-NM for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 May 2010 02:57:36 +0200 Original-Received: from localhost ([127.0.0.1]:38642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHntH-0003ML-84 for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 May 2010 20:57:35 -0400 Original-Received: from [140.186.70.92] (port=34968 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHntB-0003M9-5Y for bug-gnu-emacs@gnu.org; Thu, 27 May 2010 20:57:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHntA-0003Oh-19 for bug-gnu-emacs@gnu.org; Thu, 27 May 2010 20:57:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52825) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHnt9-0003Oc-O4 for bug-gnu-emacs@gnu.org; Thu, 27 May 2010 20:57:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OHnRd-0000e4-UT; Thu, 27 May 2010 20:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 May 2010 00:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6241-submit@debbugs.gnu.org id=B6241.12750064842466 (code B ref 6241); Fri, 28 May 2010 00:29:01 +0000 Original-Received: (at 6241) by debbugs.gnu.org; 28 May 2010 00:28:04 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHnQh-0000dj-L9 for submit@debbugs.gnu.org; Thu, 27 May 2010 20:28:03 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHnQf-0000dM-FI for 6241@debbugs.gnu.org; Thu, 27 May 2010 20:28:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAIGq/ktMCpdY/2dsb2JhbACeIXLAR4UTBIxE X-IronPort-AV: E=Sophos;i="4.53,314,1272859200"; d="scan'208";a="65820336" Original-Received: from 76-10-151-88.dsl.teksavvy.com (HELO pastel.home) ([76.10.151.88]) by ironport2-out.pppoe.ca with ESMTP; 27 May 2010 20:27:57 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0A0878267; Thu, 27 May 2010 20:27:57 -0400 (EDT) In-Reply-To: (Lennart Borgman's message of "Fri, 28 May 2010 00:25:20 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 27 May 2010 20:29:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37351 Archived-At: > 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