emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Expose value-begin and value-end instead of just value in org-element API
@ 2018-02-19 23:29 Somelauw .
  2018-02-20 19:59 ` John Kitchin
  0 siblings, 1 reply; 6+ messages in thread
From: Somelauw . @ 2018-02-19 23:29 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- 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 --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-26 10:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 23:29 Expose value-begin and value-end instead of just value in org-element API Somelauw .
2018-02-20 19:59 ` 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

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).