diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2024-03-03 23:08:16 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2024-03-03 23:58:18 -0500 |
commit | 2b5d43081a30f816dd38a16c7b5bfbad712a779b (patch) | |
tree | 8415705736e15e1e4e34382ee715bc87b7c99f81 /etc | |
parent | f5c65dae099485f4df128b61d36ae9e5af8518a8 (diff) | |
download | emacs-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/NEWS | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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))'. |