emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-beamer :BEAMER_ACT: ignored on columns
       [not found] <41d13343-d278-2474-ba8f-88d24621ab30@housseini.me>
@ 2022-10-05  6:38 ` reza
  2022-10-05  8:19   ` Fraga, Eric
  0 siblings, 1 reply; 12+ messages in thread
From: reza @ 2022-10-05  6:38 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 597 bytes --]

Hi List

I have the following MWE:

   * A section

   ** A Frame

   *** A left column
      :PROPERTIES:
      :BEAMER_COL: 0.48
      :END:

   *** A right column
      :PROPERTIES:
      :BEAMER_COL: 0.48
      :BEAMER_ACT: <2->
      :END:


And I would expect the following tex output:


   \section{A section}

   \begin{frame}{A Frame}

   \begin{columns}
   \begin{column}{0.48\columnwidth}
   \end{column}

   \begin{column}<2->{0.48\columnwidth}
   \end{column}
   \end{columns}

   \end{frame}

But the overlay specification is missing on the second column and I 
guess this is a bug?

[-- Attachment #2: OpenPGP_0xC375C6AF05125C52.asc --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #3: OpenPGP_signature --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-05  6:38 ` [BUG] org-beamer :BEAMER_ACT: ignored on columns reza
@ 2022-10-05  8:19   ` Fraga, Eric
  2022-10-06  3:06     ` Ihor Radchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Fraga, Eric @ 2022-10-05  8:19 UTC (permalink / raw)
  To: reza; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

On Wednesday,  5 Oct 2022 at 06:38, reza wrote:
> But the overlay specification is missing on the second column and I
> guess this is a bug?

Maybe a bug or more simply a missing feature.  On line 552 of
ox-beamer.el, we add options but there is no equivalent for adding
actions to the column definition.

The attached patch adds action processing but I've only tested it
minimally (busy with teaching unfortunately).

-- 
: Eric S Fraga, with org release_9.5.5-851-ge9781f in Emacs 29.0.50

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-ox-beamer.el-Add-BEAMER_ACT-to-column-definitio.patch --]
[-- Type: text/x-diff; name="0001-lisp-ox-beamer.el-Add-BEAMER_ACT-to-column-definitio.patch", Size: 1741 bytes --]

