From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#74339: 30.0.92; CC Mode stomps C TS Mode Date: Fri, 15 Nov 2024 12:58:02 -0800 Message-ID: References: <861pzdk4aq.fsf@gnu.org> <86zfm1in2p.fsf@gnu.org> <86wmh5hrya.fsf@gnu.org> <86cyiwimlr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28214"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 74339@debbugs.gnu.org To: Alan Mackenzie , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 15 22:02:01 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 1tC3S5-0007Gv-Et for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Nov 2024 22:02:01 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tC3RY-0001mm-48; Fri, 15 Nov 2024 16:01:28 -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 1tC3QB-0008JB-Kk for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 16:00:06 -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 1tC3QB-0004XH-BM for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 16:00:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=qgO19S0e3VY2v9vpZaG0vhECtkeBbTN/t1o8cngFaek=; b=p/x+K8RBlXXdRmaHYXC1I89NQGnEGs6VWlKagWYaUBNz9mMsc2u+64JXeiYxIHwtI1G0upMyazASwvhWyHH1MuN5vb4A6UNuo9il/FaudMyQUXDRtPEQc75yR0OOGsnSGbpPFuhOirr1FVLdGfQBbdYzXedGDGuAc5sL3wB6+xnWkFztg5wHA6zE9QNAm0Kr5/9gG7DMaRk9Qq9ZtXHDR6PGJu4Ll+ZOU21Wt+Ra63oCmHEONGuJxmgzioLE6geHXYdD1ZPkCMYTH+8CiB6eiFa62FCt1fLCpjFaTi0OIMIAi4cMh4TFER5XFLrSnx/TvPnfmznXpoqUvYDaPa/txw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tC3QA-00083h-S8 for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 16:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Nov 2024 21:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74339 X-GNU-PR-Package: emacs Original-Received: via spool by 74339-submit@debbugs.gnu.org id=B74339.173170435130877 (code B ref 74339); Fri, 15 Nov 2024 21:00:02 +0000 Original-Received: (at 74339) by debbugs.gnu.org; 15 Nov 2024 20:59:11 +0000 Original-Received: from localhost ([127.0.0.1]:51031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tC3PL-00081w-EQ for submit@debbugs.gnu.org; Fri, 15 Nov 2024 15:59:11 -0500 Original-Received: from mail-ed1-f42.google.com ([209.85.208.42]:60666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tC3PJ-00081j-Rh for 74339@debbugs.gnu.org; Fri, 15 Nov 2024 15:59:10 -0500 Original-Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5ceb75f9631so2731387a12.0 for <74339@debbugs.gnu.org>; Fri, 15 Nov 2024 12:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731704284; x=1732309084; 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=qgO19S0e3VY2v9vpZaG0vhECtkeBbTN/t1o8cngFaek=; b=Ado8akrYBmDZyNrgA429jQv1N3ob6Xja5ko2KK5j7Oq3YBXquQm6+1YuvrLmfUnGcq Xrg8GYsbWa7n42FskV9E6ZfuQCCJ3voP0cUqHRc81YwJOqIF2wweUYukTHWs+MiOKG5S hRnEkNsDx38fHLYtXqsJEmWWAKYtumdBAY1esSwdOFmiYBhI0Biqo44eWjZ79iMq7nLH JJlEkcRDf/mnh2mKHVCT+ND6iFNx3XdjzXug3AM8XQy4EI16sjOVTqmgHoeFBJDl3l+C RSIoHyf2c7gTYwhWNe4tMR/yofUMvwTP2GPsGprFb4zgcIyKXxURjmHVjwF1Pg9engmC HLQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704284; x=1732309084; 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=qgO19S0e3VY2v9vpZaG0vhECtkeBbTN/t1o8cngFaek=; b=o1c67zJVz+M9vQ2H1N4bo+MBHm2qM42Bl50i1kMNtTrAk702slx78vLisko/dm31HY qzFtwABY052c5aktUBL+lXwP9cv42sitMlzJ46FY/tX9BdO7Yj++iTLVbnLqhFE2A2/y KFneIvmTGy8dpHnPnA+dlJ5HtkUtut0OzPpDDvT2dlBo+eazquxMS8Knym87ND+n90Kz 0vc//c6YTln4RRpsFnVWWQ+kYBHjkYbzxAu4tuL45UjocRQ8WzA4KliQ/nAo7l2572Sh dcdG4G1mcvtEVbSciXin8pOGf+HPZO9m77E9wj5w7wMnHt2qBtE9baPKddT8CoiEhhrp zxsw== X-Forwarded-Encrypted: i=1; AJvYcCU9NOO35wCIeKidt6/rRrF1vpv3WWBUN3zHDDoGtEije0u3gwQeacH0//1GGsmLHS9HLnQmTQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzL/IIMh2y367PPTbRFEVHSUrdI1FOlT/UQbKBfb076kuAcVjds bVFxVmabFJDvw1yWWFYvocz2qfKuS4rFeKiB9vBOyJALH1CtNiwrTWKvi9iCRuWYhgqQ7Z/2jhh 1E6d1UMMvHI3Ow3jjZsFxdSywOs0= X-Google-Smtp-Source: AGHT+IHGXhsOmjHoo1YQKQRdOleJZOyul4g45hS2Bg5ELkCiy5Yvf0M0C+Zj7oNU84J9lzP0oeH7iRb+eoE1Y8miNiM= X-Received: by 2002:a05:6402:2686:b0:5cf:5ff9:2a24 with SMTP id 4fb4d7f45d1cf-5cf8fd12803mr3247602a12.32.1731704283530; Fri, 15 Nov 2024 12:58:03 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 15 Nov 2024 12:58:02 -0800 In-Reply-To: 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:295421 Archived-At: Alan Mackenzie writes: > On Fri, Nov 15, 2024 at 14:01:26 -0500, Stefan Monnier wrote: >> > One can write, in the Local Variables: section > >> > mode: c-ts > >> FWIW, unless this file is personal, this is very bad practice, and not >> only because `c-ts-mode` may not be available (in older Emacsen or if >> the user didn't build Emacs with tree-sitter support or doesn't have the >> appropriate grammar installed): the choice between `c-mode` and >> `c-ts-mode` is a personal preference, so it's not the file's business to >> tell the user which mode to use, just like it's not the file's business >> to tell the user which editor to use. +1 > Here is a section of a test file sent to bug-cc-mode some while ago: > > /* > ** Local Variables: > ** mode:c > ** indent-tabs-mode:nil > ** c-basic-offset:4 > ** End: > */ > > Here it is evident that by "mode:c" the OP means C Mode, not whatever > random mode happens to have taken the symbol `c-mode'. Yes, that is how Emacs behaves by default. However, the point of the new feature, major-mode-remap, is exactly to allow users to override that. This new feature is optional, and AFAICT the user choice is explicit and not "random". Clearly, c-mode is still favored, as it is the default, and many of us continue being happy users of it even while running a treesitter build. So this new feature very clearly only affects users that have somehow explicitly indicated that they want to use c-ts-mode instead. >> > .. This will cause the buffer to start in c-ts-mode regardless of any >> > other current settings. > >> Actually, no: `major-mode-remap-*` can also remap `c-ts-mode` to some >> other mode, such as `c-mode`. > > Maybe I should have said "regardless of any non-crazy settings". What makes anything about that setting crazy? I'd use that setting, if I ever ran into any files with a "-*- c-ts -*-" cookie. Similarly, I expect that c-ts-mode users will want to use c-ts-mode precisely when a file has a "-*- c -*-" cookie. Again, being able to do that is exactly the point of major-mode-remap. I struggle to understand why that flexibility is controversial. It puts more power into users' hands, that's all.