From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id cMLqMoZCSWVpTgEAG6o9tA:P1 (envelope-from ) for ; Mon, 06 Nov 2023 20:46:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cMLqMoZCSWVpTgEAG6o9tA (envelope-from ) for ; Mon, 06 Nov 2023 20:46:14 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 608A710F13 for ; Mon, 6 Nov 2023 20:46:14 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kjjcwDXz; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699299974; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=NvmMPnvGm4EkbVuy/TZDOOw2nicVlOoCZNM207raVnM=; b=CYNDHmhypqDwgCXNf6vNe6pKisH6D+B3fmR9EK020NoOleNSYnQbLhItRgEVXyxKZD4f7K IQB2zd8yavAi6uqeRbgv8XXdIKqfsycvtAb7T54O/WT6zVpVVEuah9R6GN+vXOBWzKq1ux wpXrkpQkAiLfYwIBd+WGuuuiQ4wsZ9h3RiFdXRXX/CcoIFDrkjT8Bc5jPmCnZ8SwEHxyIk vknQfdrmR184j2lAdmr/Dvskk0P9cEiewzn9HLKh+JJNNEbrwcmC1fmE2FW7VtT3tLcLAj nRZFr6tCXp9H3bBE8XjO1HLMRWwzYMkYWtzbJZik6C4SUB5udvMmyF0CvRmaRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kjjcwDXz; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699299974; a=rsa-sha256; cv=none; b=Xo3pCm8zBtOave+457TUmxtXLPbMjn2CLARj1R1p/7iXOYiMS9Vvk1w2pw9G6XPouzu8tq 5y3LlhsPkC/GuYY50OY0Pz8IWtNWnDvejAhg8Y1K391vW+ZFLA+psfYYqocUFjuvNO+rCc Ics7HTo37N970Z1/Od3Oc9hwpmGvyLYGdUSxhFgFgFTDMbu6N0JLhIUuwB8hskjGbjotbz 13cpKyExgQjFsVOPXV0m/5ACaM7goB+S+TO9T7KkANvl1j3m59da4lv5cI/TKCFjfCaWXC YJJvmUhJklf8EAEAC7eeoh5mpJsHcIQU00WPwDawS8R1iXl5BG2oc4BSEOn9GQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r05XM-0002N1-DM; Mon, 06 Nov 2023 14:45:28 -0500 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 1r05XH-0002KF-Dq for emacs-orgmode@gnu.org; Mon, 06 Nov 2023 14:45:23 -0500 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r05XF-0004KP-Nv for emacs-orgmode@gnu.org; Mon, 06 Nov 2023 14:45:23 -0500 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-5bd33abbb90so2717332a12.2 for ; Mon, 06 Nov 2023 11:45:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699299920; x=1699904720; darn=gnu.org; h=subject:from:to:content-language:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=NvmMPnvGm4EkbVuy/TZDOOw2nicVlOoCZNM207raVnM=; b=kjjcwDXz/J0dVOR9RTbyUmPv02rDd6rdgPmP2dvfoQG5ojmdyw86NvvT0h0JqRHDE4 PXM8BsKiv4a4JPquP/emL9vpi+QaXQzkaqQPvpoXAe72oIwcfvc/37c1397UWIpa1/Kj 2m4NT28W1BXV5FYT7kVfp19A7l4V+wSglOD/xDlmYyJf1rNBOWyeEEpldplRhCMBWHXn 5QwWy0VUGhS8cffXxXz3qBLRYL2g9a6lEj1jY3jgUv4GS6kjJnUcIkZL+UIgpIr5BS7k fOEZkKBgDv5FacByG8JEt53g321Bqy14Fo1qt2/BycCfg5+YeLvV6rpmSALrlyMCw+vj wGag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699299920; x=1699904720; h=subject:from:to:content-language:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NvmMPnvGm4EkbVuy/TZDOOw2nicVlOoCZNM207raVnM=; b=gGg4oqDTl/hBDYLrWeSQLK3JrVk8Wq9l0nUL0Hlo6UiKEGn2N2+tiddjAltQzsqJY0 a9Zt241g1KGldmomNYYYKi77Yt/g2Bg4tLfqWvmeg8Ly6yagWq+21bMmfBTYuEvsqRII GGv2eJdWcxiiWU6GFnB5xoyF8vI+kRZCEOBj4gW1POR9Nho7ZN8A8hzVPpehl/vs+yIg ZnPykdCGD77YpioB7fau7DxZOb4rhC6sb2e5JgYZJOfTCgt5qVkg2dZIb3HNF0JAS4Pr TDA+t8+K2KXreqo4G+VInmT781GowY/+cipYYRZfe06RR6xunzOx+SED8PVaUEz5JZKL H7sw== X-Gm-Message-State: AOJu0Yw3NNG872gQToUgxqObDX6lRDUzNh/uW2S3b27CkGFk0S4y1gIi QtmSQmI0t9tRAzkcMaltJtNLLTCnMUQ= X-Google-Smtp-Source: AGHT+IENYk48txZ8PHFI41xEW6OLb+oDLExbvwS9fZAwhR4PL7b3uzzmFzrAjRNry23QqOAtwsbBfQ== X-Received: by 2002:a17:902:db10:b0:1cc:5833:cf5e with SMTP id m16-20020a170902db1000b001cc5833cf5emr21971056plx.27.1699299920119; Mon, 06 Nov 2023 11:45:20 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id d7-20020a170902654700b001bb1f0605b2sm6400891pln.214.2023.11.06.11.45.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Nov 2023 11:45:19 -0800 (PST) Content-Type: multipart/mixed; boundary="------------K6ZsBgidyR0UMgW7f1U1yhWg" Message-ID: Date: Mon, 6 Nov 2023 11:45:18 -0800 MIME-Version: 1.0 X-Mozilla-News-Host: news://news.gmane.io:119 Content-Language: en-US To: emacs-orgmode@gnu.org From: Jim Porter Subject: [PATCH] Add support for 'thing-at-point' to get URL at point Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=jporterbugs@gmail.com; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.32 X-Spam-Score: -8.32 X-Migadu-Queue-Id: 608A710F13 X-Migadu-Scanner: mx10.migadu.com X-TUID: UyM9iyMK0idS This is a multi-part message in MIME format. --------------K6ZsBgidyR0UMgW7f1U1yhWg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit This is similar to Emacs bug#66752[1]. It would be nice if "(thing-at-point 'url)" would return the URL when point is over an Org link. With this, it's easier to write a function that copies (or browses to) the URL at point without coding so many special cases. Attached is a patch with a regression test for it. Should this also get a NEWS entry? [1] https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-10/msg01628.html --------------K6ZsBgidyR0UMgW7f1U1yhWg Content-Type: text/plain; charset=UTF-8; name="0001-Add-support-for-thing-at-point-to-get-URL-at-point.patch" Content-Disposition: attachment; filename*0="0001-Add-support-for-thing-at-point-to-get-URL-at-point.patc"; filename*1="h" Content-Transfer-Encoding: base64 RnJvbSA2YmNlODRiZDI4MjUzMjM2ZWZmOGVmOTcyZWRlN2RhZjgyZjk1YTcxIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxpdHNqaW1wb3J0ZXJAZ21haWwu Y29tPgpEYXRlOiBNb24sIDYgTm92IDIwMjMgMTE6Mzk6MDkgLTA4MDAKU3ViamVjdDogW1BB VENIXSBBZGQgc3VwcG9ydCBmb3IgJ3Ro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