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#74339: 30.0.92; CC Mode stomps C TS Mode Date: Sat, 23 Nov 2024 21:40:19 +0200 Message-ID: <861pz1lows.fsf@gnu.org> References: <868qtnfd2d.fsf@gnu.org> <86r07elwoh.fsf@gnu.org> <86h68al2qz.fsf@gnu.org> <867c95kaye.fsf@gnu.org> <861pzdk4aq.fsf@gnu.org> <86r075qasz.fsf@gnu.org> <7d4a925a-3960-4412-bdb3-4f752407e00a@gutov.dev> <86zflsnza0.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13277"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74339@debbugs.gnu.org To: dmitry@gutov.dev, monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 23 20:41: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 1tEw0Q-0003J7-JV for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Nov 2024 20:41:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEw08-0000dD-8O; Sat, 23 Nov 2024 14:41:04 -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 1tEw06-0000d2-SK for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 14:41:02 -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 1tEw06-00082s-JP for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 14:41:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=VCTH/fc7t4mTD0bb3D+tqzfKujQ0jjEXuDNbIc8+jLo=; b=QSq9MI8jnhCkpForBRfT8q2iCZeVMH7+GKjr/adpoWZ8sP2F3NCklii82aLJ1UuXZzl+DpFr6oDTok8YSHlIyL61qFB1PxFhHZc+T1m+H9L8blEYy3wmSo+PmoPTYZW65k2rGo3JfkFEsYohT3UU0kLix3Nz8hunZBOLQo3R6rL1LqMzHkKsrgq5TevoBSf1Dx8KPVVbI2EW2Dh5jizGzUYaQrzcUKjTlwEllx48DiGDZnTFDDPk/8V8At5FLmZ6yJNJkXKCXlZ9RVdzJSNsKaKo8k/XWWeJylVFOGYH6IwKl59131gKD6FlXz7BnSeGbbFzncF0Dc7PK9aJQf/Gvw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tEw06-0001se-02 for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 14:41: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 Nov 2024 19:41:01 +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.17323908307168 (code B ref 74339); Sat, 23 Nov 2024 19:41:01 +0000 Original-Received: (at 74339) by debbugs.gnu.org; 23 Nov 2024 19:40:30 +0000 Original-Received: from localhost ([127.0.0.1]:59210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEvzZ-0001rX-H9 for submit@debbugs.gnu.org; Sat, 23 Nov 2024 14:40:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEvzW-0001r3-RB for 74339@debbugs.gnu.org; Sat, 23 Nov 2024 14:40:27 -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 1tEvzQ-00080d-MM; Sat, 23 Nov 2024 14:40:20 -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=VCTH/fc7t4mTD0bb3D+tqzfKujQ0jjEXuDNbIc8+jLo=; b=htd3SdjG8Ig9 A59DgY+ncCyCiOqcSkMhE981EqrSzxkp5nP12+XJUgPEbAAk/ylOcZLSJBEHRAJ9eEEnlWo4e3lCM c2rJ7yS26sOYSTQ15nBFS2JDnyZeR66N3amu3RiXxy4k5nkEIgYAaXFX1nWE3fzbbqDju8Tzr3vXt E2EUtmmuuBL2PbL8E1cXgEU6VSrx+Qcnvg28TINeakk3QQZZ9f77lx1bxAGlUNOm0Jg+Cva4pTwhZ bD5Hx/pHqjQy9WRnZFE/LqViqcDwG9k4SgirtzYfa3pXOscZyB+jb8J2ZgTeucToBkP7JAAbRLqgz xrGNz67MDSdeGAoY1cYhaA==; In-Reply-To: <86zflsnza0.fsf@gnu.org> (message from Eli Zaretskii on Thu, 21 Nov 2024 21:48:55 +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:295866 Archived-At: > Cc: acm@muc.de, monnier@iro.umontreal.ca, 74339-done@debbugs.gnu.org > Date: Thu, 21 Nov 2024 21:48:55 +0200 > From: Eli Zaretskii > > > Date: Thu, 21 Nov 2024 21:02:55 +0200 > > Cc: 74339-done@debbugs.gnu.org > > From: Dmitry Gutov > > > > On 21/11/2024 09:57, Eli Zaretskii wrote: > > > Dmitry, please consider a similar change in ruby-mode.el and > > > ruby-ts-mode.el, since what we have there now is that once > > > ruby-ts-mode is loaded, there's no way for users to go back to using > > > ruby-mode unless they customize major-mode-remap-alist. > > > > Could you please go ahead with whatever changes you think appropriate? > > > > I didn't do (or review) either of the previous changes in that area. > > I could suggest a patch, but as I don't use Ruby modes, I'd hesitate > to install it without an okay from someone who does. Like the patch below. Is it okay? diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index d953ec8..903a1c5 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2748,6 +2748,9 @@ ruby-mode (dolist (name (list "ruby" "rbx" "jruby" "j?ruby\\(?:[0-9.]+\\)")) (add-to-list 'interpreter-mode-alist (cons (purecopy name) 'ruby-mode))) +(setq major-mode-remap-defaults + (assq-delete-all 'ruby-mode major-mode-remap-defaults)) + (provide 'ruby-mode) ;;; ruby-mode.el ends here diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index adcdf15..39a0d47 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -1237,8 +1237,10 @@ ruby-ts-mode (derived-mode-add-parents 'ruby-ts-mode '(ruby-mode)) -(if (treesit-ready-p 'ruby) - (add-to-list 'major-mode-remap-defaults +(when (treesit-ready-p 'ruby) + (setq major-mode-remap-defaults + (assq-delete-all 'ruby-mode major-mode-remap-defaults)) + (add-to-list 'major-mode-remap-defaults '(ruby-mode . ruby-ts-mode))) (provide 'ruby-ts-mode)