emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Can't M-x compile-defun `edebug' because dynamic variables are false


From: Drew Adams
Subject: RE: Can't M-x compile-defun `edebug' because dynamic variables are falsely taken as lexical.
Date: Thu, 13 Feb 2020 08:42:49 -0800 (PST)

Coming back to this old thread (2017).

sm> > special-variable-p only indicates if
sm> > (defvar VAR VAL . REST) was evaluated.

And not (defvar VAR), apparently?

am> So it would seem.  There is a bug in the elisp manual, which says that a
am> variable being declared by defvar will cause special-variable-p to
am> return t for it.   The doc string looks right, though far from helpful
am> for anybody who doesn't already know variable binding inside out, and
am> even a bit cryptic for those who do.
am> 
am> special-variable-p would appear to be a near useless function, since it
am> doesn't do what it's name says.
am> 
am> "Defining Variables" in the elisp manual states that "(defvar foo)" makes
am> foo a special variable; yet "(special-variable-p 'foo)" returns nil.  This
am> has got to be a bug, of some sort.
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
am> There appears to be no way of checking whether a variable's binding is
am> (or will be) lexical.
am> 
am> I can foresee quite a bit of confusion happening over all this, if it
am> hasn't happened already.
am> 
am> Am I missing something, or is this all really as incoherent as it
am> appears to me?

sm> It's useful for the compiler, but it's mostly internal, indeed.

Reading the doc, a user will have no idea that this
is "internal" mostly or not.  And s?he will have no
idea why (defvar foo) (special-variable-p 'foo)
returns nil.

Can we please fix the doc, to make things clear?

If this function is really (or "mostly"?) internal 
why document it in this way?  Neither the manual
nor the doc string gives a clue about this.

Can we please get the doc to not mislead about this,
at least in some way?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]