]> git.eshelyaron.com Git - emacs.git/commitdiff
Make ffap-read-file-or-url put point at the correct place for URLs
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 9 Aug 2021 14:03:02 +0000 (16:03 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 9 Aug 2021 14:03:02 +0000 (16:03 +0200)
* lisp/ffap.el (ffap-read-file-or-url): Put point at the end of
URLs (bug#44822).
(ffap--url-file-handler): Remove hack for default dirs.

lisp/ffap.el

index 0069af259749bf381a0f52a8a593fd3b31804e75..635e9814f120afa1120ac39051841df06c6f4e62 100644 (file)
@@ -1532,10 +1532,7 @@ which may actually result in an URL rather than a filename."
     (cl-case operation
       ;; We mainly just want to disable these bits:
       (substitute-in-file-name (car args))
-      (expand-file-name
-       (if (equal (car args) "http://<remove>")
-           ""
-         (car args)))
+      (expand-file-name (car args))
       (otherwise
        (apply operation args)))))
 
@@ -1546,7 +1543,7 @@ which may actually result in an URL rather than a filename."
         (progn
           (push elem file-name-handler-alist)
           (if (ffap-url-p guess)
-              (read-file-name prompt "http://<remove>" nil nil guess)
+              (read-file-name prompt guess)
             (unless guess
               (setq guess default-directory))
             (unless (ffap-file-remote-p guess)