emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Update Config] Babel changes -- security updates and final integration push
@ 2010-07-05 18:31 Eric Schulte
  2010-07-06  0:59 ` Thomas S. Dye
  2010-07-07  2:03 ` Bernt Hansen
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Schulte @ 2010-07-05 18:31 UTC (permalink / raw)
  To: Org Mode

Hi,

I've just merged a large set of Babel related security measures and
layout/initialization updates into the master branch of the git
repository.

These changes will require existing babel users to update their
configuration, see the following instructions for details -- even if you
think you've read similar instructions before these are worth reading.
http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html

From here on out Babel development in the master branch will settle down
along with the rest of the current Org-mode feature freeze.

Thanks -- Eric

please reply to this email with any question or problems you encounter,
a text export of the contents of the web page linked above is provided
below.

DONE document configuration changes for Babel integration 
==========================================================
Babel took the integration into Org-mode as an opportunity to do
some much needed house cleaning.  Most importantly we have
simplified the enabling of language support, and cleared out
unnecessary configuration variables -- which is great unless you
already have a working configuration under the old model.

The most important changes regard the /location/ and /enabling/
of Babel (both core functionality and language specific support).

Babel: Babel is now part of the core of Org-mode, so it is
     now loaded along with the rest of Org-mode.  That means that
     there is /no configuration/ required to enable the main
     Babel functionality.  For current users, this means that
     statements like

     (require 'org-babel)

     or

     (require 'org-babel-init)

     that may by lying around in your configuration must now be
     removed.

load path: Babel (including all language specific files --
     aside from those which are located in the =contrib/=
     directory for reasons of licencing) now lives in the base of
     the Org-mode lisp directory, so /no additional directories/
     need to be added to your load path to use babel.  For Babel
     users this means that statements adding babel-specific
     directories to your load-path should now be removed from
     your config.

language support: It is no longer necessary to require
     language specific support on a language-by-language basis.
     Specific language support should now be managed through the
     `org-babel-load-languages' variable.  This variable can be
     customized using the Emacs customization interface, or
     through the addition of something like the following to your
     configuration (note: any language not mentioned will /not/
     be enabled, aside from =emacs-lisp= which is enabled by
     default)

     (org-babel-do-load-languages
      'org-babel-load-languages
      '((R . t)
        (ditaa . t)
        (dot . t)
        (emacs-lisp . t)
        (gnuplot . t)
        (haskell . nil)
        (ocaml . nil)
        (python . t)
        (ruby . t)
        (screen . nil)
        (sh . t)
        (sql . nil)
        (sqlite . t)))
     
     Despite this change it is still possible to add
     language support through the use of =require=
     statements, however to conform to Emacs file-name
     regulations all Babel language files have changed
     prefix from =org-babel-*= to =ob-*=, so the require
     lines must also change e.g.

     (require 'org-babel-R)

     should be changed to

     (require 'ob-R)

We have eliminated the =org-babel-tangle-w-comments= variable as
well as the two main internal lists of languages, namely
- =org-babel-interpreters= and
- =org-babel-tangle-langs= 

so any config lines which mention those variables, can/should be
stripped out in their entirety.  This includes any calls to the
=org-babl-add-interpreter= function, whose sole purpose was to
add languages to the =org-babel-interpreters= variable.

With those calls stripped out, we may still in some cases want to
associate a file name extension with certain languages, for
example we want all of our emacs-lisp files to end in a =.el=, we
can do this will the =org-babel-tangle-lang-exts= variable.  In
general you shouldn't need to touch this as it already has
defaults for most common languages, and if a language is not
present in org-babel-tangle-langs, then babel will just use the
language name, so for example a file of =c= code will have a =.c=
extension by default, shell-scripts (identified with =sh=) will
have a =.sh= extension etc...

The configuration of /shebang/ lines now lives in header
arguments.  So the shebang for a single file can be set at the
code block level, e.g.


  #+begin_src clojure :shebang #!/usr/bin/env clj
    (println "with a shebang line, I can be run as a script!")
  #+end_src

Note that whenever a file is tangled which includes a /shebang/
line, Babel will make the file executable, so there is good
reason to only add /shebangs/ at the source-code block level.
However if you're sure that you want all of your code in some
language (say shell scripts) to tangle out with shebang lines,
then you can customize the default header arguments for that
language, e.g.


  ;; ensure this variable is defined defined
  (unless (boundp 'org-babel-default-header-args:sh)
    (setq org-babel-default-header-args:sh '()))
  
  ;; add a default shebang header argument
  (add-to-list 'org-babel-default-header-args:sh
               '(:shebang . "#!/bin/bash"))

The final important change included in this release is the
addition of new security measures into Babel.  These measures are
in place to protect users from the accidental or uninformed
execution of code.  Along these lines /every/ execution of a code
block will now require an explicit confirmation from the user.
These confirmations can be stifled through customization of the
`org-confirm-babel-evaluate' variable, e.g.

  ;; I don't want to be prompted on every code block evaluation
  (setq org-confirm-babel-evaluate nil)

In addition, it is now possible to remove code block evaluation
form the =C-c C-c= keybinding.  This can be done by setting the
=org-babel-no-eval-on-ctrl-c-ctrl-c= variable to a non-nil value,
e.g.

  ;; I don't want to execute code blocks with C-c C-c
  (setq org-babel-no-eval-on-ctrl-c-ctrl-c t)

An additional keybinding has been added for code block
evaluation, namely =C-c C-v e=.

Whew! that seems like a lot of effort for a /simplification/ of
configuration.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Update Config] Babel changes -- security updates and final integration push
  2010-07-05 18:31 [Update Config] Babel changes -- security updates and final integration push Eric Schulte
@ 2010-07-06  0:59 ` Thomas S. Dye
  2010-07-06  1:09   ` Eric Schulte
  2010-07-07  2:03 ` Bernt Hansen
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2010-07-06  0:59 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode

Hi Eric,

Thanks for all your work integrating Babel into Org-mode.

I've pulled the latest Org-mode and changed my initialization  
according to your message.  I also pulled the latest starter-kit, so I  
think I have all the latest code.

When I try to evaluate this code block I get an error that orgtbl-to- 
orgtbl is void.

#+begin_src emacs-lisp
   (list 1 (+ 2 3))
#+end_src

Here is a backtrace:

Debugger entered--Lisp error: (void-function orgtbl-to-orgtbl)
   (orgtbl-to-orgtbl (if (or ... ...) result (list result)) (quote  
(:fmt ...)))
   (concat (orgtbl-to-orgtbl (if ... result ...) (quote ...)) "\n")
   (insert (concat (orgtbl-to-orgtbl ... ...) "\n"))
   (cond ((not ...) (insert ...) (goto-char beg) (when ... ...))  
((member "file" result-params) (insert result)) ((member "html" result- 
params) (insert ...)) ((member "latex" result-params) (insert ...))  
((member "code" result-params) (insert ...)) ((or ... ...) (save- 
excursion ...) (if ... ...)) (t (org-babel-examplize-region ... ...  
results-switches)))
   (let ((existing-result ...) (results-switches ...) beg end) (when  
existing-result (goto-char existing-result) (save-excursion ... ...)  
(forward-line 1) (setq beg ...) (cond ... ... ...)) (setq results- 
switches (if results-switches ... "")) (cond (... ... ... ...)  
(... ...) (... ...) (... ...) (... ...) (... ... ...) (t ...)) (setq  
end (if ... ... ...)) (when (and indent ... ...) (indent-rigidly beg  
end indent)))
   (save-excursion (let (... ... beg end) (when existing- 
result ... ... ... ... ...) (setq results-switches ...)  
(cond ... ... ... ... ... ... ...) (setq end ...) (when ... ...)))
   (if (and result-params (member "silent" result-params)) (progn  
(message ...) result) (when (and ... ...) (setq result ...)) (save- 
excursion (let ... ... ... ... ... ...)) (message "finished"))
   (if (= (length result) 0) (if (member "value" result-params)  
(message "No result returned by source block") (message "Source block  
produced no output")) (if (and result-params ...) (progn ... result)  
(when ... ...) (save-excursion ...) (message "finished")))
   org-babel-insert-result((1 5) ("replace") ("emacs-lisp" "(list 1 (+  
2 3))\n" ((:cache . "no") (:colnames . "no") (:comments . "")  
(:exports . "code") (:hlines . "yes") (:noweb . "yes") (:results .  
"replace") (:session . "none") (:shebang . "") (:tangle . "")) "" nil  
nil 0) nil 0 "emacs-lisp")
   (if (and (not arg) new-hash (equal new-hash old-hash)) (save- 
excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq  
result ...) (message ...) result) (setq result (funcall cmd body  
params)) (if (eq result-type ...) (setq result ...)) (org-babel-insert- 
result result result-params info new-hash indent lang) (run-hooks  
(quote org-babel-after-execute-hook)) result)
   (progn (fset (quote call-process-region) (function* ...)) (unless  
(fboundp cmd) (error "No org-babel-execute function for %s!" lang))  
(if (and ... new-hash ...) (save-excursion ... ... ... ... ... result)  
(setq result ...) (if ... ...) (org-babel-insert-result result result- 
params info new-hash indent lang) (run-hooks ...) result))
   (unwind-protect (progn (fset ... ...) (unless ... ...)  
(if ... ... ... ... ... ... result)) (if --cl-letf-bound-- (fset ... -- 
cl-letf-save--) (fmakunbound ...)))
   (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind- 
protect (progn ... ... ...) (if --cl-letf-bound-- ... ...)))
   (letf ((... ...)) (unless (fboundp cmd) (error "No org-babel- 
execute function for %s!" lang)) (if (and ... new-hash ...) (save- 
excursion ... ... ... ... ... result) (setq result ...) (if ... ...)  
(org-babel-insert-result result result-params info new-hash indent  
lang) (run-hooks ...) result))
   (letf* ((... ...)) (unless (fboundp cmd) (error "No org-babel- 
execute function for %s!" lang)) (if (and ... new-hash ...) (save- 
excursion ... ... ... ... ... result) (setq result ...) (if ... ...)  
(org-babel-insert-result result result-params info new-hash indent  
lang) (run-hooks ...) result))
   (flet ((call-process-region ... ...)) (unless (fboundp cmd) (error  
"No org-babel-execute function for %s!" lang)) (if (and ... new- 
hash ...) (save-excursion ... ... ... ... ... result) (setq  
result ...) (if ... ...) (org-babel-insert-result result result-params  
info new-hash indent lang) (run-hooks ...) result))
   (unwind-protect (flet (...) (unless ... ...)  
(if ... ... ... ... ... ... result)) (setq call-process-region (quote  
org-babel-call-process-region-original)))
   (let* ((info ...) (evaluation-confirmed ...) (lang ...)  
(params ...) (new-hash ...) (old-hash ...) (body ...) (result- 
params ...) (result-type ...) (cmd ...) (dir ...) (default- 
directory ...) (org-babel-call-process-region-original ...)  
(indent ...) result) (unwind-protect (flet ... ... ...) (setq call- 
process-region ...)))
   org-babel-execute-src-block(nil ("emacs-lisp" "(list 1 (+ 2 3)) 
\n" ((:cache . "no") (:colnames . "no") (:comments . "") (:exports .  
"code") (:hlines . "yes") (:noweb . "yes") (:results . "replace")  
(:session . "none") (:shebang . "") (:tangle . "")) "" nil nil 0))
   (progn (org-babel-execute-src-block current-prefix-arg info) t)
   (if info (progn (org-babel-execute-src-block current-prefix-arg  
info) t) nil)
   (let ((info ...)) (if info (progn ... t) nil))
   (if (not org-babel-no-eval-on-ctrl-c-ctrl-c) (let (...) (if  
info ... nil)) nil)
   org-babel-execute-src-block-maybe()
   run-hook-with-args-until-success(org-babel-execute-src-block-maybe)
   (cond ((or ... org-occur-highlights org-latex-fragment-image- 
overlays) (and ... ...) (org-remove-occur-highlights) (org-remove- 
latex-fragment-image-overlays) (message "Temporary highlights/overlays  
removed from current buffer")) ((and ... ...) (funcall org-finish- 
function)) ((run-hook-with-args-until-success ...)) ((or ... ...)  
(call-interactively ...)) ((org-on-target-p) (call-interactively ...))  
((and ... ...) (call-interactively ...)) ((org-on-heading-p) (call- 
interactively ...)) ((org-at-table\.el-p) (message "Use C-c ' to edit  
table.el tables")) ((org-at-table-p) (org-table-maybe-eval-formula)  
(if arg ... ...) (call-interactively ...)) ((or ... ...) (call- 
interactively ...)) ((org-at-item-checkbox-p) (call- 
interactively ...)) ((org-at-item-p) (if arg ... ...)) ((save- 
excursion ... ...) (beginning-of-line 1) (save-excursion ...)) ((save- 
excursion ... ...) (cond ... ...)) ((org-clock-update-time-maybe)) (t  
(error "C-c C-c can do nothing useful at this location")))
   (let ((org-enable-table-editor t)) (cond (... ... ... ... ...)  
(... ...) (...) (... ...) (... ...) (... ...) (... ...) (... ...)  
(... ... ... ...) (... ...) (... ...) (... ...) (... ... ...)  
(... ...) (...) (t ...)))
   org-ctrl-c-ctrl-c(nil)
   call-interactively(org-ctrl-c-ctrl-c nil nil)


All the best,
Tom
On Jul 5, 2010, at 8:31 AM, Eric Schulte wrote:

> Hi,
>
> I've just merged a large set of Babel related security measures and
> layout/initialization updates into the master branch of the git
> repository.
>
> These changes will require existing babel users to update their
> configuration, see the following instructions for details -- even if  
> you
> think you've read similar instructions before these are worth reading.
> http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html
>
> From here on out Babel development in the master branch will settle  
> down
> along with the rest of the current Org-mode feature freeze.
>
> Thanks -- Eric
>
> please reply to this email with any question or problems you  
> encounter,
> a text export of the contents of the web page linked above is provided
> below.
>
> DONE document configuration changes for Babel integration
> ==========================================================
> Babel took the integration into Org-mode as an opportunity to do
> some much needed house cleaning.  Most importantly we have
> simplified the enabling of language support, and cleared out
> unnecessary configuration variables -- which is great unless you
> already have a working configuration under the old model.
>
> The most important changes regard the /location/ and /enabling/
> of Babel (both core functionality and language specific support).
>
> Babel: Babel is now part of the core of Org-mode, so it is
>     now loaded along with the rest of Org-mode.  That means that
>     there is /no configuration/ required to enable the main
>     Babel functionality.  For current users, this means that
>     statements like
>
>     (require 'org-babel)
>
>     or
>
>     (require 'org-babel-init)
>
>     that may by lying around in your configuration must now be
>     removed.
>
> load path: Babel (including all language specific files --
>     aside from those which are located in the =contrib/=
>     directory for reasons of licencing) now lives in the base of
>     the Org-mode lisp directory, so /no additional directories/
>     need to be added to your load path to use babel.  For Babel
>     users this means that statements adding babel-specific
>     directories to your load-path should now be removed from
>     your config.
>
> language support: It is no longer necessary to require
>     language specific support on a language-by-language basis.
>     Specific language support should now be managed through the
>     `org-babel-load-languages' variable.  This variable can be
>     customized using the Emacs customization interface, or
>     through the addition of something like the following to your
>     configuration (note: any language not mentioned will /not/
>     be enabled, aside from =emacs-lisp= which is enabled by
>     default)
>
>     (org-babel-do-load-languages
>      'org-babel-load-languages
>      '((R . t)
>        (ditaa . t)
>        (dot . t)
>        (emacs-lisp . t)
>        (gnuplot . t)
>        (haskell . nil)
>        (ocaml . nil)
>        (python . t)
>        (ruby . t)
>        (screen . nil)
>        (sh . t)
>        (sql . nil)
>        (sqlite . t)))
>
>     Despite this change it is still possible to add
>     language support through the use of =require=
>     statements, however to conform to Emacs file-name
>     regulations all Babel language files have changed
>     prefix from =org-babel-*= to =ob-*=, so the require
>     lines must also change e.g.
>
>     (require 'org-babel-R)
>
>     should be changed to
>
>     (require 'ob-R)
>
> We have eliminated the =org-babel-tangle-w-comments= variable as
> well as the two main internal lists of languages, namely
> - =org-babel-interpreters= and
> - =org-babel-tangle-langs=
>
> so any config lines which mention those variables, can/should be
> stripped out in their entirety.  This includes any calls to the
> =org-babl-add-interpreter= function, whose sole purpose was to
> add languages to the =org-babel-interpreters= variable.
>
> With those calls stripped out, we may still in some cases want to
> associate a file name extension with certain languages, for
> example we want all of our emacs-lisp files to end in a =.el=, we
> can do this will the =org-babel-tangle-lang-exts= variable.  In
> general you shouldn't need to touch this as it already has
> defaults for most common languages, and if a language is not
> present in org-babel-tangle-langs, then babel will just use the
> language name, so for example a file of =c= code will have a =.c=
> extension by default, shell-scripts (identified with =sh=) will
> have a =.sh= extension etc...
>
> The configuration of /shebang/ lines now lives in header
> arguments.  So the shebang for a single file can be set at the
> code block level, e.g.
>
>
>  #+begin_src clojure :shebang #!/usr/bin/env clj
>    (println "with a shebang line, I can be run as a script!")
>  #+end_src
>
> Note that whenever a file is tangled which includes a /shebang/
> line, Babel will make the file executable, so there is good
> reason to only add /shebangs/ at the source-code block level.
> However if you're sure that you want all of your code in some
> language (say shell scripts) to tangle out with shebang lines,
> then you can customize the default header arguments for that
> language, e.g.
>
>
>  ;; ensure this variable is defined defined
>  (unless (boundp 'org-babel-default-header-args:sh)
>    (setq org-babel-default-header-args:sh '()))
>
>  ;; add a default shebang header argument
>  (add-to-list 'org-babel-default-header-args:sh
>               '(:shebang . "#!/bin/bash"))
>
> The final important change included in this release is the
> addition of new security measures into Babel.  These measures are
> in place to protect users from the accidental or uninformed
> execution of code.  Along these lines /every/ execution of a code
> block will now require an explicit confirmation from the user.
> These confirmations can be stifled through customization of the
> `org-confirm-babel-evaluate' variable, e.g.
>
>  ;; I don't want to be prompted on every code block evaluation
>  (setq org-confirm-babel-evaluate nil)
>
> In addition, it is now possible to remove code block evaluation
> form the =C-c C-c= keybinding.  This can be done by setting the
> =org-babel-no-eval-on-ctrl-c-ctrl-c= variable to a non-nil value,
> e.g.
>
>  ;; I don't want to execute code blocks with C-c C-c
>  (setq org-babel-no-eval-on-ctrl-c-ctrl-c t)
>
> An additional keybinding has been added for code block
> evaluation, namely =C-c C-v e=.
>
> Whew! that seems like a lot of effort for a /simplification/ of
> configuration.
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Update Config] Babel changes -- security updates and final integration push
  2010-07-06  0:59 ` Thomas S. Dye
@ 2010-07-06  1:09   ` Eric Schulte
  2010-07-06  1:48     ` Thomas S. Dye
  2010-07-06  5:42     ` Carsten Dominik
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Schulte @ 2010-07-06  1:09 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org Mode

Hi Tom,

Thanks for finding this error, the problem is that org-table is not
being required before the source-code block is run.  As a temporary fix
you can put

  (require 'org-table)

somewhere in your configuration.

As a long term solution I would want to talk to Carsten about how best
to ensure that org-table is required when org-babel has been required as
I believe it may require some change in the org require tree.

Carsten, do you have any suggestion?  I've tried a couple of approaches
but most result in a recursive require error.

Thanks -- Eric

"Thomas S. Dye" <tsd@tsdye.com> writes:

> Hi Eric,
>
> Thanks for all your work integrating Babel into Org-mode.
>
> I've pulled the latest Org-mode and changed my initialization
> according to your message.  I also pulled the latest starter-kit, so I
> think I have all the latest code.
>
> When I try to evaluate this code block I get an error that orgtbl-to-
> orgtbl is void.
>
> #+begin_src emacs-lisp
>   (list 1 (+ 2 3))
> #+end_src
>
> Here is a backtrace:
>
> Debugger entered--Lisp error: (void-function orgtbl-to-orgtbl)
>   (orgtbl-to-orgtbl (if (or ... ...) result (list result)) (quote
> (:fmt ...)))
>   (concat (orgtbl-to-orgtbl (if ... result ...) (quote ...)) "\n")
>   (insert (concat (orgtbl-to-orgtbl ... ...) "\n"))
>   (cond ((not ...) (insert ...) (goto-char beg) (when ... ...))
> ((member "file" result-params) (insert result)) ((member "html"
> result- 
> params) (insert ...)) ((member "latex" result-params) (insert ...))
> ((member "code" result-params) (insert ...)) ((or ... ...) (save- 
> excursion ...) (if ... ...)) (t (org-babel-examplize-region
> ... ... results-switches)))
>   (let ((existing-result ...) (results-switches ...) beg end) (when
> existing-result (goto-char existing-result) (save-excursion ... ...)
> (forward-line 1) (setq beg ...) (cond ... ... ...)) (setq results- 
> switches (if results-switches ... "")) (cond (... ... ... ...)
> (... ...) (... ...) (... ...) (... ...) (... ... ...) (t ...)) (setq
> end (if ... ... ...)) (when (and indent ... ...) (indent-rigidly beg
> end indent)))
>   (save-excursion (let (... ... beg end) (when existing-
> result ... ... ... ... ...) (setq results-switches ...) (cond
> ... ... ... ... ... ... ...) (setq end ...) (when ... ...)))
>   (if (and result-params (member "silent" result-params)) (progn
> (message ...) result) (when (and ... ...) (setq result ...)) (save- 
> excursion (let ... ... ... ... ... ...)) (message "finished"))
>   (if (= (length result) 0) (if (member "value" result-params)
> (message "No result returned by source block") (message "Source block
> produced no output")) (if (and result-params ...) (progn ... result)
> (when ... ...) (save-excursion ...) (message "finished")))
>   org-babel-insert-result((1 5) ("replace") ("emacs-lisp" "(list 1 (+
> 2 3))\n" ((:cache . "no") (:colnames . "no") (:comments . "")
> (:exports . "code") (:hlines . "yes") (:noweb . "yes") (:results .
> "replace") (:session . "none") (:shebang . "") (:tangle . "")) "" nil
> nil 0) nil 0 "emacs-lisp")
>   (if (and (not arg) new-hash (equal new-hash old-hash)) (save-
> excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq
> result ...) (message ...) result) (setq result (funcall cmd body
> params)) (if (eq result-type ...) (setq result ...))
> (org-babel-insert- 
> result result result-params info new-hash indent lang) (run-hooks
> (quote org-babel-after-execute-hook)) result)
>   (progn (fset (quote call-process-region) (function* ...)) (unless
> (fboundp cmd) (error "No org-babel-execute function for %s!" lang))
> (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result)
> (setq result ...) (if ... ...) (org-babel-insert-result result result- 
> params info new-hash indent lang) (run-hooks ...) result))
>   (unwind-protect (progn (fset ... ...) (unless ... ...) (if ... ... ... ... ... ... result)) (if --cl-letf-bound-- (fset ... -- 
> cl-letf-save--) (fmakunbound ...)))
>   (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-
> protect (progn ... ... ...) (if --cl-letf-bound-- ... ...)))
>   (letf ((... ...)) (unless (fboundp cmd) (error "No org-babel-
> execute function for %s!" lang)) (if (and ... new-hash ...) (save-
> excursion ... ... ... ... ... result) (setq result ...) (if ... ...)
> (org-babel-insert-result result result-params info new-hash indent
> lang) (run-hooks ...) result))
>   (letf* ((... ...)) (unless (fboundp cmd) (error "No org-babel-
> execute function for %s!" lang)) (if (and ... new-hash ...) (save-
> excursion ... ... ... ... ... result) (setq result ...) (if ... ...)
> (org-babel-insert-result result result-params info new-hash indent
> lang) (run-hooks ...) result))
>   (flet ((call-process-region ... ...)) (unless (fboundp cmd) (error
> "No org-babel-execute function for %s!" lang)) (if (and ... new- 
> hash ...) (save-excursion ... ... ... ... ... result) (setq result
> ...) (if ... ...) (org-babel-insert-result result result-params  info
> new-hash indent lang) (run-hooks ...) result))
>   (unwind-protect (flet (...) (unless ... ...) (if
> ... ... ... ... ... ... result)) (setq call-process-region (quote
> org-babel-call-process-region-original)))
>   (let* ((info ...) (evaluation-confirmed ...) (lang ...) (params ...)
> (new-hash ...) (old-hash ...) (body ...) (result- 
> params ...) (result-type ...) (cmd ...) (dir ...) (default-
> directory ...) (org-babel-call-process-region-original ...) (indent
> ...) result) (unwind-protect (flet ... ... ...) (setq call- 
> process-region ...)))
>   org-babel-execute-src-block(nil ("emacs-lisp" "(list 1 (+ 2 3))
> \n" ((:cache . "no") (:colnames . "no") (:comments . "") (:exports
> . "code") (:hlines . "yes") (:noweb . "yes") (:results . "replace")
> (:session . "none") (:shebang . "") (:tangle . "")) "" nil nil 0))
>   (progn (org-babel-execute-src-block current-prefix-arg info) t)
>   (if info (progn (org-babel-execute-src-block current-prefix-arg
> info) t) nil)
>   (let ((info ...)) (if info (progn ... t) nil))
>   (if (not org-babel-no-eval-on-ctrl-c-ctrl-c) (let (...) (if info
> ... nil)) nil)
>   org-babel-execute-src-block-maybe()
>   run-hook-with-args-until-success(org-babel-execute-src-block-maybe)
>   (cond ((or ... org-occur-highlights org-latex-fragment-image-
> overlays) (and ... ...) (org-remove-occur-highlights) (org-remove-
> latex-fragment-image-overlays) (message "Temporary highlights/overlays
> removed from current buffer")) ((and ... ...) (funcall org-finish- 
> function)) ((run-hook-with-args-until-success ...)) ((or ... ...)
> (call-interactively ...)) ((org-on-target-p) (call-interactively ...))
> ((and ... ...) (call-interactively ...)) ((org-on-heading-p) (call- 
> interactively ...)) ((org-at-table\.el-p) (message "Use C-c ' to edit
> table.el tables")) ((org-at-table-p) (org-table-maybe-eval-formula)
> (if arg ... ...) (call-interactively ...)) ((or ... ...) (call- 
> interactively ...)) ((org-at-item-checkbox-p) (call-
> interactively ...)) ((org-at-item-p) (if arg ... ...)) ((save-
> excursion ... ...) (beginning-of-line 1) (save-excursion ...)) ((save-
> excursion ... ...) (cond ... ...)) ((org-clock-update-time-maybe)) (t
> (error "C-c C-c can do nothing useful at this location")))
>   (let ((org-enable-table-editor t)) (cond (... ... ... ... ...)
> (... ...) (...) (... ...) (... ...) (... ...) (... ...) (... ...)
> (... ... ... ...) (... ...) (... ...) (... ...) (... ... ...)
> (... ...) (...) (t ...)))
>   org-ctrl-c-ctrl-c(nil)
>   call-interactively(org-ctrl-c-ctrl-c nil nil)
>
>
> All the best,
> Tom
> On Jul 5, 2010, at 8:31 AM, Eric Schulte wrote:
>
>> Hi,
>>
>> I've just merged a large set of Babel related security measures and
>> layout/initialization updates into the master branch of the git
>> repository.
>>
>> These changes will require existing babel users to update their
>> configuration, see the following instructions for details -- even if
>> you
>> think you've read similar instructions before these are worth reading.
>> http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html
>>
>> From here on out Babel development in the master branch will settle
>> down
>> along with the rest of the current Org-mode feature freeze.
>>
>> Thanks -- Eric
>>
>> please reply to this email with any question or problems you
>> encounter,
>> a text export of the contents of the web page linked above is provided
>> below.
>>
>> DONE document configuration changes for Babel integration
>> ==========================================================
>> Babel took the integration into Org-mode as an opportunity to do
>> some much needed house cleaning.  Most importantly we have
>> simplified the enabling of language support, and cleared out
>> unnecessary configuration variables -- which is great unless you
>> already have a working configuration under the old model.
>>
>> The most important changes regard the /location/ and /enabling/
>> of Babel (both core functionality and language specific support).
>>
>> Babel: Babel is now part of the core of Org-mode, so it is
>>     now loaded along with the rest of Org-mode.  That means that
>>     there is /no configuration/ required to enable the main
>>     Babel functionality.  For current users, this means that
>>     statements like
>>
>>     (require 'org-babel)
>>
>>     or
>>
>>     (require 'org-babel-init)
>>
>>     that may by lying around in your configuration must now be
>>     removed.
>>
>> load path: Babel (including all language specific files --
>>     aside from those which are located in the =contrib/=
>>     directory for reasons of licencing) now lives in the base of
>>     the Org-mode lisp directory, so /no additional directories/
>>     need to be added to your load path to use babel.  For Babel
>>     users this means that statements adding babel-specific
>>     directories to your load-path should now be removed from
>>     your config.
>>
>> language support: It is no longer necessary to require
>>     language specific support on a language-by-language basis.
>>     Specific language support should now be managed through the
>>     `org-babel-load-languages' variable.  This variable can be
>>     customized using the Emacs customization interface, or
>>     through the addition of something like the following to your
>>     configuration (note: any language not mentioned will /not/
>>     be enabled, aside from =emacs-lisp= which is enabled by
>>     default)
>>
>>     (org-babel-do-load-languages
>>      'org-babel-load-languages
>>      '((R . t)
>>        (ditaa . t)
>>        (dot . t)
>>        (emacs-lisp . t)
>>        (gnuplot . t)
>>        (haskell . nil)
>>        (ocaml . nil)
>>        (python . t)
>>        (ruby . t)
>>        (screen . nil)
>>        (sh . t)
>>        (sql . nil)
>>        (sqlite . t)))
>>
>>     Despite this change it is still possible to add
>>     language support through the use of =require=
>>     statements, however to conform to Emacs file-name
>>     regulations all Babel language files have changed
>>     prefix from =org-babel-*= to =ob-*=, so the require
>>     lines must also change e.g.
>>
>>     (require 'org-babel-R)
>>
>>     should be changed to
>>
>>     (require 'ob-R)
>>
>> We have eliminated the =org-babel-tangle-w-comments= variable as
>> well as the two main internal lists of languages, namely
>> - =org-babel-interpreters= and
>> - =org-babel-tangle-langs=
>>
>> so any config lines which mention those variables, can/should be
>> stripped out in their entirety.  This includes any calls to the
>> =org-babl-add-interpreter= function, whose sole purpose was to
>> add languages to the =org-babel-interpreters= variable.
>>
>> With those calls stripped out, we may still in some cases want to
>> associate a file name extension with certain languages, for
>> example we want all of our emacs-lisp files to end in a =.el=, we
>> can do this will the =org-babel-tangle-lang-exts= variable.  In
>> general you shouldn't need to touch this as it already has
>> defaults for most common languages, and if a language is not
>> present in org-babel-tangle-langs, then babel will just use the
>> language name, so for example a file of =c= code will have a =.c=
>> extension by default, shell-scripts (identified with =sh=) will
>> have a =.sh= extension etc...
>>
>> The configuration of /shebang/ lines now lives in header
>> arguments.  So the shebang for a single file can be set at the
>> code block level, e.g.
>>
>>
>>  #+begin_src clojure :shebang #!/usr/bin/env clj
>>    (println "with a shebang line, I can be run as a script!")
>>  #+end_src
>>
>> Note that whenever a file is tangled which includes a /shebang/
>> line, Babel will make the file executable, so there is good
>> reason to only add /shebangs/ at the source-code block level.
>> However if you're sure that you want all of your code in some
>> language (say shell scripts) to tangle out with shebang lines,
>> then you can customize the default header arguments for that
>> language, e.g.
>>
>>
>>  ;; ensure this variable is defined defined
>>  (unless (boundp 'org-babel-default-header-args:sh)
>>    (setq org-babel-default-header-args:sh '()))
>>
>>  ;; add a default shebang header argument
>>  (add-to-list 'org-babel-default-header-args:sh
>>               '(:shebang . "#!/bin/bash"))
>>
>> The final important change included in this release is the
>> addition of new security measures into Babel.  These measures are
>> in place to protect users from the accidental or uninformed
>> execution of code.  Along these lines /every/ execution of a code
>> block will now require an explicit confirmation from the user.
>> These confirmations can be stifled through customization of the
>> `org-confirm-babel-evaluate' variable, e.g.
>>
>>  ;; I don't want to be prompted on every code block evaluation
>>  (setq org-confirm-babel-evaluate nil)
>>
>> In addition, it is now possible to remove code block evaluation
>> form the =C-c C-c= keybinding.  This can be done by setting the
>> =org-babel-no-eval-on-ctrl-c-ctrl-c= variable to a non-nil value,
>> e.g.
>>
>>  ;; I don't want to execute code blocks with C-c C-c
>>  (setq org-babel-no-eval-on-ctrl-c-ctrl-c t)
>>
>> An additional keybinding has been added for code block
>> evaluation, namely =C-c C-v e=.
>>
>> Whew! that seems like a lot of effort for a /simplification/ of
>> configuration.
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Update Config] Babel changes -- security updates and final integration push
  2010-07-06  1:09   ` Eric Schulte
@ 2010-07-06  1:48     ` Thomas S. Dye
  2010-07-06  5:42     ` Carsten Dominik
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas S. Dye @ 2010-07-06  1:48 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode

Thanks Eric,

That works.

Tom
On Jul 5, 2010, at 3:09 PM, Eric Schulte wrote:

> Hi Tom,
>
> Thanks for finding this error, the problem is that org-table is not
> being required before the source-code block is run.  As a temporary  
> fix
> you can put
>
>  (require 'org-table)
>
> somewhere in your configuration.
>
> As a long term solution I would want to talk to Carsten about how best
> to ensure that org-table is required when org-babel has been  
> required as
> I believe it may require some change in the org require tree.
>
> Carsten, do you have any suggestion?  I've tried a couple of  
> approaches
> but most result in a recursive require error.
>
> Thanks -- Eric
>
> "Thomas S. Dye" <tsd@tsdye.com> writes:
>
>> Hi Eric,
>>
>> Thanks for all your work integrating Babel into Org-mode.
>>
>> I've pulled the latest Org-mode and changed my initialization
>> according to your message.  I also pulled the latest starter-kit,  
>> so I
>> think I have all the latest code.
>>
>> When I try to evaluate this code block I get an error that orgtbl-to-
>> orgtbl is void.
>>
>> #+begin_src emacs-lisp
>>  (list 1 (+ 2 3))
>> #+end_src
>>
>> Here is a backtrace:
>>
>> Debugger entered--Lisp error: (void-function orgtbl-to-orgtbl)
>>  (orgtbl-to-orgtbl (if (or ... ...) result (list result)) (quote
>> (:fmt ...)))
>>  (concat (orgtbl-to-orgtbl (if ... result ...) (quote ...)) "\n")
>>  (insert (concat (orgtbl-to-orgtbl ... ...) "\n"))
>>  (cond ((not ...) (insert ...) (goto-char beg) (when ... ...))
>> ((member "file" result-params) (insert result)) ((member "html"
>> result-
>> params) (insert ...)) ((member "latex" result-params) (insert ...))
>> ((member "code" result-params) (insert ...)) ((or ... ...) (save-
>> excursion ...) (if ... ...)) (t (org-babel-examplize-region
>> ... ... results-switches)))
>>  (let ((existing-result ...) (results-switches ...) beg end) (when
>> existing-result (goto-char existing-result) (save-excursion ... ...)
>> (forward-line 1) (setq beg ...) (cond ... ... ...)) (setq results-
>> switches (if results-switches ... "")) (cond (... ... ... ...)
>> (... ...) (... ...) (... ...) (... ...) (... ... ...) (t ...)) (setq
>> end (if ... ... ...)) (when (and indent ... ...) (indent-rigidly beg
>> end indent)))
>>  (save-excursion (let (... ... beg end) (when existing-
>> result ... ... ... ... ...) (setq results-switches ...) (cond
>> ... ... ... ... ... ... ...) (setq end ...) (when ... ...)))
>>  (if (and result-params (member "silent" result-params)) (progn
>> (message ...) result) (when (and ... ...) (setq result ...)) (save-
>> excursion (let ... ... ... ... ... ...)) (message "finished"))
>>  (if (= (length result) 0) (if (member "value" result-params)
>> (message "No result returned by source block") (message "Source block
>> produced no output")) (if (and result-params ...) (progn ... result)
>> (when ... ...) (save-excursion ...) (message "finished")))
>>  org-babel-insert-result((1 5) ("replace") ("emacs-lisp" "(list 1 (+
>> 2 3))\n" ((:cache . "no") (:colnames . "no") (:comments . "")
>> (:exports . "code") (:hlines . "yes") (:noweb . "yes") (:results .
>> "replace") (:session . "none") (:shebang . "") (:tangle . "")) "" nil
>> nil 0) nil 0 "emacs-lisp")
>>  (if (and (not arg) new-hash (equal new-hash old-hash)) (save-
>> excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq
>> result ...) (message ...) result) (setq result (funcall cmd body
>> params)) (if (eq result-type ...) (setq result ...))
>> (org-babel-insert-
>> result result result-params info new-hash indent lang) (run-hooks
>> (quote org-babel-after-execute-hook)) result)
>>  (progn (fset (quote call-process-region) (function* ...)) (unless
>> (fboundp cmd) (error "No org-babel-execute function for %s!" lang))
>> (if (and ... new-hash ...) (save-excursion ... ... ... ... ...  
>> result)
>> (setq result ...) (if ... ...) (org-babel-insert-result result  
>> result-
>> params info new-hash indent lang) (run-hooks ...) result))
>>  (unwind-protect (progn (fset ... ...) (unless ... ...)  
>> (if ... ... ... ... ... ... result)) (if --cl-letf-bound--  
>> (fset ... --
>> cl-letf-save--) (fmakunbound ...)))
>>  (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-
>> protect (progn ... ... ...) (if --cl-letf-bound-- ... ...)))
>>  (letf ((... ...)) (unless (fboundp cmd) (error "No org-babel-
>> execute function for %s!" lang)) (if (and ... new-hash ...) (save-
>> excursion ... ... ... ... ... result) (setq result ...) (if ... ...)
>> (org-babel-insert-result result result-params info new-hash indent
>> lang) (run-hooks ...) result))
>>  (letf* ((... ...)) (unless (fboundp cmd) (error "No org-babel-
>> execute function for %s!" lang)) (if (and ... new-hash ...) (save-
>> excursion ... ... ... ... ... result) (setq result ...) (if ... ...)
>> (org-babel-insert-result result result-params info new-hash indent
>> lang) (run-hooks ...) result))
>>  (flet ((call-process-region ... ...)) (unless (fboundp cmd) (error
>> "No org-babel-execute function for %s!" lang)) (if (and ... new-
>> hash ...) (save-excursion ... ... ... ... ... result) (setq result
>> ...) (if ... ...) (org-babel-insert-result result result-params  info
>> new-hash indent lang) (run-hooks ...) result))
>>  (unwind-protect (flet (...) (unless ... ...) (if
>> ... ... ... ... ... ... result)) (setq call-process-region (quote
>> org-babel-call-process-region-original)))
>>  (let* ((info ...) (evaluation-confirmed ...) (lang ...) (params ...)
>> (new-hash ...) (old-hash ...) (body ...) (result-
>> params ...) (result-type ...) (cmd ...) (dir ...) (default-
>> directory ...) (org-babel-call-process-region-original ...) (indent
>> ...) result) (unwind-protect (flet ... ... ...) (setq call-
>> process-region ...)))
>>  org-babel-execute-src-block(nil ("emacs-lisp" "(list 1 (+ 2 3))
>> \n" ((:cache . "no") (:colnames . "no") (:comments . "") (:exports
>> . "code") (:hlines . "yes") (:noweb . "yes") (:results . "replace")
>> (:session . "none") (:shebang . "") (:tangle . "")) "" nil nil 0))
>>  (progn (org-babel-execute-src-block current-prefix-arg info) t)
>>  (if info (progn (org-babel-execute-src-block current-prefix-arg
>> info) t) nil)
>>  (let ((info ...)) (if info (progn ... t) nil))
>>  (if (not org-babel-no-eval-on-ctrl-c-ctrl-c) (let (...) (if info
>> ... nil)) nil)
>>  org-babel-execute-src-block-maybe()
>>  run-hook-with-args-until-success(org-babel-execute-src-block-maybe)
>>  (cond ((or ... org-occur-highlights org-latex-fragment-image-
>> overlays) (and ... ...) (org-remove-occur-highlights) (org-remove-
>> latex-fragment-image-overlays) (message "Temporary highlights/ 
>> overlays
>> removed from current buffer")) ((and ... ...) (funcall org-finish-
>> function)) ((run-hook-with-args-until-success ...)) ((or ... ...)
>> (call-interactively ...)) ((org-on-target-p) (call- 
>> interactively ...))
>> ((and ... ...) (call-interactively ...)) ((org-on-heading-p) (call-
>> interactively ...)) ((org-at-table\.el-p) (message "Use C-c ' to edit
>> table.el tables")) ((org-at-table-p) (org-table-maybe-eval-formula)
>> (if arg ... ...) (call-interactively ...)) ((or ... ...) (call-
>> interactively ...)) ((org-at-item-checkbox-p) (call-
>> interactively ...)) ((org-at-item-p) (if arg ... ...)) ((save-
>> excursion ... ...) (beginning-of-line 1) (save-excursion ...))  
>> ((save-
>> excursion ... ...) (cond ... ...)) ((org-clock-update-time-maybe)) (t
>> (error "C-c C-c can do nothing useful at this location")))
>>  (let ((org-enable-table-editor t)) (cond (... ... ... ... ...)
>> (... ...) (...) (... ...) (... ...) (... ...) (... ...) (... ...)
>> (... ... ... ...) (... ...) (... ...) (... ...) (... ... ...)
>> (... ...) (...) (t ...)))
>>  org-ctrl-c-ctrl-c(nil)
>>  call-interactively(org-ctrl-c-ctrl-c nil nil)
>>
>>
>> All the best,
>> Tom
>> On Jul 5, 2010, at 8:31 AM, Eric Schulte wrote:
>>
>>> Hi,
>>>
>>> I've just merged a large set of Babel related security measures and
>>> layout/initialization updates into the master branch of the git
>>> repository.
>>>
>>> These changes will require existing babel users to update their
>>> configuration, see the following instructions for details -- even if
>>> you
>>> think you've read similar instructions before these are worth  
>>> reading.
>>> http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html
>>>
>>> From here on out Babel development in the master branch will settle
>>> down
>>> along with the rest of the current Org-mode feature freeze.
>>>
>>> Thanks -- Eric
>>>
>>> please reply to this email with any question or problems you
>>> encounter,
>>> a text export of the contents of the web page linked above is  
>>> provided
>>> below.
>>>
>>> DONE document configuration changes for Babel integration
>>> ==========================================================
>>> Babel took the integration into Org-mode as an opportunity to do
>>> some much needed house cleaning.  Most importantly we have
>>> simplified the enabling of language support, and cleared out
>>> unnecessary configuration variables -- which is great unless you
>>> already have a working configuration under the old model.
>>>
>>> The most important changes regard the /location/ and /enabling/
>>> of Babel (both core functionality and language specific support).
>>>
>>> Babel: Babel is now part of the core of Org-mode, so it is
>>>    now loaded along with the rest of Org-mode.  That means that
>>>    there is /no configuration/ required to enable the main
>>>    Babel functionality.  For current users, this means that
>>>    statements like
>>>
>>>    (require 'org-babel)
>>>
>>>    or
>>>
>>>    (require 'org-babel-init)
>>>
>>>    that may by lying around in your configuration must now be
>>>    removed.
>>>
>>> load path: Babel (including all language specific files --
>>>    aside from those which are located in the =contrib/=
>>>    directory for reasons of licencing) now lives in the base of
>>>    the Org-mode lisp directory, so /no additional directories/
>>>    need to be added to your load path to use babel.  For Babel
>>>    users this means that statements adding babel-specific
>>>    directories to your load-path should now be removed from
>>>    your config.
>>>
>>> language support: It is no longer necessary to require
>>>    language specific support on a language-by-language basis.
>>>    Specific language support should now be managed through the
>>>    `org-babel-load-languages' variable.  This variable can be
>>>    customized using the Emacs customization interface, or
>>>    through the addition of something like the following to your
>>>    configuration (note: any language not mentioned will /not/
>>>    be enabled, aside from =emacs-lisp= which is enabled by
>>>    default)
>>>
>>>    (org-babel-do-load-languages
>>>     'org-babel-load-languages
>>>     '((R . t)
>>>       (ditaa . t)
>>>       (dot . t)
>>>       (emacs-lisp . t)
>>>       (gnuplot . t)
>>>       (haskell . nil)
>>>       (ocaml . nil)
>>>       (python . t)
>>>       (ruby . t)
>>>       (screen . nil)
>>>       (sh . t)
>>>       (sql . nil)
>>>       (sqlite . t)))
>>>
>>>    Despite this change it is still possible to add
>>>    language support through the use of =require=
>>>    statements, however to conform to Emacs file-name
>>>    regulations all Babel language files have changed
>>>    prefix from =org-babel-*= to =ob-*=, so the require
>>>    lines must also change e.g.
>>>
>>>    (require 'org-babel-R)
>>>
>>>    should be changed to
>>>
>>>    (require 'ob-R)
>>>
>>> We have eliminated the =org-babel-tangle-w-comments= variable as
>>> well as the two main internal lists of languages, namely
>>> - =org-babel-interpreters= and
>>> - =org-babel-tangle-langs=
>>>
>>> so any config lines which mention those variables, can/should be
>>> stripped out in their entirety.  This includes any calls to the
>>> =org-babl-add-interpreter= function, whose sole purpose was to
>>> add languages to the =org-babel-interpreters= variable.
>>>
>>> With those calls stripped out, we may still in some cases want to
>>> associate a file name extension with certain languages, for
>>> example we want all of our emacs-lisp files to end in a =.el=, we
>>> can do this will the =org-babel-tangle-lang-exts= variable.  In
>>> general you shouldn't need to touch this as it already has
>>> defaults for most common languages, and if a language is not
>>> present in org-babel-tangle-langs, then babel will just use the
>>> language name, so for example a file of =c= code will have a =.c=
>>> extension by default, shell-scripts (identified with =sh=) will
>>> have a =.sh= extension etc...
>>>
>>> The configuration of /shebang/ lines now lives in header
>>> arguments.  So the shebang for a single file can be set at the
>>> code block level, e.g.
>>>
>>>
>>> #+begin_src clojure :shebang #!/usr/bin/env clj
>>>   (println "with a shebang line, I can be run as a script!")
>>> #+end_src
>>>
>>> Note that whenever a file is tangled which includes a /shebang/
>>> line, Babel will make the file executable, so there is good
>>> reason to only add /shebangs/ at the source-code block level.
>>> However if you're sure that you want all of your code in some
>>> language (say shell scripts) to tangle out with shebang lines,
>>> then you can customize the default header arguments for that
>>> language, e.g.
>>>
>>>
>>> ;; ensure this variable is defined defined
>>> (unless (boundp 'org-babel-default-header-args:sh)
>>>   (setq org-babel-default-header-args:sh '()))
>>>
>>> ;; add a default shebang header argument
>>> (add-to-list 'org-babel-default-header-args:sh
>>>              '(:shebang . "#!/bin/bash"))
>>>
>>> The final important change included in this release is the
>>> addition of new security measures into Babel.  These measures are
>>> in place to protect users from the accidental or uninformed
>>> execution of code.  Along these lines /every/ execution of a code
>>> block will now require an explicit confirmation from the user.
>>> These confirmations can be stifled through customization of the
>>> `org-confirm-babel-evaluate' variable, e.g.
>>>
>>> ;; I don't want to be prompted on every code block evaluation
>>> (setq org-confirm-babel-evaluate nil)
>>>
>>> In addition, it is now possible to remove code block evaluation
>>> form the =C-c C-c= keybinding.  This can be done by setting the
>>> =org-babel-no-eval-on-ctrl-c-ctrl-c= variable to a non-nil value,
>>> e.g.
>>>
>>> ;; I don't want to execute code blocks with C-c C-c
>>> (setq org-babel-no-eval-on-ctrl-c-ctrl-c t)
>>>
>>> An additional keybinding has been added for code block
>>> evaluation, namely =C-c C-v e=.
>>>
>>> Whew! that seems like a lot of effort for a /simplification/ of
>>> configuration.
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Please use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Update Config] Babel changes -- security updates and final integration push
  2010-07-06  1:09   ` Eric Schulte
  2010-07-06  1:48     ` Thomas S. Dye
@ 2010-07-06  5:42     ` Carsten Dominik
  1 sibling, 0 replies; 8+ messages in thread
From: Carsten Dominik @ 2010-07-06  5:42 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode

Hi Eric,

On Jul 6, 2010, at 3:09 AM, Eric Schulte wrote:

> Hi Tom,
>
> Thanks for finding this error, the problem is that org-table is not
> being required before the source-code block is run.  As a temporary  
> fix
> you can put
>
>  (require 'org-table)
>
> somewhere in your configuration.
>
> As a long term solution I would want to talk to Carsten about how best
> to ensure that org-table is required when org-babel has been  
> required as
> I believe it may require some change in the org require tree.
>
> Carsten, do you have any suggestion?  I've tried a couple of  
> approaches
> but most result in a recursive require error.

You are using only a few entry points from org-table, and I have
just added these to the autoloads.  This fixes the current issue.

The require tree of Org could be better, but this is too complex
an issue for the moment.

- Carsten

>
> Thanks -- Eric
>
> "Thomas S. Dye" <tsd@tsdye.com> writes:
>
>> Hi Eric,
>>
>> Thanks for all your work integrating Babel into Org-mode.
>>
>> I've pulled the latest Org-mode and changed my initialization
>> according to your message.  I also pulled the latest starter-kit,  
>> so I
>> think I have all the latest code.
>>
>> When I try to evaluate this code block I get an error that orgtbl-to-
>> orgtbl is void.
>>
>> #+begin_src emacs-lisp
>>  (list 1 (+ 2 3))
>> #+end_src
>>
>> Here is a backtrace:
>>
>> Debugger entered--Lisp error: (void-function orgtbl-to-orgtbl)
>>  (orgtbl-to-orgtbl (if (or ... ...) result (list result)) (quote
>> (:fmt ...)))
>>  (concat (orgtbl-to-orgtbl (if ... result ...) (quote ...)) "\n")
>>  (insert (concat (orgtbl-to-orgtbl ... ...) "\n"))
>>  (cond ((not ...) (insert ...) (goto-char beg) (when ... ...))
>> ((member "file" result-params) (insert result)) ((member "html"
>> result-
>> params) (insert ...)) ((member "latex" result-params) (insert ...))
>> ((member "code" result-params) (insert ...)) ((or ... ...) (save-
>> excursion ...) (if ... ...)) (t (org-babel-examplize-region
>> ... ... results-switches)))
>>  (let ((existing-result ...) (results-switches ...) beg end) (when
>> existing-result (goto-char existing-result) (save-excursion ... ...)
>> (forward-line 1) (setq beg ...) (cond ... ... ...)) (setq results-
>> switches (if results-switches ... "")) (cond (... ... ... ...)
>> (... ...) (... ...) (... ...) (... ...) (... ... ...) (t ...)) (setq
>> end (if ... ... ...)) (when (and indent ... ...) (indent-rigidly beg
>> end indent)))
>>  (save-excursion (let (... ... beg end) (when existing-
>> result ... ... ... ... ...) (setq results-switches ...) (cond
>> ... ... ... ... ... ... ...) (setq end ...) (when ... ...)))
>>  (if (and result-params (member "silent" result-params)) (progn
>> (message ...) result) (when (and ... ...) (setq result ...)) (save-
>> excursion (let ... ... ... ... ... ...)) (message "finished"))
>>  (if (= (length result) 0) (if (member "value" result-params)
>> (message "No result returned by source block") (message "Source block
>> produced no output")) (if (and result-params ...) (progn ... result)
>> (when ... ...) (save-excursion ...) (message "finished")))
>>  org-babel-insert-result((1 5) ("replace") ("emacs-lisp" "(list 1 (+
>> 2 3))\n" ((:cache . "no") (:colnames . "no") (:comments . "")
>> (:exports . "code") (:hlines . "yes") (:noweb . "yes") (:results .
>> "replace") (:session . "none") (:shebang . "") (:tangle . "")) "" nil
>> nil 0) nil 0 "emacs-lisp")
>>  (if (and (not arg) new-hash (equal new-hash old-hash)) (save-
>> excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq
>> result ...) (message ...) result) (setq result (funcall cmd body
>> params)) (if (eq result-type ...) (setq result ...))
>> (org-babel-insert-
>> result result result-params info new-hash indent lang) (run-hooks
>> (quote org-babel-after-execute-hook)) result)
>>  (progn (fset (quote call-process-region) (function* ...)) (unless
>> (fboundp cmd) (error "No org-babel-execute function for %s!" lang))
>> (if (and ... new-hash ...) (save-excursion ... ... ... ... ...  
>> result)
>> (setq result ...) (if ... ...) (org-babel-insert-result result  
>> result-
>> params info new-hash indent lang) (run-hooks ...) result))
>>  (unwind-protect (progn (fset ... ...) (unless ... ...)  
>> (if ... ... ... ... ... ... result)) (if --cl-letf-bound--  
>> (fset ... --
>> cl-letf-save--) (fmakunbound ...)))
>>  (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-
>> protect (progn ... ... ...) (if --cl-letf-bound-- ... ...)))
>>  (letf ((... ...)) (unless (fboundp cmd) (error "No org-babel-
>> execute function for %s!" lang)) (if (and ... new-hash ...) (save-
>> excursion ... ... ... ... ... result) (setq result ...) (if ... ...)
>> (org-babel-insert-result result result-params info new-hash indent
>> lang) (run-hooks ...) result))
>>  (letf* ((... ...)) (unless (fboundp cmd) (error "No org-babel-
>> execute function for %s!" lang)) (if (and ... new-hash ...) (save-
>> excursion ... ... ... ... ... result) (setq result ...) (if ... ...)
>> (org-babel-insert-result result result-params info new-hash indent
>> lang) (run-hooks ...) result))
>>  (flet ((call-process-region ... ...)) (unless (fboundp cmd) (error
>> "No org-babel-execute function for %s!" lang)) (if (and ... new-
>> hash ...) (save-excursion ... ... ... ... ... result) (setq result
>> ...) (if ... ...) (org-babel-insert-result result result-params  info
>> new-hash indent lang) (run-hooks ...) result))
>>  (unwind-protect (flet (...) (unless ... ...) (if
>> ... ... ... ... ... ... result)) (setq call-process-region (quote
>> org-babel-call-process-region-original)))
>>  (let* ((info ...) (evaluation-confirmed ...) (lang ...) (params ...)
>> (new-hash ...) (old-hash ...) (body ...) (result-
>> params ...) (result-type ...) (cmd ...) (dir ...) (default-
>> directory ...) (org-babel-call-process-region-original ...) (indent
>> ...) result) (unwind-protect (flet ... ... ...) (setq call-
>> process-region ...)))
>>  org-babel-execute-src-block(nil ("emacs-lisp" "(list 1 (+ 2 3))
>> \n" ((:cache . "no") (:colnames . "no") (:comments . "") (:exports
>> . "code") (:hlines . "yes") (:noweb . "yes") (:results . "replace")
>> (:session . "none") (:shebang . "") (:tangle . "")) "" nil nil 0))
>>  (progn (org-babel-execute-src-block current-prefix-arg info) t)
>>  (if info (progn (org-babel-execute-src-block current-prefix-arg
>> info) t) nil)
>>  (let ((info ...)) (if info (progn ... t) nil))
>>  (if (not org-babel-no-eval-on-ctrl-c-ctrl-c) (let (...) (if info
>> ... nil)) nil)
>>  org-babel-execute-src-block-maybe()
>>  run-hook-with-args-until-success(org-babel-execute-src-block-maybe)
>>  (cond ((or ... org-occur-highlights org-latex-fragment-image-
>> overlays) (and ... ...) (org-remove-occur-highlights) (org-remove-
>> latex-fragment-image-overlays) (message "Temporary highlights/ 
>> overlays
>> removed from current buffer")) ((and ... ...) (funcall org-finish-
>> function)) ((run-hook-with-args-until-success ...)) ((or ... ...)
>> (call-interactively ...)) ((org-on-target-p) (call- 
>> interactively ...))
>> ((and ... ...) (call-interactively ...)) ((org-on-heading-p) (call-
>> interactively ...)) ((org-at-table\.el-p) (message "Use C-c ' to edit
>> table.el tables")) ((org-at-table-p) (org-table-maybe-eval-formula)
>> (if arg ... ...) (call-interactively ...)) ((or ... ...) (call-
>> interactively ...)) ((org-at-item-checkbox-p) (call-
>> interactively ...)) ((org-at-item-p) (if arg ... ...)) ((save-
>> excursion ... ...) (beginning-of-line 1) (save-excursion ...))  
>> ((save-
>> excursion ... ...) (cond ... ...)) ((org-clock-update-time-maybe)) (t
>> (error "C-c C-c can do nothing useful at this location")))
>>  (let ((org-enable-table-editor t)) (cond (... ... ... ... ...)
>> (... ...) (...) (... ...) (... ...) (... ...) (... ...) (... ...)
>> (... ... ... ...) (... ...) (... ...) (... ...) (... ... ...)
>> (... ...) (...) (t ...)))
>>  org-ctrl-c-ctrl-c(nil)
>>  call-interactively(org-ctrl-c-ctrl-c nil nil)
>>
>>
>> All the best,
>> Tom
>> On Jul 5, 2010, at 8:31 AM, Eric Schulte wrote:
>>
>>> Hi,
>>>
>>> I've just merged a large set of Babel related security measures and
>>> layout/initialization updates into the master branch of the git
>>> repository.
>>>
>>> These changes will require existing babel users to update their
>>> configuration, see the following instructions for details -- even if
>>> you
>>> think you've read similar instructions before these are worth  
>>> reading.
>>> http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html
>>>
>>> From here on out Babel development in the master branch will settle
>>> down
>>> along with the rest of the current Org-mode feature freeze.
>>>
>>> Thanks -- Eric
>>>
>>> please reply to this email with any question or problems you
>>> encounter,
>>> a text export of the contents of the web page linked above is  
>>> provided
>>> below.
>>>
>>> DONE document configuration changes for Babel integration
>>> ==========================================================
>>> Babel took the integration into Org-mode as an opportunity to do
>>> some much needed house cleaning.  Most importantly we have
>>> simplified the enabling of language support, and cleared out
>>> unnecessary configuration variables -- which is great unless you
>>> already have a working configuration under the old model.
>>>
>>> The most important changes regard the /location/ and /enabling/
>>> of Babel (both core functionality and language specific support).
>>>
>>> Babel: Babel is now part of the core of Org-mode, so it is
>>>    now loaded along with the rest of Org-mode.  That means that
>>>    there is /no configuration/ required to enable the main
>>>    Babel functionality.  For current users, this means that
>>>    statements like
>>>
>>>    (require 'org-babel)
>>>
>>>    or
>>>
>>>    (require 'org-babel-init)
>>>
>>>    that may by lying around in your configuration must now be
>>>    removed.
>>>
>>> load path: Babel (including all language specific files --
>>>    aside from those which are located in the =contrib/=
>>>    directory for reasons of licencing) now lives in the base of
>>>    the Org-mode lisp directory, so /no additional directories/
>>>    need to be added to your load path to use babel.  For Babel
>>>    users this means that statements adding babel-specific
>>>    directories to your load-path should now be removed from
>>>    your config.
>>>
>>> language support: It is no longer necessary to require
>>>    language specific support on a language-by-language basis.
>>>    Specific language support should now be managed through the
>>>    `org-babel-load-languages' variable.  This variable can be
>>>    customized using the Emacs customization interface, or
>>>    through the addition of something like the following to your
>>>    configuration (note: any language not mentioned will /not/
>>>    be enabled, aside from =emacs-lisp= which is enabled by
>>>    default)
>>>
>>>    (org-babel-do-load-languages
>>>     'org-babel-load-languages
>>>     '((R . t)
>>>       (ditaa . t)
>>>       (dot . t)
>>>       (emacs-lisp . t)
>>>       (gnuplot . t)
>>>       (haskell . nil)
>>>       (ocaml . nil)
>>>       (python . t)
>>>       (ruby . t)
>>>       (screen . nil)
>>>       (sh . t)
>>>       (sql . nil)
>>>       (sqlite . t)))
>>>
>>>    Despite this change it is still possible to add
>>>    language support through the use of =require=
>>>    statements, however to conform to Emacs file-name
>>>    regulations all Babel language files have changed
>>>    prefix from =org-babel-*= to =ob-*=, so the require
>>>    lines must also change e.g.
>>>
>>>    (require 'org-babel-R)
>>>
>>>    should be changed to
>>>
>>>    (require 'ob-R)
>>>
>>> We have eliminated the =org-babel-tangle-w-comments= variable as
>>> well as the two main internal lists of languages, namely
>>> - =org-babel-interpreters= and
>>> - =org-babel-tangle-langs=
>>>
>>> so any config lines which mention those variables, can/should be
>>> stripped out in their entirety.  This includes any calls to the
>>> =org-babl-add-interpreter= function, whose sole purpose was to
>>> add languages to the =org-babel-interpreters= variable.
>>>
>>> With those calls stripped out, we may still in some cases want to
>>> associate a file name extension with certain languages, for
>>> example we want all of our emacs-lisp files to end in a =.el=, we
>>> can do this will the =org-babel-tangle-lang-exts= variable.  In
>>> general you shouldn't need to touch this as it already has
>>> defaults for most common languages, and if a language is not
>>> present in org-babel-tangle-langs, then babel will just use the
>>> language name, so for example a file of =c= code will have a =.c=
>>> extension by default, shell-scripts (identified with =sh=) will
>>> have a =.sh= extension etc...
>>>
>>> The configuration of /shebang/ lines now lives in header
>>> arguments.  So the shebang for a single file can be set at the
>>> code block level, e.g.
>>>
>>>
>>> #+begin_src clojure :shebang #!/usr/bin/env clj
>>>   (println "with a shebang line, I can be run as a script!")
>>> #+end_src
>>>
>>> Note that whenever a file is tangled which includes a /shebang/
>>> line, Babel will make the file executable, so there is good
>>> reason to only add /shebangs/ at the source-code block level.
>>> However if you're sure that you want all of your code in some
>>> language (say shell scripts) to tangle out with shebang lines,
>>> then you can customize the default header arguments for that
>>> language, e.g.
>>>
>>>
>>> ;; ensure this variable is defined defined
>>> (unless (boundp 'org-babel-default-header-args:sh)
>>>   (setq org-babel-default-header-args:sh '()))
>>>
>>> ;; add a default shebang header argument
>>> (add-to-list 'org-babel-default-header-args:sh
>>>              '(:shebang . "#!/bin/bash"))
>>>
>>> The final important change included in this release is the
>>> addition of new security measures into Babel.  These measures are
>>> in place to protect users from the accidental or uninformed
>>> execution of code.  Along these lines /every/ execution of a code
>>> block will now require an explicit confirmation from the user.
>>> These confirmations can be stifled through customization of the
>>> `org-confirm-babel-evaluate' variable, e.g.
>>>
>>> ;; I don't want to be prompted on every code block evaluation
>>> (setq org-confirm-babel-evaluate nil)
>>>
>>> In addition, it is now possible to remove code block evaluation
>>> form the =C-c C-c= keybinding.  This can be done by setting the
>>> =org-babel-no-eval-on-ctrl-c-ctrl-c= variable to a non-nil value,
>>> e.g.
>>>
>>> ;; I don't want to execute code blocks with C-c C-c
>>> (setq org-babel-no-eval-on-ctrl-c-ctrl-c t)
>>>
>>> An additional keybinding has been added for code block
>>> evaluation, namely =C-c C-v e=.
>>>
>>> Whew! that seems like a lot of effort for a /simplification/ of
>>> configuration.
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Please use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Update Config] Babel changes -- security updates and final integration push
  2010-07-05 18:31 [Update Config] Babel changes -- security updates and final integration push Eric Schulte
  2010-07-06  0:59 ` Thomas S. Dye
@ 2010-07-07  2:03 ` Bernt Hansen
  2010-07-07  2:54   ` Eric Schulte
  1 sibling, 1 reply; 8+ messages in thread
From: Bernt Hansen @ 2010-07-07  2:03 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode

"Eric Schulte" <schulte.eric@gmail.com> writes:

> Hi,
>
> I've just merged a large set of Babel related security measures and
> layout/initialization updates into the master branch of the git
> repository.
>
> These changes will require existing babel users to update their
> configuration, see the following instructions for details -- even if you
> think you've read similar instructions before these are worth reading.
> http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html
>
> From here on out Babel development in the master branch will settle down
> along with the rest of the current Org-mode feature freeze.
>

Hi Eric,

I've updated my simple babel usage with your recent instructions and I
think there's a bug in the current setup.  My output isn't anything like
I expect.

Org-mode version 6.36trans (release_6.36.563.gc32d7)
GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) of 2008-11-09 on raven, modified by Debian

I have the following org-mode file

,----[ test.org ]
| * test.org
| #+begin_src sh :results output
|    cd ~/git/emacs && git log 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc..
| #+end_src
| 
| #+results:
| : commit 61bba1e248509ef2d06c95681a28288cf6af8287
| : Author: Bernt Hansen <bernt@norang.ca>
| : Date:   Fri Jun 18 15:04:57 2010 -0400
| : 
| :     Drop unused function
| 
| #+begin_example
| commit 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc
| Author: Bernt Hansen <bernt@norang.ca>
| Date:   Fri Jun 18 10:47:00 2010 -0400
| 
|     Try autoclocking gnus mail and news reading
| 
| commit 904744c6bc82e65f82109c8d7c612b3616c2ee60
| Author: Bernt Hansen <bernt@norang.ca>
| Date:   Thu Jun 17 13:19:43 2010 -0400
| 
|     Remove debug message for agenda sort function
| 
`----

and from previous runs of org-babel I've been collecting commits in
the #+results: section with older stuff I manually update in
the #+begin_example block.

Now if I execute the shell script with the new babel setup I get this:

(after the prompt to execute the shell script)

,----[ test.org ]
| * test.org
| #+begin_src sh :results output
|    cd ~/git/emacs && git log 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc..
| #+end_src
| 
| #+results:
| #+begin_example
| * test.org
| #+begin_src sh :results output
|    cd ~/git/emacs && git log 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc..
| #+end_src
| 
| #+results:
| : commit 61bba1e248509ef2d06c95681a28288cf6af8287
| : Author: Bernt Hansen <bernt@norang.ca>
| : Date:   Fri Jun 18 15:04:57 2010 -0400
| : 
| :     Drop unused function
| 
| #+begin_example
| commit 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc
| Author: Bernt Hansen <bernt@norang.ca>
| Date:   Fri Jun 18 10:47:00 2010 -0400
| 
|     Try autoclocking gnus mail and news reading
| 
| commit 904744c6bc82e65f82109c8d7c612b3616c2ee60
| Author: Bernt Hansen <bernt@norang.ca>
| Date:   Thu Jun 17 13:19:43 2010 -0400
| 
|     Remove debug message for agenda sort function
| 
| #+end_example
| 
| #+begin_example
| commit 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc
| Author: Bernt Hansen <bernt@norang.ca>
| Date:   Fri Jun 18 10:47:00 2010 -0400
| 
|     Try autoclocking gnus mail and news reading
| 
| commit 904744c6bc82e65f82109c8d7c612b3616c2ee60
| Author: Bernt Hansen <bernt@norang.ca>
| Date:   Thu Jun 17 13:19:43 2010 -0400
| 
|     Remove debug message for agenda sort function
| 
`----

The results section duplicates part of the org file instead of inserting
the output from the command.  This used to work with the old setup -- am
I missing something?

Regards,
Bernt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Update Config] Babel changes -- security updates and final integration push
  2010-07-07  2:03 ` Bernt Hansen
@ 2010-07-07  2:54   ` Eric Schulte
  2010-07-07  3:03     ` Bernt Hansen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2010-07-07  2:54 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Org Mode

Wow, this is fixed now, Thanks for pointing this out Bernt.

Bernt Hansen <bernt@norang.ca> writes:

> "Eric Schulte" <schulte.eric@gmail.com> writes:
>
>> Hi,
>>
>> I've just merged a large set of Babel related security measures and
>> layout/initialization updates into the master branch of the git
>> repository.
>>
>> These changes will require existing babel users to update their
>> configuration, see the following instructions for details -- even if you
>> think you've read similar instructions before these are worth reading.
>> http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html
>>
>> From here on out Babel development in the master branch will settle down
>> along with the rest of the current Org-mode feature freeze.
>>
>
> Hi Eric,
>
> I've updated my simple babel usage with your recent instructions and I
> think there's a bug in the current setup.  My output isn't anything like
> I expect.
>
> Org-mode version 6.36trans (release_6.36.563.gc32d7)
> GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11) of 2008-11-09 on raven, modified by Debian
>
> I have the following org-mode file
>
> ,----[ test.org ]
> | * test.org
> | #+begin_src sh :results output
> |    cd ~/git/emacs && git log 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc..
> | #+end_src
> | 
> | #+results:
> | : commit 61bba1e248509ef2d06c95681a28288cf6af8287
> | : Author: Bernt Hansen <bernt@norang.ca>
> | : Date:   Fri Jun 18 15:04:57 2010 -0400
> | : 
> | :     Drop unused function
> | 
> | #+begin_example
> | commit 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc
> | Author: Bernt Hansen <bernt@norang.ca>
> | Date:   Fri Jun 18 10:47:00 2010 -0400
> | 
> |     Try autoclocking gnus mail and news reading
> | 
> | commit 904744c6bc82e65f82109c8d7c612b3616c2ee60
> | Author: Bernt Hansen <bernt@norang.ca>
> | Date:   Thu Jun 17 13:19:43 2010 -0400
> | 
> |     Remove debug message for agenda sort function
> | 
> `----
>
> and from previous runs of org-babel I've been collecting commits in
> the #+results: section with older stuff I manually update in
> the #+begin_example block.
>
> Now if I execute the shell script with the new babel setup I get this:
>
> (after the prompt to execute the shell script)
>
> ,----[ test.org ]
> | * test.org
> | #+begin_src sh :results output
> |    cd ~/git/emacs && git log 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc..
> | #+end_src
> | 
> | #+results:
> | #+begin_example
> | * test.org
> | #+begin_src sh :results output
> |    cd ~/git/emacs && git log 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc..
> | #+end_src
> | 
> | #+results:
> | : commit 61bba1e248509ef2d06c95681a28288cf6af8287
> | : Author: Bernt Hansen <bernt@norang.ca>
> | : Date:   Fri Jun 18 15:04:57 2010 -0400
> | : 
> | :     Drop unused function
> | 
> | #+begin_example
> | commit 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc
> | Author: Bernt Hansen <bernt@norang.ca>
> | Date:   Fri Jun 18 10:47:00 2010 -0400
> | 
> |     Try autoclocking gnus mail and news reading
> | 
> | commit 904744c6bc82e65f82109c8d7c612b3616c2ee60
> | Author: Bernt Hansen <bernt@norang.ca>
> | Date:   Thu Jun 17 13:19:43 2010 -0400
> | 
> |     Remove debug message for agenda sort function
> | 
> | #+end_example
> | 
> | #+begin_example
> | commit 4d287c3c72e53f1e3c9fcd42a06599babbf9c6cc
> | Author: Bernt Hansen <bernt@norang.ca>
> | Date:   Fri Jun 18 10:47:00 2010 -0400
> | 
> |     Try autoclocking gnus mail and news reading
> | 
> | commit 904744c6bc82e65f82109c8d7c612b3616c2ee60
> | Author: Bernt Hansen <bernt@norang.ca>
> | Date:   Thu Jun 17 13:19:43 2010 -0400
> | 
> |     Remove debug message for agenda sort function
> | 
> `----
>
> The results section duplicates part of the org file instead of inserting
> the output from the command.  This used to work with the old setup -- am
> I missing something?
>
> Regards,
> Bernt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Update Config] Babel changes -- security updates and final integration push
  2010-07-07  2:54   ` Eric Schulte
@ 2010-07-07  3:03     ` Bernt Hansen
  0 siblings, 0 replies; 8+ messages in thread
From: Bernt Hansen @ 2010-07-07  3:03 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode

"Eric Schulte" <schulte.eric@gmail.com> writes:

> Wow, this is fixed now, Thanks for pointing this out Bernt.

That was quick!  Thanks!!

-Bernt

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-07-07  3:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-05 18:31 [Update Config] Babel changes -- security updates and final integration push Eric Schulte
2010-07-06  0:59 ` Thomas S. Dye
2010-07-06  1:09   ` Eric Schulte
2010-07-06  1:48     ` Thomas S. Dye
2010-07-06  5:42     ` Carsten Dominik
2010-07-07  2:03 ` Bernt Hansen
2010-07-07  2:54   ` Eric Schulte
2010-07-07  3:03     ` Bernt Hansen

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).