From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp11.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id CNdtOmGctmMm6wAAbAwnHQ
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 05 Jan 2023 10:46:10 +0100
Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp11.migadu.com with LMTPS
	id gJ9zOmGctmN7yAAA9RJhRA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 05 Jan 2023 10:46:09 +0100
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id CF52A21420
	for <larch@yhetil.org>; Thu,  5 Jan 2023 10:43:43 +0100 (CET)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces@gnu.org>)
	id 1pDMVg-0004JQ-Ve; Thu, 05 Jan 2023 04:26:05 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@posteo.net>)
 id 1pDMVa-0004HX-8g
 for emacs-orgmode@gnu.org; Thu, 05 Jan 2023 04:25:58 -0500
Received: from mout01.posteo.de ([185.67.36.65])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@posteo.net>)
 id 1pDMVW-0005E6-Jg
 for emacs-orgmode@gnu.org; Thu, 05 Jan 2023 04:25:56 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id D89D1240063
 for <emacs-orgmode@gnu.org>; Thu,  5 Jan 2023 10:25:49 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1672910751; bh=IVXbKPUR4U236XIuqm29Hod1vwZ8BIgz775rwbxuOpQ=;
 h=From:To:Cc:Subject:Date:From;
 b=aYnU/gmgnKXpGNWxLQz5zMsDcIEfPh4tqc79lKbA287PExbJRQycR6tRBV1Kz1feK
 D4Zphn0t9k1fApWxKud9MqfFdjqN3R/ntIdfq+RXKsWiQInJ9YrrXMh7M+ifc3fqpo
 0R10/6BuNoIt6tWIjIJxrvqT81VOT23krhcT/sa/ZfGQCV4EqGY2VOqgVYxblTji2q
 q34Dxx8ErXHXYNEv7rRGKL8C0Q8I590QQRvhU8PSwK6nIar7FO0mTB3WYzass+oIIC
 lU9A2XCKr42lcvan9QPWBV/h5DQyT+7b6ixsWHlpovuEeBd3VZQrczAcHVx4ZDhMfX
 3klH2oqnQ3hZw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Nnh0X5HSQz6tm4;
 Thu,  5 Jan 2023 10:25:48 +0100 (CET)
From: Ihor Radchenko <yantar92@posteo.net>
To: alan.schmitt@polytechnique.org
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [BUG] CUSTOM_id ignored on blocks by ox-beamer
In-Reply-To: <m2r0wacy90.fsf@m4x.org>
References: <m2r0wacy90.fsf@m4x.org>
Date: Thu, 05 Jan 2023 09:26:20 +0000
Message-ID: <87lemhgwn7.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net;
 helo=mout01.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1672911823;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references:list-id:list-help:
	 list-unsubscribe:list-subscribe:list-post:dkim-signature;
	bh=1Bi/wY7bpRmUzwjSTHuxtxYn3S9qNYFK2JgRjpTy/nI=;
	b=YBLpdk/GNdbUv4bQ1KrggqbSqF1wU6DCYbWzqMGD72RRlVc8cGCheBq6rt7CFlXa7BeNLn
	zvLyJLrHEWL0byPWIp3/uX7PjZbEr8E5f86s2/WrBQenwVjWshuk4VQ39b5BRy5V0oxUdJ
	5zhO95uEHF1TGgXEBqw5y108ZdHOFYPOBUmdI0aoiQJwTZlVly7vmwpFA2eknVNZka5C4F
	N3jqZLJPGWjrH22G78NsV7LSlQBpPxROw2/gCKTEFVFyNvRbCoA1qCDlLrVBUPbyBpht2h
	MwDT4MsvULOR6QyutumquDKOQNkQlcEeBHV53fVC3i/giE58hXznUfdS8SFnCw==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b="aYnU/gmg";
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=posteo.net
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672911823; a=rsa-sha256; cv=none;
	b=Ay9WQcC7TrOBRvxptpsnBWIKJhYtZ0EfQzLOwt/NBheMVVYo8ufhbv3qxUn/HVaB2x8sMJ
	OuX1Wtz08l8hH2NtN9h/CwChpWmiulZnMnq3nxIx9m9xB9X6sFqwJaXNnJ4iSxrl2JZ9BK
	KgnYkxuSu7SBA/29EsoYz7yw0ThrcH5nqYT2V4/Tj292CQ6IV+ytBI3DJfe1DCZLE7m4lF
	u24yxerQNFvA38C819mQ7RnoBMn0WbmEHtZWE/Gx1pe6qKc+dmjExoUBfKS3pUVSCooJyC
	BujuGtsqIGEUV+S7aZV8UuvwY8s0y2sYFERmT+eWtKxspvvZdFd6mAPiMwKnzQ==
X-Spam-Score: -4.51
X-Migadu-Queue-Id: CF52A21420
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b="aYnU/gmg";
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=posteo.net
X-Migadu-Scanner: scn1.migadu.com
X-Migadu-Spam-Score: -4.51
X-TUID: bwCvcBhi+KBg

Confirmed.

alan.schmitt@polytechnique.org writes:

> I=E2=80=99m writing course slides in org-mode (exported currently to beam=
er, but
> I want to also have html export in the long run), and I have trouble
> linking blocks (for theorems or definitions), as the CUSTOM_ID property
> is ignored by ox-beamer on blocks.
>
> I see this issue has already been raised on the list
> (https://list.orgmode.org/87lflg9ts2.fsf@nicolasgoaziou.fr/T/), and
> looking at the code it seems that it still needs to be modified.
> Unfortunately the code for org-beamer--format-block is quite complex and
> I do not see how to change it to add a label. Could someone on the list
> please give me a hand?

If you look inside `org-beamer--format-block', it uses
`org-beamer-environments-default' and `org-beamer-environments-extra' to
format the blocks. See docstring for the latter for details.

The code responsible for LaTeX block generation is

     (when (nth 2 env-format) ; when we non-column block
      (concat
       (org-fill-template ...) ; opening \begin lines
       contents ; block body
       ... ; block closing \end lines
       )

org-fill-template is using the template from the
`org-beamer-environments-*' replacing %-chars as described in the
docstring.

In order to handle CUSTOM_ID property, you can
(1) Introduce a new %-substitude to be handled in org-fill-template
    call. It will insert block ID. (for example, using
    `org-beamer--get-label')
(2) modify `org-beamer-environments-default' to insert label
    appropriately.

Patches welcome!

--=20
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>