help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to tame compiler?


From: Jean Louis
Subject: Re: How to tame compiler?
Date: Sun, 2 May 2021 09:54:54 +0300
User-agent: Mutt/2.0.6 (2021-03-06)

* Michael Heerdegen <michael_heerdegen@web.de> [2021-05-02 08:59]:
> Jean Louis <bugs@gnu.support> writes:
> 
> > How do I go to create dynamical bindings? Help me.
> 
> Newest Emacs versions have `dlet' to create dynamical bindings.  Here is
> the definition:
> 
> #+begin_src emacs-lisp
> (defmacro dlet (binders &rest body)
>   "Like `let*' but using dynamic scoping."
>   (declare (indent 1) (debug let))
>   `(let (_)
>      ,@(mapcar (lambda (binder)
>                  `(defvar ,(if (consp binder) (car binder) binder)))
>                binders)
>      (let* ,binders ,@body)))
> #+end_src
> 
> Use that macro to create dynamical bindings where you really need, and
> rely on lexical binding else.
> 
> Apart from that, I recommend to take Stefan's suggestions into
> consideration, he knows what he is talking about.

Thankful for dlet tip!

It would help if I wish to expand few variables dynamically bound.

Though I found the solution for `rcd-template-eval' as I want global
variables, I am simply not using lexical-binding t in the package.

All I had to do is to isolate the function for template evaluation
into separate package without lexical-binding and now there are no
problems whatsoever, interpolation works well.

It is here:
https://hyperscope.link/3/7/1/3/3/RCD-Template-Interpolation-System-for-Emacs.html

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




reply via email to

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