From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id gGqvLnbYMGY/yAAAqHPOHw:P1 (envelope-from ) for ; Tue, 30 Apr 2024 13:39:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id gGqvLnbYMGY/yAAAqHPOHw (envelope-from ) for ; Tue, 30 Apr 2024 13:39:34 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=mOQdR7N3; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714477174; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=mAn/QFg3LTIcFfBMVBjJVvBoXyNvqBz0YkIoQ7Viui0=; b=sszEbbtbrSKvq8UFf5hUgvbiBN67QdJEZZhSm0jMc9wfyDFRp/yYThRiaoBPGaznCt0e/5 BHFP24O0UVdD/2Jk5Ax0/W2+g+KggS9E48c6Och2irlPGiHsW3tm2Vh4fcCHKVPJEZLmHT H5Qob2bQGZatTFdp/gwubPKu3i7RygzCpAybx8T6ZO0ltmVDRbpjWvqb48c/ayu2HJbvkz /NhLqZI8WFkq9DxBCj6JwnAtPr7C50U3Uya462CJspGz5FtFsaippqLj2rCfVh+1vRW/Wg iJFGoIq0XYaABNyWrmvwHgzOlCTs8/MLyU+VT+cn1dooIWCZGRYQub6kQrASQQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=mOQdR7N3; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714477174; a=rsa-sha256; cv=none; b=W3RlPCWnNDtPTz0xsWJNPAlW2eYmhRNNHVJgU4g7Tn0zcNiEsG2wju/oaROlaTy1tZOiWB U9j/3hAx9/O7jk9VkcDKEkBIAlIxI9KSjQ4dxbkf6cV3Jfb7FMfdh6wdbLWg0EBgwf3v1R bmZpLpnacyXb/JHE760I0B1rd/EDea4N/xAHSMwloBPJJWtAcub7JZ5sv5thFf40XVThol vbyurMGoQ4WUJZMyW9ZzR2adSNIqbztRiLDJHRBYnAi90rNDudu7an1AhphgHi+kZd1gpk 5rymryhibmMP+dV8JyHHtOcssFE8B7DnSl72CStSnxwXedi62XxQLLarRMGIkQ== 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 8FAD126E0D for ; Tue, 30 Apr 2024 13:39:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1lov-00075p-7m; Tue, 30 Apr 2024 07:38:49 -0400 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 1s1los-00075T-VH for emacs-orgmode@gnu.org; Tue, 30 Apr 2024 07:38:47 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1loo-00015t-C6 for emacs-orgmode@gnu.org; Tue, 30 Apr 2024 07:38:45 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 8AE77240104 for ; Tue, 30 Apr 2024 13:38:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714477118; bh=Y1dC4DjkESueECx14JwtvptK1G4PBaX5Thn6NMB8iF0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=mOQdR7N3meScQb/44BMCi5+5uzePXT4DmBiuZgWNkmrPh0+WR9D/c3f+Vr/PXpJ1i pRNx2Pnw9xXZEf76cd7wkCL4Tdc8pl7qsaKjl9rIJYPCm3UOB5BG7Gz2aAEBKXxmFl cjuhimrVsim8pvK2Ylehw6sLICPBCX4XGGQhMQU9aESXYuLu6MElbCay6hHFgk/y47 UYIbQyN1YgVrrl3/GxYTb0aQZX3gUd4OPwurm0Fj0KdHTK+JS28JBYQcsH2/hwFnnZ fVE0cWYxaoDdmJNB803GKu22ZxYhJVAxJCvvQDCHYOJEvFtTYXIFzYBuEvQVhmMum1 srGNz4cmttuDg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VTJ9n130Gz9rxS; Tue, 30 Apr 2024 13:38:36 +0200 (CEST) From: Ihor Radchenko To: Jim Porter Cc: eliz@gnu.org, emacs-devel@gnu.org, emacs-orgmode@gnu.org Subject: Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point) In-Reply-To: <253c058a-d349-41a7-7733-c73075bffcb6@gmail.com> References: <87leba3ame.fsf@localhost> <88435424-afa3-d7a3-56ff-df9f0a2ca6ba@gmail.com> <875xz39cgp.fsf@localhost> <87ttk6da89.fsf@localhost> <673a0f71-c91f-8461-7388-9efbed6ba24f@gmail.com> <0c66ae28-7088-3ac7-be39-7714b8f80455@gmail.com> <87mspcave3.fsf@localhost> <253c058a-d349-41a7-7733-c73075bffcb6@gmail.com> Date: Tue, 30 Apr 2024 11:39:42 +0000 Message-ID: <87sez36pvl.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -6.60 X-Migadu-Queue-Id: 8FAD126E0D X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -6.60 X-TUID: MGD0SkOpGDzl Jim Porter writes: > + (setq-local bounds-of-thing-at-point-provider-alist > + (append bounds-of-thing-at-point-provider-alist > + '((url . eww--bounds-of-url-at-point)))) > + (setq-local forward-thing-provider-alist > + (append forward-thing-provider-alist > + '((url . eww--forward-url)))) > ... What happens if you have multiple providers for an URL? You add the provider to the end, so it will have the lower priority in this scenario. I guess that you want the opposite - EWW provider to take precedence. Same for other changes. > +(ert-deftest thing-at-point-providers () > ... > +(ert-deftest forward-thing-providers () > ... > +(ert-deftest bounds-of-thing-at-point-providers () > + (with-temp-buffer > + (setq-local bounds-of-thing-at-point-provider-alist > + `((url . ,(lambda () > + (bounds-of-thing-at-point-for-text-property > + 'my-url))))) It would make sense to add tests for "first wins" behaviour. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at