From: Eli Zaretskii <eliz@gnu.org>
To: dmitry@gutov.dev, monnier@iro.umontreal.ca
Cc: 74339@debbugs.gnu.org
Subject: bug#74339: 30.0.92; CC Mode stomps C TS Mode
Date: Sat, 23 Nov 2024 21:40:19 +0200 [thread overview]
Message-ID: <861pz1lows.fsf@gnu.org> (raw)
In-Reply-To: <86zflsnza0.fsf@gnu.org> (message from Eli Zaretskii on Thu, 21 Nov 2024 21:48:55 +0200)
> 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 <eliz@gnu.org>
>
> > Date: Thu, 21 Nov 2024 21:02:55 +0200
> > Cc: 74339-done@debbugs.gnu.org
> > From: Dmitry Gutov <dmitry@gutov.dev>
> >
> > 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)
next prev parent reply other threads:[~2024-11-23 19:40 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 14:00 bug#74339: 30.0.92; CC Mode stomps C TS Mode Eli Zaretskii
2024-11-13 15:13 ` Eli Zaretskii
2024-11-13 18:58 ` Alan Mackenzie
2024-11-13 20:13 ` Eli Zaretskii
2024-11-13 22:34 ` Alan Mackenzie
2024-11-13 22:57 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-14 6:59 ` Eli Zaretskii
2024-11-14 9:24 ` Dmitry Gutov
2024-11-14 10:05 ` Eli Zaretskii
2024-11-16 20:54 ` Andrea Corallo
2024-11-14 15:51 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-14 16:29 ` Dmitry Gutov
2024-11-14 16:49 ` Eli Zaretskii
2024-11-14 17:16 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-14 19:10 ` Eli Zaretskii
2024-11-14 19:45 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-14 16:20 ` Alan Mackenzie
2024-11-14 16:59 ` Eli Zaretskii
2024-11-14 17:45 ` Alan Mackenzie
2024-11-14 17:52 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-14 19:23 ` Eli Zaretskii
2024-11-14 19:53 ` Alan Mackenzie
2024-11-14 20:21 ` Eli Zaretskii
2024-11-14 20:38 ` Alan Mackenzie
2024-11-14 21:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-14 21:26 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-15 8:17 ` Eli Zaretskii
2024-11-15 16:17 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-15 8:13 ` Eli Zaretskii
2024-11-15 7:33 ` Eli Zaretskii
2024-11-15 13:04 ` Alan Mackenzie
2024-11-15 14:43 ` Eli Zaretskii
2024-11-15 17:58 ` Alan Mackenzie
2024-11-15 19:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-15 19:46 ` Alan Mackenzie
2024-11-15 20:45 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-16 10:25 ` Eli Zaretskii
2024-11-16 14:03 ` Stefan Kangas
2024-11-16 14:35 ` Eli Zaretskii
2024-11-15 20:58 ` Stefan Kangas
2024-11-15 21:56 ` Alan Mackenzie
2024-11-16 3:22 ` Stefan Kangas
2024-11-16 11:45 ` Eli Zaretskii
2024-11-16 18:17 ` Alan Mackenzie
2024-11-16 6:17 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-16 8:18 ` Eli Zaretskii
[not found] ` <Zzi86KPmTv1Qb3nw@MAC.fritz.box>
[not found] ` <86ttc7f7jo.fsf@gnu.org>
2024-11-16 21:56 ` Alan Mackenzie
2024-11-17 6:31 ` Eli Zaretskii
2024-11-16 9:52 ` Eli Zaretskii
2024-11-15 18:57 ` Dmitry Gutov
2024-11-21 7:57 ` Eli Zaretskii
2024-11-21 13:57 ` Alan Mackenzie
2024-11-21 19:02 ` Dmitry Gutov
2024-11-21 19:48 ` Eli Zaretskii
2024-11-23 19:40 ` Eli Zaretskii [this message]
2024-11-24 2:56 ` Dmitry Gutov
2024-11-24 5:27 ` Eli Zaretskii
2024-11-24 4:35 ` Richard Stallman
2024-11-14 17:29 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-14 19:20 ` Eli Zaretskii
2024-11-14 19:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-14 20:37 ` Eli Zaretskii
2024-11-14 20:58 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-14 22:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-15 12:02 ` Eli Zaretskii
2024-11-15 7:58 ` Eli Zaretskii
2024-11-15 16:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-16 20:51 ` Andrea Corallo
2024-11-13 20:28 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-13 20:42 ` Eli Zaretskii
2024-11-13 20:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=861pz1lows.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=74339@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).