Browse Source

org-e-beamer: Do not normalize empty arguments

* contrib/lisp/org-e-beamer.el (org-e-beamer--normalize-argument): Do
  not normalize empty arguments.
Nicolas Goaziou 12 years ago
parent
commit
436c2a0794
1 changed files with 14 additions and 13 deletions
  1. 14 13
      contrib/lisp/org-e-beamer.el

+ 14 - 13
contrib/lisp/org-e-beamer.el

@@ -227,19 +227,20 @@ TYPE is a symbol among the following:
 `action'    Return ARGUMENT within angular brackets.
 `defaction' Return ARGUMENT within both square and angular brackets.
 `option'    Return ARGUMENT within square brackets."
-  (case type
-    (action (if (string-match "\\`<.*>\\'" argument) argument
-	      (format "<%s>" argument)))
-    (defaction (cond
-		((string-match "\\`\\[<.*>\\]\\'" argument) argument)
-		((string-match "\\`<.*>\\'" argument)
-		 (format "[%s]" argument))
-		((string-match "\\`\\[\\(.*\\)\\]\\'" argument)
-		 (format "[<%s>]" (match-string 1 argument)))
-		(t (format "[<%s>]" argument))))
-    (option (if (string-match "\\`\\[.*\\]\\'" argument) argument
-	      (format "[%s]" argument)))
-    (otherwise argument)))
+  (if (not (string-match "\\S-" argument)) ""
+    (case type
+      (action (if (string-match "\\`<.*>\\'" argument) argument
+		(format "<%s>" argument)))
+      (defaction (cond
+		  ((string-match "\\`\\[<.*>\\]\\'" argument) argument)
+		  ((string-match "\\`<.*>\\'" argument)
+		   (format "[%s]" argument))
+		  ((string-match "\\`\\[\\(.*\\)\\]\\'" argument)
+		   (format "[<%s>]" (match-string 1 argument)))
+		  (t (format "[<%s>]" argument))))
+      (option (if (string-match "\\`\\[.*\\]\\'" argument) argument
+		(format "[%s]" argument)))
+      (otherwise argument))))
 
 (defun org-e-beamer--element-has-overlay-p (element)
   "Non-nil when ELEMENT has an overlay specified.