emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subject: [PATCH] * lisp/xwidget.el (xwidget-webkit-browse-url): Remo


From: Eli Zaretskii
Subject: Re: Subject: [PATCH] * lisp/xwidget.el (xwidget-webkit-browse-url): Remove space prefix of url.
Date: Sat, 13 Nov 2021 12:26:16 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: tumashu@163.com,  larsi@gnus.org,  emacs-devel@gnu.org
> Date: Sat, 13 Nov 2021 17:34:50 +0800
> 
> Thanks.  Here's a better docstring, but I don't want to change any of
> the code until I know precisely what it does.
> 
> Canonicalize URL, with SEARCH-PREFIX if URL seems to be a search query.
> 
> Try to determine if URL is an address or a query for a search engine,
> and return canonicalized URL, with SEARCH-PREFIX prepended before
> cannibalisation if it seems to be such a query.  Optional argument
> LOCAL-REGEX is a regular expression that URL is matched against.  If the
> match is successful, then URL is treated as an address, and not a search
> query.

I'd improve like this:

    "Canonicalize incomplete URL using SEARCH-PREFIX if URL is a search query.

  Canonicalization means:

    - prepend a scheme (a.k.a. \"protocol\") if it's missing
    - append a slash if it's missing
    - if URL is a search query, prepend SEARCH-PREFIX and hexify special
      characters using `url-hexify-string'

  Optional arg LOCAL-REGEX, if non-nil, means don't treat URLs that
  match the regex as queries even if they otherwise look like it."

Given the meaning of LOCAL-REGEX (if it is indeed described correctly
above), I'd ask why its name is _LOCAL_-REGEX, not something like
ADDRESS-REGEXP?  there's nothing "local" about such an address, is
there?

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]