unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Augusto Stoffel <arstoffel@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 72343@debbugs.gnu.org
Subject: bug#72343: [PATCH] Fix eglot-server-programs for TeX modes
Date: Tue, 6 Aug 2024 17:27:28 +0100	[thread overview]
Message-ID: <CALDnm50cmpKfr+n-f+QmUzkO6B91xA7+LRdVF4g1D6F7PRH7Yw@mail.gmail.com> (raw)
In-Reply-To: <CAHixrvabHG1-tydO_jCENbJzBdpujYZ9hgWOX09Hjc5_0bGuSQ@mail.gmail.com>

On Tue, Aug 6, 2024 at 4:45 PM Augusto Stoffel <arstoffel@gmail.com> wrote:
>
> On Tue, Aug 6, 2024, 17:34 João Távora <joaotavora@gmail.com> wrote:
>>
>> * lisp/progmodes/eglot.el (eglot-server-programs): Explicitly list modes
>> derived from tex-mode, so that the correct language id is guessed.
>>
>> Won't it break when another mode is derived from it?
> Not really, since such a hypothetical mode has no support from the servers.

No but it might represent a language that does! servers don't care modes,
they know about languages.  Furthermore, the same server, even
the same server connection might serve multiple documents in multiple
different languages.

> That doesn't work, because apparently Eglot picks the language id

Eglot pairs language ids with modes (plural).  This is what the internal
function eglot--lookup does.  In the same session, multiple language-id
maybe be picked depending on the LSP document being "opened".
So there's no "single pick" in general.

> of the first mode in the listing that applies, which previously was the generic tex-mode. That doesn't allow distinguishing latex and plain TeX. Again, the issue is not guessing the language id string from the mode name, but rather choosing the right mode symbol to guess from.

Previously, you suggested :language-id would work, but you didn't
want to "dabble" with it.  Now you seem to be saying it can't work
at all.

This may be an "XY Problem".  Can you state what exactly is the
end result you're trying to achieve (short of "writing thesis" or "fulfill
life goals") as someone who has never seen Eglot source code
before or has looked at LSP event logs to check what is being sent.
Tell me which server is installed and what file(s) in which major
modes you are visiting just before typing `M-x eglot`.  Then tell me
what happens to said server invocation (if any).  Focusing on the
goal  rather than the means may help me understand what you
want to achieve.

Thanks





  reply	other threads:[~2024-08-06 16:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-28 18:08 bug#72343: [PATCH] Fix eglot-server-programs for TeX modes Augusto Stoffel
2024-07-28 18:20 ` Eli Zaretskii
2024-07-28 21:31   ` João Távora
2024-07-29  6:15     ` Augusto Stoffel
2024-07-29 11:26       ` Eli Zaretskii
2024-07-30 18:20         ` Augusto Stoffel
2024-07-30 20:29           ` João Távora
     [not found]             ` <CAHixrvYMZTMRSpixw2CAkdx_b+hdPZDkB7s+1X1sUX4E7jPWHw@mail.gmail.com>
     [not found]               ` <CALDnm50sjTEnSxJ3Rzna3pets2bjHnVF=6vix1gM_54+VoHNvQ@mail.gmail.com>
2024-08-02 15:13                 ` Augusto Stoffel
2024-08-02 15:29                   ` João Távora
2024-08-06 15:04                     ` Augusto Stoffel
2024-08-06 15:34                       ` João Távora
2024-08-06 15:45                         ` Augusto Stoffel
2024-08-06 16:27                           ` João Távora [this message]
2024-08-06 16:38                             ` Augusto Stoffel
2024-08-06 18:08                               ` João Távora
2024-08-06 18:48                                 ` Augusto Stoffel
2024-08-06 22:52                                   ` João Távora
2024-08-07  7:02                                     ` Augusto Stoffel
2024-08-07  8:47                                       ` João Távora
2024-08-07  9:17                                         ` Augusto Stoffel
2024-08-07 13:17                                           ` João Távora
2024-08-07  6:33                                 ` Augusto Stoffel
2024-08-07 13:23                                   ` João Távora
2024-08-12 16:37                                     ` Philip Kaludercic
2024-08-12 16:53                                       ` João Távora

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=CALDnm50cmpKfr+n-f+QmUzkO6B91xA7+LRdVF4g1D6F7PRH7Yw@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=72343@debbugs.gnu.org \
    --cc=arstoffel@gmail.com \
    --cc=eliz@gnu.org \
    /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).