From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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 14:26:41 +0200 Message-ID: <864jel22ym.fsf@gnu.org> References: <87leba3ame.fsf@localhost> <88435424-afa3-d7a3-56ff-df9f0a2ca6ba@gmail.com> <875xz39cgp.fsf@localhost> <87mssebjwa.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11508"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, stefankangas@gmail.com, emacs-devel@gnu.org, emacs-orgmode@gnu.org To: Ihor Radchenko Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Tue Feb 06 13:27:26 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 1rXKXu-0002iM-Az for geo-emacs-orgmode@m.gmane-mx.org; Tue, 06 Feb 2024 13:27:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXKXI-0005cg-C9; Tue, 06 Feb 2024 07:26:48 -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 1rXKXG-0005cQ-0O; Tue, 06 Feb 2024 07:26:46 -0500 Original-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 1rXKXE-0002u7-ME; Tue, 06 Feb 2024 07:26:44 -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=Pxcs63NifmJO7EVdveig1lQIRLAya3G969mnwMLMhOw=; b=F+V1SqNuAHKI zuaxvPGs2VeMwp8LZMMd0XNQUDpfZeRFuREo3+0l0zmQGvgNF/xHzy5Q/Iww2jJ0T6CMZJwyIQhBL qOrZeGt4dDxZJBYnyA7derRw3O6PleVSz7cdB6jbhtWjmQ4XP0nC3BCWd+d/n8cptQn4mPydQQjCa yNqEVQvknINhdtRhzToFpM+fdSXdH2FrBmKIuGMkHzKfpn4+Byu1rh4FVBSLZM51mgiTqXACNSq+K 20+NiQMFbOp3ZBaTaWfSuDVX/djttG3WxIpNMyAJMOJnqtmnsg9WxUl1gTvqnIm2WRf5UsUBbuFEt lGvPNl/owOVo1cr/gemvEw==; In-Reply-To: <87mssebjwa.fsf@localhost> (message from Ihor Radchenko on Mon, 05 Feb 2024 22:56:05 +0000) 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:159630 gmane.emacs.devel:315926 Archived-At: > From: Ihor Radchenko > Cc: emacs-devel@gnu.org, emacs-orgmode@gnu.org > Date: Mon, 05 Feb 2024 22:56:05 +0000 > > Jim Porter writes: > > > On 2/5/2024 7:07 AM, Ihor Radchenko wrote: > >> It would make sense to add a number of alists: > >> - bounds-of-thing-at-point-provider-alist > >> - same for 'forward-op, 'beginning-op, 'end-op. > >> > >> After Emacs have those, we can add Org mode support. > > > > That sounds reasonable enough to me; does anyone else have opinions on > > this? Otherwise, I'll get to work on a patch (though probably not for a > > couple weeks). > > CCing Stefan and Eli. > Please, let us know if the above is something not wanted upstream. 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: (defun bounds-of-thing-at-point (thing) "Determine the start and end buffer locations for the THING at point. THING should be a symbol specifying a type of syntactic entity. Possibilities include `symbol', `list', `sexp', `defun', `number', `filename', `url', `email', `uuid', `word', `sentence', `whitespace', `line', and `page'. See the file `thingatpt.el' for documentation on how to define a valid THING. Return a cons cell (START . END) giving the start and end positions of the thing found." (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?