From: Jean Louis <bugs@gnu.support>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Is there equivalent internal function for this list-has-elements?
Date: Mon, 19 Oct 2020 23:15:05 +0300 [thread overview]
Message-ID: <20201019201505.GS19325@protected.rcdrun.com> (raw)
In-Reply-To: <jwvpn5ef5dx.fsf-monnier+emacs@gnu.org>
* 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.
next prev parent reply other threads:[~2020-10-19 20:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-18 19:37 Is there equivalent internal function for this list-has-elements? Jean Louis
2020-10-18 20:43 ` Stefan Monnier
2020-10-19 7:15 ` tomas
[not found] ` <20201019180655.GL19325@protected.rcdrun.com>
[not found] ` <jwvpn5ef5dx.fsf-monnier+emacs@gnu.org>
2020-10-19 20:15 ` Jean Louis [this message]
2020-10-18 20:58 ` tomas
2020-10-18 21:21 ` Joost Kremers
2020-10-19 6:57 ` tomas
2020-10-19 18:08 ` Jean Louis
2020-10-19 18:23 ` Jean Louis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201019201505.GS19325@protected.rcdrun.com \
--to=bugs@gnu.support \
--cc=help-gnu-emacs@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).