Browse Source

removing alternate code block variable syntax

* doc/org.texi (var): Remove the "Alternate argument syntax" section
  from the documentation.
* lisp/ob-core.el (org-babel-src-name-w-name-regexp): Update the regexp
  used to match code block names.
  (org-babel-get-src-block-info): Remove the code used to parse this
  alternate variable specification syntax.
Eric Schulte 12 years ago
parent
commit
2f39a704cf
2 changed files with 2 additions and 29 deletions
  1. 0 13
      doc/org.texi
  2. 2 16
      lisp/ob-core.el

+ 0 - 13
doc/org.texi

@@ -13327,19 +13327,6 @@ on two lines
 
 @end table
 
-@subsubheading Alternate argument syntax
-It is also possible to specify arguments in a potentially more natural way
-using the @code{#+NAME:} line of a code block.  As in the following
-example, arguments can be packed inside of parentheses, separated by commas,
-following the source name.
-
-@example
-#+NAME: double(input=0, x=2)
-#+BEGIN_SRC emacs-lisp
-(* 2 (+ input x))
-#+END_SRC
-@end example
-
 @subsubheading Indexable variable values
 It is possible to reference portions of variable values by ``indexing'' into
 the variables.  Indexes are 0 based with negative values counting back from

+ 2 - 16
lisp/ob-core.el

@@ -170,7 +170,7 @@ See also `org-babel-noweb-wrap-start'."
 	  "\\("
 	  org-babel-multi-line-header-regexp
 	  "\\)*"
-	  "\\([^ ()\f\t\n\r\v]+\\)\\(\(\\(.*\\)\)\\|\\)")
+	  "\\([^ ()\f\t\n\r\v]+\\)")
   "Regular expression matching source name lines with a name.")
 
 (defvar org-babel-src-block-regexp
@@ -261,21 +261,7 @@ 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-no-properties (match-string 3)))
-	    (when (and (match-string 5) (> (length (match-string 5)) 0))
-	      (setf (nth 2 info) ;; merge functional-syntax vars and header-args
-		    (org-babel-merge-params
-		     (mapcar
-		      (lambda (ref) (cons :var ref))
-		      (mapcar
-		       (lambda (var) ;; check that each variable is initialized
-			 (if (string-match ".+=.+" var)
-			     var
-			   (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 5))))
-		     (nth 2 info))))))
+	    (setq name (org-no-properties (match-string 3)))))
       ;; inline source block
       (when (org-babel-get-inline-src-block-matches)
 	(setq info (org-babel-parse-inline-src-block-match))))