emacs-devel
[Top][All Lists]
Advanced

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

Re: lexical-binding is turned on in more use cases


From: Alan Mackenzie
Subject: Re: lexical-binding is turned on in more use cases
Date: Sun, 8 Mar 2020 19:56:20 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Eli.

On Sun, Mar 08, 2020 at 21:40:17 +0200, Eli Zaretskii wrote:
> > Date: Sun, 8 Mar 2020 19:30:48 +0000
> > From: Alan Mackenzie <address@hidden>
> > Cc: Stefan Monnier <address@hidden>, address@hidden

> > > > We could say that to recover the original behavior, instead of

> > > >     --eval "<foo>"

> > > > the command could use

> > > >     --eval "(eval '<foo>)"

> > > And the same for M-:?

> > As it happens, this issue bit me this afternoon.  I instrumented a
> > function for edebug and tried

> >     M-: (c-align-cpp-indent-to-body)

> > .  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.

> Does it help to say

>   M-: (eval (c-align-cpp-indent-to-body))

> instead?

Well, the essential thing was getting a binding of c-syntactic-context
for calling c-align-cpp-indent-to-body.  So, I tried:

    M-: (eval (let ((c-syntactic-context (...)))
    (c-align-cpp-indent-to-body)))

, but this didn't help at all.  This was while the current buffer's major
mode was C Mode, which has lexical-binding nil.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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