From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Nov 2024 16:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 74367@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173168915921192 (code B ref -1); Fri, 15 Nov 2024 16:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Nov 2024 16:45:59 +0000 Received: from localhost ([127.0.0.1]:50666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBzSI-0005Vj-EP for submit@debbugs.gnu.org; Fri, 15 Nov 2024 11:45:58 -0500 Received: from lists.gnu.org ([209.51.188.17]:55812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBzSC-0005VW-Mf for submit@debbugs.gnu.org; Fri, 15 Nov 2024 11:45:57 -0500 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 1tBzSB-0006F8-VE for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 11:45:52 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBzS6-00030Z-Si for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 11:45:51 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EA31444051F for ; Fri, 15 Nov 2024 11:45:43 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1731689139; bh=91limI3RDImqyuYkEgAaIDEe/NF1nYQXXraZy3LaMgc=; h=From:To:Subject:Date:From; b=eG/5R8UpbA00jl0ZdZo0+59TSDyfv6TeQWcJEauALsW3sHB5rUtqz1U9Rt6WkTIo+ poYvAYCSwH9JEL5aOh3eQNik067KW/1kRSzI0iWuEBsZd4sXhUfnCfWeZI49D3EgPe 8n28HUqR+gmMrQ8MBJEtyqB6Hbl8/SD5kMkkXr5wMADKFrX43cyCFAvBm4MeJ3gCGW WLq6TgmPViO7Gt9Fd+IlBLdV+it+XhI4hU5NyanDffivSfIvK3XmTudGrJh1e3BzMN Aw1KVNyPpyZW1WJafQ9TR+5z3Utv6ZsbKVtZ1zkUWhVScjiyJorRyugZM8LYyYkGQ+ dRC4HOHVBLioA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 45AF8440674 for ; Fri, 15 Nov 2024 11:45:39 -0500 (EST) Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 30A7E1206CB for ; Fri, 15 Nov 2024 11:45:39 -0500 (EST) From: Stefan Monnier Message-ID: Date: Fri, 15 Nov 2024 11:45:38 -0500 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.073 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Tags: patch The doc of `c-ts-mode.el` currently recommends things we deprecate. The patch below fixes this. I think this can go into `emacs-30`, but I believe Eli prefers we leave this alone there, so I guess it would go to `master`. If we can install at least part of it into `emacs-30` (such as the removal of the recommendation to `require` or the suggestion to use the obsolete `c-or-c++-ts-mode`), I'll happily split it. Stefan In GNU Emacs 31.0.50 (build 1, i686-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) of 2024-10-17 built on alfajor Repository revision: 1df1a3f4a40aa6c49dd29db1b5a7ad47b6b2087c Repository branch: work Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure -C --enable-checking --enable-check-lisp-object-type --with-modules --with-cairo --with-tiff=ifavailable 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign' PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-c-ts-mode.el-Adjust-doc-about-how-to-change-default-.patch >From f6cb19d44fe2ff1abdf890c609264f86ee74e2d7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 15 Nov 2024 11:41:33 -0500 Subject: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Don't recommend (require 'c-ts-mode) since it's not reliable (loading `cc-mode.el` later on will override that preference) and also it is incompatible with our policy that loading a package shouldn't change Emacs's behavior. Don't recommend customizing `auto-mode-alist` since it's more complicated, only covers some of the ways a C mode can be selected, and those who really want that kind of control probably know about `auto-mode-alist` anyway. * lisp/progmodes/c-ts-mode.el (Commentary:): Adjust recommendation for how to use these modes by default: (c-ts-mode, c++-ts-mode): Don't suggest remapping `c-or-c++-mode` to `c-or-c++-ts-mode` since `c-or-c++-ts-mode` is deprecated since `c-or-c++-mode` already obeys the remapping of `c/c++-mode`. --- lisp/progmodes/c-ts-mode.el | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 3823c553fda..19e511bbac3 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -28,36 +28,17 @@ ;; functions that are useful generally to major modes for C-like ;; languages. ;; -;; This package provides `c-ts-mode' for C, `c++-ts-mode' for C++, and -;; `c-or-c++-ts-mode' which automatically chooses the right mode for -;; C/C++ header files. +;; This package provides `c-ts-mode' for C and `c++-ts-mode' for C++. ;; ;; To use these modes by default, assuming you have the respective -;; tree-sitter grammars available, do one of the following: -;; -;; - If you have both C and C++ grammars installed, add -;; -;; (require 'c-ts-mode) -;; -;; to your init file. -;; -;; - Add one or mode of the following to your init file: +;; tree-sitter grammars available, add one or more of the following to +;; your init file: ;; ;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) ;; (add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode)) -;; (add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode)) -;; -;; If you have only C grammar available, use only the first one; if -;; you have only the C++ grammar, use only the second one. -;; -;; - Customize 'auto-mode-alist' to turn one or more of the modes -;; automatically. For example: -;; -;; (add-to-list 'auto-mode-alist -;; '("\\(\\.ii\\|\\.\\(CC?\\|HH?\\)\\|\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\|\\.\\(cc\\|hh\\)\\)\\'" -;; . c++-ts-mode)) ;; -;; will turn on the c++-ts-mode for C++ source files. +;; If you have only C grammar available, use only the first one; if +;; you have only the C++ grammar, use only the second one. ;; ;; You can also turn on these modes manually in a buffer. Doing so ;; will set up Emacs to use the C/C++ modes defined here for other @@ -1340,8 +1321,6 @@ c-ts-mode (add-to-list \\='major-mode-remap-alist \\='(c-mode . c-ts-mode)) (add-to-list \\='major-mode-remap-alist \\='(c++-mode . c++-ts-mode)) - (add-to-list \\='major-mode-remap-alist - \\='(c-or-c++-mode . c-or-c++-ts-mode)) in your init files." :group 'c @@ -1410,8 +1389,6 @@ c++-ts-mode (add-to-list \\='major-mode-remap-alist \\='(c-mode . c-ts-mode)) (add-to-list \\='major-mode-remap-alist \\='(c++-mode . c++-ts-mode)) - (add-to-list \\='major-mode-remap-alist - \\='(c-or-c++-mode . c-or-c++-ts-mode)) in your init files. @@ -1513,6 +1490,8 @@ c-ts-mode--c-or-c++-regexp "\\|" "#include" ws-maybe "<" (regexp-opt headers) ">" "\\)"))) "A regexp applied to C header files to check if they are really C++.") +(make-obsolete-variable 'c-ts-mode--c-or-c++-regexp + 'c-or-c++-mode--regexp "30.1") ;;;###autoload (defun c-or-c++-ts-mode () -- 2.45.2 --=-=-=-- From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Nov 2024 21:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Monnier , 74367@debbugs.gnu.org Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.17317054031920 (code B ref 74367); Fri, 15 Nov 2024 21:17:02 +0000 Received: (at 74367) by debbugs.gnu.org; 15 Nov 2024 21:16:43 +0000 Received: from localhost ([127.0.0.1]:51109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tC3gJ-0000Uu-2p for submit@debbugs.gnu.org; Fri, 15 Nov 2024 16:16:43 -0500 Received: from mail-ed1-f49.google.com ([209.85.208.49]:42344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tC3gG-0000Ul-E4 for 74367@debbugs.gnu.org; Fri, 15 Nov 2024 16:16:41 -0500 Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5cfa581e6aeso10874a12.1 for <74367@debbugs.gnu.org>; Fri, 15 Nov 2024 13:16:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731705340; x=1732310140; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=VEjGTo0hVDxvEFDmLyQNGQteGoEsLocMRiOrTdxilTk=; b=J8qhKETuP+sXSadZgBACboTMt6PF7vPDutko9zRA6dd8FlAFs/gBj5pH77mXWOTCT+ 9V24Vl9JDxQDGOaigzhTePuQI87aEhdonCWE7PLzJH9di+mctub2v3sgL9Ru3DSZYNzb TxcJ58//eYEuVM2xJRbeybplMzBM5MrSEP+glAJCylJAnctcgKEmAs6ZLYnMJqOenv1k +qO7G/ybb5oJ2z0M5jbWpDfYCneTWwMW8pjVwY6FvmHhh8DWBm6u3WMFsw0TMypCL6bQ vZNVl1gQ4aUxlFalhLIiegN1/TTu7CoPpz1td8zrMeQ+bSAnb3G+cl3jHPlHXi7tbEQI 2IHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731705340; x=1732310140; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VEjGTo0hVDxvEFDmLyQNGQteGoEsLocMRiOrTdxilTk=; b=vHjwCFFx0KXa7v/lyysigBiLJXggdacjnq+TdEObwKaej5BcpXWJUn1CVT877ihBsW HiiSgSFh7/fMm8G+qBiGUJWwnDCR5k8m8Zfh4lUfGW6vsT0wnwRlkMI6g9BV3F76rWPp MmFxGO1Xf5B6UdVKCLMkYDXecHVva2dxfQ17QDluH6j9WoEJrxSSsZ8n4hF6qRnMoqOU KjGVMo3w/a2xvOjkJrMp9A+CnC3mkWOLJyr59idRIQZpdpixkKPDMTfxRmUm6+gQ99m5 uAKWAb67OWhGvC/K44o1UcHRpmSxxqRgc9ZYPXjH2DlT0jNzuzr+jarkrabdhSRdhOn1 gdzA== X-Forwarded-Encrypted: i=1; AJvYcCXu8rXRGacl4LvLfJtGSLdEipL2ZENktqohTSekIQxzgKztz+wwtXHEMVmwk00qv0Uut4Mw6A==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw8x4MRJRApRg/6M32T+AwSftxHvX6n7sQ+CLDrvS3kkv8RdQFR kY6MEyG6vT49v7dcpV248c/9KG53rzL8ztI0tQJOCsGnouPukUCuUrqzb+v+W2evdWBasywLHHX PVUiqDr2wga6m3Nz2WFnvt4XVArg= X-Google-Smtp-Source: AGHT+IFYdjzM4FGHkR6oDTMOSQtDRuysKgYp8DA9gRuxs5/K0IjVmmJxDw2dQqXF4Y1iN4pk4WyfXtWWFkcb7O2m17E= X-Received: by 2002:a05:6402:34d4:b0:5cf:767d:c442 with SMTP id 4fb4d7f45d1cf-5cf8e007e29mr3650440a12.13.1731705339467; Fri, 15 Nov 2024 13:15:39 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 15 Nov 2024 13:15:38 -0800 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Fri, 15 Nov 2024 13:15:38 -0800 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Tags: patch > > The doc of `c-ts-mode.el` currently recommends things we deprecate. > The patch below fixes this. > > I think this can go into `emacs-30`, but I believe Eli prefers we leave > this alone there, so I guess it would go to `master`. If we can install > at least part of it into `emacs-30` (such as the removal of the > recommendation to `require` or the suggestion to use the obsolete > `c-or-c++-ts-mode`), I'll happily split it. FWIW, I agree that we should at least remove the recommendation to use `require` on emacs-30, as it encourages bad habits and contributes to an already poor understanding of autoloading among users. From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2024 11:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Kangas Cc: 74367@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.173175476916620 (code B ref 74367); Sat, 16 Nov 2024 11:00:03 +0000 Received: (at 74367) by debbugs.gnu.org; 16 Nov 2024 10:59:29 +0000 Received: from localhost ([127.0.0.1]:52244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCGWW-0004K0-Ki for submit@debbugs.gnu.org; Sat, 16 Nov 2024 05:59:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCGWS-0004JR-FM for 74367@debbugs.gnu.org; Sat, 16 Nov 2024 05:59:24 -0500 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 1tCGWM-0002KD-4c; Sat, 16 Nov 2024 05:59:18 -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=DG2ceOkldwi9qx1dTDjHpC404kgAjt0VTn+yC36HT4Q=; b=ESBhb07ZksDh Z84CUPEKEo+HAJ6U7LJx0SsAcuY1PsNe8Ny5meRhFxaL6TIMXays9QSw163i4sH7KLVXgLSJrYM+W kXSeqhTYE9OsbXR2tYA0NfN9I+MiSyrjUucUoW6Bt+Qb06oBOPdAGoJ4OtBjl62zQT+FxPSwccoyo DPvA0WtebhHJwQz2OZyK5u42erwiqOuh7mSAiNTuvuwEIUwAZBpxvV+tyN4gbJMpPDXq8Sa12X5oZ zl3hK8CXP4eGlzT246dsdhxpEgHOi4ApTrsMTC/kkVQmUHZatu6TGDquMTzT9Rlhxzolr0+u2l9ZG LdZIer6U1V98Dr5etqYZgg==; Date: Sat, 16 Nov 2024 12:59:11 +0200 Message-Id: <86v7wnh2bk.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Kangas on Fri, 15 Nov 2024 13:15:38 -0800) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Kangas > Date: Fri, 15 Nov 2024 13:15:38 -0800 > > Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" writes: > > > Tags: patch > > > > The doc of `c-ts-mode.el` currently recommends things we deprecate. > > The patch below fixes this. > > > > I think this can go into `emacs-30`, but I believe Eli prefers we leave > > this alone there, so I guess it would go to `master`. If we can install > > at least part of it into `emacs-30` (such as the removal of the > > recommendation to `require` or the suggestion to use the obsolete > > `c-or-c++-ts-mode`), I'll happily split it. > > FWIW, I agree that we should at least remove the recommendation to use > `require` on emacs-30, as it encourages bad habits and contributes to an > already poor understanding of autoloading among users. This all should have been discussed when major-mode-remap-defaults was added and c-ts-mode was modified to use it. Not now, sigh. Anyway, I don't want to remove the 'require' part from the commentary, but I think we should modify it to use 'load', not 'require' (given the discussion in bug#74339), and we should make it the second alternative, after the one that talks about using major-mode-remap-alist. I also don't think I agree with these removals: > @@ -1340,8 +1321,6 @@ c-ts-mode > > (add-to-list \\='major-mode-remap-alist \\='(c-mode . c-ts-mode)) > (add-to-list \\='major-mode-remap-alist \\='(c++-mode . c++-ts-mode)) > - (add-to-list \\='major-mode-remap-alist > - \\='(c-or-c++-mode . c-or-c++-ts-mode)) > > in your init files." > :group 'c > @@ -1410,8 +1389,6 @@ c++-ts-mode > > (add-to-list \\='major-mode-remap-alist \\='(c-mode . c-ts-mode)) > (add-to-list \\='major-mode-remap-alist \\='(c++-mode . c++-ts-mode)) > - (add-to-list \\='major-mode-remap-alist > - \\='(c-or-c++-mode . c-or-c++-ts-mode)) > > in your init files. The commit log message says > (c-ts-mode, c++-ts-mode): Don't suggest remapping `c-or-c++-mode` > to `c-or-c++-ts-mode` since `c-or-c++-ts-mode` is deprecated > since `c-or-c++-mode` already obeys the remapping of `c/c++-mode`. However, if we don't remap c-or-c++-mode, it will load cc-mode.el, which loads a bunch of other cc-*.el files, which is not clean, since all we need is a single regexp. (And note that c-ts-mode doesn't limit the search for the regexp, whereas cc-mode.el does.) So I think if we want to _really_ deprecate c-or-c++-ts-mode, we should make this variable defined on a separate file, common to CC Mode and c-ts-mode, which doesn't load anything else. Perhaps in subr.el or files.el. P.S. As an aside, I find our handling of this and related issues quite appalling. Variables introduced (or should I say "sneaked in"?), without properly discussing their effects on the users and without properly documenting those effects; unclean tricks to "fight off" changes installed by others, without properly describing those changes and triggering a discussion; etc. This is unbecoming, and almost feels like some kind of court intrigues. We should know better how to deal with controversial changes. From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2024 16:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: Alan Mackenzie , 74367@debbugs.gnu.org, Stefan Kangas Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.173177597916922 (code B ref 74367); Sat, 16 Nov 2024 16:53:01 +0000 Received: (at 74367) by debbugs.gnu.org; 16 Nov 2024 16:52:59 +0000 Received: from localhost ([127.0.0.1]:54569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCM2d-0004Os-8k for submit@debbugs.gnu.org; Sat, 16 Nov 2024 11:52:59 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCM2b-0004Oe-1s for 74367@debbugs.gnu.org; Sat, 16 Nov 2024 11:52:58 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D23E2809C2; Sat, 16 Nov 2024 11:52:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1731775969; bh=axm3dgXP2migvQIkByGyjFKHAeWI6G5DrSUu8qxf4iI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bNT9hY7yGNALQVpbOJ+w2uzLh5hgj5o/mZqeDCYGuuEgeX8feZOI/25qPp7rBmrdu 00TM9liXKgj+Ear1AECLa1GpTAVIC78OMSpn/+N/sN79ubcIQbYcboDsxIjuuVfZg2 XnaUMGMMsALeGTVoDbktby+EqLvBjgPn3pb0kd23aLa93WqvU2tfr6ShyIWjkSRT9e nx16tJV5m2JxMNqIKyri6JteaN5BGJwM+LzcIAhwdVpKCGJ1Ef/fuXWecPGhRc5uMm echioMy5/tVDb/RKodFbmcFIO7ooJhJj6bcEOE8HYXkzT0u7jNn4QGf4LpP7i7nrmu IWobZwRe4V/Kw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D48A1804BC; Sat, 16 Nov 2024 11:52:49 -0500 (EST) Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9A00F1200BB; Sat, 16 Nov 2024 11:52:49 -0500 (EST) From: Stefan Monnier In-Reply-To: <86v7wnh2bk.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Nov 2024 12:59:11 +0200") Message-ID: References: <86v7wnh2bk.fsf@gnu.org> Date: Sat, 16 Nov 2024 11:52:48 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.008 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> FWIW, I agree that we should at least remove the recommendation to use >> `require` on emacs-30, as it encourages bad habits and contributes to an >> already poor understanding of autoloading among users. > This all should have been discussed when major-mode-remap-defaults was > added and c-ts-mode was modified to use it. Not now, sigh. Yup. I too often focus on the code and skip the doc. =F0=9F=99=81 > Anyway, I don't want to remove the 'require' part from the commentary, > but I think we should modify it to use 'load', not 'require' (given > the discussion in bug#74339), and we should make it the second > alternative, after the one that talks about using > major-mode-remap-alist. `load`? Yuck! But well, better than nothing (tho it likely won't make much difference in an init file: the problem of later loading `cc-mode` will still bite just as much). I don't understand why you insist on suggesting such a "setting" since it's unreliable now and probably even more so in the future. What advantage do you see in it for the user over the `major-mode-remap-alist` option? > The commit log message says > >> (c-ts-mode, c++-ts-mode): Don't suggest remapping `c-or-c++-mode` >> to `c-or-c++-ts-mode` since `c-or-c++-ts-mode` is deprecated >> since `c-or-c++-mode` already obeys the remapping of `c/c++-mode`. > > However, if we don't remap c-or-c++-mode, it will load cc-mode.el, > which loads a bunch of other cc-*.el files, which is not clean, since > all we need is a single regexp. ...and the `c-or-c++-mode` function itself. Good point. > (And note that c-ts-mode doesn't limit the search for the regexp, > whereas cc-mode.el does.) Should we harmonize the two? Do we know if there's a reason other than accidental for the difference? Presumably the `cc-mode.el` one has been more widely tested. > So I think if we want to _really_ deprecate > c-or-c++-ts-mode, we should make this variable defined on a separate > file, common to CC Mode and c-ts-mode, which doesn't load anything > else. Perhaps in subr.el or files.el. BTW, there's a similar issue with the `c-string-list-p` and `c-string-or-string-list-p` functions which are used for `safe-local-variable` which would cause `cc-vars.el` to be loaded for `c-ts-mode` users when a `dir-locals.el` sets some `c-mode` vars. Maybe we should move those things to a small `cc-utils.el` file which doesn't load other CC-mode files? [ Currently, this problem is hidden by the fact that we eagerly load `cc-mode.el` anyway (which also loads `cc-vars.el`) even before we try to look at those vars's `safe-local-variable` setting. ] Stefan From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2024 18:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Monnier Cc: acm@muc.de, 74367@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.17317821432440 (code B ref 74367); Sat, 16 Nov 2024 18:36:02 +0000 Received: (at 74367) by debbugs.gnu.org; 16 Nov 2024 18:35:43 +0000 Received: from localhost ([127.0.0.1]:54766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCNe2-0000dH-De for submit@debbugs.gnu.org; Sat, 16 Nov 2024 13:35:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCNdx-0000d2-LK for 74367@debbugs.gnu.org; Sat, 16 Nov 2024 13:35:40 -0500 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 1tCNdq-0004oh-P9; Sat, 16 Nov 2024 13:35:30 -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=Y3XsUGI7pV9TPTHZWjjjDVaWnAe/PQTZlSGjw5Wz3Yw=; b=G5hv1E9rw0Mx UWJpsYLkDbaOTOYzTWw9Mknf8gJbHFAgmfEk7LbPiMH7FC3nKjkdmqFZ/Am5egQ4g5z5CWEfSK+bh eg/fieNtcm815rRhVGGCN+wG79GuZ+geq7C6gvcSR+n75NFobw8g7xCWU9gHRJhXUETMnBvMSMwN3 X76JfB8xVAcLObhvwFhWZuxIBGn5D16kwz7SOwz+c8lsldK5/EKHmAMZxUxT30AXW9k8bKZzEsMFJ x6G8Cter9p+XJ498X2YLkeX75bKU8hGPiRFUjPHCqSTGNso0noT6BacFF4ZuCkSFur0m1gc+as8jq S7dKP/iCSbl7X0SdsuR9PQ==; Date: Sat, 16 Nov 2024 20:35:25 +0200 Message-Id: <86plmvf2mq.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Monnier on Sat, 16 Nov 2024 11:52:48 -0500) References: <86v7wnh2bk.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Stefan Kangas , 74367@debbugs.gnu.org, Alan > Mackenzie > Date: Sat, 16 Nov 2024 11:52:48 -0500 > > > Anyway, I don't want to remove the 'require' part from the commentary, > > but I think we should modify it to use 'load', not 'require' (given > > the discussion in bug#74339), and we should make it the second > > alternative, after the one that talks about using > > major-mode-remap-alist. > > `load`? Yuck! > But well, better than nothing (tho it likely won't make much difference > in an init file: the problem of later loading `cc-mode` will still bite > just as much). > > I don't understand why you insist on suggesting such a "setting" since > it's unreliable now and probably even more so in the future. Because that's what users did in Emacs 29. I don't want us to make an impression it no longer works. > What advantage do you see in it for the user over the > `major-mode-remap-alist` option? Since I agreed to make the major-mode-remap-alist the first item, is there still a question of the advantages of 'load' wrt major-mode-remap-alist? > > The commit log message says > > > >> (c-ts-mode, c++-ts-mode): Don't suggest remapping `c-or-c++-mode` > >> to `c-or-c++-ts-mode` since `c-or-c++-ts-mode` is deprecated > >> since `c-or-c++-mode` already obeys the remapping of `c/c++-mode`. > > > > However, if we don't remap c-or-c++-mode, it will load cc-mode.el, > > which loads a bunch of other cc-*.el files, which is not clean, since > > all we need is a single regexp. > > ...and the `c-or-c++-mode` function itself. > > Good point. > > > (And note that c-ts-mode doesn't limit the search for the regexp, > > whereas cc-mode.el does.) > > Should we harmonize the two? Do we know if there's a reason other than > accidental for the difference? Presumably the `cc-mode.el` one has been > more widely tested. I don't mind limiting the search in c-ts-mode, but then we need two common variables. > > So I think if we want to _really_ deprecate > > c-or-c++-ts-mode, we should make this variable defined on a separate > > file, common to CC Mode and c-ts-mode, which doesn't load anything > > else. Perhaps in subr.el or files.el. > > BTW, there's a similar issue with the `c-string-list-p` and > `c-string-or-string-list-p` functions which are used for > `safe-local-variable` which would cause `cc-vars.el` to be loaded for > `c-ts-mode` users when a `dir-locals.el` sets some `c-mode` vars. I think we should have a string-or-list-p function in subr.el, like string-or-null-p we already have there. > Maybe we should move those things to a small `cc-utils.el` file which > doesn't load other CC-mode files? That would also work for me. From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2024 20:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: acm@muc.de, 74367@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.173178881221752 (code B ref 74367); Sat, 16 Nov 2024 20:27:02 +0000 Received: (at 74367) by debbugs.gnu.org; 16 Nov 2024 20:26:52 +0000 Received: from localhost ([127.0.0.1]:54929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCPNb-0005em-Uf for submit@debbugs.gnu.org; Sat, 16 Nov 2024 15:26:52 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCPNZ-0005eS-Bk for 74367@debbugs.gnu.org; Sat, 16 Nov 2024 15:26:50 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1BABA100180; Sat, 16 Nov 2024 15:26:42 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1731788801; bh=7sAftMXB5AmrlByumTqXyNIFX/PKKV6y5b2Cwze9Iwo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iR4oHKKmiueMifQjA7aYu/NM/3bKBR6NSFkherkWlDdRbomKFIwqV2emEB2TzcTTz pvOBxYLuOl1gzMQPPe5n/FBLQEHkVnpYup8EsYsNiRPMCLB4wjvS6ODcglfS4Y6srH UeWhyVGdJBxLL86ZKlrVgV48wCknH86dOV38QDxHjdSdEwm9hYC/P7KmpePcX3wF5W n34dHMFuoLrqT1eB7CrYFjWJ2ZHNePErnF31XfFUYDL8csHY+LmMrWUWeXrducwwhE 9EIf3N5ucd7hKKtQlMcExrf7meSVLLKTXv+zx44Eo0ybmHNZ9CGc7KIGcO8lMzsbyK vA/InHf0EX+/A== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 455D6100043; Sat, 16 Nov 2024 15:26:41 -0500 (EST) Received: from alfajor (modemcable005.21-80-70.mc.videotron.ca [70.80.21.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1E8C512041A; Sat, 16 Nov 2024 15:26:41 -0500 (EST) From: Stefan Monnier In-Reply-To: <86plmvf2mq.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Nov 2024 20:35:25 +0200") Message-ID: References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> Date: Sat, 16 Nov 2024 15:26:31 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.199 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I don't understand why you insist on suggesting such a "setting" since >> it's unreliable now and probably even more so in the future. > Because that's what users did in Emacs 29. I don't want us to make an > impression it no longer works. In Emacs-29, it did work, because it modified `auto-mode-alist` and CC-mode never modified it back. In `emacs-30`, it doesn't work reliably any more because loading `cc-mode.el` after `c-ts-mode.el` causes the default mode to revert to `c-mode`. Loading `cc-mode.el` happens when you do `C-h f c-mode RET`, or when you load a file that requires it, e.g.: lisp/cedet/semantic/bovine/c.el:(eval-when-compile (require 'cc-mode)) lisp/generic-x.el:(require 'cc-mode) lisp/org/ob-C.el:(require 'cc-mode) lisp/org/ob-fortran.el:(require 'cc-mode) lisp/progmodes/antlr-mode.el:(require 'cc-mode) lisp/progmodes/cc-mode.el:;; (require 'cc-mode) lisp/progmodes/cmacexp.el:(require 'cc-mode) lisp/progmodes/csharp-mode.el:(require 'cc-mode) lisp/progmodes/cwarn.el:(require 'cc-mode) lisp/progmodes/hideif.el:(require 'cc-mode) lisp/progmodes/js.el:(require 'cc-mode) or: ../elpa/packages/csharp-mode/csharp-mode.el:(require 'cc-mode) ../elpa/packages/electric-spacing/electric-spacing.el:(require 'cc-mode) ../elpa/packages/gnome-c-style/gnome-c-align.el:(require 'cc-mode) ../elpa/packages/javaimp/javaimp-parse.el:(require 'cc-mode) ;for java-mode-syntax-table ../elpa/packages/vcl-mode/vcl-mode.el:(require 'cc-mode) ../nongnu/packages/arduino-mode/arduino-mode.el:(require 'cc-mode) ../nongnu/packages/bison-mode/bison-mode.el:(require 'cc-mode) ../nongnu/packages/d-mode/d-mode.el:(require 'cc-mode) ../nongnu/packages/php-mode/lisp/php.el: (require 'cc-mode) ../nongnu/packages/php-mode/lisp/php-mode-debug.el:(require 'cc-mode) ../nongnu/packages/php-mode/lisp/php-mode.el:(require 'cc-mode) ../nongnu/packages/scad-mode/scad-mode.el:(require 'cc-mode) ../nongnu/packages/typescript-mode/typescript-mode.el: (require 'cc-mode) Also we're discussing changing `c-ts-mode.el` so loading it doesn't have that effect at all, which means that there's a good chance it will work even less well in the future. So to me it's clear that suggesting the use of `require` or `load` to change the default C mode is doing a disservice to our users. Stefan From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2024 21:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Monnier Cc: acm@muc.de, 74367@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.173179082228015 (code B ref 74367); Sat, 16 Nov 2024 21:01:02 +0000 Received: (at 74367) by debbugs.gnu.org; 16 Nov 2024 21:00:22 +0000 Received: from localhost ([127.0.0.1]:54983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCPu1-0007Hh-Hs for submit@debbugs.gnu.org; Sat, 16 Nov 2024 16:00:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCPtz-0007HE-Cn for 74367@debbugs.gnu.org; Sat, 16 Nov 2024 16:00:20 -0500 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 1tCPtt-0007E3-VP; Sat, 16 Nov 2024 16:00:13 -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=GZICIDxnxusdF54VAX8TTxna2t5RA+PSzA5FuN/JqX0=; b=blpEHUqiZQvx agQSpKuEFQx5T6y/0/mIvcGYO3OAtzeCADvhkxZegOGax9EFHatCV6QjfXLM7VYyDbKlIs+C7Wmw7 HHqfX1bmm+6xjpogxA9C4YW9raL70NgwcoNpUmzXxFTlaW75+xmq5TnmSTxGI0umrl3zfgeXjp3gc e9r7aR/Qa9DNYHKNQ+eeOjwm4iSLkUBdz439b/1ySR0QFmgjGyhzG+CTD84zVtIEXoeI+zDs1sQed pM6cZTFDqKLb7zXH4hHRz1Zfj7Mll8OxiL5unMlmkQAMiv3D5aV76K79IYAfvhloEan2UHBETxp3A YNBnb3BRJCDVrjl4gXtJ8A==; Date: Sat, 16 Nov 2024 23:00:09 +0200 Message-Id: <86serqx5ba.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Monnier on Sat, 16 Nov 2024 15:26:31 -0500) References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: stefankangas@gmail.com, 74367@debbugs.gnu.org, acm@muc.de > Date: Sat, 16 Nov 2024 15:26:31 -0500 > > >> I don't understand why you insist on suggesting such a "setting" since > >> it's unreliable now and probably even more so in the future. > > Because that's what users did in Emacs 29. I don't want us to make an > > impression it no longer works. > > In Emacs-29, it did work, because it modified `auto-mode-alist` and > CC-mode never modified it back. > > In `emacs-30`, it doesn't work reliably any more because loading > `cc-mode.el` after `c-ts-mode.el` causes the default mode to revert to > `c-mode`. Loading `cc-mode.el` happens when you do `C-h f c-mode RET`, > or when you load a file that requires it, e.g.: This will be better once we fix the major-mode-remap-defaults are handled by the modes involved in this. But yes, the effect of your introduction of major-mode-remap-defaults and the subsequent changes in cc-mode is that loading the mode works less reliably now. Which is why the advice to use major-mode-remap-alist should now be the first one. > lisp/cedet/semantic/bovine/c.el:(eval-when-compile (require 'cc-mode)) > lisp/generic-x.el:(require 'cc-mode) > lisp/org/ob-C.el:(require 'cc-mode) > lisp/org/ob-fortran.el:(require 'cc-mode) > lisp/progmodes/antlr-mode.el:(require 'cc-mode) > lisp/progmodes/cc-mode.el:;; (require 'cc-mode) > lisp/progmodes/cmacexp.el:(require 'cc-mode) > lisp/progmodes/csharp-mode.el:(require 'cc-mode) > lisp/progmodes/cwarn.el:(require 'cc-mode) > lisp/progmodes/hideif.el:(require 'cc-mode) > lisp/progmodes/js.el:(require 'cc-mode) See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74339#38 > Also we're discussing changing `c-ts-mode.el` so loading it doesn't have > that effect at all That's not the change I am discussing in bug#74339. > which means that there's a good chance it will work even less well > in the future. So to me it's clear that suggesting the use of > `require` or `load` to change the default C mode is doing a > disservice to our users. Noted. From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Nov 2024 22:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: acm@muc.de, 74367@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.17318819797020 (code B ref 74367); Sun, 17 Nov 2024 22:20:02 +0000 Received: (at 74367) by debbugs.gnu.org; 17 Nov 2024 22:19:39 +0000 Received: from localhost ([127.0.0.1]:58978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCncI-0001p9-MM for submit@debbugs.gnu.org; Sun, 17 Nov 2024 17:19:38 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCncG-0001os-2A for 74367@debbugs.gnu.org; Sun, 17 Nov 2024 17:19:36 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5C3D14441A6; Sun, 17 Nov 2024 17:19:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1731881969; bh=saBsqYuo2pnLhbqGxwbnmJlWBWPv67Q0gwbl60qLkg0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CcLKfBVcUsBbhu9zAB1StELbN3Jei0uyJJ67lJMVlhc6O8qFZouC1K/vZiWEBnk1Q GbFsK625Hr1gN/DEHlgkD9pUorBJdZ5vt3Tdw+QUaBxM4xWJgTG0/VRycXGo//ueMR C1QP7LMUip7R6/k6cP4FGtwSiX96KF919BuVzAZ0M7JOjr1hpiw4vnV9rg0819Hrp4 +Z8xsgg1rxyeE8vLipxYWXOdRV2x9SnFSVuejaitb5UODgJlrJxcBFKGU1gbPbX5qU t0ZmIrfIdmb5AS7uBg/vFMJirq0jD0qtv1AqGCLllmCV7rAawlUZFfn0MJWxhlVhm3 DjJVHYWAl1Ifw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 35E97443B01; Sun, 17 Nov 2024 17:19:29 -0500 (EST) Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0078C1205FA; Sun, 17 Nov 2024 17:19:28 -0500 (EST) From: Stefan Monnier In-Reply-To: <86serqx5ba.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Nov 2024 23:00:09 +0200") Message-ID: References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> <86serqx5ba.fsf@gnu.org> Date: Sun, 17 Nov 2024 17:19:28 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.020 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) So, for `emacs-30` I propose the patch below. Any objection? Stefan diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 2785e9a6e68..af23cd66d98 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -35,12 +35,6 @@ ;; To use these modes by default, assuming you have the respective ;; tree-sitter grammars available, do one of the following: ;; -;; - If you have both C and C++ grammars installed, add -;; -;; (require 'c-ts-mode) -;; -;; to your init file. -;; ;; - Add one or mode of the following to your init file: ;; ;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) @@ -59,6 +53,12 @@ ;; ;; will turn on the c++-ts-mode for C++ source files. ;; +;; - If you have both C and C++ grammars installed, add +;; +;; (require 'c-ts-mode) +;; +;; to your init file. +;; ;; You can also turn on these modes manually in a buffer. Doing so ;; will set up Emacs to use the C/C++ modes defined here for other ;; files, provided that you have the corresponding parser grammar @@ -1496,7 +1496,6 @@ c-or-c++-ts-mode '(c++-mode . c++-ts-mode))) (when (treesit-ready-p 'c) - (add-to-list 'major-mode-remap-defaults '(c++-mode . c++-ts-mode)) (add-to-list 'major-mode-remap-defaults '(c-mode . c-ts-mode))) (when (and (treesit-ready-p 'cpp) From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Nov 2024 12:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Monnier Cc: acm@muc.de, 74367@debbugs.gnu.org, stefankangas@gmail.com Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.173193177525768 (code B ref 74367); Mon, 18 Nov 2024 12:10:01 +0000 Received: (at 74367) by debbugs.gnu.org; 18 Nov 2024 12:09:35 +0000 Received: from localhost ([127.0.0.1]:60289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tD0ZS-0006hY-Ji for submit@debbugs.gnu.org; Mon, 18 Nov 2024 07:09:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tD0ZQ-0006hK-1q for 74367@debbugs.gnu.org; Mon, 18 Nov 2024 07:09:33 -0500 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 1tD0ZJ-0006fz-2T; Mon, 18 Nov 2024 07:09:25 -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=FFxNRpe+ttTLRfwtWlbL6T7w3xq87UnphUl5fgZa+mU=; b=XBdx2aI8ERT3 HHpjfCBOAXop+a+vP6lOOGTIdbCbUeoZVqrrxzmIlREsyztuKP2IA2PmDd8M5h5hlG2cr0deXEBPR sIigHsoxfE/ChX8nZkfhztRfXgeOl91SepX9P0OEp+ndIj+n/su3MlElkU7r5YnH3Haai1BZoizQ0 SC6FBlob6wqLydJvmBVM5b1YRAW91a9q8NUJL+1SIzC/tPL3KrZSWmDwaGgIEhPJoQiG7qHOdpP3K x3XZw+wb95lpGA3bincgoHWMPLUYcBQj7OySVcGtVRdfzpl307qGKMkHzSfjuee9qvtBWnl0wKC9k b5qympEPVMzuAj0WiR8Pfw==; Date: Mon, 18 Nov 2024 14:09:22 +0200 Message-Id: <86ldxgvj4d.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Monnier on Sun, 17 Nov 2024 17:19:28 -0500) References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> <86serqx5ba.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: stefankangas@gmail.com, 74367@debbugs.gnu.org, acm@muc.de > Date: Sun, 17 Nov 2024 17:19:28 -0500 > > So, for `emacs-30` I propose the patch below. > Any objection? No objections, provided that you replace (require 'c-ts-mode) with (load "c-ts-mode") since, as we now understand, just 'require' might not do anything. > @@ -1496,7 +1496,6 @@ c-or-c++-ts-mode > '(c++-mode . c++-ts-mode))) > > (when (treesit-ready-p 'c) > - (add-to-list 'major-mode-remap-defaults '(c++-mode . c++-ts-mode)) > (add-to-list 'major-mode-remap-defaults '(c-mode . c-ts-mode))) > > (when (and (treesit-ready-p 'cpp) Please leave this part alone in the meantime, as long as bug#74339 is being discussed and is not resolved. The resolution of that bug will also handle this nit. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 01 21:02:03 2025 Received: (at control) by debbugs.gnu.org; 2 Jan 2025 02:02:03 +0000 Received: from localhost ([127.0.0.1]:41395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTAXD-0002SN-GE for submit@debbugs.gnu.org; Wed, 01 Jan 2025 21:02:03 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:60599) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTAXB-0002Rl-9g for control@debbugs.gnu.org; Wed, 01 Jan 2025 21:02:02 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5d3ecae02beso13363681a12.0 for ; Wed, 01 Jan 2025 18:02:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735783315; x=1736388115; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=TtZY82MuVUvrP1YAJC2/l67NNhCJVaSmeGwRWo66zM0=; b=Hb6UW5EZtnIIFztrkac0facGIsisvDAJORmRDIc7YNOSdBkgjmRYYvOHbubREXfyR7 n4RHCB85Ahxoz5vyfY8zc7yy1wbsFGOTQFh0GNqKmieYHgeWEVaQo/4sniA8I4GcQ681 0hAU0TvfEjK16QiOdHemlFRkpyKGUzX8tNcWlyTzPgfmjsqdfUX2cO+LmkYeStWYfydQ RdWmMoA31wHHsOSsseVqMHFO3WOgn9+QslFB0Or12y7qKXhokS+cjwDbDITJCjkQKswR x3VxSs/2od8l9S90Qchysdk8eXi2MbHMahwZOEEvOR2D35zSr04VKDwnEmYJ+eUdKF3G oMtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735783315; x=1736388115; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TtZY82MuVUvrP1YAJC2/l67NNhCJVaSmeGwRWo66zM0=; b=vcP8ae/OLFyNu7LmpN/edPOkLaLy+P8uHrQ6sKStwzDVEZd2vuF6SKSRgBbtIPjo2/ l9a4kClRW6ijn5vAzrPcXwuzOjjy2RWtDfiKpIJ2NMZ+WgFjDiE9DK02AvPo3svtajDw zYi9CQh3UHdtFU29NdQqFK3kTE8f8d+1S7BdtsfJRCec/cuPhONdWgXYc7lprzDx5Qcc jDZxW+jcxcUWp2HtYjq8mhy8I8pZ5T5Yl/uQrpnQHOg5eEzZDpyndKanp86IkIRS4ckE lywG+BpElI5nE7DMfqiJKORWvwx2EFgJOFaNEs2KFqwHk7jJ30M/iTHGqAdD/A2fUs31 3XCQ== X-Gm-Message-State: AOJu0YxKIdaIQoD3eZ9DIDRArYJ3IuC56Ra86bfp3t8PDb1xirMwThMC CLce4f86v9iObPk7+dauce4Rs7dWxo0e7TPzz9PzjdlzU3GcMOGKTTYVs8fyK8UAN7cbTPjtNY3 kKy+EomdQBnaAgStP8IuV8G6ICumSZ5Xl X-Gm-Gg: ASbGnctE0Yb1EboyDdrVcTMchx/Irl5p+1jKxjYf9euHFqpuQp59HnydP6sP7gkCwJI vAM5jMUtED1W0OD3WPLpSHiA7Uh1u87G8ikbN/7I7 X-Google-Smtp-Source: AGHT+IHka2KNotGmxIvDmlkLLUx1VGREM8qBNjOvcmGgaEWA32QQTCmAhTjuyFGKRTir9xA6Df/pXvYJ5iJ+vQ5v+gg= X-Received: by 2002:a05:6402:13d0:b0:5d0:d492:970b with SMTP id 4fb4d7f45d1cf-5d81dc6d6c9mr39232608a12.0.1735783315085; Wed, 01 Jan 2025 18:01:55 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 1 Jan 2025 20:01:54 -0600 From: Stefan Kangas MIME-Version: 1.0 Date: Wed, 1 Jan 2025 20:01:54 -0600 Message-ID: Subject: control message for bug #74367 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 74367 wishlist quit From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Feb 2025 19:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Monnier Cc: acm@muc.de, Eli Zaretskii , 74367@debbugs.gnu.org Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.173930145412823 (code B ref 74367); Tue, 11 Feb 2025 19:18:01 +0000 Received: (at 74367) by debbugs.gnu.org; 11 Feb 2025 19:17:34 +0000 Received: from localhost ([127.0.0.1]:58661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1thvlF-0003Kl-Ku for submit@debbugs.gnu.org; Tue, 11 Feb 2025 14:17:33 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:54431) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1thvlD-0003KM-Ec for 74367@debbugs.gnu.org; Tue, 11 Feb 2025 14:17:32 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-ab7a342ef4eso113571266b.0 for <74367@debbugs.gnu.org>; Tue, 11 Feb 2025 11:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739301445; x=1739906245; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=IGGuZLHqyfaiekNoTmuSz/vWYmR0iA3bRunwIpmGsdo=; b=CUTcxAzYtSItx2m0ePZK3R7lSlCrWi7XD01hBgkE2d0tLbGhKoalStoPngqrjPvbca n1widseoh7fMT2YnttugC4qnQcY8OWcuPNDk6YZUXqCqz3WWmepuROZ0+rVczy87oP9z 0PtjYOyy9J7JVZQOOLS71LmjTupp8k4hkOga/+/BlGlVS4K/zYbCpv23sPYjfF/Qisax pY6dWOTJ0tNjo+GgK8c8GMlrp5GRyZZAoguP7qnKJ7zjBwvZIre9GtdSwBIUxkN6bNHY 6Cx665PO8uFDcII2JxLOsSPmd4lA41Axf8210xk5/s4cHsnePmBMGSOep+mH0XoRC+lw OtkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739301445; x=1739906245; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IGGuZLHqyfaiekNoTmuSz/vWYmR0iA3bRunwIpmGsdo=; b=UkVf7ELVTZL97Uo4APYWTEbUfhTdbtEHNHzA14zZ63rqeMsH5BDQJBjh4Frl94UsYU rgpDhdtZpBwn+MkK2dyUaMLkKly4Wscyb+q66FZdbLYYumnXKSKS5OHlZHJHDvnnEj01 yUgvLa5k+Nen97LEsRIKY+ZHy4GisFjqRXTZZYqpW0UghbsM7uUFBtyMrK7q0UXHkBN3 UQvcl6pYWN17POzcJ9ngvwU4PN56LeH6ouemHnxP7U6fVJgXevkaHnwMvvQ5w9afMerU Plum5OZGiqMmMHgmJt7tQzZlbSqSro1g5auIbktAeK1ctjobJS/SHNTdDea/qjs7p8za 1vLA== X-Forwarded-Encrypted: i=1; AJvYcCWkbWpGzWj16C7JlPQiyX9c/nBV7EDAaHCXDGkw2vowNVzFIq6BYKBx5SgElm3VivWQgkRz4g==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzrE5080ylWto4w8a5wuQ1GKNKBTtML2EH+ymhdvF2MN7De1WMh +u7EToYZhNv2+swpfc32QACDBoCoX0IjgaRbTiOvRbopC+r8pVKPW4YXM8dqQMNnyKyPBKrbV0v M6+VBxtpZ7X1kt27WU2wFayzWvb8= X-Gm-Gg: ASbGncug6yzytghJPwAYGHeIPoFJXZQHNMyMo2BHfOGJWXdyJOHY/SOXUW8f4qHXQWt FIx+jGaYQ1qkr9/Ftw/ynHa2cLy5iA5zyQG4vp30CqfqMlKMQri39iTAm08WgrNO8np/FonmpDw == X-Google-Smtp-Source: AGHT+IHxXYbNGRlRQSKLgmufJt5P1y+EMxDjD8+uCc2msAvq0kcuPVuCRoYcpBpl3lFEScSXHImoLK489KL3kXnsNfc= X-Received: by 2002:a17:906:4fce:b0:ab7:ed56:a780 with SMTP id a640c23a62f3a-ab7f33d82bdmr15827266b.27.1739301444939; Tue, 11 Feb 2025 11:17:24 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Feb 2025 11:17:24 -0800 From: Stefan Kangas In-Reply-To: References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> <86serqx5ba.fsf@gnu.org> MIME-Version: 1.0 Date: Tue, 11 Feb 2025 11:17:24 -0800 X-Gm-Features: AWEUYZlij7-uYHCn2simCYNM1jFj3kv2Spf-nM-h3cwY5QwUGIEJH0JcmGrGTlw Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: > So, for `emacs-30` I propose the patch below. > Any objection? Is there anything left to do here, or can the bug be closed? Any followup changes on master, for example? From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Feb 2025 19:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Kangas Cc: acm@muc.de, 74367@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.173930211714928 (code B ref 74367); Tue, 11 Feb 2025 19:29:02 +0000 Received: (at 74367) by debbugs.gnu.org; 11 Feb 2025 19:28:37 +0000 Received: from localhost ([127.0.0.1]:58717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1thvvw-0003sh-JP for submit@debbugs.gnu.org; Tue, 11 Feb 2025 14:28:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33818) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1thvvt-0003sP-PW for 74367@debbugs.gnu.org; Tue, 11 Feb 2025 14:28:34 -0500 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 1thvvn-00004r-BD; Tue, 11 Feb 2025 14:28:27 -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=XTJ+yiqRtEaxvEIlik309Dnxr2lFJaos2Tb0URmt7fA=; b=VFBdS44chF1A VVrjHTcejzawltsjW4SAa0ySfpXkOFPuYKCmrbY70z+nJcIEo5PeL+/xvlwa91qaY5D6diKbvp5jn ULAyqcSH/SN2fNwBwsHt5d34opfei0XSFTweSljhlnTjDjvmouovHL487QweB5enIOJptDefaiFyG 5xgoeCzqRpH2IlJ6xdZDQDOBpRrXjO4v81d12YE5xBaSWbkDTVMNbFazubDLrgr9ZZ24oD5rWW3sU 1p/nZVPpfQeSD8WiGIWk5SCcAcllH+ztSuZK2WcmKjOzdlhVBTX0FcPfzOk0+IlP0/50NAK4tbQxK 0KdSS+/6Cu0SaXjVBOhvAg==; Date: Tue, 11 Feb 2025 21:27:34 +0200 Message-Id: <867c5wwac9.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Kangas on Tue, 11 Feb 2025 11:17:24 -0800) References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> <86serqx5ba.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Kangas > Date: Tue, 11 Feb 2025 11:17:24 -0800 > Cc: Eli Zaretskii , acm@muc.de, 74367@debbugs.gnu.org > > Stefan Monnier writes: > > > So, for `emacs-30` I propose the patch below. > > Any objection? > > Is there anything left to do here, or can the bug be closed? I think this can be closed, as the changes were done already. > Any followup changes on master, for example? I'm not sure anything else is needed. But let's hear from Stefan Monnier. From unknown Sat Aug 16 11:42:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Feb 2025 20:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74367 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: acm@muc.de, 74367@debbugs.gnu.org, Stefan Kangas Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.173930746525733 (code B ref 74367); Tue, 11 Feb 2025 20:58:01 +0000 Received: (at 74367) by debbugs.gnu.org; 11 Feb 2025 20:57:45 +0000 Received: from localhost ([127.0.0.1]:59071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1thxK9-0006gl-G6 for submit@debbugs.gnu.org; Tue, 11 Feb 2025 15:57:45 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:26344) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1thxK6-0006gT-Dk for 74367@debbugs.gnu.org; Tue, 11 Feb 2025 15:57:39 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CA2CC10004C; Tue, 11 Feb 2025 15:57:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1739307450; bh=cXCVTFo/jjuSqDl0IEvC7rTBSH8wZtBRlS/6oj2H7IY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=litttaTL+qhNwjEpd6X+dvWJhhfABe5B+R4RYqwKF6s7Kl0wDbQ88u+itTKjMBSzv lSlV1A7bUQUtCIv26mCsx0/9y8D/9u6mk/mrfCEgtJvOBJzwKhOZOBMnWEP4ZgkpUn IGTNi8WXs1O7LnHecqWlVJp2YZDWPCMiu/SFPF4Yo6TS+CM5j8rNKuZhn1nkGRJyRo vL/msOjL0o4BCHpK795OZ6NDeXbZ5HtPa8KxGeFqjauzJX0pKJVCstQbVuwSp1dGg7 rq77B0PJAcA5eTkH8Hy2NDuh3IhUroObqeC88gArPEvMuMFHCtWCty7vGUoP4iPgKF ayTbGIsx4QNBQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1973A100034; Tue, 11 Feb 2025 15:57:30 -0500 (EST) Received: from alfajor (modemcable005.21-80-70.mc.videotron.ca [70.80.21.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E0E20120195; Tue, 11 Feb 2025 15:57:29 -0500 (EST) From: Stefan Monnier In-Reply-To: <867c5wwac9.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 11 Feb 2025 21:27:34 +0200") Message-ID: References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> <86serqx5ba.fsf@gnu.org> <867c5wwac9.fsf@gnu.org> Date: Tue, 11 Feb 2025 15:57:30 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> Any followup changes on master, for example? > I'm not sure anything else is needed. But let's hear from Stefan > Monnier. IIRC I wanted further changes in `master` but there wasn't consensus that it was a good idea (ro at least not yet), so I think we're good (for now). Stefan From unknown Sat Aug 16 11:42:20 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Stefan Monnier Subject: bug#74367: closed (Re: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes) Message-ID: References: X-Gnu-PR-Message: they-closed 74367 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 74367@debbugs.gnu.org Date: Tue, 11 Feb 2025 23:39:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1739317142-3545-1" This is a multi-part message in MIME format... ------------=_1739317142-3545-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 74367@debbugs.gnu.org. --=20 74367: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D74367 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1739317142-3545-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 74367-done) by debbugs.gnu.org; 11 Feb 2025 23:38:31 +0000 Received: from localhost ([127.0.0.1]:59540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1thzpn-0000uH-Fd for submit@debbugs.gnu.org; Tue, 11 Feb 2025 18:38:31 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:52530) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1thzpk-0000tu-O3 for 74367-done@debbugs.gnu.org; Tue, 11 Feb 2025 18:38:29 -0500 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aaedd529ba1so757851466b.1 for <74367-done@debbugs.gnu.org>; Tue, 11 Feb 2025 15:38:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739317102; x=1739921902; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=xwsVScZ4AcLNFj5+jbOKibB8uVmDDOr0EIJLh34Yd4o=; b=IwOqQEDv5Wb0HWQ/IqLR2XJptkEW0dhmBJ5m9K2eidWnixjbIL86WZgCU4tO8DnWw3 w0lwL9M2Mh9tCo7D3yFrawPNrBoA9xOKgB9X7lu44gk1qYCuWcEZI7p9U1BbDXHX/vzY WlLQSz0QTaP21omBW7HuceXZobA0jaMURsz47lE6AAJfS7/K94AID9G6wqg8MgpAo4zK Zlj3hmws1pV4iW3CfrGa1/8UWLyxTcKA8mygfjX0R/AX5dh7snXDZnshNljzLtpUbiMa 1oy4Qv/ALxZLFi5ne+VE8qxYlUM6xzWicpkpj32OO5/2Pc6wdO2R+5sRzowtIkPS7CfG MJ4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739317102; x=1739921902; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xwsVScZ4AcLNFj5+jbOKibB8uVmDDOr0EIJLh34Yd4o=; b=AIxYrmM7aMb9qU1qFo4Ft/iGqPOwYFj4OjEPGpvQVXxQQzq6OTk3D5Fm5KtoZW/9Ob N2og32+VHussRRKtewSRkDPvPoqj1UdPhHQ9DsShiN4oz3QSU2Eq8VMXaR13Mz6ABHjh nP/onAUFuw/ahDoFu6a67X9Djc7+AaQez69P9dk0sNJZpYL/neQaq7SceO9v9FGYLAqA YzwDn8UiYjMPICKIadi0unO4D+D6gv19stDNdnQh8s/xlB8wRW8xYhXFpsfn5Vp8yzFQ /Cr6/ONXeeS3bGrY9uf7hwgWP0v3RaUYo04cZZgIiBESMYY/gf3VA6au7D+Rr5H4OP3g hRxg== X-Forwarded-Encrypted: i=1; AJvYcCUCMAdpGj5GDO4wWDnLWIGnqMvY5WixxRqXz+eDqqLoykyYGW8i5F4861l58mi2LubWCj8gvE+v07iG@debbugs.gnu.org X-Gm-Message-State: AOJu0YxI8V8RHJO4U88Xfsl5EHG1B2rlCHRA0neCJV7PHdamyTSAEM64 juOVQngjTkoL8AvFqo7WYpKmHoRaGGzgkExJY8qbeq/LuXtIK06bC2GIn6dkMszTCjViVJWLVDN cZsgiAh5FzwoxCbSBd+UPtBZojOE= X-Gm-Gg: ASbGncsBL5AqAdBBGco2FV450Z+94ZAiTPBD3oZC5fXQS4l/s2FPC+/YQnZeMz9TyXF +gPRkyXpD+50NfApw865NRtSVKunFD1nK4AWIoLUGEWdHdEc7T3l94KvzzrO5GjfsmCsbX6Eaxg 0= X-Google-Smtp-Source: AGHT+IHSHja7z/my3fSgg6ufaNiEQC68bvMQQbbOSpKvzfWsImOtrKxpA4917ILrupnXLYyHAs1IL25at91egEm0Ebo= X-Received: by 2002:a05:6402:268e:b0:5d0:c697:1f02 with SMTP id 4fb4d7f45d1cf-5deadd9d2b4mr2357381a12.17.1739317102324; Tue, 11 Feb 2025 15:38:22 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Feb 2025 15:38:22 -0800 From: Stefan Kangas In-Reply-To: References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> <86serqx5ba.fsf@gnu.org> <867c5wwac9.fsf@gnu.org> MIME-Version: 1.0 Date: Tue, 11 Feb 2025 15:38:22 -0800 X-Gm-Features: AWEUYZkXDoyObMQUGBiY13Z5oUYC8Z0cIybA5V5o31uoehZX9AX17XyagTLsBEE Message-ID: Subject: Re: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes To: Stefan Monnier , Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74367-done Cc: acm@muc.de, 74367-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >>> Any followup changes on master, for example? >> I'm not sure anything else is needed. But let's hear from Stefan >> Monnier. > > IIRC I wanted further changes in `master` but there wasn't consensus > that it was a good idea (ro at least not yet), so I think we're good > (for now). OK, I'm therefore closing this for now. We can always revisit it later. ------------=_1739317142-3545-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 15 Nov 2024 16:45:59 +0000 Received: from localhost ([127.0.0.1]:50666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBzSI-0005Vj-EP for submit@debbugs.gnu.org; Fri, 15 Nov 2024 11:45:58 -0500 Received: from lists.gnu.org ([209.51.188.17]:55812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBzSC-0005VW-Mf for submit@debbugs.gnu.org; Fri, 15 Nov 2024 11:45:57 -0500 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 1tBzSB-0006F8-VE for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 11:45:52 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBzS6-00030Z-Si for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 11:45:51 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EA31444051F for ; Fri, 15 Nov 2024 11:45:43 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1731689139; bh=91limI3RDImqyuYkEgAaIDEe/NF1nYQXXraZy3LaMgc=; h=From:To:Subject:Date:From; b=eG/5R8UpbA00jl0ZdZo0+59TSDyfv6TeQWcJEauALsW3sHB5rUtqz1U9Rt6WkTIo+ poYvAYCSwH9JEL5aOh3eQNik067KW/1kRSzI0iWuEBsZd4sXhUfnCfWeZI49D3EgPe 8n28HUqR+gmMrQ8MBJEtyqB6Hbl8/SD5kMkkXr5wMADKFrX43cyCFAvBm4MeJ3gCGW WLq6TgmPViO7Gt9Fd+IlBLdV+it+XhI4hU5NyanDffivSfIvK3XmTudGrJh1e3BzMN Aw1KVNyPpyZW1WJafQ9TR+5z3Utv6ZsbKVtZ1zkUWhVScjiyJorRyugZM8LYyYkGQ+ dRC4HOHVBLioA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 45AF8440674 for ; Fri, 15 Nov 2024 11:45:39 -0500 (EST) Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 30A7E1206CB for ; Fri, 15 Nov 2024 11:45:39 -0500 (EST) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Message-ID: X-Debbugs-Cc: Date: Fri, 15 Nov 2024 11:45:38 -0500 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.073 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Tags: patch The doc of `c-ts-mode.el` currently recommends things we deprecate. The patch below fixes this. I think this can go into `emacs-30`, but I believe Eli prefers we leave this alone there, so I guess it would go to `master`. If we can install at least part of it into `emacs-30` (such as the removal of the recommendation to `require` or the suggestion to use the obsolete `c-or-c++-ts-mode`), I'll happily split it. Stefan In GNU Emacs 31.0.50 (build 1, i686-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) of 2024-10-17 built on alfajor Repository revision: 1df1a3f4a40aa6c49dd29db1b5a7ad47b6b2087c Repository branch: work Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure -C --enable-checking --enable-check-lisp-object-type --with-modules --with-cairo --with-tiff=ifavailable 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign' PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-c-ts-mode.el-Adjust-doc-about-how-to-change-default-.patch >From f6cb19d44fe2ff1abdf890c609264f86ee74e2d7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 15 Nov 2024 11:41:33 -0500 Subject: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Don't recommend (require 'c-ts-mode) since it's not reliable (loading `cc-mode.el` later on will override that preference) and also it is incompatible with our policy that loading a package shouldn't change Emacs's behavior. Don't recommend customizing `auto-mode-alist` since it's more complicated, only covers some of the ways a C mode can be selected, and those who really want that kind of control probably know about `auto-mode-alist` anyway. * lisp/progmodes/c-ts-mode.el (Commentary:): Adjust recommendation for how to use these modes by default: (c-ts-mode, c++-ts-mode): Don't suggest remapping `c-or-c++-mode` to `c-or-c++-ts-mode` since `c-or-c++-ts-mode` is deprecated since `c-or-c++-mode` already obeys the remapping of `c/c++-mode`. --- lisp/progmodes/c-ts-mode.el | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 3823c553fda..19e511bbac3 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -28,36 +28,17 @@ ;; functions that are useful generally to major modes for C-like ;; languages. ;; -;; This package provides `c-ts-mode' for C, `c++-ts-mode' for C++, and -;; `c-or-c++-ts-mode' which automatically chooses the right mode for -;; C/C++ header files. +;; This package provides `c-ts-mode' for C and `c++-ts-mode' for C++. ;; ;; To use these modes by default, assuming you have the respective -;; tree-sitter grammars available, do one of the following: -;; -;; - If you have both C and C++ grammars installed, add -;; -;; (require 'c-ts-mode) -;; -;; to your init file. -;; -;; - Add one or mode of the following to your init file: +;; tree-sitter grammars available, add one or more of the following to +;; your init file: ;; ;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) ;; (add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode)) -;; (add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode)) -;; -;; If you have only C grammar available, use only the first one; if -;; you have only the C++ grammar, use only the second one. -;; -;; - Customize 'auto-mode-alist' to turn one or more of the modes -;; automatically. For example: -;; -;; (add-to-list 'auto-mode-alist -;; '("\\(\\.ii\\|\\.\\(CC?\\|HH?\\)\\|\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\|\\.\\(cc\\|hh\\)\\)\\'" -;; . c++-ts-mode)) ;; -;; will turn on the c++-ts-mode for C++ source files. +;; If you have only C grammar available, use only the first one; if +;; you have only the C++ grammar, use only the second one. ;; ;; You can also turn on these modes manually in a buffer. Doing so ;; will set up Emacs to use the C/C++ modes defined here for other @@ -1340,8 +1321,6 @@ c-ts-mode (add-to-list \\='major-mode-remap-alist \\='(c-mode . c-ts-mode)) (add-to-list \\='major-mode-remap-alist \\='(c++-mode . c++-ts-mode)) - (add-to-list \\='major-mode-remap-alist - \\='(c-or-c++-mode . c-or-c++-ts-mode)) in your init files." :group 'c @@ -1410,8 +1389,6 @@ c++-ts-mode (add-to-list \\='major-mode-remap-alist \\='(c-mode . c-ts-mode)) (add-to-list \\='major-mode-remap-alist \\='(c++-mode . c++-ts-mode)) - (add-to-list \\='major-mode-remap-alist - \\='(c-or-c++-mode . c-or-c++-ts-mode)) in your init files. @@ -1513,6 +1490,8 @@ c-ts-mode--c-or-c++-regexp "\\|" "#include" ws-maybe "<" (regexp-opt headers) ">" "\\)"))) "A regexp applied to C header files to check if they are really C++.") +(make-obsolete-variable 'c-ts-mode--c-or-c++-regexp + 'c-or-c++-mode--regexp "30.1") ;;;###autoload (defun c-or-c++-ts-mode () -- 2.45.2 --=-=-=-- ------------=_1739317142-3545-1--