mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
(browse-url-file-url): Encode file name on conversion to URL.
This commit is contained in:
parent
f9be433c82
commit
59b715013e
1 changed files with 4 additions and 0 deletions
|
|
@ -680,6 +680,10 @@ interactively. Turn the filename into a URL with function
|
|||
(defun browse-url-file-url (file)
|
||||
"Return the URL corresponding to FILE.
|
||||
Use variable `browse-url-filename-alist' to map filenames to URLs."
|
||||
(let ((coding (and default-enable-multibyte-characters
|
||||
(or file-name-coding-system
|
||||
default-file-name-coding-system))))
|
||||
(if coding (setq file (encode-coding-string file coding))))
|
||||
;; URL-encode special chars, do % first
|
||||
(let ((s 0))
|
||||
(while (setq s (string-match "%" file s))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue