From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Can't M-x compile-defun `edebug' because dynamic variables are falsely taken as lexical. Date: Wed, 04 Jan 2017 10:23:16 -0500 Message-ID: References: <20170103141444.GA4649@acm.fritz.box> <20170103213228.GB2085@acm.fritz.box> <20170104133948.GA7373@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1483543464 21383 195.159.176.226 (4 Jan 2017 15:24:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Jan 2017 15:24:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 04 16:24:13 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOnQC-0004Dh-G5 for ged-emacs-devel@m.gmane.org; Wed, 04 Jan 2017 16:24:12 +0100 Original-Received: from localhost ([::1]:40000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOnQG-0002MZ-KH for ged-emacs-devel@m.gmane.org; Wed, 04 Jan 2017 10:24:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOnPf-0002MS-Tf for emacs-devel@gnu.org; Wed, 04 Jan 2017 10:23:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cOnPc-00011z-Pf for emacs-devel@gnu.org; Wed, 04 Jan 2017 10:23:39 -0500 Original-Received: from [195.159.176.226] (port=42136 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cOnPc-00011V-I3 for emacs-devel@gnu.org; Wed, 04 Jan 2017 10:23:36 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cOnPU-0007jz-Ov for emacs-devel@gnu.org; Wed, 04 Jan 2017 16:23:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:qynJI/TgCX6rUcBa47X8lkeaoE8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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 Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211103 Archived-At: > Ouch! There seems to be a clash between symbols (which are global, > dynamic) and lexical variables (which are local and "invisible"): the > only way to mark a variable as lexical is at the global level. Yes, there are some subtleties there. The main issue is that every occurrence of an identifier, whether a binding occurrence or a "use" can be lexical or dynamic, but we don't want the coders to have to constantly specify which uses and which bindings are lexical and which are dynamic. So we offer ways to "mark" symbols are "this one uses dynamic scoping". There are 2 such ways: - *Evaluation* of (defvar VAR VAL . REST) marks this variable as being dynamically scoped in all the code that will be compiled in this session. - *Compilation* of (defvar VAR . REST) marks this variable as being dynamically scoped in the current compilation unit. > (vi) e (special-variable-p 'edebug-breakpoints). > > This last returns nil. This suggests edebug-breakpoints has been bound > as a lexical variable, rather than a dynamic one. (There is a defvar > for it earlier in the file.) This is surely not right. special-variable-p only indicates if (defvar VAR VAL . REST) was evaluated. Stefan