From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Somelauw ." Subject: Add contents-begin and contents-end to src-block in org-element.el Date: Sun, 24 Dec 2017 15:56:24 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eT7hV-0006Dx-B5 for emacs-orgmode@gnu.org; Sun, 24 Dec 2017 09:56:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eT7hS-0002FU-Fw for emacs-orgmode@gnu.org; Sun, 24 Dec 2017 09:56:29 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:40633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eT7hS-0002EU-6n for emacs-orgmode@gnu.org; Sun, 24 Dec 2017 09:56:26 -0500 Received: by mail-wr0-x242.google.com with SMTP id p17so7858381wre.7 for ; Sun, 24 Dec 2017 06:56:25 -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 Here is a simple patch that makes it possible to find the inner contents of a src-code block. In the function called "defun org-element-src-block-parser (limit affiliated)": - First find contents-begin and contents-end using the following: #+BEGIN_SRC emacs-lisp (contents-begin (save-excursion (goto-char begin) (forward-line 1) (line-beginning-position))) (contents-end (save-excursion (goto-char end) (forward-line (- -1 (count-lines pos-before-blank end))) (line-beginning-position))) #+END_SRC - Then make sure both are included in the list below that: #+BEGIN_SRC emacs-lisp :begin begin :end end :contents-begin contents-begin :contents-end contents-end #+END_SRC With kind regards, Somelauw