reddit / emacs

How do I add to a list with a "not" in it?

thiscarhasfourtires · 2022-03-06 16:13
For example, I wanna add `fountain-mode` to the list `company-global-modes`, which is defined as`(not erc-mode circe-mode message-mode)`, in such a way that it becomes `(not erc-mode circe-mode message-mode fountain-mode)`, and not `((fountain-mode) not erc-mode circe-mode message-mode)`. How can I do that?
agrostis · 2022-03-06 16:19
You can use the function [``add-to-list``](https://www.gnu.org/software/emacs/manual/html_node/elisp/List-Variables.html#index-add_002dto_002dlist) with the ``append`` flag, like this: (add-to-list 'company-global-modes 'fountain-mode t)
thiscarhasfourtires · 2022-03-06 16:44
That's wonderful, thanks!