[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lexical-binding is turned on in more use cases
From: |
Stefan Monnier |
Subject: |
Re: lexical-binding is turned on in more use cases |
Date: |
Sun, 08 Mar 2020 19:41:44 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> . This complained about c-syntactic-context being unbound, so I
> tried:
>
> M-: (let ((c-syntactic-context (c-guess-basic-syntax)))
> (c-align-cpp-indent-to-body))
>
> , and was puzzled that c-syntactic-context was _still_ unbound. So I
> checked the spelling, and was more puzzled. Eventually I used setq,
> which worked, but caused me further problems later on in my Emacs
> session.
Indeed `c-syntactic-context` is only declared as dynamically scoped in
some files but not globally, for some reason.
It's rather unusual. The more common pattern is to write
(defvar c-syntactic-context nil)
which would not make you bump into this problem.
> Furthermore, c-syntactic-context is explicitly declared a dynamic
> variable by a defvar form.
But a `defvar` with no 2nd arg (i.e. no default value), which means it
only affects the current file (not sure if this is part of the reason
why you have `(defvar c-syntactic-context)` both `cc-cmds.el` and in
`cc-vars.el`, but it would explain it tho the `(cc-bytecomp-defvar
c-syntactic-context)` in `cc-vars.el` makes the whole situation much
more murky).
> THIS IS A MAJOR BACKWARD STEP FOR EMACS!!!!
;-)
> Looking at the git log, it appears this change was made nearly a year ago.
Indeed, it's a wonder you managed to survive with such a majorly broken
Emacs for so long ;-)
Stefan
- Re: lexical-binding is turned on in more use cases, (continued)
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/08
- Re: lexical-binding is turned on in more use cases, Eli Zaretskii, 2020/03/08
- Re: lexical-binding is turned on in more use cases, Alan Mackenzie, 2020/03/08
- Re: lexical-binding is turned on in more use cases, Eli Zaretskii, 2020/03/08
- Re: lexical-binding is turned on in more use cases, Alan Mackenzie, 2020/03/08
- Re: lexical-binding is turned on in more use cases, Eli Zaretskii, 2020/03/08
- Re: lexical-binding is turned on in more use cases, Alan Mackenzie, 2020/03/08
- Re: lexical-binding is turned on in more use cases, Richard Stallman, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/11
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/08
- Re: lexical-binding is turned on in more use cases,
Stefan Monnier <=
- Re: lexical-binding is turned on in more use cases, John Wiegley, 2020/03/09
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/09
- RE: lexical-binding is turned on in more use cases, Drew Adams, 2020/03/09
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/09
- Re: lexical-binding is turned on in more use cases, John Wiegley, 2020/03/09
- Re: lexical-binding is turned on in more use cases, Alan Mackenzie, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Andrea Corallo, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Alan Mackenzie, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Andrea Corallo, 2020/03/10
- Re: lexical-binding is turned on in more use cases, Stefan Monnier, 2020/03/10