From: Drew Adams <drew.adams@oracle.com>
To: 44822@debbugs.gnu.org
Subject: bug#44822: 27.1; Regression in `ffap-read-file-or-url'
Date: Mon, 23 Nov 2020 09:23:37 -0800 (PST) [thread overview]
Message-ID: <d4f8e6e2-7a0c-44cd-9c12-79f62a18b4d2@default> (raw)
`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.
In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
of 2020-08-12 built on CIRROCUMULUS
Repository revision: 86d8d76aa36037184db0b2897c434cdaab1a9ae8
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.18362
System Description: Microsoft Windows 10 Pro (v10.0.1903.18362.1139)
next reply other threads:[~2020-11-23 17:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-23 17:23 Drew Adams [this message]
2020-11-23 17:53 ` bug#44822: 27.1; Regression in `ffap-read-file-or-url' Eli Zaretskii
2021-07-31 12:48 ` Lars Ingebrigtsen
2021-07-31 16:47 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-31 16:58 ` Lars Ingebrigtsen
2021-07-31 17:51 ` Lars Ingebrigtsen
2021-08-09 6:21 ` Madhu
2021-08-09 14:03 ` Lars Ingebrigtsen
2021-07-31 17:54 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d4f8e6e2-7a0c-44cd-9c12-79f62a18b4d2@default \
--to=drew.adams@oracle.com \
--cc=44822@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).