From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id EAEEMeIX4maMhgEA62LTzQ:P1 (envelope-from ) for ; Wed, 11 Sep 2024 22:21:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id EAEEMeIX4maMhgEA62LTzQ (envelope-from ) for ; Thu, 12 Sep 2024 00:21:22 +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=VbK9QVTB; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b=exGxdX8B; dmarc=fail reason="SPF not aligned (relaxed)" header.from=adamkovic.org (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726093282; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=2saWykHT2igSyFYPRdXeVyfgGt/odfPCwNCDFOMbD2M=; b=dE/Ge/Ns/4n44pmbpXn/AgSpFFUd+1MzA5RO5ajMDGZq+iitwrmWorsP7QJKSHyE59LQjr 0Z7FKALVNoSTUmaXwkjIEQM3OV017NXgYs2zJjgBgYa9U0p+AGps8ICwSgAYGdS1H72Uje TlTqY9PiFQnK1TqHpLyARPyJt0cpsZsx3vEknD32H1U3XO0W2Qibcrn4+y4aU0ETnHN99K 0LhSUrPYEiUIl5SCXFWwz/DNiujfwdhpBhhrPFQJVp/XBqNqVCAnAN7XevLO/EJW7NVEFI +3LBI+Fk5CTm2A76kBBU/6b6bwNXw/ifYK1n/nymGhRmm5HT9K7dKYfxmVFyCQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726093282; a=rsa-sha256; cv=none; b=me1cz5DZYpReBAZUeFqgglP9eTp7qROXdfpW7z0GiXQ/zaGqpAOVNEu6ZyitJ+q8fvh3SI pwXQRBaY0ASW/ZLFP2LJohRSdYDwM9bZ/1XWnZK01JY+bLbFoGRE346dexxLw7M1Wb8biE VO1IffqjqC9EhtVv1GsA3LFh8lNlwl3GuqmniWzw23mUn3f+w/x0bBTNFeI+7D4Q9/cHim niseH5d9kPQ85co7oYiZDk4OS1EzpxA75RY9zAtvWjBNyheABgTAS6a4k6XOgmlBBvGzOZ KY3CFIyIaDqWWwY3Nv+bbb9X2mdTyy6MSBSlNMVBGFM3ne+GVMdlUw+OpRu52A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=adamkovic.org header.s=fm2 header.b=VbK9QVTB; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b=exGxdX8B; dmarc=fail reason="SPF not aligned (relaxed)" header.from=adamkovic.org (policy=none); 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" 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 DCE921453F for ; Thu, 12 Sep 2024 00:21:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soVhE-0004g4-GW; Wed, 11 Sep 2024 18: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 1soVh8-0004fW-PU for emacs-orgmode@gnu.org; Wed, 11 Sep 2024 18:20:14 -0400 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soVh6-0005ft-8i for emacs-orgmode@gnu.org; Wed, 11 Sep 2024 18:20:14 -0400 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id F192A11400D2; Wed, 11 Sep 2024 18:20:08 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 11 Sep 2024 18:20:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamkovic.org; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm2; t=1726093208; x=1726179608; bh=v0pHDzTQGg ubXPtVIcdawQnw4Gqi8A2ba8bd7/0OG0Q=; b=VbK9QVTBHJXd24DBiyB/0vPI/D 30xfQH7dlkQSb8baCSH/KH0LjTER+Qn6jFBg/eV/4+xZQWiByuhpjiqaX0lVquRB IL6XwUGupC4NX5rcGx5UZaOrOs2+3Pc0TgfXsEpNTc2wc45TPhU9YA4dac6BsXW7 VkGRM/SJzk0mwY4luyXzsdCFV/BjG+1e0b2lpAZBX/3dMxbb78rSNba+6GjsV9ST yUATGCz2DuzHtkUpV4hdYPUzphXIaTshOiTlvxwEg7MFZ8tQ4PxkV3iv9fmgog2N FOc6G/kzHLZg7o/mJSmre99+B62OuNvUVjOb4w6J9/vUDl74qwvABHQqvVtw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1726093208; x=1726179608; bh=v0pHDzTQGgubXPtVIcdawQnw4Gqi 8A2ba8bd7/0OG0Q=; b=exGxdX8BIZIrAwdOY2pgHZf4hExaVSLS5dY1yOpykJVP vM322PSdU6HpQ4Rl1khIKi5SDooPRtQYKtkOvXqdbYGI775mrHlpDikQJwpmgMqW bJ5vPBQ8ExI3Sl/eV8fYzGNtofjORSkpKpGy8FT2GQBt67rTF73B6/3lCzgTEbWX kuJ5p56O5wGSGJNrk6u0ILuSbeID/Pj3pJTN4DuPNGiGs3abxMR3yl2aoFIatJYT ZJfQ5bo6JGuwq3PwYJHoV54SOAqHA/a23/PLCDaOO1mjf3xJS74dwNDyG7Yi5vnl qP5ZJ1qOUNPMc24h9YVGEJl/omG0Vyot2vMm9A39yQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejvddgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffoggfgsedtkeertdertdejnecuhfhrohhmpeftuhguohhlfhcutegurghmkhhovhhi tgcuoehruhguohhlfhesrggurghmkhhovhhitgdrohhrgheqnecuggftrfgrthhtvghrnh epkeeuheetuddtudejffeiveeuveelgffgleetveeitddtjeeiteefgfduieduleejnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhhuugholh hfsegruggrmhhkohhvihgtrdhorhhgpdhnsggprhgtphhtthhopedvpdhmohguvgepshhm thhpohhuthdprhgtphhtthhopegvmhgrtghsqdhorhhgmhhouggvsehgnhhurdhorhhgpd hrtghpthhtoheprhhuugholhhfsegruggrmhhkohhvihgtrdhorhhg X-ME-Proxy: Feedback-ID: i88214938:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Sep 2024 18:20:07 -0400 (EDT) From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= To: emacs-orgmode@gnu.org Cc: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Subject: [PATCH] ox-texinfo: Fix automatic @ref titles Date: Thu, 12 Sep 2024 00:19:55 +0200 Message-ID: <20240911221955.88397-1-rudolf@adamkovic.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=103.168.172.157; envelope-from=rudolf@adamkovic.org; helo=fhigh6-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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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." 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: DCE921453F X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -2.49 X-Spam-Score: -2.49 X-TUID: 87Nog1C0mn6X * lisp/ox-texinfo.el (org-texinfo--@ref): Fix an incorrect assumption that Texinfo uses node names for automatic link text. It does not. Instead, it uses the corresponding section title. For example, if a node is named `a' its section is named `A', the Org link to the node `a' written as `[[...][xxx]]' ends up being rendered as "A", which means the link description the Org user provided is ignored. --- lisp/ox-texinfo.el | 2 +- testing/lisp/test-ox-texinfo.el | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 6adee9fca..2da90ca0f 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1311,7 +1311,7 @@ nil." (replace-regexp-in-string "[ \t]*:+" "" (replace-regexp-in-string "," "@comma{}" description))))) - (if (or (not title) (equal title node-name)) + (if (not title) (format "@ref{%s}" node-name) (format "@ref{%s, , %s}" node-name title)))) diff --git a/testing/lisp/test-ox-texinfo.el b/testing/lisp/test-ox-texinfo.el index b16a344e7..d4552459d 100644 --- a/testing/lisp/test-ox-texinfo.el +++ b/testing/lisp/test-ox-texinfo.el @@ -345,5 +345,34 @@ body (should-not (org-element-contents section)) (should (eq first-heading (org-element-parent section))))))) + +;;; References + +(ert-deftest test-ox-texinfo/references () + "Test references with manual and automatic descriptions." + (should + (org-test-with-temp-text + (string-join + (list "* A" + ":PROPERTIES:" + ":ALT_TITLE: B" + ":END:" + "[[A]]" + "[[A][B]]" + "[[A][C]]" + " ....") + "\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)) + (and + (re-search-forward "@ref{B}") + (re-search-forward "@ref{B, , B}") + (re-search-forward "@ref{B, , C}"))))))) + (provide 'test-ox-texinfo) ;;; test-ox-texinfo.el end here -- 2.46.0