summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus <rasmus@gmx.us>2017-08-10 20:31:07 +0200
committerRasmus <rasmus@gmx.us>2017-08-10 20:31:07 +0200
commit323fc95b4f7fda0948babb12d61a4bcb3423b84b (patch)
tree28dae1cded6cd69483b7c71ddfee0ca5a44782ed
parent33e0dc61556d35d3a6a0d3da45bfd1ec03e94394 (diff)
downloadorg-mode-323fc95b4f7fda0948babb12d61a4bcb3423b84b.tar.gz
ox-beamer: Fix bug related to frame options
* lisp/ox-beamer.el (org-beamer--format-frame): Remove empty options explicitly. Reported-by: Jarmo Hurri <jarmo.hurri@iki.fi> <http://permalink.gmane.org/gmane.emacs.orgmode/115190>
-rw-r--r--lisp/ox-beamer.el56
1 files changed, 29 insertions, 27 deletions
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 82651d3..e721550 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -423,33 +423,35 @@ used as a communication channel."
;; Options, if any.
(let* ((beamer-opt (org-element-property :BEAMER_OPT headline))
(options
- ;; Collect options from default value and headline's
- ;; properties. Also add a label for links.
- (append
- (org-split-string
- (plist-get info :beamer-frame-default-options) ",")
- (and beamer-opt
- (org-split-string
- ;; Remove square brackets if user provided
- ;; them.
- (and (string-match "^\\[?\\(.*\\)\\]?$" beamer-opt)
- (match-string 1 beamer-opt))
- ","))
- ;; Provide an automatic label for the frame
- ;; unless the user specified one. Also refrain
- ;; from labeling `allowframebreaks' frames; this
- ;; is not allowed by beamer.
- (unless (and beamer-opt
- (or (string-match "\\(^\\|,\\)label=" beamer-opt)
- (string-match "allowframebreaks" beamer-opt)))
- (list
- (let ((label (org-beamer--get-label headline info)))
- ;; Labels containing colons need to be
- ;; wrapped within braces.
- (format (if (string-match-p ":" label)
- "label={%s}"
- "label=%s")
- label)))))))
+ ;; Collect nonempty options from default value and
+ ;; headline's properties. Also add a label for
+ ;; links.
+ (cl-remove-if-not 'org-string-nw-p
+ (append
+ (org-split-string
+ (plist-get info :beamer-frame-default-options) ",")
+ (and beamer-opt
+ (org-split-string
+ ;; Remove square brackets if user provided
+ ;; them.
+ (and (string-match "^\\[?\\(.*\\)\\]?$" beamer-opt)
+ (match-string 1 beamer-opt))
+ ","))
+ ;; Provide an automatic label for the frame
+ ;; unless the user specified one. Also refrain
+ ;; from labeling `allowframebreaks' frames; this
+ ;; is not allowed by beamer.
+ (unless (and beamer-opt
+ (or (string-match "\\(^\\|,\\)label=" beamer-opt)
+ (string-match "allowframebreaks" beamer-opt)))
+ (list
+ (let ((label (org-beamer--get-label headline info)))
+ ;; Labels containing colons need to be
+ ;; wrapped within braces.
+ (format (if (string-match-p ":" label)
+ "label={%s}"
+ "label=%s")
+ label))))))))
;; Change options list into a string.
(org-beamer--normalize-argument
(mapconcat