From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: make-variable-buffer-local change Date: Fri, 25 Sep 2009 19:31:09 +0200 Message-ID: References: <200909251609.n8PG97YN020225@godzilla.ics.uci.edu> <200909251707.n8PH7nuk020712@godzilla.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1253899909 309 80.91.229.12 (25 Sep 2009 17:31:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2009 17:31:49 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 25 19:31:42 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 1MrEdx-00017H-7K for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 19:31:41 +0200 Original-Received: from localhost ([127.0.0.1]:50923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrEdw-0007Dd-Lz for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 13:31:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrEdr-0007DU-Ms for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:31:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrEdn-0007D2-Da for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:31:35 -0400 Original-Received: from [199.232.76.173] (port=56299 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrEdn-0007Cz-8Z for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:31:31 -0400 Original-Received: from mail-fx0-f205.google.com ([209.85.220.205]:37741) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MrEdm-0001M7-Tr for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:31:31 -0400 Original-Received: by fxm1 with SMTP id 1so2343378fxm.31 for ; Fri, 25 Sep 2009 10:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=YrEKZJla9RJsECQSSCfSUUf+S6WyqRcuf0Hjxo3gif4=; b=HNr/pAi9OFHC+LavZdH1NVr55so2zfdTsOQHVgAztZpSy410menRsW7jgLHBSwLX5N 8GchZ/2WKnu6eKHkFD7YRCyJEgYVK5ZccdyiHz787sB1U5SSs4+KuMtpkkr60qLXxI2Q Q0ZZrQnhrsumHZPscw9iwufQq9BizijTm09X0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=JMkUS+39EnpjTb9itlMehaBHZd48nvaAJBFXsHIH9ZDrndgnbtJk91Y+8spe3nhCYf ZWVrLTzEjLqz9Hhod7eQCLfjzSEnQQDoya7Wyb/ncZFxF45fY4JsqTITkCdHSBw/3JqF yRmpgY5s5Tc/kcV1QvLdCVyORksVbfW3OHjkU= Original-Received: by 10.239.179.91 with SMTP id c27mr36520hbg.51.1253899889094; Fri, 25 Sep 2009 10:31:29 -0700 (PDT) In-Reply-To: <200909251707.n8PH7nuk020712@godzilla.ics.uci.edu> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:115622 Archived-At: On Fri, Sep 25, 2009 at 19:07, Dan Nicolaescu wrote: > "All packages that assign it" Of course. For packages that read it, they only want to find the right (local) value, or nil when it has not been assigned. > It is globally assigned to nil. That's the default. Every buffer-local variable has a global default. Surely you're not implying that is a reason for assigning it globally. > All buffers that don't set it explicitly use the global nil value. All buffers that don't set it explicitly don't use it. All packages that don't set it but read it expect it to be locally set (or globally nil). > 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. Sorry, I think I'm not understanding your point. The packages that read it will read either the global value, if they're doing some processing on a buffer that does not have a local value, or the local value if it exists. There's not such thing as a valid, global, non-nil value of `list-buffers-directory' (I can imagine uses of local bindings, though). As I've said, every package that assigns it does it so locally. So I don't think any inefficiency has been introduced; it was already buffer-local whenever it was needed. Unless I'm mistaken, it is not more costly to read a global value for a buffer-local variable than for an automatically buffer-local variable. The only way that it could be slightly less efficient is if buffers get `list-buffers-directory' locally set to nil; I don't think that happens right now in any standard package, but if it happened, a call to `kill-local-variable' would be in order. > 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. =C2=A0(no idea here). If you create a buffer *vc-dir* with working dir /emacs/lisp, and another with working dir /emacs/src, one of the *vc-dir* buffers will have a value for uniquify-managed and the other will not. That cannot be right. Juanma