From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id wCB2MJqBx2YmyQAA62LTzQ:P1 (envelope-from ) for ; Thu, 22 Aug 2024 18:21:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id wCB2MJqBx2YmyQAA62LTzQ (envelope-from ) for ; Thu, 22 Aug 2024 20:21:14 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=adamkovic.org header.s=fm2 header.b=A26umXbZ; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b="N/D9CYUh"; 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=fail reason="SPF not aligned (relaxed)" header.from=adamkovic.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1724350874; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=MvBJ46o3GEErIOPvYGboIxcGYuh7Kn8QA91m51NTuxc=; b=MS7zz8UYuUhg3vsfu7zO/72lRKNGLwHb5tnsjv/4VBsXobgWJHmNn6r1HzRd/VaPDMbyqz ex+Blwlg/n9kItJJAr2Ia3b557FPOMOqfyJF0DDxjFQ5TPbwNfFmMNUYxOFXUhQZzxx2hR zoe75r179fwipHKA2Ffzu6anTkR/WJ8Nk1iEdJFVmA66NNQcKLmAJjjdH7NI0Mz3pqSoJy jtnf67tEV9qpQDu5MLowOSdnWuonpXITt/0Wi4miVPmaWfKwF72fIK+pfDoZkhJe0iLIbr qjkftqJDQeH9ek85MNoMZxoODRhMYAcIlNn0KyVzZgmOKGIw/Ee0UQna6Fs4Yg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=adamkovic.org header.s=fm2 header.b=A26umXbZ; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b="N/D9CYUh"; 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=fail reason="SPF not aligned (relaxed)" header.from=adamkovic.org (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1724350874; a=rsa-sha256; cv=none; b=A1vLoTF2D/HJOhMtdYO73JdDjTRW0RBg/+9Byb5briNGtFYpz3E0pNy56Y7ydNN3UVcc1u j68PJAespHRl2nUbJ2O3wfvCVPdy4+u0cW/JdRkaaFXAaPpHAdJvB4T30zr++VfBP8mXnY AxSFVMlB6VWMtlYSZsMxSuoo1InFjd4FE8M0obtT4pmzaGjnNI7jPgUDhDQPiGNjnY0YT6 GcVRm0FUS5SZpHlwo05S1c/A+0TlvchsCBUyU+BSrjsZGiYQD+MOA4P1PRPULlqMdrXfT9 A/gbhBovh5ncZidpeFa+GSHeNxoDxFpDToXQ4JMsE1a7piI8JuICj/lgUdKU1Q== 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 B65B8BB53 for ; Thu, 22 Aug 2024 20:21:13 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shCQ0-0002WH-Ms; Thu, 22 Aug 2024 14:20:20 -0400 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 ) id 1shCPw-0002UL-NK for emacs-orgmode@gnu.org; Thu, 22 Aug 2024 14:20:17 -0400 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shCPr-0007xa-Ir for emacs-orgmode@gnu.org; Thu, 22 Aug 2024 14:20:15 -0400 Received: from phl-compute-06.internal (phl-compute-06.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 79F0F1151C1C for ; Thu, 22 Aug 2024 14:20:10 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Thu, 22 Aug 2024 14:20:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamkovic.org; h=cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1724350810; x=1724437210; bh=3fwkHsaxjDiFHrShIXFD/LHzR+P9mwK2 z75hb0GLh9I=; b=A26umXbZF1bLtzecNB5/60mwZv9/4OAPBIUXMTvRSbW5AFc8 tqPnLQ55JM1COXGIcaYpaxT2muGAqjYseiXfutvh79wwkPpxK00FpijsVvGVRIYT MrDkZqqaEjjqbLt/hsX7EJNVBDQbY2iK0ap9AbJ6dDMMJWWdNSHTz0MXgkJFnnCp KC8lDpep/+oyhyFktCE9RU6W0FWzaBlvtOM7GV6r85A7sA2zWWZTyOSfUhhStQUM X4nkcN4Wyw7TSmN6n7wpGzqGKw+ozI4UmM7uD0GY4CVWXFHrws/mQzDlc2t7Dqwz ZH82Ah7ZM8bvu9gXdtFZBkIyMo3wbxsWqKh++A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1724350810; x=1724437210; bh=3fwkHsaxjDiFHrShIXFD/LHzR+P9mwK2z75 hb0GLh9I=; b=N/D9CYUhGgYmGDTdYkRo4m0DltJeyjCGyZRs7+65WIjcz/8QCuc b63JWAlxm1acrUOtOqH2pAxl91MxtRX/BogCv4ErLgLyWm90uc4XWT/riSLEwlm9 QFqnsBSJYj8N9Sj1YY9uPmOovnPrnlZOb2iwljZnAP104GffIhO8pa+MH2NSoB60 k8H+4lpZQuoFeZXIq/cUC/2xYYfMJuEXkZVfnkEAVmTpxCwkvhM1aEgNVY71CuHJ g37Bcs1aLP+tShUEa1IFDUKkJ3xOta52B067Dj7ZkBojIEsymtKjDlC+nH3EpPRS 4O8/zoDiL0aI1XvPiIaifUQQBffcyPXd+Yg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddvtddguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvuf ffkfggtgesmhdtreertddtjeenucfhrhhomheptfhuugholhhfucetuggrmhhkohhvihgt uceorhhuugholhhfsegruggrmhhkohhvihgtrdhorhhgqeenucggtffrrghtthgvrhhnpe ffkeefuedufedtkeevjeejveetffduteejteegtdffudeuvdejkedvjeeuieevffenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehruhguohhlfh esrggurghmkhhovhhitgdrohhrghdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhht phhouhhtpdhrtghpthhtohepvghmrggtshdqohhrghhmohguvgesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i88214938:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 22 Aug 2024 14:20:09 -0400 (EDT) From: =?utf-8?Q?Rudolf_Adamkovi=C4=8D?= To: emacs-orgmode@gnu.org Subject: Texinfo: Custom navigation and links in headings Date: Thu, 22 Aug 2024 20:20:07 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=103.168.172.159; envelope-from=rudolf@adamkovic.org; helo=fhigh8-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 X-Spam-Score: 2.42 X-Migadu-Queue-Id: B65B8BB53 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: 2.42 X-TUID: MKhN90/Prkke --=-=-= Content-Type: text/plain Howdy! I would like to contribute two patches for the Texinfo exporter: 1. Custom, or disabled, Texinfo navigation. This enables the user to, e.g. - put a top-level tree to a wider "Up" context, or - hide "Next" and "Previous" for a group of unrelated headings, or - build deeper hierarchies if needed. 2. Links in Texinfo section names. Importantly, this also applies to sub-`h:' headings, which are exported as plain lists. (Note: Links are a bit buggy on the Texinfo side, but that is not an Org issue; they are supported, and I find them useful.) Thank you. Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ox-texinfo-Add-support-for-custom-navigation-hierarc.patch >From 1c4fc3979ea26ca93742b16d9c135ec62a8b4d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Thu, 22 Aug 2024 12:27:01 +0200 Subject: [PATCH 1/2] ox-texinfo: Add support for custom navigation hierarchies * doc/org-manual.org (Headings and sectioning structure): Describe the new functionality in detail. * etc/ORG-NEWS (Texinfo exports can have custom navigation hierarchies): Inform end users about the new functionality. * lisp/org.el (org-default-properties): Offer the `ALT_TITLE' and `ALT_NAVIGATION' properties for completion. * lisp/ox-texinfo.el (org-texinfo-headline): Use the `ALT_NAVIGATION' property when generating Texinfo notes to set the Next, Previous, and Up pointers of the relevant Texinfo node. * testing/lisp/test-ox-texinfo.el (test-ox-texinfo/alt-title): (test-ox-texinfo/alt-navigation/all-directions): (test-ox-texinfo/alt-navigation/one-direction): (test-ox-texinfo/alt-navigation/no-directions): (test-ox-texinfo/alt-navigation/with-alt-title): Test the new functionality to avoid regressions in the future. --- doc/org-manual.org | 23 ++++++++ etc/ORG-NEWS | 7 +++ lisp/org.el | 3 +- lisp/ox-texinfo.el | 5 +- testing/lisp/test-ox-texinfo.el | 99 +++++++++++++++++++++++++++++++++ 5 files changed, 135 insertions(+), 2 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 9365c66b1..9b53c13c1 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -15999,6 +15999,29 @@ the node in which a reader enters an Info manual. As such, it is expected not to appear in printed output generated from the =.texi= file. See [[info:texinfo::The Top Node]], for more information. +#+cindex: @samp{ALT_NAVIGATION}, property +By default, Texinfo automatically sets the /Next/, /Previous/, and +/Up/ pointers, reflecting the hierarchy of your document. If you want +it to reflect a different hierarchy, or no hierarchy at all, set the +=ALT_NAVIGATION= property to a list of at most 3 titles, separated by +commas, to be used for the /Next/, /Previous/, and /Up/ pointers, +respectively. For example: + +#+begin_example +,* Mathematical Logic + :PROPERTIES: + :ALT_TITLE: Logic + :END: + +,* Proposition + :PROPERTIES: + :ALT_NAVIGATION: ,, Logic + :END: + + - /Next/ and /Previous/ disabled. + - /Up/ leads to [[Mathematical Logic]]. +#+end_example + *** Indices :PROPERTIES: :DESCRIPTION: Creating indices. diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 392788055..25dd3ae49 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -77,6 +77,13 @@ You can now create links to =shortdoc= documentation groups for Emacs Lisp functions (see =M-x shortdoc-display-group=). Requires Emacs 28 or newer. +*** Texinfo exports can have custom navigation hierarchies + +You can now alter the Texinfo navigation hierarchy by specifying the +/Next/, /Previous/, and /Up/ pointers in the =ALT_NAVIGATION= +property. For more information, see "13.14.6 Headings and sectioning +structure" section of the Org manual. + ** New and changed options # Chanes deadling with changing default values of customizations, diff --git a/lisp/org.el b/lisp/org.el index d5c1dcb35..dcd05571e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12691,7 +12691,8 @@ but in some other way.") "EXPORT_TITLE" "EXPORT_AUTHOR" "EXPORT_DATE" "UNNUMBERED" "ORDERED" "NOBLOCKING" "COOKIE_DATA" "LOG_INTO_DRAWER" "REPEAT_TO_STATE" "CLOCK_MODELINE_TOTAL" "STYLE" "HTML_CONTAINER_CLASS" - "ORG-IMAGE-ACTUAL-WIDTH") + "ORG-IMAGE-ACTUAL-WIDTH" + "ALT_TITLE" "ALT_NAVIGATION") "Some properties that are used by Org mode for various purposes. Being in this list makes sure that they are offered for completion.") diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 6adee9fca..43fdf27ae 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1102,6 +1102,7 @@ holding contextual information." (full-text (funcall (plist-get info :texinfo-format-headline-function) todo todo-type priority text tags)) + (navigation (org-element-property :ALT_NAVIGATION headline)) (contents (concat "\n" (if (org-string-nw-p contents) (concat "\n" contents) "") @@ -1118,7 +1119,9 @@ holding contextual information." (concat ;; Even if HEADLINE is using @subheading and al., leave an ;; anchor so cross-references in the Org document still work. - (format (if notoc? "@anchor{%s}\n" "@node %s\n") node) + (format (if notoc? "@anchor{%s}" "@node %s") node) + (if navigation (concat "," navigation) "") + "\n" (format command full-text) contents)))))) diff --git a/testing/lisp/test-ox-texinfo.el b/testing/lisp/test-ox-texinfo.el index b16a344e7..352df378f 100644 --- a/testing/lisp/test-ox-texinfo.el +++ b/testing/lisp/test-ox-texinfo.el @@ -345,5 +345,104 @@ body (should-not (org-element-contents section)) (should (eq first-heading (org-element-parent section))))))) + +;;; Alternative title and navigation + +(ert-deftest test-ox-texinfo/alt-title () + "Test alternative titles." + (should + (org-test-with-temp-text + (string-join + (list "* Title 1" + ":PROPERTIES:" + ":ALT_TITLE: Title 2" + ":END:") + "\n") + (let ((export-buffer "*Test Texinfo Export*") + (org-export-show-temporary-export-buffer nil)) + (org-export-to-buffer 'texinfo export-buffer + nil nil nil nil nil + #'texinfo-mode) + (with-current-buffer export-buffer + (goto-char (point-min)) + (search-forward "@node Title 2")))))) + +(ert-deftest test-ox-texinfo/alt-navigation/all-directions () + "Test alternative navigation in all directions." + (should + (org-test-with-temp-text + (string-join + (list "* Title" + ":PROPERTIES:" + ":ALT_NAVIGATION: Next,Previous,Up" + ":END:") + "\n") + (let ((export-buffer "*Test Texinfo Export*") + (org-export-show-temporary-export-buffer nil)) + (org-export-to-buffer 'texinfo export-buffer + nil nil nil nil nil + #'texinfo-mode) + (with-current-buffer export-buffer + (goto-char (point-min)) + (search-forward "@node Title,Next,Previous,Up")))))) + +(ert-deftest test-ox-texinfo/alt-navigation/one-direction () + "Test alternative navigation in only one direction." + (should + (org-test-with-temp-text + (string-join + (list "* Title" + ":PROPERTIES:" + ":ALT_NAVIGATION: ,, Up" + ":END:") + "\n") + (let ((export-buffer "*Test Texinfo Export*") + (org-export-show-temporary-export-buffer nil)) + (org-export-to-buffer 'texinfo export-buffer + nil nil nil nil nil + #'texinfo-mode) + (with-current-buffer export-buffer + (goto-char (point-min)) + (search-forward "@node Title,,, Up")))))) + +(ert-deftest test-ox-texinfo/alt-navigation/no-directions () + "Test alternative navigation with all directions disabled." + (should + (org-test-with-temp-text + (string-join + (list "* Title" + ":PROPERTIES:" + ":ALT_NAVIGATION: ,,," + ":END:") + "\n") + (let ((export-buffer "*Test Texinfo Export*") + (org-export-show-temporary-export-buffer nil)) + (org-export-to-buffer 'texinfo export-buffer + nil nil nil nil nil + #'texinfo-mode) + (with-current-buffer export-buffer + (goto-char (point-min)) + (search-forward "@node Title,,,")))))) + +(ert-deftest test-ox-texinfo/alt-navigation/with-alt-title () + "Test alternative navigation combined with alternative titles." + (should + (org-test-with-temp-text + (string-join + (list "* Title 1" + ":PROPERTIES:" + ":ALT_TITLE: Title 2" + ":ALT_NAVIGATION: Next,Previous,Up" + ":END:") + "\n") + (let ((export-buffer "*Test Texinfo Export*") + (org-export-show-temporary-export-buffer nil)) + (org-export-to-buffer 'texinfo export-buffer + nil nil nil nil nil + #'texinfo-mode) + (with-current-buffer export-buffer + (goto-char (point-min)) + (search-forward "@node Title 2,Next,Previous,Up")))))) + (provide 'test-ox-texinfo) ;;; test-ox-texinfo.el end here -- 2.39.3 (Apple Git-146) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-ox-texinfo-Add-support-for-links-in-titles.patch >From ecd8df5bd46feeb8951005bc4929b1384d16bad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Thu, 22 Aug 2024 18:11:35 +0200 Subject: [PATCH 2/2] ox-texinfo: Add support for links in titles * etc/ORG-NEWS (Texinfo export backend now allows links to be used in headings): Inform end users about the new functionality. * lisp/ox-texinfo.el: (org-texinfo--format-entries): (org-texinfo--get-node): (org-texinfo--sanitize-title-reference): (org-texinfo--sanitize-title): A 2-step change: (1) Rename `--sanitize-title' to `--sanitize-title-reference' and (2) create a new `--sanitize-title' sanitation function. The new function is less strict in that does not remove links, which should be allowed in sectioning commands, such as `@unnumbered'. The old function remains more strict, which is useful for generating `@node' names, for example. * testing/lisp/test-ox-texinfo.el: (test-ox-texinfo/headings-with-links): Test the new functionality to avoid regressions in the future. --- etc/ORG-NEWS | 4 ++++ lisp/ox-texinfo.el | 17 +++++++++++++++-- testing/lisp/test-ox-texinfo.el | 28 ++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 25dd3ae49..b6d9c54ef 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -230,6 +230,10 @@ This way, attachments will remain accessible when opening symlinked Org file. When no attach dir exists, Org mode will still prefer creating it in the "default" directory - where the symlink is located. +*** Texinfo export can have links in headings + +The Texinfo export backend no longer removes links from headings. + * Version 9.7 ** Important announcements and breaking changes diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 43fdf27ae..4a02e7b04 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -524,7 +524,7 @@ node or anchor name is unique." (org-texinfo--sanitize-node (pcase (org-element-type datum) (`headline - (org-texinfo--sanitize-title + (org-texinfo--sanitize-title-reference (org-export-get-alt-title datum info) info)) (`radio-target (org-export-data (org-element-contents datum) info)) @@ -569,6 +569,19 @@ periods, commas and colons." (defun org-texinfo--sanitize-title (title info) "Make TITLE suitable as a section name. TITLE is a string or a secondary string. INFO is the current +export state, as a plist." + (org-export-data-with-backend + title + (org-export-create-backend + :parent 'texinfo + :transcoders `((footnote-reference . ,#'ignore) + (radio-target . ,(lambda (_r c _) c)) + (target . ,#'ignore))) + info)) + +(defun org-texinfo--sanitize-title-reference (title info) + "Make TITLE suitable as a section reference. +TITLE is a string or a secondary string. INFO is the current export state, as a plist." (org-export-data-with-backend title (org-export-toc-entry-backend 'texinfo) info)) @@ -1471,7 +1484,7 @@ a plist containing contextual information." ;; name. Remove them. (replace-regexp-in-string "[ \t]*:+" "" - (org-texinfo--sanitize-title + (org-texinfo--sanitize-title-reference (org-export-get-alt-title h info) info))) (node (org-texinfo--get-node h info)) (entry (concat "* " title ":" diff --git a/testing/lisp/test-ox-texinfo.el b/testing/lisp/test-ox-texinfo.el index 352df378f..f22448681 100644 --- a/testing/lisp/test-ox-texinfo.el +++ b/testing/lisp/test-ox-texinfo.el @@ -444,5 +444,33 @@ body (goto-char (point-min)) (search-forward "@node Title 2,Next,Previous,Up")))))) + +;;; Headings with links + +(ert-deftest test-ox-texinfo/headings-with-links () + "Test node and chapter names." + (should + (org-test-with-temp-text + (string-join + (list "* Heading 1" + " ...." + "* Heading 2 ([[* Heading 1][Heading 1]])" + " ....") + "\n") + (let ((export-buffer "*Test Texinfo Export*") + (org-export-show-temporary-export-buffer nil)) + (org-export-to-buffer 'texinfo export-buffer + nil nil nil nil nil + #'texinfo-mode) + (with-current-buffer export-buffer + (goto-char (point-min)) + (search-forward "* Heading 1::") + (search-forward "* Heading 2 (Heading 1)::") + (search-forward "@node Heading 1") + (search-forward "@chapter Heading 1") + (search-forward "@node Heading 2 (Heading 1)") + (search-forward "@chapter Heading 2 (@ref{Heading 1})") + (buffer-string)))))) + (provide 'test-ox-texinfo) ;;; test-ox-texinfo.el end here -- 2.39.3 (Apple Git-146) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 "Thinking is a momentary dismissal of irrelevancies." --- Richard Buckminster Fuller, 1969 Rudolf Adamkovi=C4=8D [he/him] http://adamkovic.org --=-=-=--