emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [ANN] Org Elements in contrib
Date: Sun, 10 Jun 2012 18:40:59 +0200	[thread overview]
Message-ID: <CALn3zoisRVn7G6kwm_pC+-Hf5GHW83vCf4RxxbXP=Qhv++VCeA@mail.gmail.com> (raw)
In-Reply-To: <87ty5xxqbu.fsf@gmail.com>

Hi Nicolas

On Mon, Nov 21, 2011 at 7:50 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> I've added org-element.el in contrib directory. It is a complete parser
> and interpreter for Org syntax.
>
> [...]
>
> the following code will parse the buffer, interpret the parsed
> tree, and create a canonical copy of it (no indentation, lowercased
> blocks, standard keywords):
>
> #+begin_src org
> (let ((out (org-element-interpret-data (org-element-parse-buffer))))
>  (switch-to-buffer (get-buffer-create "*Bijectivep*"))
>  (erase-buffer)
>  (insert out)
>  (goto-char (point-min))
>  (org-mode))
> #+end_src
>
> [...]
>
> Feedback is welcome.

Good to mention is also this code to show the pretty print formatted
lisp object representation of the current Org buffer:

#+BEGIN_SRC emacs-lisp
  (let ((out (org-element-parse-buffer)))
    (setq eval-expression-print-length nil)
    (setq eval-expression-print-level  nil)
    (switch-to-buffer (get-buffer-create "*prettyprint*"))
    (erase-buffer)
    (insert (pp-to-string out))
    (goto-char (point-min))
    (emacs-lisp-mode)
    (setq truncate-lines t))
#+END_SRC

Not sure if the following should be supported by
org-element-interpret-data:

#+BEGIN_SRC org
  ,variable declaration in some programming languages:
  ,- Perl :: the variable declaration can be implicit
  ,- C ::
  ,  #+BEGIN_SRC C
  ,    time_t variable_name;
  ,  #+END_SRC
#+END_SRC

The above command for Bijectivep of (org-element-interpret-data
(org-element-parse-buffer)) shows BEGIN_SRC on the same line as
"- C ::" but I expect it on a separate line like in the original. The above
command for prettyprint of (org-element-parse-buffer) alone looks ok
to me.

Michael

  parent reply	other threads:[~2012-06-10 16:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 18:50 [ANN] Org Elements in contrib Nicolas Goaziou
2011-11-21 22:02 ` Martyn Jago
2011-11-22  5:17 ` Eric Abrahamsen
2011-11-22 14:02 ` Brian Wightman
2011-11-22 16:00 ` Thomas S. Dye
2011-11-23 20:12   ` Wes Hardaker
2012-06-10 16:40 ` Michael Brand [this message]
2012-06-12 12:32   ` Nicolas Goaziou
2012-06-12 14:14     ` Michael Brand

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='CALn3zoisRVn7G6kwm_pC+-Hf5GHW83vCf4RxxbXP=Qhv++VCeA@mail.gmail.com' \
    --to=michael.ch.brand@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.com \
    /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).