unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, juri@linkov.net, 60525@debbugs.gnu.org, dgutov@yandex.ru
Subject: bug#60525: 29.0.60; tree-sitter support in semantic-symref
Date: Wed, 04 Jan 2023 13:07:47 -0500	[thread overview]
Message-ID: <jwvfscqdvnn.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83a62yz18b.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 04 Jan 2023 18:57:40 +0200")

>> >> On 03/01/2023 20:06, Juri Linkov wrote:
>> >> > +    (c-ts-mode "*.[ch]")
>> >> >       (c++-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
>> >> > +    (c++-ts-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
>> >> >       (html-mode "*.html" "*.shtml" "*.php")
>> >> >       (mhtml-mode "*.html" "*.shtml" "*.php") ; FIXME: remove
>> >> >                                               ; duplication of
>> >> > @@ -53,7 +55,10 @@ semantic-symref-filepattern-alist
>> >> >                                               ; major mode definition?
>> >> >       (ruby-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
>> >> >                  "Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
>> >> > +    (ruby-ts-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
>> >> > +                  "Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
>> >> >       (python-mode "*.py" "*.pyi" "*.pyw")
>> >> 
>> >> Instead of duplicating entries, we could try to look up the remappings 
>> >> in major-mode-remap-alist.
>> >
>> > That doesn't sound to me like the use of major-mode-remap-alist that
>> > was intended.
>> >
>> > I'm okay with duplication at this point.  It is much easier, and we
>> > can always augment or fix later as needed.  I see no reason to do
>> > anything fancier at this point.
>> >
>> > Stefan, Lars, WDYT?
>> 
>> I'll just note that the above alists already duplicate info present in
>> `auto-mode-alist`.  Admittedly, this redundant info is present in
>> a different form, so maybe not directly usable as is, but if we care
>> about redundancy, we should maybe add some layer on top which we can
>> then use both for `semantic-symref-filepattern-alist` and for
>> `auto-mode-alist`.
>
> I' aware of the redundancy.  But since we decided to go with those
> separate modes in Emacs 29, I think the redundancy is in general
> unavoidable.  If we can use the fact that auto-mode-alist already
> mentions both modes, and we can do that cleanly, it's fine by me.
> Otherwise we will have to live with this for now.

BTW, other ways to reduce the redundancy (not between
`semantic-symref-filepattern-alist` and `auto-mode-alist`, but the one
introduced by the patch above):

- make the various variants of a major mode all inherit from a shared
  parent mode (and then use that shared parent mode in
  `semantic-symref-filepattern-alist`).

- Use `set-auto-mode--last` which remembers the mode specified before it
  was remapped by things like `major-mode-remap-alist` (or by dispatch
  functions like `tex-mode`).


        Stefan






  parent reply	other threads:[~2023-01-04 18:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 18:06 bug#60525: 29.0.60; tree-sitter support in semantic-symref Juri Linkov
2023-01-03 20:19 ` Eli Zaretskii
2023-01-04  1:51 ` Dmitry Gutov
2023-01-04  7:43   ` Juri Linkov
2023-01-04 12:06     ` Dmitry Gutov
2023-01-04 14:34     ` Eli Zaretskii
2023-01-04 14:26   ` Eli Zaretskii
2023-01-04 15:47     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-04 16:57       ` Eli Zaretskii
2023-01-04 17:03         ` Dmitry Gutov
2023-01-04 17:17           ` Eli Zaretskii
2023-01-04 18:07         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-01-04 18:20           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-04 18:43             ` Eli Zaretskii
2023-01-04 19:38               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-05 17:29             ` Juri Linkov
2023-01-04 18:39           ` Eli Zaretskii
2023-01-04 19:04             ` Dmitry Gutov
2023-01-04 19:36               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-05 18:18     ` Juri Linkov

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=jwvfscqdvnn.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=60525@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    --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).