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#44822: 27.1; Regression in `ffap-read-file-or-url' Date: Mon, 23 Nov 2020 19:53:34 +0200 Message-ID: <83pn44ufhd.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18592"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44822@debbugs.gnu.org To: Thierry Volpiatto , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 23 18:54:25 2020 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 1khG2i-0004jp-La for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Nov 2020 18:54:24 +0100 Original-Received: from localhost ([::1]:58092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khG2h-0004xt-MX for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Nov 2020 12:54:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khG2M-0004xg-G6 for bug-gnu-emacs@gnu.org; Mon, 23 Nov 2020 12:54:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khG2L-0004Pj-OU for bug-gnu-emacs@gnu.org; Mon, 23 Nov 2020 12:54:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1khG2L-0007j8-Nf for bug-gnu-emacs@gnu.org; Mon, 23 Nov 2020 12:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Nov 2020 17:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44822 X-GNU-PR-Package: emacs Original-Received: via spool by 44822-submit@debbugs.gnu.org id=B44822.160615403229685 (code B ref 44822); Mon, 23 Nov 2020 17:54:01 +0000 Original-Received: (at 44822) by debbugs.gnu.org; 23 Nov 2020 17:53:52 +0000 Original-Received: from localhost ([127.0.0.1]:51065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khG2B-0007ij-Qz for submit@debbugs.gnu.org; Mon, 23 Nov 2020 12:53:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khG2A-0007iW-Ca for 44822@debbugs.gnu.org; Mon, 23 Nov 2020 12:53:50 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50076) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khG24-0004Ld-9f; Mon, 23 Nov 2020 12:53:44 -0500 Original-Received: from [176.228.60.248] (port=2812 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1khG1x-0001ZB-Qi; Mon, 23 Nov 2020 12:53:40 -0500 In-Reply-To: (message from Drew Adams on Mon, 23 Nov 2020 09:23:37 -0800 (PST)) 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" Xref: news.gmane.io gmane.emacs.bugs:193941 Archived-At: > Date: Mon, 23 Nov 2020 09:23:37 -0800 (PST) > From: Drew Adams > > `ffap-read-file-or-url' now reads a URL as a file name, truncating to > remove a prefix such as http:/. Prior to Emacs 27, it correctly > returned the URL. > > If point is not on a URL, then the guess is nil. The user is prompted > (as before) with the default directory as default. If the user rejects > that default value and replaces it by a URL (e.g. yanking), then > `ffap-read-file-or-url' should just return that URL, as it has always > done. In Emacs 27, it instead tries to handle it as a file name, > removing the prefix up to the first `/' before a non-/ char. > > emacs -Q > > ;; With point not on a URL or file name: > > (ffap-read-file-or-url "URL: " nil) > > ;; User is prompted, with the default-directory as default: > > URL: /my/default/dir/ > > ;; User pastes a URL after that or replaces that with a URL. > > URL: /my/default/dir/http://foobar.com RET > ;; or > URL: http://foobar.com RET > > ;; This is returned: /foobar.com > > In Emacs 26.3 the URL entered by the user is returned correctly. > > A main use of `read-file-or-url' is to prompt for and read a URL. If a > user enters a URL when FFAP has not been able to guess a URL, FFAP now > just treats the input as a filename. It treats prefix `http:/' the same > way it would treat prefix `c:' on MS Windows. > > Reading a URL is maybe the main use case of `ffap-read-file-or-url'. (There is no `ffap-read-url'.) It's now broken. Thierry and Stefan, these changes seem to have been done by you. Can you please take a look at this issue? Would it be possible to fix this for Emacs 27.2?