GNU bug report logs -
#67848
29.1; Fix usage of `setq-default' and add explanation
Previous Next
Reported by: Xiyue Deng <manphiz <at> gmail.com>
Date: Sat, 16 Dec 2023 11:19:01 UTC
Severity: normal
Tags: patch
Found in version 29.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #25 received at 67848 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Xiyue Deng <manphiz <at> gmail.com>
>> Date: Sat, 16 Dec 2023 03:18:20 -0800
>>
>>
>> In the lisp intro book, there is a discrepancy in the section "Text and
>> Auto Fill mode" where the first code example uses "(setq-default
>> major-mode 'text-mode)"[1] but in the later explanation part the
>> function was changed to `setq'[2]. It looks like the original change[3]
>> was to deprecate the usage of "default-major-mode", but forgot to update
>> the other part.
>>
>> I have prepared a patch to make it consistent, and also added some extra
>> text to explain why `setq-default' is required for a buffer local
>> variable using a foot note. Will add in the next mail.
>
> Thanks, but I think it's wrong to use setq-default here, since that
> makes Text mode the default major-mode (instead of Fundamental), which
> is not what most people would want.
Actually making text-mode the default mode for new files is exactly what
the author intended based on the text from an earlier section[1]. In
addition, the previous change was to deprecate `default-major-mode'
which used to achieve the same effect. So it looks like that the
intention to change the default major-mode for new files is consistent
through the text.
Of course, whether this is a good advice is a slightly different matter,
and may be worth discussing in a footnote if it sounds worth doing. But
based on the text flow setting the new default major-mode should not be
changed IMHO.
>
> I think we should instead do one of the following:
>
> . convert the _first_ setq-default to setq
> . do as above, and also explain that people who really want Emacs to
> start new buffers in Text mode should use setq-default
>
> Would you like to amend your patch along these lines?
[1] https://git.savannah.gnu.org/cgit/emacs.git/tree/doc/lispintro/emacs-lisp-intro.texi#n16569
--
Xiyue Deng
This bug report was last modified 1 year and 149 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.