From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#14926: 24.3.50; Warning "`make-variable-buffer-local' should be called at toplevel" Date: Fri, 16 Aug 2013 10:58:42 -0700 (PDT) Message-ID: References: <2aaa3bfa-1556-4135-b70a-1308e6cc7cdd@default> <8738qb816m.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1376675978 1513 80.91.229.3 (16 Aug 2013 17:59:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Aug 2013 17:59:38 +0000 (UTC) Cc: 14926@debbugs.gnu.org To: Stefan Monnier , Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 16 19:59:39 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VAOJG-0004sQ-MS for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 19:59:38 +0200 Original-Received: from localhost ([::1]:60645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAOJG-00034D-E6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 13:59:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAOIq-00031t-Sb for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 13:59:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VAOIh-0005Mj-E2 for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 13:59:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAOIh-0005Ly-9x for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 13:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VAOIg-0005Pq-0r for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 13:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Aug 2013 17:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14926 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14926-submit@debbugs.gnu.org id=B14926.137667593220786 (code B ref 14926); Fri, 16 Aug 2013 17:59:01 +0000 Original-Received: (at 14926) by debbugs.gnu.org; 16 Aug 2013 17:58:52 +0000 Original-Received: from localhost ([127.0.0.1]:35069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAOIW-0005PC-0m for submit@debbugs.gnu.org; Fri, 16 Aug 2013 13:58:52 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:44692) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAOIT-0005Oq-8X for 14926@debbugs.gnu.org; Fri, 16 Aug 2013 13:58:50 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7GHwg75019516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Aug 2013 17:58:43 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7GHwfac004683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Aug 2013 17:58:41 GMT Original-Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7GHweAg009822; Fri, 16 Aug 2013 17:58:41 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77440 Archived-At: > > The message still suggests that using make-variable-buffer-local > > other than at toplevel is erroneous. >=20 > Notice that the message is only emitted when the argument to the" > function is a constant. I know of only one case where it is "not > erroneous" to have such a call not at top-level (from message.el): >=20 > ;; FIXME: On XEmacs this causes problems since let-binding like: > ;; (let ((message-options message-options)) ...) > ;; as in `message-send' and `mml-preview' loses to buffer-local > ;; variable initialization. > (unless (featurep 'xemacs) > (make-variable-buffer-local 'message-options)) >=20 > So yes, I think in 99% of the cases, it's erroneous. Hm. A certain Stefan said this previously: ;-) >> > 2. What is wrong with code such as this at top level? >>=20 >> Nothing. But most of the cases I bumped into... were cases >> where the author had confused make-local-variable and >> make-variable-buffer-local. Putting the two statements together, I guess you're saying: 1. There is nothing *inherently* wrong with `make-variable-buffer-local' at other than top level, at least in cases like the example cited in the bug report: (when (fboundp 'foo) (defvar toto 42 "...") (make-variable-buffer-local 'toto)) 2. But though there is nothing inherently wrong with that, in 99% of the cases it is erroneous to use `make-variable-buffer-local', except at top level. That would indeed be a good case for a warning. (And perhaps a note in the doc.) But see my previous mail about the content of the warning message: it should point to `make-local-variable' and it should not mention "top level" at all.