emacs-devel
[Top][All Lists]
Advanced

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

Re: inverse of add-to-list: remove-from-list


From: Thibaut Verron
Subject: Re: inverse of add-to-list: remove-from-list
Date: Fri, 16 Oct 2020 13:14:03 +0200

Le jeu. 15 oct. 2020 à 18:31, Stefan Monnier
<monnier@iro.umontreal.ca> a écrit :
>
> > I might be missing something, but where would the harm be in using
> >> (add-hook 'org-export-filter-src-block-functions 
> >> 'my-html-filter-src-blocks)
> > even if it is not a hook?
>
> I think none, but it would be harmful to do:
>
>     (add-hook 'org-export-filter-src-block-functions
>               #'my-html-filter-src-blocks
>               nil t)

Oh, right, thanks.

> > So basically the answer would be, instead of looking for an opposite
> > to add-to-list, use cl-pushnew which has a natural opposite in
> > cl-remove. Is that so?
>
> `cl-remove` is not the opposite of `cl-pushnew`, because
>
>     (cl-pushnew V X :test F)
>     (cl-remove  V X :test F)
>
> will usually result in X being different from what it started (because
> `cl-remove` does not modify its argument X).

Oops. I guess it goes to say how confusing the situation is. :)



reply via email to

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