summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-08-22 17:45:18 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2012-08-22 17:45:18 +0200
commit436c2a0794cb719834bce82c4194bd0a544a401e (patch)
tree78e9e554de5a4c4152e2259514a9a6acde97250f
parentcd9ce4b9141366b9c2364a96d26b1ec3da6a3c61 (diff)
downloadorg-mode-436c2a0794cb719834bce82c4194bd0a544a401e.tar.gz
org-e-beamer: Do not normalize empty arguments
* contrib/lisp/org-e-beamer.el (org-e-beamer--normalize-argument): Do not normalize empty arguments.
-rw-r--r--contrib/lisp/org-e-beamer.el27
1 files changed, 14 insertions, 13 deletions
diff --git a/contrib/lisp/org-e-beamer.el b/contrib/lisp/org-e-beamer.el
index a579bd7..85a0482 100644
--- a/contrib/lisp/org-e-beamer.el
+++ b/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.