From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58790: Eglot URI parsing bug when using clojure-lsp server Date: Thu, 10 Nov 2022 11:49:39 +0200 Message-ID: <83edubrvf0.fsf@gnu.org> References: <8cf8ba5d-c604-b2dc-274a-7597b19fb73f@dfreeman.email> <87ilk5xq01.fsf@gmail.com> <87r0yrwfn3.fsf@gmail.com> <37716e41-5955-99f6-5204-e760a716fbf6@yandex.ru> <9bb290c8-f000-31d8-265d-b5441c33eb38@dfreeman.email> <4d50b820-7053-75eb-5b11-d3d36a02b013@dfreeman.email> <87v8nxsrq6.fsf@gmail.com> <87cza40xgs.fsf@dfreeman.email> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58790@debbugs.gnu.org, dgutov@yandex.ru, felician.nemeth@gmail.com, joaotavora@gmail.com, stefankangas@gmail.com To: Danny Freeman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 10 10:50:40 2022 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 1ot4Cl-0003HY-Gs for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Nov 2022 10:50:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot4CQ-0001OG-CF; Thu, 10 Nov 2022 04:50:23 -0500 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 1ot4CA-0001N2-PI for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 04:50:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot4CA-0001Dt-EK for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 04:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ot4CA-0004fs-4R for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 04:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Nov 2022 09:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58790 X-GNU-PR-Package: emacs Original-Received: via spool by 58790-submit@debbugs.gnu.org id=B58790.166807378917945 (code B ref 58790); Thu, 10 Nov 2022 09:50:02 +0000 Original-Received: (at 58790) by debbugs.gnu.org; 10 Nov 2022 09:49:49 +0000 Original-Received: from localhost ([127.0.0.1]:41925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot4Bw-0004fN-H0 for submit@debbugs.gnu.org; Thu, 10 Nov 2022 04:49:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot4Bu-0004f9-A0 for 58790@debbugs.gnu.org; Thu, 10 Nov 2022 04:49:46 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4Bo-0000JE-Q9; Thu, 10 Nov 2022 04:49:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=A//8ovQRzoyTmNCuJteSkunBIDU/W6i5Wk3Agzuzo54=; b=GmdOgLBQKnC7GxZL6mvq PZ0mifN7OW8wDSc98Z4jxJ2kMRhuYCqHo0ISHMZbKddLunyGSoljl4hbtM7ZGqdoNA4uDsSuO2AFv Y8E8a/S9zVD09wLb8g6u5RpW+on1RnHMIcpNNir4RXFjd5SP9UQCR5/HTmSEU/I5OOuwXiQAB+5s7 uYiQSi2NeiUxajciA/XswZik6opHxZZnGUC6MZzouuKdIjQUC1LXSm76SfE0TNJ9WmrR995Yv2lY0 ibo9WAXS83FApXMfehlvqeessrJnppYxdZSLGT0cPtpBxvZXBtJb4xsLLJd6aTEjmRqweYHPZaNZ6 bfFS/A5do7dkkA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot4Bm-0006At-Qt; Thu, 10 Nov 2022 04:49:39 -0500 In-Reply-To: <87cza40xgs.fsf@dfreeman.email> (bug-gnu-emacs@gnu.org) 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:247499 Archived-At: Ping! João, any comments on this patch? > Cc: 58790@debbugs.gnu.org, felician.nemeth@gmail.com, > Stefan Kangas , Dmitry Gutov > Date: Thu, 03 Nov 2022 13:10:32 -0400 > From: Danny Freeman via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > João Távora writes: > > > I think it's better to patch eglot--uri-to-path so that if X looks > > anything other than file://, Eglot leaves it untouched. After all, it's > > the only safe translation Eglot can make. > > I've attached patch > 0001-Only-handle-file-type-URIs-in-eglot-explicitly.patch > to this email that does this pretty well > > > And in eglot--path-to-uri, we do likewise. If the PATH argument already > > looks vaguely URIish (say, it makes something like "^[[:alnum:]]+://") > > we leave it unchanged. > > This is done by just trying to parse the path as a URL and checking the > url-type instead of checking a regex. > > > Felicián also suggested that Eglot warns the user when it doesn't know > > an URI scheme. I think that can make sense in some situations, for now > > let's assume it isn't as important as getting your new Jar > > file-name-handler to integrate with Eglot. Maybe in some later patch > > Eglot can somehow predict if there is a file-name-handler entry for a > > given URI and only warn if there isn't. > > This change is only a matter of consulting the `find-file-name-handler` > function. I added another patch for that as > 0002-Warn-when-eglot-receives-a-non-file-type-URI-that-Em.patch