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 17:38:41 +0200 Message-ID: <83o7terf9a.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> <83edubrvf0.fsf@gnu.org> <87cz9v9irh.fsf@gmail.com> 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="30079"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58790@debbugs.gnu.org, felician.nemeth@gmail.com, stefankangas@gmail.com, dgutov@yandex.ru To: danny@dfreeman.email, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 10 16:39:14 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 1ot9e5-0007bC-Ih for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Nov 2022 16:39:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot9dw-0004nr-Db; Thu, 10 Nov 2022 10:39:04 -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 1ot9du-0004ng-UK for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 10:39:02 -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 1ot9du-0002FN-M4 for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 10:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ot9du-0008G3-Hs for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 10:39: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 15:39: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.166809473331727 (code B ref 58790); Thu, 10 Nov 2022 15:39:02 +0000 Original-Received: (at 58790) by debbugs.gnu.org; 10 Nov 2022 15:38:53 +0000 Original-Received: from localhost ([127.0.0.1]:44025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot9dk-0008Fe-Hm for submit@debbugs.gnu.org; Thu, 10 Nov 2022 10:38:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ot9di-0008FR-4P for 58790@debbugs.gnu.org; Thu, 10 Nov 2022 10:38:51 -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 1ot9dc-0002Cz-75; Thu, 10 Nov 2022 10:38:44 -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=rQyQ+1L1fyfWz+eKPJUMXyvCkbwtci9iJ5BNjMmwag0=; b=P/h5mcpH8tpSS5BlLVdk +hwXs6eDrHwYKZ+DEr8OcEsqsYcB1M+8QgP4MPNmdowwEbcgS4W46EHzG5eeBAWN69dQd9d58UBTg ipeh2R0yhdc3u4CIECYcrmFPw9QP6IdFY5pTCMYMOL49J0uS0egZHD4q3CD1HJHOpsKbhU9VC8iwX kE4Jr04JX9coPPOrWHWF/uM7979lNuHfOeGu9SFSDr4auDKUIBOjZh2r4jOMfLUWMqwWmA0664b/j 6wTgDzVXLq1rgapLsBmscwjQc7mPB8oOFKc4zm0/uOdf3iWb4RTCmxlSfde4tR0rXH6OQrh+iKAY6 U7gfZWiamDqdNw==; 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 1ot9da-0002SZ-Ny; Thu, 10 Nov 2022 10:38:43 -0500 In-Reply-To: <87cz9v9irh.fsf@gmail.com> (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Thu, 10 Nov 2022 11:00:18 +0000) 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:247522 Archived-At: > From: João Távora > Cc: Danny Freeman , 58790@debbugs.gnu.org, > felician.nemeth@gmail.com, stefankangas@gmail.com, dgutov@yandex.ru > Date: Thu, 10 Nov 2022 11:00:18 +0000 > > Eli Zaretskii writes: > > > Ping! João, any comments on this patch? > > Hi Eli, thanks for pinging. Yes, had a look and _both_ patches look > fine. OK, then I have a few minor comments, before this can be installed: > >From 936034d0e72621815584680a9e75f44a4448ba9d Mon Sep 17 00:00:00 2001 > From: dannyfreeman > Date: Thu, 3 Nov 2022 09:39:16 -0400 > Subject: [PATCH 1/2] Only handle file:// type URIs in eglot explicitly > > (Bug#58790) > > This issue originated with clojure-lsp sending clients "jar": type URIs > that emacs is unable to handle out of the box. Before this change, jar: > URIs were parsed once, but since jar: URIs contain a nested URI, > this resulted in a file being dispatched with a partially parsed path > that looked like `file://path/to.jar!/path/in/jar`. > > Now eglot will not attempt to parse URIs that are not file:// type at > all, instead let file-name-handler-alist entries to deal with them. > Not parsing them at all allows the file-name-handler-alist regexps to > identify them more accurately. > > By also checking if eglot received a URI in eglot--path-to-uri, the > file-name-handler-alist can provide the non-file type URI back to the > lsp server, which presumably will know how to handle them since it is > also giving them out to clients. This lacks ChangeLog-style parts which specify the file(s) and function(s) which were changed. Also, in the text above, please leave two spaces between sentences, per our conventions, and refill the text to be at most 63 columns. Finally, please consider moving some of the text above to comments explaining why the code does what it does. > >From 4c5dbc458ca1b13a897b6f01f69cacd9490c1ee1 Mon Sep 17 00:00:00 2001 > From: dannyfreeman > Date: Thu, 3 Nov 2022 09:57:45 -0400 > Subject: [PATCH 2/2] Warn when eglot receives a non-file type URI that Emacs > can't handle > > (bug#58790) > > The file-name-operation being checked, any-handler, has no significant > meaning, other than that it is not one that would be suppressed by > inhibit-file-name-operation. We just want to check that a handler exists > and has the potential to handle this URI, not actually dispatch a > file-name-operation right now. Same here. And in this case, the text should definitely be in comments. Thanks.