mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-15 19:31:29 -07:00
Emacs 28 started fontifying several 'composite' (non-builtin) GNU M4 macros which, while listed under '(m4) Macro index', are not defined by GNU M4, and are included in its manual for illustrative purposes. These macro keywords range from clearly misleading (e.g., 'example', which the GNU M4 manual explicitly describes as nonexistent), to common in Autoconf's M4sugar layer (e.g., 'm4_quote'), to variations thereof (e.g., 'foreachq'). It is arguably too late to revert all of these additions, so this patch selects a handful to remove, and categorizes the rest; this should make it easier to hide some categories behind a font lock level or user option in the future, if desired. This patch reverts the Emacs 28 addition of 'example', and removes the older 'file', 'line', and 'gnu' macros. GNU M4 renamed 'gnu' to '__gnu__' already in 1990; and I couldn't find references to the other two which exist as '__file__' and '__line__', respectively. The remaining macros are partitioned into three sets: built-in, M4sugar-like, and other (bug#80412). For discussion, see also: https://lists.gnu.org/r/emacs-devel/2025-10/msg00357.html * lisp/progmodes/m4-mode.el (m4-program-options): Remove stale commentary. (m4--macro-list): Remove, replacing with... (m4--builtin, m4--autoconf, m4--composite): ...these new rx definitions. All uses changed. Remove 'example', 'file', 'gnu', and 'line' as keywords. (m4-font-lock-keywords): For consistency with real #-comments, fontify dnl macro with font-lock-comment-delimiter-face, and only the rest of its line with font-lock-comment-face. Fontify argument references with font-lock-variable-use-face rather than font-lock-variable-name-face. Use font lock faces rather than their eponymous but obsolete variables. Remove redundant entries for $@ and $*. Prefer shy regexp groups where applicable. (m4-mode-syntax-table): Quote syntactically special characters. (m4-m4-buffer): DRY using m4-m4-region. (m4-m4-region): Take region bounds as optional arguments, as recommended under '(elisp) The Mark'. Quote shell command. Support non-contiguous regions. (m4-current-defun-name): Recognize m4 backtick in addition to Autoconf bracket. Prefer shy regexp groups where applicable. (m4-mode): Simplify font-lock-defaults. * test/lisp/progmodes/m4-mode-resources/font-lock.m4: * test/lisp/progmodes/m4-mode-tests.el: New test files. |
||
|---|---|---|
| .. | ||
| autoconf-resources | ||
| c-ts-mode-resources | ||
| cperl-mode-resources | ||
| csharp-mode-resources | ||
| elisp-mode-resources | ||
| elixir-ts-mode-resources | ||
| flymake-resources | ||
| go-ts-mode-resources | ||
| heex-ts-mode-resources | ||
| java-ts-mode-resources | ||
| js-resources | ||
| lua-mode-resources | ||
| lua-ts-mode-resources | ||
| m4-mode-resources | ||
| project-resources | ||
| ruby-mode-resources | ||
| rust-ts-mode-resources | ||
| sh-script-resources | ||
| typescript-ts-mode-resources | ||
| xref-resources | ||
| asm-mode-tests.el | ||
| autoconf-tests.el | ||
| bat-mode-tests.el | ||
| bug-reference-tests.el | ||
| c-ts-mode-tests.el | ||
| cc-mode-tests.el | ||
| compile-tests.el | ||
| cperl-mode-tests.el | ||
| csharp-mode-tests.el | ||
| eglot-tests.el | ||
| elisp-mode-tests.el | ||
| elixir-ts-mode-tests.el | ||
| etags-tests.el | ||
| executable-tests.el | ||
| f90-tests.el | ||
| flymake-tests.el | ||
| gdb-mi-tests.el | ||
| glasses-tests.el | ||
| go-ts-mode-tests.el | ||
| grep-tests.el | ||
| heex-ts-mode-tests.el | ||
| hideshow-tests.el | ||
| java-ts-mode-tests.el | ||
| js-tests.el | ||
| json-ts-mode-tests.el | ||
| lua-mode-tests.el | ||
| lua-ts-mode-tests.el | ||
| m4-mode-tests.el | ||
| make-mode-tests.el | ||
| octave-tests.el | ||
| opascal-tests.el | ||
| pascal-tests.el | ||
| peg-tests.el | ||
| perl-mode-tests.el | ||
| project-tests.el | ||
| ps-mode-tests.el | ||
| python-tests.el | ||
| ruby-mode-tests.el | ||
| ruby-ts-mode-tests.el | ||
| rust-ts-mode-tests.el | ||
| scheme-tests.el | ||
| sh-script-tests.el | ||
| sql-tests.el | ||
| subword-tests.el | ||
| tcl-tests.el | ||
| typescript-ts-mode-tests.el | ||
| which-func-tests.el | ||
| xref-tests.el | ||