comparison lisp/org/ob-lob.el @ 111880:a7740098b594

Update to Org mode 7.4
author Carsten Dominik <carsten.dominik@gmail.com>
date Sat, 11 Dec 2010 17:42:53 +0100
parents 76c2ff4450eb
children 6378d1b57038
comparison
equal deleted inserted replaced
111879:4a0faa1cecc2 111880:a7740098b594
1 ;;; ob-lob.el --- functions supporting the Library of Babel 1 ;;; ob-lob.el --- functions supporting the Library of Babel
2 2
3 ;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. 3 ;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
4 4
5 ;; Author: Eric Schulte 5 ;; Author: Eric Schulte, Dan Davison
6 ;; Dan Davison
7 ;; Keywords: literate programming, reproducible research 6 ;; Keywords: literate programming, reproducible research
8 ;; Homepage: http://orgmode.org 7 ;; Homepage: http://orgmode.org
9 ;; Version: 7.3 8 ;; Version: 7.4
10 9
11 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
12 11
13 ;; GNU Emacs is free software: you can redistribute it and/or modify 12 ;; GNU Emacs is free software: you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by 13 ;; it under the terms of the GNU General Public License as published by
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 24
26 ;;; Commentary: 25 ;;; Commentary:
27 26
28 ;; See the online documentation for more information 27 ;; See the online documentation for more information
29 ;; 28 ;;
30 ;; http://orgmode.org/worg/org-contrib/babel/ 29 ;; http://orgmode.org/worg/org-contrib/babel/
31 30
32 ;;; Code: 31 ;;; Code:
33 (require 'ob) 32 (require 'ob)
34 (require 'ob-table) 33 (require 'ob-table)
70 69
71 (defconst org-babel-lob-one-liner-regexp 70 (defconst org-babel-lob-one-liner-regexp
72 (concat 71 (concat
73 "^\\([ \t]*\\)#\\+\\(?:" 72 "^\\([ \t]*\\)#\\+\\(?:"
74 (mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|") 73 (mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|")
75 "\\):[ \t]+\\([^\(\)\n]+\\)\(\\([^\n]*\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\([^\n]*\\)") 74 "\\):[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
75 "\(\\([^\n]*\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\([^\n]*\\)")
76 "Regexp to match calls to predefined source block functions.") 76 "Regexp to match calls to predefined source block functions.")
77 77
78 ;; functions for executing lob one-liners 78 ;; functions for executing lob one-liners
79 ;;;###autoload 79 ;;;###autoload
80 (defun org-babel-lob-execute-maybe () 80 (defun org-babel-lob-execute-maybe ()
91 (let ((case-fold-search t)) 91 (let ((case-fold-search t))
92 (save-excursion 92 (save-excursion
93 (beginning-of-line 1) 93 (beginning-of-line 1)
94 (if (looking-at org-babel-lob-one-liner-regexp) 94 (if (looking-at org-babel-lob-one-liner-regexp)
95 (append 95 (append
96 (mapcar #'org-babel-clean-text-properties 96 (mapcar #'org-babel-clean-text-properties
97 (list 97 (list
98 (format "%s(%s)%s" 98 (format "%s%s(%s)%s"
99 (match-string 2) (match-string 3) (match-string 4)) 99 (match-string 2)
100 (match-string 5))) 100 (if (match-string 4)
101 (concat "[" (match-string 4) "]") "")
102 (or (match-string 6) "") (match-string 7))
103 (match-string 8)))
101 (list (length (match-string 1)))))))) 104 (list (length (match-string 1))))))))
102 105
103 (defun org-babel-lob-execute (info) 106 (defun org-babel-lob-execute (info)
104 "Execute the lob call specified by INFO." 107 "Execute the lob call specified by INFO."
105 (let ((params (org-babel-process-params 108 (let ((params (org-babel-process-params
106 (org-babel-merge-params 109 (org-babel-merge-params
107 org-babel-default-header-args 110 org-babel-default-header-args