summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2024-03-03 23:08:16 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2024-03-03 23:58:18 -0500
commit2b5d43081a30f816dd38a16c7b5bfbad712a779b (patch)
tree8415705736e15e1e4e34382ee715bc87b7c99f81 /etc
parentf5c65dae099485f4df128b61d36ae9e5af8518a8 (diff)
downloademacs-2b5d43081a30f816dd38a16c7b5bfbad712a779b.tar.gz
(major-mode-remap(-defaults)): New var and function (bug#69191)
While `major-mode-remap-alist` provides a way for users to indicate the major mode of their choice, we need a similar variable for the use of packages. This patch adds a new `major-mode-remap-defaults` and changes various packages to obey it or make use of it. I think it nicely cleans the regexp duplication between CC-mode and `c-ts-mode.el` and also makes it easier/cleaner for users to override the changes made by `*-ts-mode.el`. * lisp/files.el (major-mode-remap-defaults): New variable. (major-mode-remap): New function. (set-auto-mode-0): Use it. * doc/lispref/modes.texi (Auto Major Mode): Document them. * lisp/textmodes/tex-mode.el (tex--redirect-to-submode): Use `major-mode-remap`. (major-mode-remap-defaults): Set it to remap AUCTeX modes by default. * lisp/progmodes/ruby-ts-mode.el (auto-mode-alist): Leave it alone. (major-mode-remap-defaults): Set this one instead. * lisp/progmodes/c-ts-mode.el (c-or-c++-ts-mode): Use `major-mode-remap`. (auto-mode-alist): Leave it alone. (major-mode-remap-defaults): Set this one instead. * lisp/org/ox.el (org-export-to-buffer): Modernize docstring accordingly. * lisp/progmodes/cc-mode.el (c-or-c++-mode): * lisp/org/ox-latex.el (org-latex-export-as-latex): * lisp/org/ox-koma-letter.el (org-koma-letter-export-as-latex): * lisp/org/ox-beamer.el (org-beamer-export-as-latex): Use `major-mode-remap` when available.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS4
1 files changed, 4 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 792e178c3b6..41bff184676 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1595,6 +1595,10 @@ values.
* Lisp Changes in Emacs 30.1
+** New var 'major-mode-remap-defaults' and function 'major-mode-remap'.
+The first is like Emacs-29's 'major-mode-remap-alist' but to be set by
+packages (instead of users). The second looks up those two variables.
+
+++
** Pcase's functions (in 'pred' and 'app') can specify the argument position.
For example, instead of '(pred (< 5))' you can write '(pred (> _ 5))'.