From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.orgmode,gmane.emacs.devel Subject: Re: Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point) Date: Tue, 06 Feb 2024 12:38:19 +0000 Message-ID: <87mssdlqdg.fsf@localhost> References: <87leba3ame.fsf@localhost> <88435424-afa3-d7a3-56ff-df9f0a2ca6ba@gmail.com> <875xz39cgp.fsf@localhost> <87mssebjwa.fsf@localhost> <864jel22ym.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18946"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, stefankangas@gmail.com, emacs-devel@gnu.org, emacs-orgmode@gnu.org To: Eli Zaretskii Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Tue Feb 06 13:35:57 2024 Return-path: Envelope-to: geo-emacs-orgmode@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 1rXKg8-0004eh-PI for geo-emacs-orgmode@m.gmane-mx.org; Tue, 06 Feb 2024 13:35:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXKfI-0007fr-II; Tue, 06 Feb 2024 07:35:04 -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 1rXKfG-0007fO-CB for emacs-orgmode@gnu.org; Tue, 06 Feb 2024 07:35:02 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXKf6-0004l7-OI for emacs-orgmode@gnu.org; Tue, 06 Feb 2024 07:35:02 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9A794240029 for ; Tue, 6 Feb 2024 13:34:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1707222890; bh=/geAc0xOyL63rynImMwEAC0bQ2Gi9wQlCpJINTQU/14=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=gTXlWDgGpiUUSr/yQWW2fITIWR28Ce626KTKxaih1XhbTKCIL9iWPNoN+yCBey9Jg ET0BRRhhxf9hzcuwGYBDKv27ait7UnL/Ao5BITAxCkQi331H0Xi7FBREFZ94+ZJb9T 36msAwEGxJy5B8l+FR7uGXxPQvuwhr+/KRsIakf9goYBtToeaDHOTm3XBE0s4nEW3y Wkey8Dhsb65ZYVd1LsL6PBGaK4EyOxivgvs405tbqcdSxjth8RIDF6GQ1b48M7jXpA ZKQFSQ2a9d+OLsJq1GiCahkBrHWqGV3pjHD6kvBp6kkdPM/2rl+nviGP6gGr1hR0Mb i8jt5qh5hhfHg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TTjPP3zr2z9rxM; Tue, 6 Feb 2024 13:34:49 +0100 (CET) In-Reply-To: <864jel22ym.fsf@gnu.org> Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Original-Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.orgmode:159631 gmane.emacs.devel:315927 Archived-At: 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. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at