From: Eric Schulte <schulte.eric@gmail.com>
To: Sebastien Vauban <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Standardized code block syntax and Property Accumulation merged into Master
Date: Thu, 17 Nov 2011 09:16:24 -0700 [thread overview]
Message-ID: <87hb22d8j2.fsf@gmail.com> (raw)
In-Reply-To: 80lirfuhs5.fsf@somewhere.org
"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
> Hi Eric,
>
> Eric Schulte wrote:
>> The standard-code-block-syntax branch has been merged into the master
>> branch of the git repository. This brings two much discussed changes to
>> Org-mode, first a standard set of keywords for code blocks and second
>> the ability to accumulate properties by appending a "+" to the end of
>> the property name. For much more information on both of these changes
>> see the relevant commits [1] and [2] respectively. A function for
>> updating existing Org-mode files to use the new standardized code block
>> keywords is inline below [3], additionally I've updated my collection of
>> Org-mode code block scraps [4].
>
> Nice to see it's finally in!
>
Thanks, me too.
>
> However, I have to report a _tiny_ feature of applying your function:
>
>> [3] Function to update Org-mode buffers to use the new code block syntax.
>> (defun update-org-buffer ()
>> "Update an Org-mode buffer to the new data, code block and call line syntax."
>> (interactive)
>> (save-excursion
>> (flet ((to-re (lst) (concat "^[ \t]*#\\+" (regexp-opt lst t)
>> "\\(\\[\\([[:alnum:]]+\\)\\]\\)?\\:[ \t]*"))
>> (update (re new)
>> (goto-char (point-min))
>> (while (re-search-forward re nil t)
>> (replace-match new nil nil nil 1))))
>> (let ((old-re (to-re '("RESULTS" "DATA" "SRCNAME" "SOURCE")))
>> (lob-re (to-re '("LOB")))
>> (case-fold-search t))
>> (update old-re "name")
>> (update lob-re "call")))))
>
> When run on a buffer containing:
>
> #+property: var foo=1
>
> #+begin_src emacs-lisp
> foo
> #+end_src
>
> #+results:
> : 1
>
> it will translate `#+results' to `#+name':
>
> #+property: var foo=1
>
> #+begin_src emacs-lisp
> foo
> #+end_src
>
> #+name:
> : 1
>
> Further evaluations of that *un-named* code block will leave the `#+name'
> line.
>
> To get back the expected `#+results' line, you have to manually remove that
> results line, and re-evaluate the code block.
>
This, given that results and name are technically still synonyms this
isn't necessarily a bug, however I do agree that a version of the
functions which left the #+results: lines immediately following code
blocks unchanged would be preferable.
Cheers -- Eric
>
> Best regards,
> Seb
--
Eric Schulte
http://cs.unm.edu/~eschulte/
next prev parent reply other threads:[~2011-11-17 16:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-15 15:58 Standardized code block syntax and Property Accumulation merged into Master Eric Schulte
2011-11-17 11:09 ` Sebastien Vauban
2011-11-17 16:16 ` Eric Schulte [this message]
2011-11-18 8:56 ` Sebastien Vauban
2011-11-17 13:23 ` Sebastien Vauban
2011-11-17 16:15 ` Eric Schulte
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=87hb22d8j2.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=wxhgmqzgwmuf@spammotel.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).