From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Date: Sun, 17 Nov 2024 17:19:28 -0500 Message-ID: References: <86v7wnh2bk.fsf@gnu.org> <86plmvf2mq.fsf@gnu.org> <86serqx5ba.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13287"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: acm@muc.de, 74367@debbugs.gnu.org, stefankangas@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 17 23:20:23 2024 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 1tCnd0-0003Es-HM for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Nov 2024 23:20:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCncj-0003di-Rw; Sun, 17 Nov 2024 17:20:06 -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 1tCnch-0003bC-1R for bug-gnu-emacs@gnu.org; Sun, 17 Nov 2024 17:20:03 -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 1tCncg-0004ty-Mt for bug-gnu-emacs@gnu.org; Sun, 17 Nov 2024 17:20:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=C9c7k6KxG0KUUA6T3EJgWGbXcbA+FGOcsSTlcDag70s=; b=IRgIMVxPYMvg3WPuwCo3OZszV9pGznqLKVPRwhfyXwrIgMsjL4K7FLvar1mB4gv9vIOu44qdzaCb5mbfMNRiHybIJgNmN52cnrRPNNDBUbcFC8rfVkRQ/8PvtO9HF1eDoLchriTbbK0msIO0hZfzHNq851IvcNpjUbKi4z5B2vdb412MK0KpArQ1QPpd4BHxjGQKciUrWgvvFc7gAdTbeFBs6sSygm8ttGRTkKQhSziWzvbOcyFr/SfBGTL6v+dxK5G973mSDuxWsXBIXGLnmr6M9oaQrY2CTnJebekOq6z0UgiM+UAvdxcb1Ql8IRK2xlqZj2AJzhxP+Ppsz533vA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCncg-0001px-As for bug-gnu-emacs@gnu.org; Sun, 17 Nov 2024 17:20:02 -0500 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 74367-submit@debbugs.gnu.org id=B74367.17318819797020 (code B ref 74367); Sun, 17 Nov 2024 22:20:02 +0000 Original-Received: (at 74367) by debbugs.gnu.org; 17 Nov 2024 22:19:39 +0000 Original-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 Original-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 Original-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== Original-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) Original-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) In-Reply-To: <86serqx5ba.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Nov 2024 23:00:09 +0200") 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:295565 Archived-At: 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)