From 6668760b3be48610dddb03f20c5291760c11b8bf Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Wed, 5 Oct 2022 09:15:05 +0100
Subject: [PATCH] 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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 51684448d..1d84aae6e 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -512,6 +512,11 @@ used as a communication channel."
 	 (options (if raw-options
 		      (org-beamer--normalize-argument raw-options 'option)
 		    ""))
+         ;; also process actions
+	 (raw-actions (org-element-property :BEAMER_ACT headline))
+	 (actions (if raw-actions
+	              (org-beamer--normalize-argument raw-actions '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.
@@ -546,10 +551,11 @@ 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 "")
+	       (if (equal environment "column") actions "")
 	       (format "%s\\columnwidth" column-width)))
      ;; Block's opening string.
      (when (nth 2 env-format)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-05  8:19   ` Fraga, Eric
@ 2022-10-06  3:06     ` Ihor Radchenko
  2022-10-06  8:01       ` Fraga, Eric
  0 siblings, 1 reply; 12+ messages in thread
From: Ihor Radchenko @ 2022-10-06  3:06 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: reza, emacs-orgmode

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> On Wednesday,  5 Oct 2022 at 06:38, reza wrote:
>> But the overlay specification is missing on the second column and I
>> guess this is a bug?
>
> Maybe a bug or more simply a missing feature.  On line 552 of
> ox-beamer.el, we add options but there is no equivalent for adding
> actions to the column definition.
>
> The attached patch adds action processing but I've only tested it
> minimally (busy with teaching unfortunately).

Thanks for the patch anyway!

>  	 ;; 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.
> @@ -546,10 +551,11 @@ 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 "")
> +	       (if (equal environment "column") actions "")

Is there any reason why you only allow actions for "column" environment
specifically? What about other environments?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-06  3:06     ` Ihor Radchenko
@ 2022-10-06  8:01       ` Fraga, Eric
  2022-10-07 13:16         ` Fraga, Eric
  0 siblings, 1 reply; 12+ messages in thread
From: Fraga, Eric @ 2022-10-06  8:01 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: reza, emacs-orgmode

On Thursday,  6 Oct 2022 at 11:06, Ihor Radchenko wrote:
> Is there any reason why you only allow actions for "column" environment
> specifically? What about other environments?

Good question.  But I don't know the answer!  I was mimicking the existing code (e.g. the line above).  I am not sure of the logic of limiting to this case.  I can try (maybe tomorrow) to see what happens without the condition (and maybe try to understand the original logic).

-- 
: Eric S Fraga, with org release_9.5.5-840-g52be6f in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-06  8:01       ` Fraga, Eric
@ 2022-10-07 13:16         ` Fraga, Eric
  2022-10-08  6:10           ` Ihor Radchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Fraga, Eric @ 2022-10-07 13:16 UTC (permalink / raw)
  To: Org Mode List

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

On Thursday,  6 Oct 2022 at 08:01, Fraga, Eric wrote:
> On Thursday,  6 Oct 2022 at 11:06, Ihor Radchenko wrote:
>> Is there any reason why you only allow actions for "column" environment
>> specifically? What about other environments?

I've removed the check (not only for the new actions aspect but also for
the options bit) and beamer export seems to work just fine.  But with
minimal testing so testing by others would be welcome.

Updated patch attached.

-- 
: Eric S Fraga, with org release_9.5.5-851-ge9781f in Emacs 29.0.50

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-ox-beamer.el-Add-BEAMER_ACT-to-column-definitio.patch --]
[-- Type: text/x-diff; name="0001-lisp-ox-beamer.el-Add-BEAMER_ACT-to-column-definitio.patch", Size: 1740 bytes --]

From f2559723ee11eea7f606a48555ff79b2d5a5e03a Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Wed, 5 Oct 2022 09:15:05 +0100
Subject: [PATCH] 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 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 51684448d..ce0b6c0e0 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -512,6 +512,11 @@ used as a communication channel."
 	 (options (if raw-options
 		      (org-beamer--normalize-argument raw-options 'option)
 		    ""))
+         ;; also process actions
+	 (raw-actions (org-element-property :BEAMER_ACT headline))
+	 (actions (if raw-actions
+	              (org-beamer--normalize-argument raw-actions '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.
@@ -546,10 +551,11 @@ 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
+               actions
 	       (format "%s\\columnwidth" column-width)))
      ;; Block's opening string.
      (when (nth 2 env-format)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-07 13:16         ` Fraga, Eric
@ 2022-10-08  6:10           ` Ihor Radchenko
  2022-10-10  7:38             ` Fraga, Eric
  0 siblings, 1 reply; 12+ messages in thread
From: Ihor Radchenko @ 2022-10-08  6:10 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Org Mode List

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> On Thursday,  6 Oct 2022 at 08:01, Fraga, Eric wrote:
>> On Thursday,  6 Oct 2022 at 11:06, Ihor Radchenko wrote:
>>> Is there any reason why you only allow actions for "column" environment
>>> specifically? What about other environments?
>
> I've removed the check (not only for the new actions aspect but also for
> the options bit) and beamer export seems to work just fine.  But with
> minimal testing so testing by others would be welcome.
>
> Updated patch attached.

I am reading the whole patched function now, and I feel that something is
not right.

Note the complex processing of actions below the following comment

	  ;; 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.

This patch certainly adds code duplication and might also miss some
scenarios considered in the environments from
org-beamer-environments-default.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-08  6:10           ` Ihor Radchenko
@ 2022-10-10  7:38             ` Fraga, Eric
  2022-10-12  6:00               ` Ihor Radchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Fraga, Eric @ 2022-10-10  7:38 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org Mode List

On Saturday,  8 Oct 2022 at 14:10, Ihor Radchenko wrote:
> This patch certainly adds code duplication and might also miss some
> scenarios considered in the environments from
> org-beamer-environments-default.

I'm not sure what code duplication you are referring to unless it's the
two lines that now address actions and are similar to those for options.
The comments you referenced are from the original code.

-- 
: Eric S Fraga, with org release_9.5.5-851-ge9781f in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-10  7:38             ` Fraga, Eric
@ 2022-10-12  6:00               ` Ihor Radchenko
  2022-10-12  7:42                 ` Fraga, Eric
  0 siblings, 1 reply; 12+ messages in thread
From: Ihor Radchenko @ 2022-10-12  6:00 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Org Mode List

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> On Saturday,  8 Oct 2022 at 14:10, Ihor Radchenko wrote:
>> This patch certainly adds code duplication and might also miss some
>> scenarios considered in the environments from
>> org-beamer-environments-default.
>
> I'm not sure what code duplication you are referring to unless it's the
> two lines that now address actions and are similar to those for options.
> The comments you referenced are from the original code.

Let me elaborate.

Your patch adds for columns

         ;; also process actions
	 (raw-actions (org-element-property :BEAMER_ACT headline))
	 (actions (if raw-actions
	              (org-beamer--normalize-argument raw-actions 'action)
	            ""))

but the existing code also have

	  (let ((action (org-element-property :BEAMER_ACT headline)))

at least :BEAMER_ACT is acquired redundantly.

Further, the old code has

	     ((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))

So, depending on the :BEAMER_ACT value (if it is enclosed into [xxx]),
it is parsed differently.

---

I do not know if [xxx] vs xxx makes any difference for columns, but it
is generally not very clear why there is a distinction in one case but
not another. If using (org-beamer--normalize-argument raw-actions
'action) unconditionally (rather than 'defaction or 'action) is ok, at
least it deserves a comment in the code.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-12  6:00               ` Ihor Radchenko
@ 2022-10-12  7:42                 ` Fraga, Eric
  2022-10-13  2:39                   ` Ihor Radchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Fraga, Eric @ 2022-10-12  7:42 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org Mode List

Hi Ihor,

On Wednesday, 12 Oct 2022 at 14:00, Ihor Radchenko wrote:
> Your patch adds for columns

All I did was copy the code that was there for options and adapted for
actions.  I really do not understand what the rest of the code does and
really do not have the time (due to teaching obligations) to investigate
in more detail.  Sorry.  The patch solved the OP's problem...

I will try to have a better look in a few weeks when my teaching duties
subside a bit.

>          ;; also process actions
>          (raw-actions (org-element-property :BEAMER_ACT headline))
>          (actions (if raw-actions
>                       (org-beamer--normalize-argument raw-actions 'action)
>                     ""))

[...]

> I do not know if [xxx] vs xxx makes any difference for columns, but it

The org-beamer--normalize-argument function ensures that the action is
enclosed in [<...>] and [...] for options.

-- 
: Eric S Fraga, with org release_9.5.5-966-g88c85d in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-12  7:42                 ` Fraga, Eric
@ 2022-10-13  2:39                   ` Ihor Radchenko
  2022-10-13  8:59                     ` Fraga, Eric
  0 siblings, 1 reply; 12+ messages in thread
From: Ihor Radchenko @ 2022-10-13  2:39 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Org Mode List

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> On Wednesday, 12 Oct 2022 at 14:00, Ihor Radchenko wrote:
>> Your patch adds for columns
>
> All I did was copy the code that was there for options and adapted for
> actions.  I really do not understand what the rest of the code does and
> really do not have the time (due to teaching obligations) to investigate
> in more detail.  Sorry.  The patch solved the OP's problem...
>
> I will try to have a better look in a few weeks when my teaching duties
> subside a bit.

Take your time. What I do not want here is introducing new bugs. I am
not familiar with ox-beamer and do not want to miss anything subtle.

>>          ;; also process actions
>>          (raw-actions (org-element-property :BEAMER_ACT headline))
>>          (actions (if raw-actions
>>                       (org-beamer--normalize-argument raw-actions 'action)
>>                     ""))
>
> [...]
>
>> I do not know if [xxx] vs xxx makes any difference for columns, but it
>
> The org-beamer--normalize-argument function ensures that the action is
> enclosed in [<...>] and [...] for options.

Or <...>. In particular,
(org-beamer--normalize-argument raw-actions 'action)
, will return <raw-actions> (possibly stripping duplicate <>)
Looking at 12.7 Splitting a Frame into Multiple Columns section of the
beamer manual, it should be safe to use <raw-actions>.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-13  2:39                   ` Ihor Radchenko
@ 2022-10-13  8:59                     ` Fraga, Eric
  2022-11-14  5:48                       ` Ihor Radchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Fraga, Eric @ 2022-10-13  8:59 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org Mode List

On Thursday, 13 Oct 2022 at 10:39, Ihor Radchenko wrote:
> Take your time. What I do not want here is introducing new bugs. I am
> not familiar with ox-beamer and do not want to miss anything subtle.

Thank you.  I'll update you in due course.

> Or <...>. In particular,
> (org-beamer--normalize-argument raw-actions 'action)
> , will return <raw-actions> (possibly stripping duplicate <>)
> Looking at 12.7 Splitting a Frame into Multiple Columns section of the
> beamer manual, it should be safe to use <raw-actions>.

That is likely true.  I have never put actions on columns before in
beamer, only on items or more low level constructs, so I will need to
play around a little to ensure we don't break anything.  With [<...>],
things work so far (for columns), however.

-- 
: Eric S Fraga, with org release_9.5.5-840-g52be6f in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [BUG] org-beamer :BEAMER_ACT: ignored on columns
  2022-10-13  8:59                     ` Fraga, Eric
@ 2022-11-14  5:48                       ` Ihor Radchenko
  0 siblings, 0 replies; 12+ messages in thread
From: Ihor Radchenko @ 2022-11-14  5:48 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Ihor Radchenko, Org Mode List

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> On Thursday, 13 Oct 2022 at 10:39, Ihor Radchenko wrote:
>> Take your time. What I do not want here is introducing new bugs. I am
>> not familiar with ox-beamer and do not want to miss anything subtle.
>
> Thank you.  I'll update you in due course.

Have you had a chance to look into this?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-11-15  1:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <41d13343-d278-2474-ba8f-88d24621ab30@housseini.me>
2022-10-05  6:38 ` [BUG] org-beamer :BEAMER_ACT: ignored on columns reza
2022-10-05  8:19   ` Fraga, Eric
2022-10-06  3:06     ` Ihor Radchenko
2022-10-06  8:01       ` Fraga, Eric
2022-10-07 13:16         ` Fraga, Eric
2022-10-08  6:10           ` Ihor Radchenko
2022-10-10  7:38             ` Fraga, Eric
2022-10-12  6:00               ` Ihor Radchenko
2022-10-12  7:42                 ` Fraga, Eric
2022-10-13  2:39                   ` Ihor Radchenko
2022-10-13  8:59                     ` Fraga, Eric
2022-11-14  5:48                       ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).