emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: nicholas.dokos@hp.com
Cc: emacs-orgmode@gnu.org
Subject: Re: [RFC] Standardized code block keywords
Date: Fri, 28 Oct 2011 12:52:48 -0600	[thread overview]
Message-ID: <87d3dhosn3.fsf@gmail.com> (raw)
In-Reply-To: <8934.1319827222@alphaville.americas.hpqcorp.net> (Nick Dokos's message of "Fri, 28 Oct 2011 14:40:22 -0400")

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

Nick Dokos <nicholas.dokos@hp.com> writes:

> Eric Schulte <schulte.eric@gmail.com> wrote:
>
>> The attached updated patch fixes a bug in the original.
>> 
>
> Minor problem in applying:
>
> ,----
> | $ git apply ~/Mail/inbox/724
> | /home/nick/Mail/inbox/724:671: trailing whitespace.
> | #+name: 
> | /home/nick/Mail/inbox/724:599: new blank line at EOF.
> | +
> | warning: 2 lines add whitespace errors.
> `----

The attached version fixes these issues, Thanks -- Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-removing-code-block-results-and-call-line-synonyms-B.patch --]
[-- Type: text/x-diff, Size: 24029 bytes --]

From 0e43d59ee8d46a63f86780a502de726271bc39de Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Fri, 28 Oct 2011 10:44:21 -0600
Subject: [PATCH] removing code block, results and call-line synonyms -- BREAKING CHANGE

Following a round of on-list discussion many code block synonyms have
been removed, moving forward the following syntax is valid.

- call lines are specified with #+call:
- code blocks are named with #+name:
- results are named with #+name:, however results generated by a code
  block may still be labeled with #+results:, and tables named with
  #+tblname: will be considered to be named results

The following function may be used to update an existing Org-mode
buffer to the new 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")))))

Note: If an old version of Org-mode (e.g., the one shipped with Emacs)
      is installed on your system many of the important variables will
      be pre-defined with a defvar and *will not* have their values
      automatically updated, these include the following.
      - org-babel-data-names
      - org-babel-result-regexp
      - org-babel-src-block-regexp
      - org-babel-src-name-regexp
      - org-babel-src-name-w-name-regexp
      It may be necessary to either remove the source code of older
      versions of Org-mode, or to explicitly evaluate the ob.el file.

* lisp/ob-exp.el (org-exp-res/src-name-cleanup): Updated
  Documentation.
* lisp/ob-lob.el (org-babel-block-lob-one-liner-regexp): Updated
  regular expression.
  (org-babel-inline-lob-one-liner-regexp): Updated regular expression.
* lisp/ob-ref.el (org-babel-ref-resolve): Notice when something that
  looks like a data results may actually be a code block.
* lisp/ob-table.el: Updated documentation.
* lisp/ob.el (org-babel-src-name-regexp): Simplified regexp.
  (org-babel-get-src-block-info): Updated match strings.
  (org-babel-data-names): Simplified acceptable names.
  (org-babel-find-named-block): Indentation.
  (org-babel-find-named-result): Updated to not return a code block as
  a result.
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Removing
  references to old syntactic elements.
  (org-additional-option-like-keywords): Removing references to old
  syntactic elements.
* contrib/babel/library-of-babel.org: Updated to make use of the new
  syntax.
* testing/examples/babel-dangerous.org: Updated to make use of the new
  syntax.
* testing/examples/babel.org: Updated to make use of the new syntax.
* testing/examples/ob-awk-test.org: Updated to make use of the new
  syntax.
* testing/examples/ob-fortran-test.org: Updated to make use of the new
  syntax.
* testing/lisp/test-ob.el: Removed two bad tests which tested the
  literal values of old regular expressions rather than their
  behavior.
---
 contrib/babel/library-of-babel.org   |   48 +++++++++++++++++-----------------
 lisp/ob-exp.el                       |    2 +-
 lisp/ob-lob.el                       |   13 +--------
 lisp/ob-ref.el                       |    5 +++
 lisp/ob-table.el                     |    2 +-
 lisp/ob.el                           |   31 ++++++++++++---------
 lisp/org.el                          |    9 ++----
 testing/examples/babel-dangerous.org |    5 +++-
 testing/examples/babel.org           |   30 ++++++++++----------
 testing/examples/ob-awk-test.org     |    4 +-
 testing/examples/ob-fortran-test.org |    4 +-
 testing/lisp/test-ob.el              |   42 -----------------------------
 12 files changed, 77 insertions(+), 118 deletions(-)

diff --git a/contrib/babel/library-of-babel.org b/contrib/babel/library-of-babel.org
index 2db9d4c..571eb70 100644
--- a/contrib/babel/library-of-babel.org
+++ b/contrib/babel/library-of-babel.org
@@ -22,7 +22,7 @@
 
 A collection of simple utility functions:
 
-#+srcname: echo
+#+name: echo
 #+begin_src emacs-lisp :var input="echo'd"
   input
 #+end_src
@@ -35,7 +35,7 @@ Read the contents of the file at =file=.  The =:results vector= and
 =:results scalar= header arguments can be used to read the contents of
 file as either a table or a string.
 
-#+srcname: read
+#+name: read
 #+begin_src emacs-lisp :var file="" :var format=""
   (if (string= format "csv")
       (with-temp-buffer
@@ -49,7 +49,7 @@ file as either a table or a string.
 Write =data= to a file at =file=.  If =data= is a list, then write it
 as a table in traditional Org-mode table syntax.
 
-#+srcname: write
+#+name: write
 #+begin_src emacs-lisp :var data="" :var file="" :var ext='()
   (flet ((echo (r) (if (stringp r) r (format "%S" r))))
     (with-temp-file file
@@ -67,7 +67,7 @@ as a table in traditional Org-mode table syntax.
 
 Read local or remote file in [[http://www.json.org/][json]] format into emacs-lisp objects.
 
-#+srcname: json
+#+name: json
 #+begin_src emacs-lisp :var file='() :var url='()
   (require 'json)
   (cond
@@ -96,7 +96,7 @@ The =google= command seems to be throwing "Moved Temporarily" errors
 when trying to download textual documents, but this is working fine
 for spreadsheets.
 
-#+source: gdoc-read
+#+name: gdoc-read
 #+begin_src emacs-lisp :var title="example" :var format="csv"
   (let* ((file (concat title "." format))
          (cmd (format "google docs get --format %S --title %S" format title)))
@@ -126,7 +126,7 @@ Write =data= to a google document named =title=.  If =data= is tabular
 it will be saved to a spreadsheet, otherwise it will be saved as a
 normal document.
 
-#+source: gdoc-write
+#+name: gdoc-write
 #+begin_src emacs-lisp :var title="babel-upload" :var data=fibs(n=10) :results silent
   (let* ((format (if (listp data) "csv" "txt"))
          (tmp-file (make-temp-file "org-babel-google-doc" nil (concat "." format)))
@@ -157,7 +157,7 @@ example usage
   Plot column 2 (y axis) against column 1 (x axis). Columns 3 and
   beyond, if present, are ignored.
 
-#+srcname: R-plot(data=R-plot-example-data)
+#+name: R-plot(data=R-plot-example-data)
 #+begin_src R
 plot(data)
 #+end_src
@@ -169,7 +169,7 @@ plot(data)
 | 4 | 16 |
 | 5 | 25 |
 
-#+lob: R-plot(data=R-plot-example-data)
+#+call: R-plot(data=R-plot-example-data)
 
 #+resname: R-plot(data=R-plot-example-data)
 : nil
@@ -180,7 +180,7 @@ plot(data)
 
 ** Headline references
 
-#+source: headline
+#+name: headline
 #+begin_src emacs-lisp :var headline=top :var file='()
   (save-excursion
     (when file (get-file-buffer file))
@@ -217,7 +217,7 @@ optional.
 | env   | optional environment, default to "tabular" |
 | width | optional width specification string        |
 
-#+srcname: booktabs
+#+name: booktabs
 #+begin_src emacs-lisp :var table='((:head) hline (:body)) :var align='() :var env="tabular" :var width='() :noweb yes :results latex
   (flet ((to-tab (tab)
                  (orgtbl-to-generic
@@ -266,7 +266,7 @@ are optional.
 | foot      | optional "foot" string                                      |
 | lastfoot  | optional "lastfoot" string                                  |
 
-#+srcname: longtable
+#+name: longtable
 #+begin_src emacs-lisp :var table='((:table)) :var align='() :var width='() :var hline="\\hline" :var firsthead='() :var head='() :var foot='() :var lastfoot='() :noweb yes :results latex
   (org-fill-template
    "
@@ -314,7 +314,7 @@ span. Note the use of LaTeX, rather than Org-mode, markup.
 #+tblname: arguments-notes
 | \multicolumn{2}{l}{This is a footnote to the \emph{arguments} table.} |
 
-#+srcname: booktabs-notes
+#+name: booktabs-notes
 #+begin_src emacs-lisp :var table='((:head) hline (:body)) :var notes='() :var align='() :var env="tabular" :var width='() :var lspace='() :noweb yes :results latex
   (flet ((to-tab (tab)
                  (orgtbl-to-generic
@@ -356,7 +356,7 @@ span. Note the use of LaTeX, rather than Org-mode, markup.
 | 1 | 2 | 3 |
 | 4 | 5 | 6 |
 
-#+srcname: transpose
+#+name: transpose
 #+begin_src emacs-lisp :var table=transpose-example
   (apply #'mapcar* #'list table)
 #+end_src
@@ -372,7 +372,7 @@ span. Note the use of LaTeX, rather than Org-mode, markup.
 | 1 | 2 | 3 |
 | a | b | c |
 
-#+source: all-to-string
+#+name: all-to-string
 #+begin_src emacs-lisp :var tbl='()
   (defun all-to-string (tbl)
     (if (listp tbl)
@@ -387,7 +387,7 @@ span. Note the use of LaTeX, rather than Org-mode, markup.
   (mapcar (lambda (row) (mapcar (lambda (cell) (stringp cell)) row)) tbl)
 #+end_src
 
-#+results:
+#+name:
 | nil | nil | nil |
 | t   | t   | t   |
 
@@ -395,7 +395,7 @@ span. Note the use of LaTeX, rather than Org-mode, markup.
   (mapcar (lambda (row) (mapcar (lambda (cell) (stringp cell)) row)) tbl)
 #+end_src
 
-#+results:
+#+name:
 | t | t | t |
 | t | t | t |
 
@@ -412,7 +412,7 @@ export. The function uses the Emacs VC commands to interface to the
 local version control system, but has only been tested to work with
 Git. 'limit' is currently unsupported.
 
-#+source: vc-log
+#+name: vc-log
 #+headers: :var limit=-1
 #+headers: :var buf=(buffer-name (current-buffer))
 #+begin_src emacs-lisp
@@ -440,34 +440,34 @@ Git. 'limit' is currently unsupported.
 
 ** Trivial python code blocks
 
-#+srcname: python-identity(a=1)
+#+name: python-identity(a=1)
 #+begin_src python
 a
 #+end_src
 
-#+srcname: python-add(a=1, b=2)
+#+name: python-add(a=1, b=2)
 #+begin_src python
 a + b
 #+end_src
 
 ** Arithmetic
 
-#+source: lob-add
+#+name: lob-add
 #+begin_src emacs-lisp :var a=0 :var b=0
   (+ a b)
 #+end_src
 
-#+source: lob-minus
+#+name: lob-minus
 #+begin_src emacs-lisp :var a=0 :var b=0
   (- a b)
 #+end_src
 
-#+source: lob-times
+#+name: lob-times
 #+begin_src emacs-lisp :var a=0 :var b=0
   (* a b)
 #+end_src
 
-#+source: lob-div
+#+name: lob-div
 #+begin_src emacs-lisp :var a=0 :var b=0
   (/ a b)
 #+end_src
@@ -477,7 +477,7 @@ a + b
 The =elispgantt= source block was sent to the mailing list by Eric
 Fraga.  It was modified slightly by Tom Dye.
  
-#+source: elispgantt
+#+name: elispgantt
 #+begin_src emacs-lisp :var table=gantttest
   (let ((dates "")
         (entries (nthcdr 2 table))
diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index 3b102e1..e4fae80 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -147,7 +147,7 @@ options and are taken from `org-babel-default-inline-header-args'."
 		(forward-char 2)))))))))
 
 (defun org-exp-res/src-name-cleanup ()
-  "Clean up #+results and #+srcname lines for export.
+  "Clean up #+results and #+name lines for export.
 This function should only be called after all block processing
 has taken place."
   (interactive)
diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el
index be3033e..73f9553 100644
--- a/lisp/ob-lob.el
+++ b/lisp/ob-lob.el
@@ -61,24 +61,15 @@ To add files to this list use the `org-babel-lob-ingest' command."
 	     lob-ingest-count (if (> lob-ingest-count 1) "s" ""))
     lob-ingest-count))
 
-(defconst org-babel-lob-call-aliases '("lob" "call")
-  "Aliases to call a source block function.
-If you change the value of this variable then your files may
-  become unusable by other org-babel users, and vice versa.")
-
 (defconst org-babel-block-lob-one-liner-regexp
   (concat
-   "^\\([ \t]*\\)#\\+\\(?:"
-   (mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|")
-   "\\):[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
+   "^\\([ \t]*\\)#\\+call:[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
    "\(\\([^\n]*\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?")
   "Regexp to match non-inline calls to predefined source block functions.")
 
 (defconst org-babel-inline-lob-one-liner-regexp
   (concat
-   "\\([^\n]*\\)\\(?:"
-   (mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|")
-   "\\)_\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
+   "\\([^\n]*\\)call_\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
    "\(\\([^\n]*\\)\)\\(\\[\\(.*?\\)\\]\\)?")
   "Regexp to match inline calls to predefined source block functions.")
 
diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el
index bff3b3f..9534aac 100644
--- a/lisp/ob-ref.el
+++ b/lisp/ob-ref.el
@@ -173,6 +173,11 @@ the variable."
 	(cond
 	 (lob-info (setq type 'lob))
 	 (id (setq type 'id))
+	 ((and (looking-at org-babel-src-name-regexp)
+	       (progn (forward-line 1)
+		      (or (looking-at org-babel-src-block-regexp)
+			  (looking-at org-babel-multi-line-header-regexp))))
+	  (setq type 'source-block))
 	 (t (while (not (setq type (org-babel-ref-at-ref-p)))
 	      (forward-line 1)
 	      (beginning-of-line)
diff --git a/lisp/ob-table.el b/lisp/ob-table.el
index 1cee16e..15ebff9 100644
--- a/lisp/ob-table.el
+++ b/lisp/ob-table.el
@@ -30,7 +30,7 @@
 ;;   (defun fibbd (n) (if (< n 2) 1 (+ (fibbd (- n 1)) (fibbd (- n 2)))))
 ;; #+end_src
 
-;; #+srcname: fibbd
+;; #+name: fibbd
 ;; #+begin_src emacs-lisp :var n=2 :results silent
 ;; (fibbd n)
 ;; #+end_src
diff --git a/lisp/ob.el b/lisp/ob.el
index 4438ee8..7fd684b 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -113,7 +113,7 @@ remove code block execution from the C-c C-c keybinding."
   :type 'boolean)
 
 (defvar org-babel-src-name-regexp
-  "^[ \t]*#\\+\\(srcname\\|source\\|function\\):[ \t]*"
+  "^[ \t]*#\\+name:[ \t]*"
   "Regular expression used to match a source name line.")
 
 (defvar org-babel-multi-line-header-regexp
@@ -216,8 +216,8 @@ Returns a list
 		   (nth 2 info)
 		   (org-babel-parse-header-arguments (match-string 1)))))
 	  (when (looking-at org-babel-src-name-w-name-regexp)
-	    (setq name (org-babel-clean-text-properties (match-string 4)))
-	    (when (match-string 6)
+	    (setq name (org-babel-clean-text-properties (match-string 3)))
+	    (when (match-string 5)
 	      (setf (nth 2 info) ;; merge functional-syntax vars and header-args
 		    (org-babel-merge-params
 		     (mapcar
@@ -229,7 +229,7 @@ Returns a list
 			   (error
 			    "variable \"%s\"%s must be assigned a default value"
 			    var (if name (format " in block \"%s\"" name) ""))))
-		       (org-babel-ref-split-args (match-string 6))))
+		       (org-babel-ref-split-args (match-string 5))))
 		     (nth 2 info))))))
       ;; inline source block
       (when (org-babel-get-inline-src-block-matches)
@@ -396,7 +396,7 @@ specific header arguments as well.")
   '((:session . "none") (:results . "replace") (:exports . "results"))
   "Default arguments to use when evaluating an inline source block.")
 
-(defvar org-babel-data-names '("TBLNAME" "RESNAME" "RESULTS" "DATA"))
+(defvar org-babel-data-names '("TBLNAME" "RESULTS" "NAME"))
 
 (defvar org-babel-result-regexp
   (concat "^[ \t]*#\\+"
@@ -1359,7 +1359,7 @@ org-babel-named-src-block-regexp."
 	  (regexp (org-babel-named-src-block-regexp-for-name name)) msg)
       (goto-char (point-min))
       (when (or (re-search-forward regexp nil t)
-                (re-search-backward regexp nil t))
+		(re-search-backward regexp nil t))
         (match-beginning 0)))))
 
 (defun org-babel-src-block-names (&optional file)
@@ -1368,7 +1368,7 @@ org-babel-named-src-block-regexp."
     (when file (find-file file)) (goto-char (point-min))
     (let (names)
       (while (re-search-forward org-babel-src-name-w-name-regexp nil t)
-	(setq names (cons (match-string 4) names)))
+	(setq names (cons (match-string 3) names)))
       names)))
 
 ;;;###autoload
@@ -1384,16 +1384,21 @@ org-babel-named-src-block-regexp."
         (progn (goto-char point) (org-show-context))
       (message "result '%s' not found in this buffer" name))))
 
-(defun org-babel-find-named-result (name)
+(defun org-babel-find-named-result (name &optional point)
   "Find a named result.
 Return the location of the result named NAME in the current
 buffer or nil if no such result exists."
   (save-excursion
-    (goto-char (point-min))
-    (when (re-search-forward
-           (concat org-babel-result-regexp
-                   "[ \t]" (regexp-quote name) "[ \t\n\f\v\r]") nil t)
-      (beginning-of-line 0) (point))))
+    (goto-char (or point (point-min)))
+    (catch 'is-a-code-block
+      (when (re-search-forward
+	     (concat org-babel-result-regexp
+		     "[ \t]" (regexp-quote name) "[ \t\n\f\v\r]") nil t)
+	(when (and (string= "name" (match-string 1))
+		   (or (looking-at org-babel-src-block-regexp)
+		       (looking-at org-babel-multi-line-header-regexp)))
+	  (throw 'is-a-code-block (org-babel-find-named-result name (point))))
+	(beginning-of-line 0) (point)))))
 
 (defun org-babel-result-names (&optional file)
   "Returns the names of results in FILE or the current buffer."
diff --git a/lisp/org.el b/lisp/org.el
index 2599d41..e23242e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5400,9 +5400,8 @@ will be prompted for."
 	     '(font-lock-fontified t face org-meta-line))
 	    t)
 	   ((or (member dc1 '("begin:" "end:" "caption:" "label:"
-			      "orgtbl:" "tblfm:" "tblname:" "result:"
-			      "results:" "source:" "srcname:" "call:"
-			      "data:" "header:" "headers:"))
+			      "orgtbl:" "tblfm:" "tblname:" "results:"
+			      "call:" "header:" "headers:"))
 		(and (match-end 4) (equal dc3 "attr")))
 	    (add-text-properties
 	     beg (match-end 0)
@@ -10966,10 +10965,8 @@ This function can be used in a hook."
     "BEGIN_CENTER" "END_CENTER"
     "BEGIN_SRC" "END_SRC"
     "BEGIN_RESULT" "END_RESULT"
-    "SOURCE:" "SRCNAME:" "FUNCTION:"
-    "RESULTS:" "DATA:"
+    "NAME:" "RESULTS:"
     "HEADER:" "HEADERS:"
-    "BABEL:"
     "CATEGORY:" "COLUMNS:" "PROPERTY:"
     "CAPTION:" "LABEL:"
     "SETUPFILE:"
diff --git a/testing/examples/babel-dangerous.org b/testing/examples/babel-dangerous.org
index 63f9f27..8ec9fa6 100644
--- a/testing/examples/babel-dangerous.org
+++ b/testing/examples/babel-dangerous.org
@@ -9,7 +9,9 @@
 There is no default value assigned to =x= variable. This is not permitted
 anymore.
 
-#+source: carre(x)
+#+name: carre(x)
 #+begin_src python
   return x*x
 #+end_src
+
+#+name: carre
diff --git a/testing/examples/babel.org b/testing/examples/babel.org
index 9c61b0c..45d0171 100644
--- a/testing/examples/babel.org
+++ b/testing/examples/babel.org
@@ -6,7 +6,7 @@
   :ID:       eb1f6498-5bd9-45e0-9c56-50717053e7b7
   :END:
 
-#+source: noweb-example
+#+name: noweb-example
 #+begin_src emacs-lisp
   (message "expanded")
 #+end_src
@@ -39,7 +39,7 @@
   prop
 #+end_src
 
-#+results:
+#+name:
 : 4
 
 * excessive id links on tangling
@@ -64,7 +64,7 @@
   :ID:       f68821bc-7f49-4389-85b5-914791ee3718
   :END:
 
-#+source: four
+#+name: four
 #+begin_src emacs-lisp
   (list 1 2 3 4)
 #+end_src
@@ -73,7 +73,7 @@
   (length four)
 #+end_src
 
-#+results:
+#+name:
 : 4
 
 * multi-line header arguments
@@ -86,7 +86,7 @@
   (map 'list #'list numbers letters)
 #+end_src
 
-#+results:
+#+name:
 | 1 | a |
 | 2 | b |
 | 3 | c |
@@ -100,15 +100,15 @@
   :ID:       0d82b52d-1bb9-4916-816b-2c67c8108dbb
   :END:
 
-#+source: i-have-a-name
+#+name: i-have-a-name
 #+begin_src emacs-lisp
   42
 #+end_src
 
-#+results: 
+#+name:
 : 42
 
-#+results: i-have-a-name
+#+name: i-have-a-name
 : 42
 
 * Pascal's Triangle -- export test
@@ -116,7 +116,7 @@
   :ID:       92518f2a-a46a-4205-a3ab-bcce1008a4bb
   :END:
 
-#+source: pascals-triangle
+#+name: pascals-triangle
 #+begin_src emacs-lisp :var n=5 :exports both
   (defun pascals-triangle (n)
     (if (= n 0)
@@ -136,7 +136,7 @@
   :ID:       6d2ff4ce-4489-4e2a-9c65-e3f71f77d975
   :END:
 
-#+source: take-sqrt
+#+name: take-sqrt
 #+begin_src emacs-lisp :var n=9
   (sqrt n)
 #+end_src
@@ -159,7 +159,7 @@ This is an inline call call_echo(input="testing")[:results vector] embedded in p
 call_echo("testing")
 call_concat(1,2,3)
 
-#+source: concat
+#+name: concat
 #+begin_src emacs-lisp :var a=0 :var b=0 :var c=0
   (format "%S%S%S" a b c)
 #+end_src
@@ -169,7 +169,7 @@ call_concat(1,2,3)
   :ID:       72ddeed3-2d17-4c7f-8192-a575d535d3fc
   :END:
 
-#+source: double
+#+name: double
 #+begin_src emacs-lisp :var it=0
   (* 2 it)
 #+end_src
@@ -214,7 +214,7 @@ src_sh{echo 3} Here is one at the beginning of a line.
   :PROPERTIES:
   :ID:       5daa4d03-e3ea-46b7-b093-62c1b7632df3
   :END:
-#+results: a-list
+#+name: a-list
 - a
 - b
 - c
@@ -298,13 +298,13 @@ src_sh{echo 2} blocks on the src_emacs-lisp{"same"} line
   echo "[[file:./cv.cls]]"
 #+end_src
 
-#+results:
+#+name:
 : [[file:./cv.cls]]
 
 #+begin_src sh :results raw scalar
    echo "[[file:./cv.cls]]"
 #+end_src
 
-#+results:
+#+name:
 [[file:./cv.cls]]
 
diff --git a/testing/examples/ob-awk-test.org b/testing/examples/ob-awk-test.org
index 7f51772..9a33bf8 100644
--- a/testing/examples/ob-awk-test.org
+++ b/testing/examples/ob-awk-test.org
@@ -20,7 +20,7 @@ Use a code block ouput as an input
 #+end_src
 
 Use input file
-#+srcname: genfile
+#+name: genfile
 #+begin_src awk  :in-file ob-awk-test.in :results silent
     $0~/[\t]*#/{
         # skip comments 
@@ -33,7 +33,7 @@ Use input file
 
 * Input data generators
 A code block to generate input stream
-#+srcname: genseq
+#+name: genseq
 #+begin_src emacs-lisp :results silent
 (print "1")
 #+end_src
diff --git a/testing/examples/ob-fortran-test.org b/testing/examples/ob-fortran-test.org
index d48ae4e..47931bf 100644
--- a/testing/examples/ob-fortran-test.org
+++ b/testing/examples/ob-fortran-test.org
@@ -5,12 +5,12 @@
   :PROPERTIES:
   :ID:       459384e8-1797-4f11-867e-dde0473ea7cc
   :END:
-#+source: hello
+#+name: hello
 #+begin_src fortran :results silent
 print *, 'Hello world'
 #+end_src
 
-#+source: fortran_parameter
+#+name: fortran_parameter
 #+begin_src fortran :results silent
 integer, parameter :: i = 10
 write (*, '(i2)') i
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 58ff756..738df52 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -13,36 +13,6 @@
   (require 'org-test)
   (require 'org-test-ob-consts))
 
-(ert-deftest test-org-babel/src-name-regexp ()
-  (should(equal "^[ \t]*#\\+\\(srcname\\|source\\|function\\):[ \t]*"
-		org-babel-src-name-regexp))
-  (mapcar (lambda (name) 
-	    (should (org-test-string-exact-match
-		     org-babel-src-name-regexp
-		     (concat
-		      "   \t #+"
-		      name
-		      ":    \t src-name \t blah blah blah ")))
-	    (should (string-match
-		     org-babel-src-name-regexp
-		     (concat 
-		      "#+" (upcase name)
-		      ": src-name")))
-	    ;;TODO This should fail no?
-	    (should (org-test-string-exact-match
-		     org-babel-src-name-regexp
-		     (concat
-		      "#+" name ":")))
-	    ;;TODO Check - should this pass?
-	    (should (not (org-test-string-exact-match
-			  org-babel-src-name-regexp
-			  (concat
-			   "#+" name " : src-name")))))
-	  '("srcname" "source" "function"))
-  (should (not  (org-test-string-exact-match
-		 org-babel-src-name-regexp
-		 "#+invalid-name: src-name"))))
-
 (ert-deftest test-org-babel/multi-line-header-regexp ()
   (should(equal "^[ \t]*#\\+headers?:[ \t]*\\([^\n]*\\)$"
 		org-babel-multi-line-header-regexp))
@@ -63,18 +33,6 @@
 	 org-babel-multi-line-header-regexp
 	 "   \t #+headers : blah1 blah2 blah3 \t\n\t\n blah4 blah5 blah6 \n"))))
 
-(ert-deftest test-org-babel/src-name-w-name-regexp ()
-  (should(equal
-	  (concat org-babel-src-name-regexp "\\("
-		  org-babel-multi-line-header-regexp "\\)*"
-		  "\\([^ ()\f\t\n\r\v]+\\)\\(\(\\(.*\\)\)\\|\\)")
-	  org-babel-src-name-w-name-regexp))
-  (should (org-test-string-exact-match
-	   org-babel-src-name-w-name-regexp
-	   (concat
-	    "#+srcname: src-name "
-	    "#+headers: blah1 blah2 blah3 \t\n\t\n blah4 blah5 blah6 \n"))))
-
 (ert-deftest test-org-babel/src-block-regexp ()
   (let ((test-block
 	 (concat
-- 
1.7.4.1


[-- Attachment #3: Type: text/plain, Size: 47 bytes --]


-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

  reply	other threads:[~2011-10-28 18:53 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-20 19:43 [ANN] BREAKING CHANGE -- removing #+BABEL file-wide property lines Eric Schulte
2011-10-20 20:06 ` Nick Dokos
2011-10-20 20:12   ` Eric Schulte
2011-10-20 20:51     ` Nick Dokos
2011-10-20 21:04       ` Sebastien Vauban
2011-10-20 21:50         ` [RFC] Standardized code block keywords Eric Schulte
2011-10-21  1:52           ` Thomas S. Dye
2011-10-21  2:57             ` Nick Dokos
2011-10-21  7:26               ` Christian Moe
2011-10-21 16:12                 ` Eric Schulte
2011-10-21 19:10                   ` Thomas S. Dye
2011-10-23 12:20                     ` Daniel Bausch
2011-10-23 16:09                       ` Thomas S. Dye
2011-10-24  5:49                         ` Daniel Bausch
2011-10-21  8:17               ` Sebastien Vauban
2011-10-21 16:17                 ` Eric Schulte
2011-10-21 17:37                   ` Sebastien Vauban
     [not found]                     ` <CAGhLh6GXg6nMZ-xdu-EP=YRx7Pznrme2Yq1S0vdc6Yq0tPMxFg@mail.gmail.com>
2011-10-25  6:59                       ` Rainer M Krug
2011-10-21 16:08               ` Eric Schulte
2011-10-21 16:05             ` Eric Schulte
2011-10-21 18:02               ` Thomas S. Dye
2011-10-22 15:19                 ` Eric Schulte
2011-10-21  7:43           ` Torsten Wagner
2011-10-21  8:27             ` Sebastien Vauban
2011-10-21 16:25               ` Eric Schulte
2011-10-21 16:24             ` Eric Schulte
2011-10-21 17:41               ` Sebastien Vauban
2011-10-24  1:06                 ` Torsten Wagner
2011-10-25  6:44               ` Rainer M Krug
2011-10-25  7:24                 ` Jambunathan K
2011-10-25  8:21                 ` Sebastien Vauban
2011-10-21 12:22           ` Nicolas Goaziou
2011-10-21 16:27             ` Eric Schulte
2011-10-21 17:48               ` Eric Schulte
2011-10-21 19:24                 ` Viktor Rosenfeld
2011-10-23 12:42                 ` Daniel Bausch
2011-10-24  7:37                   ` Eric S Fraga
2011-10-24 14:39                     ` Darlan Cavalcante Moreira
2011-10-24  7:47                   ` Sebastien Vauban
2011-10-25  1:30                     ` Eric Schulte
2011-10-25  7:14                       ` Daniel Bausch
2011-10-25  8:14                         ` Sebastien Vauban
2011-10-25 14:44                           ` Eric Schulte
2011-10-25 15:38                             ` Christian Moe
2011-10-25 15:42                             ` Nick Dokos
2011-10-25 16:28                               ` Martyn Jago
2011-10-25 16:49                                 ` Eric Schulte
2011-10-25 17:21                                   ` Nick Dokos
2011-10-26  5:58                                     ` Daniel Bausch
2011-10-26 13:10                               ` Giovanni Ridolfi
2011-10-26 14:41                                 ` Daniel Bausch
2011-10-26 15:04                                   ` Nick Dokos
2011-10-27  5:25                                     ` Daniel Bausch
2011-10-28 16:49                                       ` Eric Schulte
2011-10-28 18:31                                         ` Eric Schulte
2011-10-28 18:40                                           ` Nick Dokos
2011-10-28 18:52                                             ` Eric Schulte [this message]
2011-10-28 23:22                                               ` Nick Dokos
2011-10-28 23:39                                                 ` Thomas S. Dye
2011-10-29  2:18                                                   ` Nick Dokos
2011-10-31  7:25                                               ` Daniel Bausch
2011-10-31 19:01                                                 ` Eric Schulte
2011-11-01  6:34                                                   ` C-c C-c not working at end of #+end_src line (was: [RFC] Standardized code block keywords) Daniel Bausch
2011-10-25 14:17                         ` [RFC] Standardized code block keywords Eric Schulte
2011-10-26  5:41                           ` Daniel Bausch
2011-10-26  6:17                             ` Thomas S. Dye
2011-10-26 12:16                             ` Eric Schulte
2011-10-21 18:14           ` Thorsten
2011-10-20 21:34       ` [ANN] BREAKING CHANGE -- removing #+BABEL file-wide property lines Eric Schulte
2011-10-20 21:44         ` suvayu ali
2011-10-20 21:52           ` Eric Schulte
2011-10-20 22:23             ` Suvayu Ali
2011-10-20 21:47         ` Sebastien Vauban
2011-10-20 21:54           ` Eric Schulte
2011-10-20 21:57           ` Nick Dokos
2011-10-20 21:48         ` Nick Dokos
2011-10-20 21:57           ` Eric Schulte
2011-10-20 22:08             ` Nick Dokos
2011-10-20 22:18               ` Eric Schulte
2011-10-21  7:28                 ` Sebastien Vauban
2011-10-21  8:14                   ` Christian Moe
2011-10-21  9:12                     ` Rainer M Krug
2011-10-21 10:47                       ` Christian Moe
2011-10-21 10:59                         ` Rainer M Krug
2011-10-21 11:17                           ` Christian Moe
2011-10-21 11:18                             ` Rainer M Krug
2011-10-21 17:37                     ` Eric Schulte
2011-10-21 18:09                       ` Nick Dokos
2011-10-22 15:25                         ` Eric Schulte
2011-10-21 18:35                       ` Rainer M Krug
2011-10-21 18:40                         ` Rainer M Krug
2011-10-22  7:58                           ` Christian Moe
2011-10-24  9:44                             ` Rainer M Krug
2011-10-22 15:52                           ` Eric Schulte
2011-10-22 19:07                             ` Christian Moe
2011-10-24 10:10                               ` Rainer M Krug
2011-10-24 11:37                                 ` Christian Moe
2011-10-24 12:11                                   ` Sebastien Vauban
2011-10-24 12:38                                     ` Christian Moe
2011-10-24 15:07                                       ` Nicolas Goaziou
2011-10-24  9:50                             ` Rainer M Krug
2011-10-25  9:35                             ` Sebastien Vauban
2011-10-25 10:06                               ` Rainer M Krug
2011-10-25 10:31                                 ` Sebastien Vauban
2011-10-25 11:47                                   ` Rainer M Krug
2011-10-25 14:13                               ` Eric Schulte
2011-10-26 14:00                                 ` Sebastien Vauban
2011-10-26 15:20                                   ` Eric Schulte
2011-10-22 15:26                         ` Eric Schulte
2011-10-21 20:24                       ` Christian Moe
2011-10-21 21:05                         ` Darlan Cavalcante Moreira
2011-10-22  7:08                           ` Sebastien Vauban
2011-10-22 15:53                           ` Eric Schulte
2011-10-24 18:07                             ` Darlan Cavalcante Moreira
2011-10-31 18:53                               ` Eric Schulte
2011-10-31 20:18                                 ` Samuel Wales
     [not found]                                   ` <87obwwkia5.fsf@gmail.com>
     [not found]                                     ` <CAJcAo8scJXx=3s0f_FDAJXFKW2uh5gFTHwgDRbM6xXohr5ZPzQ@mail.gmail.com>
2011-10-31 22:22                                       ` Samuel Wales
2011-11-01  1:28                                         ` Eric Schulte
2011-11-01 14:26                                           ` Nick Dokos
2011-11-01 15:02                                             ` Nick Dokos
2011-11-01 15:17                                               ` Eric Schulte
2011-11-02 11:12                                                 ` Rainer M Krug
2011-11-02 12:18                                                   ` Nicolas Goaziou
2011-11-02 14:16                                                     ` Rainer M Krug
2011-11-03 18:40                                                   ` Eric Schulte
2011-11-03 18:51                                                     ` Jambunathan K
2011-11-04  9:15                                                       ` Rainer M Krug
2011-11-02 12:57                                                 ` Brian Wightman
2011-11-02 14:18                                                   ` Rainer M Krug
2011-11-03  1:29                                                   ` Bastien
2011-10-20 21:27     ` Christian Moe
2011-10-20 21:32       ` Nick Dokos

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=87d3dhosn3.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicholas.dokos@hp.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).