From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Re: ox-beamer and CUSTOM_ID Date: Wed, 14 Oct 2015 11:47:14 +0200 Message-ID: References: <87pp0izi1f.fsf@nicolasgoaziou.fr> <87h9luzgyd.fsf@nicolasgoaziou.fr> <874mhuze22.fsf@nicolasgoaziou.fr> <87vbaaxvia.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b471cb4aec48c05220d73b0 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmIem-0003Pj-5s for emacs-orgmode@gnu.org; Wed, 14 Oct 2015 05:47:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmIel-0001pQ-5t for emacs-orgmode@gnu.org; Wed, 14 Oct 2015 05:47:36 -0400 Received: from mail-ob0-x235.google.com ([2607:f8b0:4003:c01::235]:36596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmIek-0001p6-VM for emacs-orgmode@gnu.org; Wed, 14 Oct 2015 05:47:35 -0400 Received: by obbrx8 with SMTP id rx8so34982355obb.3 for ; Wed, 14 Oct 2015 02:47:34 -0700 (PDT) In-Reply-To: <87vbaaxvia.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Fabrice Popineau , "emacs-orgmode@gnu.org" --047d7b471cb4aec48c05220d73b0 Content-Type: text/plain; charset=UTF-8 2015-10-14 0:18 GMT+02:00 Nicolas Goaziou : > Fabrice Popineau writes: > > > This is a pity. Things would be more straightforward. > > Straightforward for what? Use againframes? Or force label? > > Force label. Having to explicitly state it twice : * Frame 1 :PROPERTIES: :CUSTOM_ID: foo :BEAMER_opt: label=foo :END: is not exactly straightforward. The following (crude) patch would avoid it. Anyway, the BEAMER_opt label= way of setting the label is not Org-y. Regards, Fabrice diff --git a/vendor/org-mode/lisp/ox-beamer.el b/vendor/org-mode/lisp/ox-beamer.el index 24dcf19..cc8d241 100644 --- a/vendor/org-mode/lisp/ox-beamer.el +++ b/vendor/org-mode/lisp/ox-beamer.el @@ -333,11 +333,13 @@ INFO is a plist used as a communication channel. The value is either the label specified in \"BEAMER_opt\" property, or a fallback value built from headline's number. This function assumes HEADLINE will be treated as a frame." + (if org-latex-prefer-user-labels + (org-element-property :CUSTOM_ID headline) (let ((opt (org-element-property :BEAMER_OPT headline))) (if (and (stringp opt) (string-match "\\(?:^\\|,\\)label=\\(.*?\\)\\(?:$\\|,\\)" opt)) (match-string 1 opt) - (format "{sec:%s}" (org-export-get-reference headline info))))) + (format "{sec:%s}" (org-export-get-reference headline info)))))) (defun org-beamer--frame-level (headline info) "Return frame level in subtree containing HEADLINE. --047d7b471cb4aec48c05220d73b0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


2015-10-14 0:18 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr= >:
Fabrice Popineau <= fabrice.popineau@gmail.com> writes:

> This is a pity. Things would be more straightforward.

Straightforward for what? Use againframes? Or force label?



=C2=A0 :PROPERTIES:
=C2=A0 :CUSTOM_ID: foo
=C2=A0 :BEAMER_opt: label=3Dfoo
=C2=A0 :END:=

is not exactly strai= ghtforward. The following (crude) patch would avoid it.
=

Anyway, the BEAMER_opt label=3D w= ay of setting the label is not Org-y.

Regards,

Fabrice

diff --git a/vendor/org-= mode/lisp/ox-beamer.el b/vendor/org-mode/lisp/ox-beamer.el
index 24= dcf19..cc8d241 100644
--- a/vendor/org-mode/lisp/ox-beamer.el
+++ b/vendor/org-mode/lisp/ox-beamer.el
@@ -333,11 +333,13 @@ IN= FO is a plist used as a communication channel.
=C2=A0The value is e= ither the label specified in \"BEAMER_opt\"
=C2=A0propert= y, or a fallback value built from headline's number.=C2=A0 This<= /div>
=C2=A0function assumes HEADLINE will be treated as a frame."
= + =C2=A0(if org-latex-prefer-user-labels
+ =C2=A0 =C2=A0 =C2=A0(org= -element-property :CUSTOM_ID headline)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(= let ((opt (org-element-property :BEAMER_OPT headline)))
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 (if (and (stringp opt)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(string-match "\\(?:^\\|,\\)labe= l=3D\\(.*?\\)\\(?:$\\|,\\)" opt))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (match-string 1 opt)
- =C2=A0 =C2=A0 =C2=A0(format &q= uot;{sec:%s}" (org-export-get-reference headline info)))))
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "{sec:%s}" (org-export-get-re= ference headline info))))))

=C2=A0(defun org-beamer--f= rame-level (headline info)
=C2=A0 =C2=A0"Return frame level in= subtree containing HEADLINE.
<= br>


--047d7b471cb4aec48c05220d73b0--