all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xiyue Deng <manphiz@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 67848@debbugs.gnu.org
Subject: bug#67848: 29.1; Fix usage of `setq-default' and add explanation
Date: Sat, 23 Dec 2023 02:09:29 -0800	[thread overview]
Message-ID: <87jzp5fcx2.fsf@debian-hx90.lan> (raw)
In-Reply-To: <83r0jde1it.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Dec 2023 11:00:58 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Xiyue Deng <manphiz@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





  reply	other threads:[~2023-12-23 10:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-16 11:18 bug#67848: 29.1; Fix usage of `setq-default' and add explanation Xiyue Deng
2023-12-16 11:26 ` Xiyue Deng
2023-12-23  9:00 ` Eli Zaretskii
2023-12-23 10:09   ` Xiyue Deng [this message]
2023-12-23 11:20     ` Eli Zaretskii
2023-12-24  7:00       ` Xiyue Deng
2023-12-24  8:47         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzp5fcx2.fsf@debian-hx90.lan \
    --to=manphiz@gmail.com \
    --cc=67848@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.