From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Can't M-x compile-defun `edebug' because dynamic variables are falsely taken as lexical. Date: Tue, 3 Jan 2017 21:32:28 +0000 Message-ID: <20170103213228.GB2085@acm.fritz.box> References: <20170103141444.GA4649@acm.fritz.box> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1483479190 17803 195.159.176.226 (3 Jan 2017 21:33:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 3 Jan 2017 21:33:10 +0000 (UTC) User-Agent: Mutt/1.5.24 (2015-08-30) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 03 22:33:06 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 1cOWhT-000314-SI for ged-emacs-devel@m.gmane.org; Tue, 03 Jan 2017 22:32:55 +0100 Original-Received: from localhost ([::1]:36158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOWhY-0004cQ-1V for ged-emacs-devel@m.gmane.org; Tue, 03 Jan 2017 16:33:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOWhR-0004b6-Ac for emacs-devel@gnu.org; Tue, 03 Jan 2017 16:32:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cOWhJ-0007Ut-Pb for emacs-devel@gnu.org; Tue, 03 Jan 2017 16:32:48 -0500 Original-Received: from ocolin.muc.de ([193.149.48.4]:22784 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1cOWhJ-0007UZ-El for emacs-devel@gnu.org; Tue, 03 Jan 2017 16:32:45 -0500 Original-Received: (qmail 83696 invoked by uid 3782); 3 Jan 2017 21:32:43 -0000 Original-Received: from acm.muc.de (p548C6A5F.dip0.t-ipconnect.de [84.140.106.95]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 03 Jan 2017 22:32:43 +0100 Original-Received: (qmail 5695 invoked by uid 1000); 3 Jan 2017 21:32:28 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.4 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:211093 Archived-At: Hello, Stefan. On Tue, Jan 03, 2017 at 01:35:19PM -0500, Stefan Monnier wrote: > > I want to M-x compile-defun the function `edebug'. > Looks like `compile-defun` is another function that needs to be changed > to use `eval-sexp-add-defvars`. It looks like you've already done that, possibly on 2015-10-29. Looking at the source (now I know what to look for), eval-sexp-add-defvars is also in Emacs 25.1's source for compile-defun. So, something else has gone wrong..... I think the something else might be in Fdefvar. At its outermost level Fdefvar contains: ############################################### (Lisp_Object args) { Lisp_Object sym, tem, tail; sym = XCAR (args); tail = XCDR (args); if (CONSP (tail)) { ...... /* Do it before evaluating the initial value, for self-references. */ XSYMBOL (sym)->declared_special = 1; ...... } ############################################### , so the question becomes why is setting the declared_special flag done inside the "if (CONSP (tail))" rather than outside? I.e. why is it only done when a variable has an initialisation? > Stefan -- Alan Mackenzie (Nuremberg, Germany).