mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Fix `browse-url-of-dired'
* lisp/net/browse-url.el (browse-url-emacs): Make the `browse-url-of-dired' command work again after the browse-emacs changes (bug#42429).
This commit is contained in:
parent
0a3d584ce4
commit
ea47bcc431
1 changed files with 12 additions and 4 deletions
|
|
@ -134,6 +134,8 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; Code:
|
||||
|
||||
(require 'url)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Variables
|
||||
|
||||
|
|
@ -1374,10 +1376,16 @@ Optional argument SAME-WINDOW non-nil means show the URL in the
|
|||
currently selected window instead."
|
||||
(interactive (browse-url-interactive-arg "URL: "))
|
||||
(require 'url-handlers)
|
||||
(let ((file-name-handler-alist
|
||||
(cons (cons url-handler-regexp 'url-file-handler)
|
||||
file-name-handler-alist)))
|
||||
(if same-window (find-file url) (find-file-other-window url))))
|
||||
(let ((parsed (url-generic-parse-url url))
|
||||
(func (if same-window 'find-file 'find-file-other-window)))
|
||||
(if (and (equal (url-type parsed) "file")
|
||||
(file-directory-p (url-filename parsed)))
|
||||
;; It's a directory; just open it.
|
||||
(funcall func (url-filename parsed))
|
||||
(let ((file-name-handler-alist
|
||||
(cons (cons url-handler-regexp 'url-file-handler)
|
||||
file-name-handler-alist)))
|
||||
(funcall func url)))))
|
||||
|
||||
(function-put 'browse-url-emacs 'browse-url-browser-kind 'internal)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue