--
发自我的网易邮箱手机智能版
----- Original Message -----
From: "Po Lu"
To: tumashu
Cc: "emacs-devel@gnu.org"
Sent: Thu, 11 Nov 2021 17:39:41 +0800
Subject: Re: Subject: [PATCH] * lisp/xwidget.el (xwidget-webkit-browse-url): Remove space prefix of url.
tumashu writes:
> From 2f460c83b4e304cb1f6df0f11d54e4cb0da0b223 Mon Sep 17 00:00:00 2001
> From: Feng Shu
> Date: Thu, 11 Nov 2021 17:32:53 +0800
> Subject: [PATCH] * lisp/xwidget.el (xwidget-webkit-browse-url): Remove space
> prefix of url.
>
> ---
> lisp/xwidget.el | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lisp/xwidget.el b/lisp/xwidget.el
> index 2c7b4dd83d..be5a510986 100644
> --- a/lisp/xwidget.el
> +++ b/lisp/xwidget.el
> @@ -114,6 +114,7 @@ xwidget-webkit-browse-url
> (or (featurep 'xwidget-internal)
> (user-error "Your Emacs was not compiled with xwidgets support"))
> (when (stringp url)
> + (setq url (replace-regexp-in-string "^[[:space:]]+" "" url))
> ;; If it's a "naked url", just try adding https: to it.
> (unless (string-match "\\`[A-Za-z]+:" url)
> (setq url (concat "https://" url)))
Why is this necessary? I don't think the other `browse-url-function's
do this.
I often encountered in this case, when copy url, space begin url hard notice :)
Thanks in advance.