From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2BD3315800A for ; Sat, 26 Aug 2023 06:52:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 381B12BC10F; Sat, 26 Aug 2023 06:52:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2329A2BC10F for ; Sat, 26 Aug 2023 06:52:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4F9EE340AD2 for ; Sat, 26 Aug 2023 06:52:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C4C3A1064 for ; Sat, 26 Aug 2023 06:52:16 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1693032666.9ad1e2555ee67d4cd7dfc538f09f37b1eecc5566.ulm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/elisp-common.eclass X-VCS-Directories: eclass/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 9ad1e2555ee67d4cd7dfc538f09f37b1eecc5566 X-VCS-Branch: master Date: Sat, 26 Aug 2023 06:52:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 078f29af-8fa4-4b2f-9c95-38973e723dad X-Archives-Hash: b7f43ed5362f244d1e66046089329d52 commit: 9ad1e2555ee67d4cd7dfc538f09f37b1eecc5566 Author: Maciej Barć gentoo org> AuthorDate: Tue Aug 22 13:48:26 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sat Aug 26 06:51:06 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ad1e255 eclass/elisp-common.eclass: add elisp-org-export-to Signed-off-by: Maciej Barć gentoo.org> Signed-off-by: Ulrich Müller gentoo.org> eclass/elisp-common.eclass | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 03e47d931f44..ef24622d405e 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -348,6 +348,39 @@ elisp-make-autoload-file() { eend $? "elisp-make-autoload-file: batch-update-autoloads failed" || die } +# @FUNCTION: elisp-org-export-to +# @USAGE: +# @DESCRIPTION: +# Use Emacs Org "export-to" functions to convert a given Org file to a picked +# format. +# +# Example: +# @CODE +# elisp-org-export-to texinfo README.org +# mv README.texi ${PN}.texi || die +# @CODE + +elisp-org-export-to() { + local export_format="${1}" + local org_file_path="${2}" + + local export_group + case ${export_format} in + info) export_group=texinfo ;; # Straight to ".info". + markdown) export_group=md ;; + pdf) export_group=latex ;; + *) export_group=${export_format} ;; + esac + + # export_format = texinfo => org-texinfo-export-to-texinfo + # export_format = pdf => org-latex-export-to-pdf + + local export_function=org-${export_group}-export-to-${export_format} + + ${EMACS} ${EMACSFLAGS} "${org_file_path}" -f "${export_function}" \ + || die "Org export to ${export_format} failed" +} + # @FUNCTION: elisp-test-buttercup # @USAGE: [test-subdirectory] [test-runner-opts] ... # @DESCRIPTION: