From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: 74367@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes
Date: Sat, 16 Nov 2024 12:59:11 +0200 [thread overview]
Message-ID: <86v7wnh2bk.fsf@gnu.org> (raw)
In-Reply-To: <CADwFkm=sqK56rQgxhssShBg-nZDHFDSy2hz-OodXZooxnBu8gQ@mail.gmail.com> (message from Stefan Kangas on Fri, 15 Nov 2024 13:15:38 -0800)
> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Fri, 15 Nov 2024 13:15:38 -0800
>
> Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@gnu.org> 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.
next prev parent reply other threads:[~2024-11-16 10:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-15 16:45 bug#74367: [PATCH] c-ts-mode.el: Adjust doc about how to change default modes Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-15 21:15 ` Stefan Kangas
2024-11-16 10:59 ` Eli Zaretskii [this message]
2024-11-16 16:52 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-16 18:35 ` Eli Zaretskii
2024-11-16 20:26 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-16 21:00 ` Eli Zaretskii
2024-11-17 22:19 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-18 12:09 ` Eli Zaretskii
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=86v7wnh2bk.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=74367@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=stefankangas@gmail.com \
/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).