From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id IB5NM7UqwmUmZgEA62LTzQ:P1 (envelope-from ) for ; Tue, 06 Feb 2024 13:48:53 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id IB5NM7UqwmUmZgEA62LTzQ (envelope-from ) for ; Tue, 06 Feb 2024 13:48:53 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=Q58xewFY; 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=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1707223733; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=q7bofUzICxxOHsfYdEeiGstFvn6tjaaPe3r8xTIRF90=; b=Ic5i56idalke9zpQ9JRX43ly2KRjtdLEvrOGeL2jXEEPiiD09rkpEqqbhCHu/OcgS/sjvS DVgtgkAPREx64kucPDwT0hB2Q40ruJ4zS1QDLNl4QFrgM3tUhMznK6WnVdAl77VdNWO1Hg VcR42tBfqumTEZ6AQOxBN7pZtpycs42rO6wqcovU24nS1TN9KD0RiZSt4fvyotbnY9soip NUqRs0MFOgCrmEHvp/qehKQpAERv+AY7ezzgAHyIoLlZ7Hm9dDua9PuvHuGC7sKF2NEnzE bNFvcBSPIS7SexyY//SXl7O+rSXgV2zKRSuByXseFTIv4AQKpDJOo1k6x8l8fw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=Q58xewFY; 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=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1707223733; a=rsa-sha256; cv=none; b=rdbKK9OoWTmbw7DSffW3AsMEIzHfnS4jGYZnirhswTnOtLw6Sil7BGZFyw6A+M/UGAL468 rMMxEpyqevvtl97T0nPCCeBN49uBhhAd1rtXBCaVCCGFsIpGRCNb0MK2T+oFQb7Edz4e6y 2IkmCay/XSr0YTesKHw8/Bj1pJx76T2He89Jv9H2GAvcqh03cNiyjVyN7RNRiiREjMTDzI MfpjTwdqS3gUtE8T9C9bUCDXJyrYYWeS0pCKrBzbZj89N2xylo8YXiQaas9bAczOm6bVst DQZ6T2JdVpL6kRR/G9Ih1TAZDTFb7exA/DCjcU/3O3fhaVLVoWiwa4RrEgHSNQ== 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 A915D65D98 for ; Tue, 6 Feb 2024 13:48:53 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXKrZ-00037L-NW; Tue, 06 Feb 2024 07:47:45 -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 1rXKrX-00036Y-V1; Tue, 06 Feb 2024 07:47:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXKrO-0007Kg-PJ; Tue, 06 Feb 2024 07:47:35 -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=q7bofUzICxxOHsfYdEeiGstFvn6tjaaPe3r8xTIRF90=; b=Q58xewFYg6ao kt2elu5yVlIT5RdGVIMjaw5xxfvOOFpNBj31C8JrLzwhQFnQ6nSx4KpFth6FwB7d6DC/teAsDGbv8 Lh4Qy0iC5RChfg2wLSpBWZ3gfqxiU3C9UVVw9RW5vZGv3CTo4BB/DECTO6Tw/C4Tio00HX4iv4NtB wMiEye4uOmAwOsmciB0LK6jfSGc9K+74s/WVkP51GJiU8+qPc0IMCQt0ugpJqCPJFhHEd1H345ycJ ZuvU9fhsqGbbwLXhfJIPZ14nICDHJtpjx6zg5tOCiEG5GyiZ3ksr+NW7GhsmQgsCXWzsgyTgxBfbt 15sw+5HIeoYt1b3uL7L1eQ==; Date: Tue, 06 Feb 2024 14:47:32 +0200 Message-Id: <86y1bxzrmj.fsf@gnu.org> From: Eli Zaretskii To: Ihor Radchenko Cc: jporterbugs@gmail.com, stefankangas@gmail.com, emacs-devel@gnu.org, emacs-orgmode@gnu.org In-Reply-To: <87mssdlqdg.fsf@localhost> (message from Ihor Radchenko on Tue, 06 Feb 2024 12:38:19 +0000) Subject: Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point) References: <87leba3ame.fsf@localhost> <88435424-afa3-d7a3-56ff-df9f0a2ca6ba@gmail.com> <875xz39cgp.fsf@localhost> <87mssebjwa.fsf@localhost> <864jel22ym.fsf@gnu.org> <87mssdlqdg.fsf@localhost> 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.41 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -8.41 X-Migadu-Queue-Id: A915D65D98 X-TUID: wP2tPWCjtNJB > From: Ihor Radchenko > Cc: jporterbugs@gmail.com, stefankangas@gmail.com, emacs-devel@gnu.org, > emacs-orgmode@gnu.org > Date: Tue, 06 Feb 2024 12:38:19 +0000 > > Eli Zaretskii writes: > > > I think we do want to allow extending of this, but doesn't > > thingatpt.el already provide such capabilities? For example, I see > > this in bounds-of-thing-at-point: > > ... > > (cond > > ((get thing 'bounds-of-thing-at-point) <<<<<<<<<<<<<<<<<<<<<<<< > > (funcall (get thing 'bounds-of-thing-at-point))) > > > > Doesn't this provide the extension capabilities you are looking for? > > If not, why not? > > Unlike `thing-at-point-provider-alist', which can be buffer-local, > symbol property is always global and setting it would override other > thing providers. > > Note how `thing-at-point' uses > > (cond > ((let ((alist thing-at-point-provider-alist) > elt result) > (while (and alist (null result)) > (setq elt (car alist) > alist (cdr alist)) > (and (eq (car elt) thing) > (setq result (funcall (cdr elt))))) > result)) > ((get thing 'thing-at-point) > (funcall (get thing 'thing-at-point))) > > checking `thing-at-point-provider-alist' and only then falling back to > `get'. What I am proposing is to add the equivalent alists for other > operators used by thingatpt.el. I guess it's fine, then. But we probably should have such alists in all the other thingatpt methods as well.