From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#72343: [PATCH] Fix eglot-server-programs for TeX modes Date: Wed, 7 Aug 2024 09:47:59 +0100 Message-ID: References: <87sevtz8xg.fsf@gmail.com> <86msm1z8c4.fsf@gnu.org> <87ttg8k9l6.fsf@gmail.com> <86frrszbep.fsf@gnu.org> <87o765k7ze.fsf@gmail.com> <87ed71fvy8.fsf@gmail.com> <87frrhxzbz.fsf@gmail.com> <875xscrf1z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38658"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 72343@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 07 10:49:56 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 1sbcMl-0009sr-OU for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 07 Aug 2024 10:49:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbcMU-0001tW-Vj; Wed, 07 Aug 2024 04:49:39 -0400 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 1sbcMT-0001t9-K5 for bug-gnu-emacs@gnu.org; Wed, 07 Aug 2024 04:49:37 -0400 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 1sbcMT-0002Rl-9w for bug-gnu-emacs@gnu.org; Wed, 07 Aug 2024 04:49:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=r+NfFUA9UQCf9TdfY+/fsZ6+cOnv1fwEAaRJGv1Xuwc=; b=eGAfP5YX3oga9A8vs6T2msVN2PNnz9ugoku16QuE1M++HYcJUMP3n1F8iHXYLSustuT3Fz53hN4OsAbKDVg90gxqp1RkyPk/NnIWDVYGgjNT9AFRzVIeDrk2zVKIcaXoQUP2E7uROWsN6rJizbb+22FIgJhKRB25uWzQ10one+MqxCloAdi9GRTUYr05a7hps4BE6nVgPuKHvV7jfrK//37L0ufMnE1yyTxuNp1Yx0ln5pcdhssRtDnKJAJDmk5u5LIpcMIDnEqjteaJT4bOImY6N29cXPKVRYgSyGxs/Y4dL3Xzwzg169mfZ2dZw1ZOmp61rL/4hVVcJrU+IR9klw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sbcMs-0005Xv-4Z for bug-gnu-emacs@gnu.org; Wed, 07 Aug 2024 04:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Aug 2024 08:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72343-submit@debbugs.gnu.org id=B72343.172302058421286 (code B ref 72343); Wed, 07 Aug 2024 08:50:02 +0000 Original-Received: (at 72343) by debbugs.gnu.org; 7 Aug 2024 08:49:44 +0000 Original-Received: from localhost ([127.0.0.1]:33634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbcMZ-0005XG-N3 for submit@debbugs.gnu.org; Wed, 07 Aug 2024 04:49:44 -0400 Original-Received: from mail-oa1-f54.google.com ([209.85.160.54]:52371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbcMX-0005Wy-HZ for 72343@debbugs.gnu.org; Wed, 07 Aug 2024 04:49:42 -0400 Original-Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-2689f74963bso887603fac.0 for <72343@debbugs.gnu.org>; Wed, 07 Aug 2024 01:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723020491; x=1723625291; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r+NfFUA9UQCf9TdfY+/fsZ6+cOnv1fwEAaRJGv1Xuwc=; b=TcFcoTFIdcCvvtjYHJRMrsJo+0XYc0WorHfKYjmZpO+gzAwoprK/aQQF7N3979Bx8w OKJx0oTYVAN3JYnRuThcUxUxdPdYvWKzU1mqfMpJTHWOsWod/Z1pByJJRLshbOwOr7yL lE6NiwoGP2X0E55Trhy5XSqaX9ZjSLiaDUEJGfeBFruX7304y0nJaQrMeqrm98p0ggFi 4qfIdaAHB+2rNo9VLWdgzCIsdO45Omg+gGywSz16Ydk4jY2i7SESPqvn2qY9qm5Nb1V7 eorUaV9g1SLbnvYsuYr0uBMvKFO1DYQO/qt70dh5NQCOJCUzjEQc9zz3Dn35nynM0R6O oKhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723020491; x=1723625291; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r+NfFUA9UQCf9TdfY+/fsZ6+cOnv1fwEAaRJGv1Xuwc=; b=iEc6bCx9EDoIbXAmiKGzQES+ujIUQKb0pCN5r+mZvYXwmW/YfKj7BERvGYNXdIxz+T Ro5vIMoRjZhWlg2zscvtxH1RaBs82h7CAJjqZ/0Jn8nUls4Q+Tar7Fp6ULgCe0b3VmTT FuI7iMGVu7LFKI6aaK4N0rwQfdnmBIMf5+ZFakXLk9tGbDxRv3QZmsVfklqlbGQwM3Zf a1vrrV1zwJ7aCq4pSePUeQIW3LZt69yMP0OCO8I8UytKTwbVTdfOnHr78gORMK2enbjd Ob2PogO11wfsRvUmqtIz2qmWhJvIHr7gjfjjT01Vi/+vSgSYDcgnV7zDIONhl5M8LJPy tBYw== X-Gm-Message-State: AOJu0Yxlmd9F3jYZETRHXkDb9Xp8rgzyf5VPNeBRuFfGL5T7wD0rtkTD 3Q3BA7RXzX4GDRloHQmMWlMTd3+H0S8cga2cYQW/cbobdUh27KwVExQFMq5BfB23+oBI7uK62Xk flCPbdqkvmjcMzM70f+9gHNhN0IU= X-Google-Smtp-Source: AGHT+IH0ZYX/flw/NNpvQdPJy0z8FnhWwPUVazqtIA/RUCZWJSi6k0kbAjdhgw4/Rw0NicdpocXzQL3/ijdKYNbb/1A= X-Received: by 2002:a05:6870:c18b:b0:24c:59f7:e840 with SMTP id 586e51a60fabf-26891ae01e0mr21857257fac.17.1723020490735; Wed, 07 Aug 2024 01:48:10 -0700 (PDT) In-Reply-To: <875xscrf1z.fsf@gmail.com> 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:289869 Archived-At: On Wed, Aug 7, 2024 at 8:02=E2=80=AFAM Augusto Stoffel wrote: > Sure, but how is that useful information for a language server? Fairly useful. If someone tells me this upfront about some stream of data they're about to send I know I can use a very simple parser. Or I can reject it altogether if I don't like "lisp" for some reason. If working on a language server multiplexer, for example that information is possibly enough to know where to redirect the didOpen. > Relegating to users the task of debugging language ids doesn't sound > very user-friendly... It was you, not me, who talked about "ultimately the user". So ultimately the user has control over things, always has had. > (For the record, the only thing that's currently broken in the > Eglot-Digestif interaction is the plain TeX case.) Interesting, this is the X problem I was looking for. > > 3. Ignoring my advice and sending "plain-tex" from Eglot anyway > > (i.e. installing your patch without :language-id) > > You're clearly against this so it is not going to happen, but I hope I > managed to explain to you why I would have done it. Ultimately, I have to leave room for a pragmatic decision from domain experts, even if it violates the spec. I'm just trying to understand the angles and judge the probability of breakage later on. > > For the _other_ orthogonal problem, I suggest: > > (racket-mode . ("racket" "-l" "racket-langserver")) > > - ((tex-mode context-mode texinfo-mode bibtex-mode) > > + ((latex-mode (plain-tex-mode :language-id "tex") tex-mode > > context-mode texinfo-mode bibtex-mode) > > Since you want to send "tex" language id for plain tex, the following > suffices: > > ((latex-mode tex-mode context-mode texinfo-mode bibtex-mode) Again, I don't "want" to (see above for the reasons). This patch is concerned with the orthogonal requirement of keeping tex-mode (and not removing it as you proposed) So: * please make up your mind, i.e. make a (possibly overriding) decision whether sending off-spec "plain-tex" for tex-mode is really what is needed. * whatever your decision, keep 'tex-mode' in the list. * help me test the patch below by checking that problem X is now solved and now new problem Z has popped up. > > (defun eglot--guess-contact (&optional interactive) > > I have no opinion on that one, except to say that it looks really > complicated, although that's probably out of necessity. OK, then don't bother giving an opinion, but how can it look complicated?? It removes cyclomatic complexity (and lines of code) from the program. Jo=C3=A3o