From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: mode-line-format - local variableness Date: Sun, 5 Apr 2009 16:29:23 -0700 Message-ID: <004a01c9b646$5b15efa0$0200a8c0@us.oracle.com> References: <004901c9b63c$77c768e0$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1238974188 31243 80.91.229.12 (5 Apr 2009 23:29:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Apr 2009 23:29:48 +0000 (UTC) To: "=?iso-8859-1?Q?'Johan_=22Bockg=E5rd=22'?=" , Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 06 01:31:07 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 1Lqbnt-0005PJ-Id for ged-emacs-devel@m.gmane.org; Mon, 06 Apr 2009 01:31:05 +0200 Original-Received: from localhost ([127.0.0.1]:37157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LqbmV-0003qv-HX for ged-emacs-devel@m.gmane.org; Sun, 05 Apr 2009 19:29:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LqbmR-0003pT-5w for emacs-devel@gnu.org; Sun, 05 Apr 2009 19:29:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LqbmK-0003jB-HM for emacs-devel@gnu.org; Sun, 05 Apr 2009 19:29:33 -0400 Original-Received: from [199.232.76.173] (port=59866 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LqbmK-0003iy-B6 for emacs-devel@gnu.org; Sun, 05 Apr 2009 19:29:28 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:38966 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LqbmK-0003Pg-06 for emacs-devel@gnu.org; Sun, 05 Apr 2009 19:29:28 -0400 Original-Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n35NT9NC030723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 5 Apr 2009 23:29:11 GMT Original-Received: from acsmt703.oracle.com (acsmt703.oracle.com [141.146.40.81]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n35NTaeT003251; Sun, 5 Apr 2009 23:29:37 GMT Original-Received: from dradamslap1 (/141.144.64.94) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 05 Apr 2009 23:29:10 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acm2QQdl6IEXqC5SS++JLf9HuVN37AAARGdQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt703.oracle.com [141.146.40.81] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A09020A.49D93ECF.0209:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:110076 Archived-At: > From: Johan "Bockg=E5rd" Sent: Sunday, April 05, 2009 3:50 PM > > What am I missing? `mode-line-format' is a buffer-local variable. >=20 > No, it isn't. > (local-variable-p 'mode-line-format) =3D> nil > (local-variable-if-set-p 'mode-line-format) =3D> t Then there seems to be a bug (either Emacs behavior or doc). `C-h v mode-line-format' seems to say that it is buffer-local: "Automatically becomes buffer-local when set in any fashion." And "Each buffer has its own value of this variable." And exactly the same thing is said after you do M-: = (make-variable-buffer-local 'mode-line-format). To me, that doc is saying that the variable is = buffer-local in all buffers: setting it in a buffer affects only the mode-line of = that buffer. Looking at some of the Emacs source code, things are not too clear. = hideshow.el (why hideshow.el?), for instance, calls `make-variable-buffer-local' for = it. I don't see where it is made buffer-local generally (hide-show.el is not = loaded by default, AFAIK), but the doc string does seem to indicate that it is. = (Maybe it's done in C code.) To me, the behavior from the code snippet I sent seems like a product = bug, not a doc bug. But Emacs has been this way apparently since Emacs 21 (not 20). =20 Wrt the code I sent (which uses `let', not `setq'), this, from Elisp = manual node Creating Buffer-Local, seems to be part of the explanation: "A peculiar wrinkle of this feature is that binding the variable (with `let' or other binding constructs) does not create a buffer-local binding for it. Only setting the variable (with `set' or `setq'), while the variable does not have a `let'-style binding that was made in the current buffer, does so." That text was not present in Emacs 20, where the code works (only the = mode-line of the given buffer is affected). I guess the bottom line is that I will need to use `setq' for the code = to work beyond Emacs 20. Presumably (hopefully), the change that introduced = "this feature" (whatever the undisclosed feature might be) did improve = something, even at the cost of breaking this. Further elucidations/advice is welcome.