From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Danny Freeman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59338: 29.0.50; Commit 1a2d603bb3 breaks Eglot on Windows Date: Thu, 17 Nov 2022 17:27:40 -0500 Message-ID: <87bkp5xl6f.fsf@dfreeman.email> References: <86bkp5y16y.fsf@gnu.org> <83r0y1cxyb.fsf@gnu.org> <87o7t5wlby.fsf@gmail.com> Reply-To: Danny Freeman Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19621"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, 59338@debbugs.gnu.org, arash@gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 17 23:38:39 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 1ovnWp-0004qj-A8 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Nov 2022 23:38:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovnWM-0005ow-9j; Thu, 17 Nov 2022 17:38:10 -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 1ovnWE-0005oO-PP for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 17:38: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 1ovnWE-0004nt-De for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 17:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovnWE-0006kC-9N for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 17:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Danny Freeman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Nov 2022 22:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59338 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Eli Zaretskii , bug-gnu-emacs@gnu.org, Arash Esbati , 59338@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166872463025833 (code B ref -1); Thu, 17 Nov 2022 22:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Nov 2022 22:37:10 +0000 Original-Received: from localhost ([127.0.0.1]:34580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovnVN-0006ib-QP for submit@debbugs.gnu.org; Thu, 17 Nov 2022 17:37:10 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovnVL-0006iT-Mh for submit@debbugs.gnu.org; Thu, 17 Nov 2022 17:37:08 -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 1ovnVK-0005kt-Vd for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 17:37:06 -0500 Original-Received: from out0.migadu.com ([2001:41d0:2:267::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovnVI-0004ie-C9; Thu, 17 Nov 2022 17:37:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1668724621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BEuog3jDnOyJDRqoqFrjQLqtlJ/CQCS9drG3hAP3uFA=; b=rOXb/RRxwx0qLu1Mj8Vg8K9copMd3rSA1Hicl02VL5nwQ8KDcLcsyHCX5eT4Y/lmFJPTlp X+hY+pXFmpIHAFHgSOwHVRMGpuiQpMe6K1sL5I070eWclaLUj3IGUbQSgFBuVLQeIaBfRS x2ytKxYC4uYacJ9wlTZ7F8AyJPeJtQY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <87o7t5wlby.fsf@gmail.com> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:267::; envelope-from=danny@dfreeman.email; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:248148 Archived-At: Augusto Stoffel writes: > On Thu, 17 Nov 2022 at 19:06, Eli Zaretskii wrote: > >> Both are wrong, right? The correct URL should AFAIU be >> >> file:///d:/digestif-test/tikz-test.tex >> >> IOW, the problem is that the URL is being run through url-encode-url, >> which doesn't support file:// URLs on Windows properly. > > While we are at it, note that > > (url-filename > (url-generic-parse-url "file:///d:/digestif-test/tikz-test.tex")) > => "/d:/digestif-test/tikz-test.tex" > > is not the right file name under Windows. Eglot treats this special > case correctly, but every package that deals with file URLs has to > repeat the work. So there should be a helper function in Emacs for > this. With the original problem: we're now getting a false positive in eglot when checking for URLs being passed to `eglot--path-to-uri` when the path is a windows path. Is there something we can do to detect a windows path and continue treating it as a path like we were before this change? ``` (defun eglot--path-to-uri (path) "URIfy PATH." (let ((truepath (file-truename path))) (if (and (url-type (url-generic-parse-url truepath)) (NOT_WINDOWS_PATH truepath) ;; what would this be? ) ;; ... blah blah blah ``` If there is no function available already, it may be enough to check if the return value of `url-type` is not 1 character. Looking at this list of what I believe are official URI schemes, all of them have at least two characters: https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml -- Danny Freeman