Fix usage of `setq-default' and offer more suggestions
cd61af0
changed from default-major-mode to major-mode in the first
code sample but didn't change the rest. This patch fixes this and add
some explanations of why use `setq-default' instead of `setq'. In
addition, it gives background on suggesting using text-mode as default
mode and suggest other alternatives.
* doc/lispintro/emacs-lisp-intro.texi (Text and Auto-fill): Fix usage
of `setq-default' and offer more suggestions. (Bug#67848)
This commit is contained in:
parent
2701da0eee
commit
ceacf75395
1 changed files with 14 additions and 6 deletions
|
@ -16892,8 +16892,12 @@ remember to look here to remind myself.
|
||||||
@node Text and Auto-fill
|
@node Text and Auto-fill
|
||||||
@section Text and Auto Fill Mode
|
@section Text and Auto Fill Mode
|
||||||
|
|
||||||
Now we come to the part that turns on Text mode and
|
Now we come to the part that turns on Text mode and Auto Fill
|
||||||
Auto Fill mode.
|
mode.@footnote{This section suggests settings that are more suitable
|
||||||
|
for writers. For programmers, the default mode will be set to the
|
||||||
|
corresponding prog-mode automatically based on the type of the file.
|
||||||
|
And it's perfectly fine if you want to keep the fundamental mode as
|
||||||
|
the default mode.}
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
@group
|
@group
|
||||||
|
@ -16945,15 +16949,19 @@ Here is the line again; how does it work?
|
||||||
|
|
||||||
@cindex Text Mode turned on
|
@cindex Text Mode turned on
|
||||||
@smallexample
|
@smallexample
|
||||||
(setq major-mode 'text-mode)
|
(setq-default major-mode 'text-mode)
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
This line is a short, but complete Emacs Lisp expression.
|
This line is a short, but complete Emacs Lisp expression.
|
||||||
|
|
||||||
We are already familiar with @code{setq}. It sets the following
|
We are already familiar with @code{setq}. We use a similar macro
|
||||||
variable, @code{major-mode}, to the subsequent value, which is
|
@code{setq-default} to set the following variable,
|
||||||
@code{text-mode}. The single-quote before @code{text-mode} tells
|
@code{major-mode}@footnote{We use @code{setq-default} because
|
||||||
|
@code{text-mode} is buffer local. If we use @code{setq} it will only
|
||||||
|
apply to the current buffer, and using @code{setq-default} will also
|
||||||
|
apply this to newly created buffers.}, to the subsequent value, which
|
||||||
|
is @code{text-mode}. The single-quote before @code{text-mode} tells
|
||||||
Emacs to deal directly with the @code{text-mode} symbol, not with
|
Emacs to deal directly with the @code{text-mode} symbol, not with
|
||||||
whatever it might stand for. @xref{setq, , Setting the Value of
|
whatever it might stand for. @xref{setq, , Setting the Value of
|
||||||
a Variable}, for a reminder of how @code{setq} works. The main point
|
a Variable}, for a reminder of how @code{setq} works. The main point
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue