From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: make-variable-buffer-local change Date: Fri, 25 Sep 2009 10:07:49 -0700 (PDT) Message-ID: <200909251707.n8PH7nuk020712@godzilla.ics.uci.edu> References: <200909251609.n8PG97YN020225@godzilla.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253898601 28143 80.91.229.12 (25 Sep 2009 17:10:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2009 17:10:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 25 19:09:54 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MrEIs-0001Nl-3B for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 19:09:54 +0200 Original-Received: from localhost ([127.0.0.1]:52504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrEIr-0006qF-1N for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 13:09:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrEIh-0006pF-Db for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:09:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrEIZ-0006nI-E2 for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:09:39 -0400 Original-Received: from [199.232.76.173] (port=47702 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrEIZ-0006nF-7x for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:09:35 -0400 Original-Received: from sallyv2.ics.uci.edu ([128.195.1.120]:48305) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MrEIY-0005nk-BC for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:09:34 -0400 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by sallyv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n8PH7nFg014738; Fri, 25 Sep 2009 10:07:50 -0700 (PDT) Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n8PH7nuk020712; Fri, 25 Sep 2009 10:07:49 -0700 (PDT) In-Reply-To: (Juanma Barranquero's message of "Fri, 25 Sep 2009 18:32:17 +0200") Original-Lines: 40 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n8PH7nFg014738 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115620 Archived-At: Juanma Barranquero writes: > On Fri, Sep 25, 2009 at 18:09, Dan Nicolaescu wrote: > > > Can you please explain the reason for this change: > > Sure. > > > In most cases it is better to use `make-local-variable', > > which makes a variable local in just one buffer. > > That's true, in the case where a variable has local and non-local > uses. The warning that you quote is intended to keep people from > blindly making variables automatically buffer-local as soon as they > realize that the variable *could* sometimes be useful as buffer-local. > That's a good suggestion. > > However, `list-buffers-directory' is *always* used as buffer-local. > All packages that assign it make it buffer-local first. There's no "All packages that assign it" > reason ever (that I can think of) to assign it globally; it would in It is globally assigned to nil. All buffers that don't set it explicitly use the global nil value. Isn't it slightly more efficient to access global bindings than buffer local bindings, so forcing `make-variable-buffer-local' will force this inefficiency everywhere. > BTW, I did this patch while investigating #3224. uniquify has code to > deal with buffers that assign `list-buffers-directory', but it is > doing a bad job of it. I cannot think of a clean way to fix it that > does not involve changing more code than I would like, though. Ideas > welcome. IMHO the first thing to do there is to decide if this is a problem with uniquify, or if it's just working as expected. (no idea here).