From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67848: 29.1; Fix usage of `setq-default' and add explanation Date: Sat, 23 Dec 2023 11:00:58 +0200 Message-ID: <83r0jde1it.fsf@gnu.org> References: <87msuaief7.fsf@debian-hx90.lan> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3775"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67848@debbugs.gnu.org To: Xiyue Deng Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 23 10:02:13 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rGxtc-0000pf-75 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Dec 2023 10:02:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGxtP-0002T5-JZ; Sat, 23 Dec 2023 04:01:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGxtN-0002Sh-TI for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 04:01:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rGxtN-00080B-Ek for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 04:01:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGxtS-0005A9-7F for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 04:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Dec 2023 09:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67848 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67848-submit@debbugs.gnu.org id=B67848.170332208119683 (code B ref 67848); Sat, 23 Dec 2023 09:02:02 +0000 Original-Received: (at 67848) by debbugs.gnu.org; 23 Dec 2023 09:01:21 +0000 Original-Received: from localhost ([127.0.0.1]:48520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGxsm-00056u-U8 for submit@debbugs.gnu.org; Sat, 23 Dec 2023 04:01:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGxsk-0004xE-Ex for 67848@debbugs.gnu.org; Sat, 23 Dec 2023 04:01:19 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGxsa-0007vY-0w; Sat, 23 Dec 2023 04:01:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+oLEm7ae8Hmi3zP6G4SFHn8lxbxyTYkRzmUlXge5I7c=; b=YNgHl9IC/9E9 vMntPYjp06NNQAhVWIY9cDTXe4xylGbHleDb3bFVgg1BHEJdXPS9cE6lTfb2SbuWzLLMprJy1Ri+I OWZgzQW9YJisHqsylzn5+4yqqe1RXgg4PYjXOYXVPI+uOLhECKsI0hF4idr2dz95tMrhERDkEJCxg kPAJjfjwgXL8F0N6kAJOJQn3ICGlvTChuEjy+e63kQA+yrx0BXiAHzkNnebJN2Sju696zTlg1ZqNd s0Sx72x9rdKA+X3MvmEgXHwgoaZNkmoZ/4Y50gQi0iNSS7b1/5tCHJCqvPyjXh2p8SDXMGFvWn8FE /hHqa4cN0W0r9TTAU6sC/w==; In-Reply-To: <87msuaief7.fsf@debian-hx90.lan> (message from Xiyue Deng on Sat, 16 Dec 2023 03:18:20 -0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276713 Archived-At: > From: Xiyue Deng > 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. 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?