emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Somelauw ." <somelauw@gmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Expose value-begin and value-end instead of just value in org-element API
Date: Tue, 20 Feb 2018 00:29:27 +0100	[thread overview]
Message-ID: <CA+gt_a_6GU7a3LO27k6d7_-2_JZW_2jdA=DBi1DfmATE+MbYYA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 975 bytes --]

Some org-mode elements expose "contents-begin" and "contents-end"
properties as buffer positions, whereas other elements such as verbatim and
org-src-block expose a "value" property in the form of a string.

I think it would be preferable to also expose the value by beginning and
ending buffer positions for the following reasons:
- Consistency with elements that expose contents-begin and contents-end.
- More powerful. In my evil-org plugin I want to be able to mark the value
property of the org element at point (so the user can do stuff like easily
copy the code of the current code block), but to do so I need the beginning
and ending position in the buffer of "value". The org-element API does
currently not provide clean way to retrieve these positions.
- It's usually more efficient to return the beginning and ending positions
than to retrieve the substring that contains the value, which may require a
large buffer partition to be copied.

Kind regards,
Somelauw

[-- Attachment #2: Type: text/html, Size: 1044 bytes --]

             reply	other threads:[~2018-02-19 23:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 23:29 Somelauw . [this message]
2018-02-20 19:59 ` Expose value-begin and value-end instead of just value in org-element API John Kitchin
2018-02-21 11:17   ` Nicolas Goaziou
2018-02-21 21:13     ` Somelauw .
2018-02-26  3:43     ` John Kitchin
2018-02-26 10:05       ` Nicolas Goaziou

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.orgmode.org/

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

  git send-email \
    --in-reply-to='CA+gt_a_6GU7a3LO27k6d7_-2_JZW_2jdA=DBi1DfmATE+MbYYA@mail.gmail.com' \
    --to=somelauw@gmail.com \
    --cc=emacs-orgmode@gnu.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/org-mode.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).