Subject: Re: bug#75170: add-to-alist: new function

From: Michael Heerdegen <[email-masked]>
Date: Mon, 20 Jan 2025 01:47:26 +0100

Roland Winkler <[email-masked]> writes:

> > The no-replace argument is useful for setting auto-mode-alist when you
> > don't know whether Emacs supports a particular programming language.
> > For example, the following suppresses using text-mode for m4 files in
> > Emacs 19 but doesn't override using m4-mode in Emacs 20.
> >
> > (setq default-major-mode 'text-mode)
> > (add-to-alist 'auto-mode-alist '("\\.m4\\'" . fundamental-mode) t)

You can already do something like this, e.g.

  (unless (assoc ...) (add-to-list ...))

or

  (cl-callf or (alist-get ...) VAL)

Michael.