emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Add contents-begin and contents-end to src-block in org-element.el


From: Somelauw .
Subject: [O] Add contents-begin and contents-end to src-block in org-element.el
Date: Sun, 24 Dec 2017 15:56:24 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]