all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Hongyi Zhao <hongyi.zhao@gmail.com>,
	help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Re: append, push, and add-to-list.
Date: Sun, 4 Jul 2021 16:01:15 +0000	[thread overview]
Message-ID: <SA2PR10MB4474A857C324673CCAE1DEE1F31D9@SA2PR10MB4474.namprd10.prod.outlook.com> (raw)
In-Reply-To: <CAGP6PO+wuCFyatdEbPcuy7gLxJVcWoz9JoTRbQwviTwf_6wJOQ@mail.gmail.com>

> I'm curious why `add-to-list' must take 'company-backends, i.e.,
> (quote company-backends) as one of its argument, while the other
> functions can directly use the unquoted form.

It's not that it "must take" a quoted symbol as arg.
It's that takes a symbol as arg.  That symbol can be
provided any way you like, i.e., by evaluating any
sexp that results in a symbol.

It's essentially equivalent to using both a `pushnew'
and a `set' or `setq' (with a variable as PLACE).  It
sets the variable value of its symbol arg to the new
list value.

As others have said, you will do yourself a favor by
reading (even studying) the Elisp manual.

Likewise, by looking at the Elisp source code provided
with Emacs.  The source code is freely available;
consider taking advantage of that fact.

`grep' the source code and use `flush-lines' to remove
instances where the first arg to `add-to-list' is a
quoted symbol, to get a feel for its use evaluating a
sexp (other than a quoted symbol) that yields a symbol.

  parent reply	other threads:[~2021-07-04 16:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-04  3:18 append, push, and add-to-list Hongyi Zhao
2021-07-04  4:35 ` Jean Louis
2021-07-04  5:11   ` Hongyi Zhao
2021-07-04 11:28     ` Jean Louis
2021-07-04 13:50       ` Hongyi Zhao
2021-07-04 15:58         ` Jean Louis
2021-07-05  2:04           ` Hongyi Zhao
2021-07-04 16:01         ` Drew Adams [this message]
2021-07-04 16:20     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-04 16:19 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05  2:16   ` Hongyi Zhao
2021-07-05  3:48     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05  4:31       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05  5:07         ` Hongyi Zhao
2021-07-05  5:50           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05  6:19             ` Hongyi Zhao
2021-07-05  5:06     ` Jean Louis
2021-07-05  6:22       ` Hongyi Zhao
2021-07-05  6:32         ` Emanuel Berg via Users list for the GNU Emacs text editor
  -- strict thread matches above, loose matches on Subject: below --
2021-07-05 14:37 Drew Adams
2021-07-05 14:53 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05 15:19   ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-05 16:18     ` [External] : " Drew Adams
2021-07-05 16:19   ` Drew Adams
2021-07-05 16:41     ` Emanuel Berg via Users list for the GNU Emacs text editor

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SA2PR10MB4474A857C324673CCAE1DEE1F31D9@SA2PR10MB4474.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.