Document how to specify fallback modes

* doc/emacs/custom.texi (Specifying File Variables): Document
fallback mode order.
This commit is contained in:
Lars Ingebrigtsen 2022-04-19 18:21:21 +02:00
parent e45abc832d
commit 247e587d56
2 changed files with 30 additions and 0 deletions

View file

@ -1232,6 +1232,31 @@ Manual}.
These four keywords are not really variables; setting them in any
other context has no special meaning.
If you're editing a file across Emacs versions, and a new mode has
been introduced to handle a file in a newer Emacs version, you can use
several @code{mode} entries to use the new mode (called
@code{my-new-mode}) in the new Emacs, and fall back to the old mode
(called @code{my-old-mode}) in older Emacs versions. If you're
enabling the modes in the first line of the file, you should use this
order:
@example
-*- mode: my-new; mode: my-old -*-
@end example
Emacs will ignore undefined modes until it finds one it can use.
However, if you're using a local variable block at the end up the
file, the order is reversed:
@example
Local variables:
mode: my-old
mode: my-new
@end example
Here Emacs will use the @emph{last} defined mode it finds. (This is
for historical reasons.)
Do not use the @code{mode} keyword for minor modes. To enable or
disable a minor mode in a local variables list, use the @code{eval}
keyword with a Lisp expression that runs the mode command

View file

@ -1441,6 +1441,11 @@ functions.
* Lisp Changes in Emacs 29.1
+++
** The local variable section now supports defining fallback modes.
This was previously only available when using a property line (i.e.,
putting the modes on the first line of a file).
+++
** New function 'flush-standard-output'.
This enables you do display incomplete lines from batch-based Emacs