From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel 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 Message-ID: <83o86oxsfr.fsf@gnu.org> References: <27840630.58e8.17d0e5b6389.Coremail.tumashu@163.com> <877ddfvxnm.fsf@yahoo.com> <87v90z6k0p.fsf@gnus.org> <87r1bnuenl.fsf@yahoo.com> <87ilwy7vla.fsf@gnus.org> <87ilwyvq5m.fsf@yahoo.com> <87ilwy6fr8.fsf@gnus.org> <87wnlcoo9p.fsf@yahoo.com> <83r1bkxzvu.fsf@gnu.org> <87h7cgo0ud.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22539"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tumashu@163.com, larsi@gnus.org, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 13 11:27:35 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlqFy-0005g6-LK for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Nov 2021 11:27:34 +0100 Original-Received: from localhost ([::1]:41496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlqFw-0000MF-R0 for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Nov 2021 05:27:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlqF3-00081H-81 for emacs-devel@gnu.org; Sat, 13 Nov 2021 05:26:37 -0500 Original-Received: from [2001:470:142:3::e] (port=47256 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlqF0-0005tg-3w; Sat, 13 Nov 2021 05:26:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/nbpK+qjySEk+4dFL5tmjyTpTiizHW+kxhDYCNt+gf0=; b=mb0A4aW+2CsX 25Y09hr2SyjJcwOdOBZfEJ+/5Wb9+GxVZCSLJnimQqPW4M/Vl/3af4b88ISJnySKOogD3rfOhBRfi TvgbFNCd5SVDffVdGeG41epzcjmKlwdZpyTGLS6k7u32vnRqwqF5m6ya/TEG9XVE5Xiwg7aCYrrfx AmMcuNJms8HDOKYXVp0IoMbfkyZKLwBTERImUj0AQYP4BBdDxN6/TvJsMGXuElGXtfpRfN+CKmoRi 2/FWVvbUT3banJsX1gBgfH3SSl72W8p/uUzlrLAiwGgn7CjcGpwTOxzfPGWjsqm+R07LXbHdUjzbp d+ye82aKY4QM6oo0C39IRA==; Original-Received: from [87.69.77.57] (port=2832 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlqEy-0005ak-F5; Sat, 13 Nov 2021 05:26:34 -0500 In-Reply-To: <87h7cgo0ud.fsf@yahoo.com> (message from Po Lu on Sat, 13 Nov 2021 17:34:50 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279311 Archived-At: > From: Po Lu > 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.