[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org c9ed0388e7 3/4: lisp/ox-beamer.el: Add BEAMER_ACT t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org c9ed0388e7 3/4: lisp/ox-beamer.el: Add BEAMER_ACT to column definition |
Date: |
Wed, 31 Jan 2024 10:00:22 -0500 (EST) |
branch: externals/org
commit c9ed0388e722255dcf67e66ef68aacc4c78c3847
Author: Eric S Fraga <e.fraga@ucl.ac.uk>
Commit: Ihor Radchenko <yantar92@posteo.net>
lisp/ox-beamer.el: Add BEAMER_ACT to column definition
* ox-beamer.el (org-beamer--format-block): Process BEAMER_ACT if given
for column block.
---
lisp/ox-beamer.el | 62 ++++++++++++++++++++++++++++++++-----------------------
1 file changed, 36 insertions(+), 26 deletions(-)
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index cc2dcbfb29..4434614c7e 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -513,6 +513,18 @@ used as a communication channel."
(options (if raw-options
(org-beamer--normalize-argument raw-options 'option)
""))
+ ;; also process actions
+ (raw-action (org-element-property :BEAMER_ACT headline))
+ (action (if raw-action
+ ;; If BEAMER_act property has its value enclosed in square
+ ;; brackets, it is a default overlay specification and
+ ;; overlay specification is empty. Otherwise, it is an
+ ;; overlay specification and the default one is nil.
+ (org-beamer--normalize-argument
+ raw-action
+ (if (string-match "\\`\\[.*\\]\\'" raw-action) 'defaction
+ 'action))
+ ""))
;; Start a "columns" environment when explicitly requested or
;; when there is no previous headline or the previous
;; headline do not have a BEAMER_column property.
@@ -522,12 +534,12 @@ used as a communication channel."
(or (equal environment "columns")
(and column-width
(not (and parent-env
- (equal (downcase parent-env) "columns")))
+ (equal (downcase parent-env) "columns")))
(or (org-export-first-sibling-p headline info)
(not (org-element-property
- :BEAMER_COL
- (org-export-get-previous-element
- headline info)))))))
+ :BEAMER_COL
+ (org-export-get-previous-element
+ headline info)))))))
;; End the "columns" environment when explicitly requested or
;; when there is no next headline or the next headline do not
;; have a BEAMER_column property.
@@ -535,11 +547,11 @@ used as a communication channel."
(or (equal environment "columns")
(and column-width
(not (and parent-env
- (equal (downcase parent-env) "columns")))
+ (equal (downcase parent-env) "columns")))
(or (org-export-last-sibling-p headline info)
(not (org-element-property
- :BEAMER_COL
- (org-export-get-next-element headline info))))))))
+ :BEAMER_COL
+ (org-export-get-next-element headline info))))))))
(concat
(when start-columns-p
;; Column can accept options only when the environment is
@@ -547,10 +559,13 @@ used as a communication channel."
(if (not (equal environment "columns")) "\\begin{columns}\n"
(format "\\begin{columns}%s\n" options)))
(when column-width
- (format "\\begin{column}%s{%s}\n"
+ (format "\\begin{column}%s%s{%s}\n"
;; One can specify placement for column only when
;; HEADLINE stands for a column on its own.
- (if (equal environment "column") options "")
+ options
+ (if env-format
+ "" ; Inner environment is specified - pass actions later.
+ action)
(format "%s\\columnwidth" column-width)))
;; Block's opening string.
(when (nth 2 env-format)
@@ -558,23 +573,18 @@ used as a communication channel."
(org-fill-template
(nth 2 env-format)
(nconc
- ;; If BEAMER_act property has its value enclosed in square
- ;; brackets, it is a default overlay specification and
- ;; overlay specification is empty. Otherwise, it is an
- ;; overlay specification and the default one is nil.
- (let ((action (org-element-property :BEAMER_ACT headline)))
- (cond
- ((not action) (list (cons "a" "") (cons "A" "") (cons "R" "")))
- ((and (string-prefix-p "[" action)
- (string-suffix-p "]" action))
- (list
- (cons "A" (org-beamer--normalize-argument action 'defaction))
- (cons "a" "")
- (cons "R" action)))
- (t
- (list (cons "a" (org-beamer--normalize-argument action 'action))
- (cons "A" "")
- (cons "R" action)))))
+ (cond
+ ((not action) (list (cons "a" "") (cons "A" "") (cons "R" "")))
+ ((and (string-prefix-p "[" action)
+ (string-suffix-p "]" action))
+ (list
+ (cons "A" (org-beamer--normalize-argument action 'defaction))
+ (cons "a" "")
+ (cons "R" raw-action)))
+ (t
+ (list (cons "a" action)
+ (cons "A" "")
+ (cons "R" raw-action))))
(list (cons "o" options)
(cons "O" (or raw-options ""))
(cons "h" title)