Browse Source

Macros: Fix bugs with macro arguments distributed over lines

Carsten Dominik 15 years ago
parent
commit
5ad80265af
2 changed files with 5 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 2 1
      lisp/org-exp.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-08-11  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-exp.el (org-export-preprocess-apply-macros): Make sure to
+	ignore newlines and space before the first macro argument.
+
 	* org-latex.el (org-export-latex-tables): Remove save-excursion
 	around `org-table-align'.
 

+ 2 - 1
lisp/org-exp.el

@@ -2057,7 +2057,7 @@ TYPE must be a string, any of:
   (goto-char (point-min))
   (let (sy val key args args2 s n)
     (while (re-search-forward
-	    "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\((\\([^\000]*?\\))\\)?}}}"
+	    "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\(([ \t\n]*\\([^\000]*?\\))\\)?}}}"
 	    nil t)
       (setq key (downcase (match-string 1))
 	    args (match-string 3))
@@ -2068,6 +2068,7 @@ TYPE must be a string, any of:
 	(save-match-data
 	  (when args
 	    (setq args (org-split-string args ",[ \t\n]*") args2 nil)
+	    (setq args (mapcar 'org-trim args))
 	    (while args
 	      (while (string-match "\\\\\\'" (car args))
 		;; repair bad splits