Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free variable smie--parent #74

Open
psteckler opened this issue May 10, 2016 · 3 comments
Open

Free variable smie--parent #74

psteckler opened this issue May 10, 2016 · 3 comments

Comments

@psteckler
Copy link
Collaborator

The file coq/coq-smie.el has a couple of references to free variable `smie--parent'.

I see that variable defined in some versions of smie.el online, but it's not in my installation. I'm running Emacs 24.3.1.

@cpitclaudel
Copy link
Member

Are you sure? It dates back to 2010:

2010-10-29  Stefan Monnier  <monnier@iro.umontreal.ca>

    SMIE: change indent rules format, improve smie-setup.
    (...)
    (smie--parent, smie--after): New dynamic vars.

@psteckler
Copy link
Collaborator Author

I see the warning message when running make on the PG trunk.

I downloaded the .el source package for my Emacs, and yes, I see the defvar.

Maybe because the variable has not been assigned to? I don't know the
behavior of Elisp so well.

-- Paul

On Tue, May 10, 2016 at 4:27 PM, Clément Pit--Claudel <
notifications@github.com> wrote:

Are you sure? It dates back to 2010:

2010-10-29 Stefan Monnier monnier@iro.umontreal.ca

SMIE: change indent rules format, improve smie-setup.
(...)
(smie--parent, smie--after): New dynamic vars.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#74 (comment)

@cpitclaudel
Copy link
Member

Ah, I see :) Yup, I see the message as well. The trick is that smie--parent is a dynamic variable. See this:

defvar is a special form in ‘C source code’.

(defvar SYMBOL &optional INITVALUE DOCSTRING)

Define SYMBOL as a variable, and return SYMBOL.
You are not required to define a variable in order to use it, but
defining it lets you supply an initial value and documentation, which
can be referred to by the Emacs help facilities and other programming
tools.  The ‘defvar’ form also declares the variable as "special",
so that it is always dynamically bound even if ‘lexical-binding’ is t.

The warning is benign, but replicating the defvar form (with no initialization, of course) into the relevant PG source file would work (and is in fact the right way to do this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants