Subject: bug#12314: 24.2.50; `add-to-history': use `setq' with `delete'

From: Dmitry Gutov <[email-masked]>
Date: Sun, 09 Sep 2012 12:25:25 +0400

Chong Yidong <[email-masked]> writes:

 > Eli Zaretskii <[email-masked]> writes:
 >
 >> But the manual should cater first and foremost to newbies.  The rest
 >> will get the point when they read the detailed description of how the
 >> list is modified.
 >
 > I modified the manual to hopefully make the situation clearer.  In
 > particular, the descriptions of delq and delete explicitly say that you
 > typically ought to use the return value.
 >
 > The docstrings are harder, since they should be succinct.  Here is what
 > I suggest; WDYT?
 >
 >
 > (delq ELT LIST)
 >
 > ...
 >
 > Therefore, write `(setq foo (delq element foo))' to be sure of
 > changing the value of `foo'.

I think the last sentence could be better: (a) the value of foo won't
necessarily change, even if we do (setq ...), (b) our goal is for foo to
have the correct value, some not changed one. How about this?

Therefore, write `(setq foo (delq element foo))' to make sure that
`foo' points to the result.