unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Emanuel Berg <incal@dataswamp.org>
Cc: emacs-devel@gnu.org
Subject: Re: buffer segments, uniform and automatic (was: Re: [Elisp: 8 out of 10 problems] I think the last one! (point))
Date: Tue, 13 Aug 2024 14:10:31 +0000	[thread overview]
Message-ID: <875xs4ikdk.fsf@localhost> (raw)
In-Reply-To: <87jzgkftwi.fsf_-_@dataswamp.org>

Emanuel Berg <incal@dataswamp.org> writes:

> So as for the segments in a text mode buffer, as for
> point (2), it would look something like:
> ...
>   [ buffer [ paragraphs [ sentences [words] ] ] ]
>
> Definitions of each has to be setup manually and individually,
> as for (1), so for example for word it could be
> ...
> Then the program will define a set of functions for each
> segment type, the same for each.
>
> Note that so many common operations can be defined from the
> definition, i.e. the (BEG END) pair:
>
> -len is (- END BEG)
> -reg is (BEG END)
> -beg is BEG
> -end is END
> -cur is (buffer-substring-no-properties BEG END)
> ...

Check out thingatpt.el: `beginning-of-thing', `end-of-thing',
`thing-at-point', etc.

"thing" can be anything, including page, paragraph, word, link, sexp, etc

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



  reply	other threads:[~2024-08-13 14:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-11  0:14 [Elisp: 8 out of 10 problems] I think the last one! (point) Emanuel Berg
2024-08-11  4:46 ` Emanuel Berg
2024-08-11  5:43   ` Eli Zaretskii
2024-08-11  5:22 ` Eli Zaretskii
2024-08-11  7:44 ` Yuri Khan
2024-08-11  9:06   ` Emanuel Berg
2024-08-11 12:16   ` Emanuel Berg
2024-08-13 13:13     ` buffer segments, uniform and automatic (was: Re: [Elisp: 8 out of 10 problems] I think the last one! (point)) Emanuel Berg
2024-08-13 14:10       ` Ihor Radchenko [this message]
2024-08-13 17:10         ` Emanuel Berg
2024-08-13 18:07           ` Emanuel Berg
2024-08-14 20:02             ` Emanuel Berg
2024-08-15  5:39               ` Emanuel Berg

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=875xs4ikdk.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=incal@dataswamp.org \
    /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).