emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Somelauw ." <somelauw@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Add contents-begin and contents-end to src-block in org-element.el
Date: Sun, 24 Dec 2017 15:56:24 +0100	[thread overview]
Message-ID: <CA+gt_a8xh9Td+2k5tHEpGhDTnD-oJy8n5zp8MNaa5MY7k2h7cg@mail.gmail.com> (raw)

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	other threads:[~2017-12-24 14:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-24 14:56 Somelauw . [this message]
2017-12-24 15:05 ` Add contents-begin and contents-end to src-block in org-element.el Nicolas Goaziou
2017-12-24 23:55   ` Somelauw .
2017-12-25  8:49     ` Nicolas Goaziou
2017-12-25 13:09       ` Somelauw .
2017-12-25 22:42         ` Nicolas Goaziou
2017-12-27 20:50           ` Somelauw .

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_a8xh9Td+2k5tHEpGhDTnD-oJy8n5zp8MNaa5MY7k2h7cg@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).