From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: void variable Date: Wed, 28 Jul 2004 12:00:20 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <410353ED.1090107@math.ku.dk> <4104091E.4040007@math.ku.dk> <200407252046.i6PKkFH29813@raven.dms.auburn.edu> <200407262041.i6QKfFu15523@raven.dms.auburn.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1091030622 29838 80.91.224.253 (28 Jul 2004 16:03:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Jul 2004 16:03:42 +0000 (UTC) Cc: larsh@math.ku.dk, monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 28 18:03:32 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bpqtv-00008w-00 for ; Wed, 28 Jul 2004 18:03:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bpqx4-0004SN-JG for ged-emacs-devel@m.gmane.org; Wed, 28 Jul 2004 12:06:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BpquO-0002d5-26 for emacs-devel@gnu.org; Wed, 28 Jul 2004 12:04:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BpquM-0002c7-Qn for emacs-devel@gnu.org; Wed, 28 Jul 2004 12:03:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BpquM-0002bO-Nl for emacs-devel@gnu.org; Wed, 28 Jul 2004 12:03:58 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BpqrA-0005Ub-3e for emacs-devel@gnu.org; Wed, 28 Jul 2004 12:00:40 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1Bpqqq-0004cL-MZ; Wed, 28 Jul 2004 12:00:20 -0400 Original-To: Luc Teirlinck In-reply-to: <200407262041.i6QKfFu15523@raven.dms.auburn.edu> (message from Luc Teirlinck on Mon, 26 Jul 2004 15:41:15 -0500 (CDT)) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26054 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26054 Maybe we could arrange for defvar to burp a warning if the var is currently let-bound? That sounds like a good idea. It should be possible to do this by searching the specpdl. Maybe we could arrange for defvar to burp a warning if the var is currently let-bound? Just to be sure, I assume you mean a compiler warning? This is a load-time occurrence; the compiler cannot detect it. It would have to be detected at run time. The warning could use display-warning. defvar-ing let-bound variables is OK for autoloaded variables. The warning could be issued only when the global binding that was shadowed by the let-binding was unbound. That will never be the case for autoloaded variables. It is also OK for `(defvar foo)''s that are just there to pacify the compiler. Yes, that case should not warn.