From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Somelauw ." Subject: Expose value-begin and value-end instead of just value in org-element API Date: Tue, 20 Feb 2018 00:29:27 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1141a7f6b25b090565991027" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enusF-0006mc-1d for emacs-orgmode@gnu.org; Mon, 19 Feb 2018 18:29:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enusE-0006r7-4r for emacs-orgmode@gnu.org; Mon, 19 Feb 2018 18:29:31 -0500 Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]:44862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enusD-0006qf-U2 for emacs-orgmode@gnu.org; Mon, 19 Feb 2018 18:29:30 -0500 Received: by mail-wr0-x22a.google.com with SMTP id v65so11261065wrc.11 for ; Mon, 19 Feb 2018 15:29:29 -0800 (PST) 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.org@gnu.org Sender: "Emacs-orgmode" To: "emacs-orgmode@gnu.org" --001a1141a7f6b25b090565991027 Content-Type: text/plain; charset="UTF-8" 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 --001a1141a7f6b25b090565991027 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Some org-mode elements expose "contents-begin" and "contents= -end" properties as buffer positions, whereas other elements such as v= erbatim and org-src-block expose a "value" property in the form o= f a string.

I think it would be preferable to also expose the value = by beginning and ending buffer positions for the following reasons:
- Co= nsistency with elements that expose contents-begin and contents-end.
- M= ore powerful. In my evil-org plugin I want to be able to mark the value pro= perty of the org element at point (so the user can do stuff like easily cop= y the code of the current code block), but to do so I need the beginning an= d ending position in the buffer of "value". The org-element API d= oes currently not provide clean way to retrieve these positions.
- It= 9;s usually more efficient to return the beginning and ending positions tha= n to retrieve the substring that contains the value, which may require a la= rge buffer partition to be copied.

Kind regards,
Somelauw --001a1141a7f6b25b090565991027--