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

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

Re: Is there equivalent internal function for this list-has-elements?


From: Jean Louis
Subject: Re: Is there equivalent internal function for this list-has-elements?
Date: Mon, 19 Oct 2020 23:15:05 +0300
User-agent: Mutt/1.10.1 (2018-07-13)

* Stefan Monnier <monnier@iro.umontreal.ca> [2020-10-19 21:20]:
> > I want to use function that is always unchangable or default within
> > Emacs for future years, and which is fast.
> 
> `push` and `cl-pushnew` are your guys.
> 
> > Apparently add-to-list is mentioned as not to be abused,
> 
> The main problem with it is that it can only be used on dynamically
> scoped variables, whereas `push` and `cl-pushnew` can be used on any
> variable you like and even on any *place* you like.
> 
> If it weren't for the fact that it's used in very many places, I'd have
> marked `add-to-list` as deprecated back in Emacs-24.

What you explained about dynamically scoped variables now makes sense.

Then those words "dynamically scoped variables" should be entered into
documentation for that function

>This is handy to add some elements to configuration variables,
but please do not abuse it in Elisp code, where you are usually
better off using ‘push’ or ‘cl-pushnew’.:

"Please do not abuse it in Elisp code" -- I did understand what it
means, I was here thinking more of using it let us say on very large
lists, that would be "abuse" for me, it is also in the sense of
excessively.

But then it is probably meant not to use it excessively in the sense
of too often.

That should be better clarified.




reply via email to

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