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: Stefan Monnier
Subject: Re: inverse of add-to-list: remove-from-list
Date: Thu, 15 Oct 2020 12:31:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> 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)

> 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).


        Stefan




reply via email to

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