unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: jporterbugs@gmail.com, stefankangas@gmail.com,
	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)
Date: Tue, 06 Feb 2024 14:26:41 +0200	[thread overview]
Message-ID: <864jel22ym.fsf@gnu.org> (raw)
In-Reply-To: <87mssebjwa.fsf@localhost> (message from Ihor Radchenko on Mon, 05 Feb 2024 22:56:05 +0000)

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: emacs-devel@gnu.org, emacs-orgmode@gnu.org
> Date: Mon, 05 Feb 2024 22:56:05 +0000
> 
> Jim Porter <jporterbugs@gmail.com> 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?



  reply	other threads:[~2024-02-06 12:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <abbf9444-7bc7-83f1-f48a-632f4d7a6154@gmail.com>
2023-11-06 20:11 ` Adding custom providers for thingatpt.el (was: [PATCH] Add support for 'thing-at-point' to get URL at point) Ihor Radchenko
2023-11-06 20:53   ` Jim Porter
2024-02-05 15:07     ` Ihor Radchenko
2024-02-05 22:44       ` Jim Porter
2024-02-05 22:56         ` Ihor Radchenko
2024-02-06 12:26           ` Eli Zaretskii [this message]
2024-02-06 12:38             ` Ihor Radchenko
2024-02-06 12:47               ` Eli Zaretskii
2024-04-12 12:41         ` Ihor Radchenko
2024-04-12 22:30           ` Jim Porter
2024-04-29  4:26             ` Jim Porter
2024-04-29 18:14               ` Ihor Radchenko
2024-04-30  4:42                 ` Jim Porter
2024-04-30 11:39                   ` Ihor Radchenko
2024-04-30 18:27                     ` Jim Porter
2024-04-30 21:10                       ` [External] : " Drew Adams
2024-05-07  1:08                         ` Jim Porter
2024-05-07  1:52                           ` Drew Adams
2024-05-07 12:20                             ` Eli Zaretskii
2024-05-07 15:16                               ` Drew Adams
2024-05-07 16:10                               ` Jim Porter
2024-05-07 18:01                                 ` Eli Zaretskii
2024-05-18  8:26                       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=864jel22ym.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=jporterbugs@gmail.com \
    --cc=stefankangas@gmail.com \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).