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 00:34:51 -0700 (PDT) Message-ID: <94fb172e-f41b-470c-93a4-33376ab367b6@default> 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 1376638584 10629 80.91.229.3 (16 Aug 2013 07:36:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Aug 2013 07:36:24 +0000 (UTC) Cc: 14926@debbugs.gnu.org To: Glenn Morris , Stefan Monnier , Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 16 09:36:25 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 1VAEa7-0004wV-Mq for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 09:36:23 +0200 Original-Received: from localhost ([::1]:56951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAEa7-0007Hq-Bz for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 03:36:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAEZv-0007Fv-I0 for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 03:36:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VAEZm-00074F-VN for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 03:36:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAEZm-00074A-Ry for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 03:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VAEZm-0004uD-3I for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 03:36: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 07:36:02 +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.137663850818748 (code B ref 14926); Fri, 16 Aug 2013 07:36:02 +0000 Original-Received: (at 14926) by debbugs.gnu.org; 16 Aug 2013 07:35:08 +0000 Original-Received: from localhost ([127.0.0.1]:33755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAEYt-0004sJ-2s for submit@debbugs.gnu.org; Fri, 16 Aug 2013 03:35:07 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:47369) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAEYp-0004rf-Im for 14926@debbugs.gnu.org; Fri, 16 Aug 2013 03:35:04 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7G7YtAr020233 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Aug 2013 07:34:55 GMT Original-Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7G7YqgL011854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Aug 2013 07:34:53 GMT Original-Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7G7YquU016210; Fri, 16 Aug 2013 07:34:52 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6668.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] 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:77421 Archived-At: > > > "Warning: `make-variable-buffer-local' not called at toplevel" > > > would have the same learning experience, without saying > > > "should be...", which is wrong and confusing to people who > > > know what they're doing. > > > > Sounds right. Can someone make that change, plase? >=20 > Done. Of course, it won't remotely satisfy the OP. Right. It warns people not to use `make-variable-buffer-local' except at top level. Which is wrong. Top level is irrelevant to the proper use of `make-variable-buffer-local'. By Stefan's admission, the problem this warning aims to solve is a user who might be confusing `make-variable-buffer-local' with `make-local-variable'. His heuristic is presumably that IF `make-variable-buffer-local' is used somewhere other than at top level THEN it is likely that the user has confused the two functions, and `make-local-variable' might be more appropriate. It is the THEN part of that sentence, not the IF part, that is the proper message for the user. Assuming that the heuristic is good, the "warning" should really draw the user's attention, not to "top level", but to `make-local-variable' (which it does not mention). Non top-levelness is only the **means by which the compiler** detects a situation where the user might need help. The warning as proposed does not provide the help. At all. Think of what the user needs, not what the heuristic does. You think you've found a good way to detect a case where the user needs to be informed about `make-variable-buffer-local' vs `make-local-variable'. Great. So tell the user about that, not about how you figured out that s?he might be confused (=3D not at top level). If you want to issue a warning based on this heuristic, the=20 message to the user should be to suggest that s?he might want to use `make-local-variable' instead. Don't even mention "top level". Just tell the user to consider using `make-local-variable'. A useful message would even point to a doc section clarifying the difference between the two functions.