GNU bug report logs - #75170
add-to-alist: new function

Previous Next

Package: emacs;

Reported by: Roland Winkler <winkler <at> gnu.org>

Date: Sun, 29 Dec 2024 05:35:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Roland Winkler <winkler <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 75170 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: bug#75170: add-to-alist: new function
Date: Mon, 20 Jan 2025 01:47:26 +0100
Roland Winkler <winkler <at> gnu.org> 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.




This bug report was last modified 142 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.