From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriel Newsgroups: gmane.emacs.bugs Subject: bug#59443: 29.0.50; [PATCH] Allow goto-address-at-point to use secondary browser Date: Mon, 21 Nov 2022 12:03:56 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29090"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 59443@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 21 16:05:37 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ox8Ma-0007R4-LA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Nov 2022 16:05:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ox8MR-0001go-IH; Mon, 21 Nov 2022 10:05:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox8M2-0001Yp-3X for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 10:05:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ox8M1-0001l9-Pq for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 10:05:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ox8M1-0008If-Lg for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 10:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gabriel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Nov 2022 15:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59443 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166904307131857 (code B ref -1); Mon, 21 Nov 2022 15:05:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Nov 2022 15:04:31 +0000 Original-Received: from localhost ([127.0.0.1]:48457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ox8LW-0008Hl-HA for submit@debbugs.gnu.org; Mon, 21 Nov 2022 10:04:30 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ox8LT-0008Ha-C8 for submit@debbugs.gnu.org; Mon, 21 Nov 2022 10:04:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox8LE-00013H-I7 for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 10:04:26 -0500 Original-Received: from mail-co1nam11olkn2013.outbound.protection.outlook.com ([40.92.18.13] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox8L9-0001eV-9L for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 10:04:10 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CXs47BeqZNRN8qK7y3cEfgdEds1+8uPu/sPV79+gratMYEgEjIyImwr+Wycd3jpp3lZy6bMIcfBQNaPuNFFCgkiryN8HviD/ikpD1K2IZp5fBFhYofLLRvTthOCfOua2R29a7N6aaeNurFMw7uDNURWyVLuLl6ov6+WcbcgwQ5qezocCtW/YujMEdJzzh1Q/fZC2EhwohLtn5a+cM9I4niwlf5eGgQ5jQr34+EeLYDdQqrQIIu2rqRvWkhj2dfixM9iYsR95InMRVjgyHYgRqHwmkv2EG41FBql5dK9A4bvQLm6uPnaBe70KouuLyrVzvynv18ss9mHqmUy743+ejw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ThEiJ8ywqgkFgoExG2fs0AMH4gCPzfkSlqQojRrd7gw=; b=BGLrSWnO7gTRyGqI7RFAvKU95CRKkbkAPamMa0xHyfuHf8SQ84TNKrRAVDu9AYDg3WzOYK0Sl8Ti2gCBpX7BqHKWWDNDPJjLRx4yPzRyrhWydvCZfLB0Tzejke41neTdgc+qkmNjJ5C4W+5MR0kPvVArzEcnKXVo5GWY/gmu01zS/dpP5pbjfo6ZTt9oOi89kQ1iVnpDqBiZf8Gw4vkabtDplnGvLU+BdFUCdze8FN9O07TG8jzKRwfw/OccSW5gw8p8oo6VByRH6vF7gEk0Gph9UwaAMT9u1P57BS2/qGmqU7Go/SDJfahpjLmnMDMqDZ3k2Ac2KYSssBN5g2rYOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ThEiJ8ywqgkFgoExG2fs0AMH4gCPzfkSlqQojRrd7gw=; b=dqzsu3bYuVqHZQsgcFXHO3qcfKeKUXtk646Yq9ufQBEO7CCFMWcVam5fZli9IRWh0f6cvlS/W/mEqyFiU+5UdN63TWd6GSpweIcov3tWGIFR7R3xlbz/GN2B/foO23MceIufBvWhynqnn7+T17ANdUZuRuZsmP2FNkBHliib2StXeKpCcPrRjBr5yykjTsd+dFRnrTNkvAkCCmBg9AJwLs3owsiWcejELhn4Z6dh3nGG3xkYvuYIGVLYkj5r+ji6Rp8fhidRta/gOhK3Mhsqam9MatHCoYkCN1Dane5r2ETL29SSe1CRwobCVi4YnPM3t56tsHv4h2oviKALjQNe1Q== Original-Received: from SJ0PR06MB8609.namprd06.prod.outlook.com (2603:10b6:a03:40c::11) by MWHPR06MB2749.namprd06.prod.outlook.com (2603:10b6:300:40::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.8; Mon, 21 Nov 2022 15:04:03 +0000 Original-Received: from SJ0PR06MB8609.namprd06.prod.outlook.com ([fe80::33ae:d3a7:24ae:5c6f]) by SJ0PR06MB8609.namprd06.prod.outlook.com ([fe80::33ae:d3a7:24ae:5c6f%4]) with mapi id 15.20.5857.017; Mon, 21 Nov 2022 15:04:03 +0000 In-Reply-To: (Stefan Kangas's message of "Mon, 21 Nov 2022 05:52:41 -0800") X-TMN: [gACXGFSEjghSzMZwcgEFUODK7IMDR5OFKOR+6E5RDBw22TC8nYiu7z+Y2wz91tMx] X-ClientProxiedBy: CPYP284CA0040.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:81::9) To SJ0PR06MB8609.namprd06.prod.outlook.com (2603:10b6:a03:40c::11) X-Microsoft-Original-Message-ID: <87leo48i3n.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR06MB8609:EE_|MWHPR06MB2749:EE_ X-MS-Office365-Filtering-Correlation-Id: 30c2f32a-9cde-4f9d-ae87-08dacbd1a095 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9q5lywZIg4I/bbqxe1WudPmCLJy6QSK5YC7ebTpJ6Hmf6m5pqS67U57OrqT4Y2uJ5OwuvyuHBmw1WW7QLx7ID2nUlRCaT8H90QfRZiUTGxOtwwf0sP+3cS6fcD6aNfK6oqDGTCDstSsNya8G4qH24Fm5sBYNLE0ewfA25gcIzUcHMMJieDDtw9efEQjYk2n5PWWKJ3RkaWYXIPcq8SD+X8MsGbMUG297YmzSfYKR0F0zuhM0m0qdfaWeD1CBbbIomqzRv4KcptQE7qXZL0gOqFlzX4zuxU4ZHawLGuNKQBSVG5OXYtA+tMxNEc410dqednYAIoWpilWOpKeoPkYG8DHHtyGm3xvA7J5kaoEK16fe72j3Ede/7mWl+6VcYQ8UOo1DogQrvTKdOylA9A0RXyrjxyM7iiesNvr8gdeJbxya+uHpXo8XnoZAJ7szmYZmMGPQ19bSuoIKtibC6BY9jDjUMPyYSwN10rXpTqYld2vlDTt7kNp58MGDEVztXOnyAJjDzSrWmHfBAmp1gwtnQEPKEcNwsMt0Koc7p/UGN6u81pp4g8/uBLieaWX99mSxlG7F77KBUVGPVmRaYfovNuReqvY6XIUyDSuG22NY20YhfwxYXv/wJzN0TsqBHgxq3BxgeXNHZPx047euUEe31g== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RPrShfMJEHJqdsgzmb77PCzKeoEjGBD3314WBsfzPyQpy7gObVUVVol0CjtbXI/pupCL+HzDB149XbtylazUn0912rXeYtnvWE/YSdn8a0xeVqwqg+tdgkgO6hSA6zIlhQ2rj3zXtcwoWsrdfg4wFQMgi6dR8KEPImVqmdgpEwqDqPwwdoO8BlrBDva2USvS9FqnqvDonj0UFH0E/3L+Oejti35OnrIDfmP/ul0swC0KuCLZn7dAXCPgzOZLv+/9mzPujp9ZkbcvCujzvYoXlTdU4TCnKv7n9Rmbh2lKHjjjrYJNGq0lON+ReypUY7doX6/fih+fDmnu7bB/g81ApqCHJ6Gi2CYOIfr/Z20GLS9Ib4iMc4igfHoCgH24JC7meeFTITzLDuWeSJwzhmbEgRo2pNI2x6rIeQ0kPV9rGm/jneWO7aXMiRw/Lw7eCyerLNsayd5XXkoVytcFCmqINYiJa+5VUMlwwk2DDBzYpKndrfL1gPX9HDqkSXf1GgSK6QjyVjFKXpUV+Id1jFlKIBf8blD/o12nkb9ahhU7WorQqjUmJQgcOjHQfbdemYhrws6kI2T4ecprNAr88IbkRfKqZD9m7lzmIKESxdt+ZEH283ZSegNXczmuQoEup/L0Qzxrx6ph86ETUmq0gByW3YfmOf/q9Kf5n40bROsOWxYmNmK9SFJQw/+htlPR08o1lEONgz6AMx05oHc3iTfK/COXj+9hdnZ8uGQrdXn9MPsCTZ8S5nYjKzin8J Wuq1VyFRt4ZUUkmfLwkzmj+3oTMZMx61K+6jJ+8CTO5Cwd53doZ65mIh2UlvtEVcywx4LUbhZrgoI/kfYUspheWh+DNZZskdH7 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-89723.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 30c2f32a-9cde-4f9d-ae87-08dacbd1a095 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR06MB8609.namprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 15:04:03.5050 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR06MB2749 Received-SPF: pass client-ip=40.92.18.13; envelope-from=gabriel376@hotmail.com; helo=NAM11-CO1-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248542 Archived-At: --=-=-= Content-Type: text/plain Stefan Kangas writes: > I didn't really study the patch or the issue, but here are two nits. > > Gabriel writes: > >> * lisp/net/dictionary.el (goto-address-at-point): Call >> `browse-url-button-open-url', so a prefix argument uses >> `browse-url-secondary-browser-function'. > ^^ > > We do not indent the commit message like this. It should start at > column 0. > > >> ;;;###autoload >> (defun goto-address-at-point (&optional event) >> - "Send to the e-mail address or load the URL at point. >> -Send mail to address at point. See documentation for >> -`goto-address-find-address-at-point'. If no address is found >> -there, then load the URL at or before point." >> + "Compose a new message to the e-mail address or browse the URL at >> +point. > > The first line of a docstring should be a complete sentence (for > e.g. eldoc and apropos). Thanks for the quick review, Stefan. Please find attached an updated patch. I fixed the commit message indent and rephrased the first line of docstring to be a complete sentence (based on the docstring's of `compose-mail' and `browse-url-button-open-url'). --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Allow-goto-address-at-point-to-use-secondary-browser.patch >From 2151f92bf5d07106d7f322ea69bfc745b0bf1d28 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Mon, 21 Nov 2022 08:08:52 -0300 Subject: [PATCH 1/1] Allow goto-address-at-point to use secondary browser * lisp/net/dictionary.el (goto-address-at-point): Call `browse-url-button-open-url', so a prefix argument uses `browse-url-secondary-browser-function'. --- lisp/net/goto-addr.el | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 86cf98004b..03e14c9268 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el @@ -222,25 +222,28 @@ goto-address-fontify-region ;;;###autoload (defun goto-address-at-point (&optional event) - "Send to the e-mail address or load the URL at point. -Send mail to address at point. See documentation for -`goto-address-find-address-at-point'. If no address is found -there, then load the URL at or before point." + "Start composing a new message to the e-mail address at point or +open URL at point. + +If no e-mail address is found at point, use the URL at or before +point. See `goto-address-find-address-at-point'. + +With prefix argument, use the secondary browser to open the URL. +See `browse-url-button-open-url'." (interactive (list last-input-event)) (save-excursion (if event (posn-set-point (event-end event))) (let ((address (save-excursion (goto-address-find-address-at-point)))) (if (and address - (save-excursion - (goto-char (previous-single-char-property-change - (point) 'goto-address nil - (line-beginning-position))) - (not (looking-at goto-address-url-regexp)))) - (compose-mail address) - (let ((url (browse-url-url-at-point))) - (if url - (browse-url url) - (error "No e-mail address or URL found"))))))) + (save-excursion + (goto-char (previous-single-char-property-change + (point) 'goto-address nil + (line-beginning-position))) + (not (looking-at goto-address-url-regexp)))) + (compose-mail address) + (if-let ((url (browse-url-url-at-point))) + (browse-url-button-open-url url) + (error "No e-mail address or URL found")))))) (defun goto-address-find-address-at-point () "Find e-mail address around or before point. -- 2.34.1 --=-=-= Content-Type: text/plain --- Gabriel --=-=-=--