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 ms8.migadu.com with LMTPS id cNf7OVx83mW93AAA62LTzQ:P1 (envelope-from ) for ; Wed, 28 Feb 2024 01:20:45 +0100 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 cNf7OVx83mW93AAA62LTzQ (envelope-from ) for ; Wed, 28 Feb 2024 01:20:45 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b=HrIhGxKx; 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=quarantine) header.from=iro.umontreal.ca ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709079644; 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=lxSxW3fEWXI/yX5aP+IgiPLv0MEPIocBD8ZeAkxoduc=; b=DegtabVJlB3d+c3QtTtX0DmYa8BPWOs52ho1kG0tNhIMLRFDk5leidRzS+Plp8p1KLV+te PemudOl0xk2MxYIA5gAD7hRF7/JD/IvnPwkhFjgPDeEsB8AUg3I0/9Z2Pk9ENptZvejzzA t55v4hQ1aMWw55U/gJxODBdmUKzd9i5UOX0C4S/eoagpENPIIfZy7MfnstepzIKkF121wV YtJvcmwOOKZrAh9uTDo+Z1eVbYVQ678T6rT/lCv2BbXQNvrn/WLqAE8EuamjOZmFrtFgbB LojA49nh9aVeF1WB95CY7SueMXXdSjCQa4q/rSgZVK2MAgUDzVl5h+eyW5JkIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b=HrIhGxKx; 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=quarantine) header.from=iro.umontreal.ca ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709079644; a=rsa-sha256; cv=none; b=WkPxMnBXKVo3CY0ly7mPwKELjWsy1Sfoy5ORpI0ZyWQ1A2jUwnk3Xl+Kk8lbqgeB0AJmC0 v6I/0L01Zkmj5rBCwlhf9yCotCoCu+Vox+87UyBVEJ+gLXKpc2OTcYhPkX68v830zlzI6/ tMH3Ljhchem9KarAH/AzHD/V1hUx0fECn2kLPIbiTZT8rua+txbWnBQzC+umhcAIMrCu2F BPzZehBhSzRt6y/+FaFX8lcQe5rM3HSjQ2p1yNxDkoKdCkg7qiPB8vL6wEF2oY33n2zblb V8choQHPfiwGslocAQ9YvuoL/nnQRJj4lxpTTbZkmdHyswiXHquOKDtxdJVw+A== 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 DE551AE8C for ; Wed, 28 Feb 2024 01:20:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf7fo-0007w2-5O; Tue, 27 Feb 2024 19:19:48 -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 ) id 1rf7fk-0007vU-G8 for emacs-orgmode@gnu.org; Tue, 27 Feb 2024 19:19:44 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf7fi-0001G7-Qy for emacs-orgmode@gnu.org; Tue, 27 Feb 2024 19:19:44 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DBA5E80974; Tue, 27 Feb 2024 19:19:40 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1709079579; bh=EhEpNlEqwbRcMlDD/qX7u84qyrVW190Bu1xM24f1QaQ=; h=From:To:Subject:Date:From; b=HrIhGxKxW74MFT8XwqhAxjJTmieX4QbdIgXSXT6FKNRnrp1cSEKya2SFUax/MxTOt np6dU2Yd3qzbc4BP50W8Eo1UtWMcvUnphVF1XgWqOkttYSahnAUKtx0fURiRWRFRuW /BvTRhe+HZ9AR8v+vZATWFwao0Uuhrh9psyOBtMjEyB0t2YBSF0bPqsdfZ9DbqU5l/ z6X9e36rzWnWHEFKJfFP6TuBPMr9i+FVPHAlIy/7bSl19dxObkDjqFxVhxBMlBNJjU IGWFK43M7Gs0CI+7DQH6e44uakjmxXD5kcg54WVK957ohP7R6MPwCwYYaD3ZVbgYq/ UaNidF+31+ptw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id ADB6780240; Tue, 27 Feb 2024 19:19:39 -0500 (EST) Received: from pastel (unknown [216.154.21.95]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8F5911203CA; Tue, 27 Feb 2024 19:19:39 -0500 (EST) From: Stefan Monnier To: emacs-orgmode@gnu.org Subject: Provide sane default for the @direntry Message-ID: Date: Tue, 27 Feb 2024 19:19:38 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -5.93 X-Spam-Score: -5.93 X-Migadu-Queue-Id: DE551AE8C X-TUID: uG8nCe1sVhdc --=-=-= Content-Type: text/plain When exporting to Texinfo, the patch below makes it easier to generate a good `@direntry` by using sane defaults. For most files, you'll just need #+TEXINFO_DIR_CATEGORY: {my-category} I believe it also makes it a bit harder to shoot oneself in the foot and generate an invalid entry (e.g. with a missing or wrong file name). Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org.patch diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el index 84313645e6e..beea7aacab7 100644 --- a/lisp/org/ox-texinfo.el +++ b/lisp/org/ox-texinfo.el @@ -817,17 +799,27 @@ org-texinfo-template (org-export-data copying info)))) ;; Info directory information. Only supply if both title and ;; category are provided. - (let ((dircat (plist-get info :texinfo-dircat)) - (dirtitle - (let ((title (plist-get info :texinfo-dirtitle))) - (and title - (string-match "^\\(?:\\* \\)?\\(.*?\\)\\(\\.\\)?$" title) - (format "* %s." (match-string 1 title)))))) - (when (and dircat dirtitle) + (let* ((dircat (plist-get info :texinfo-dircat)) + (dt (plist-get info :texinfo-dirtitle)) + (file (file-name-sans-extension + (or (org-strip-quotes (plist-get info :texinfo-filename)) + (plist-get info :output-file)))) + (dirtitle + (cond + ((and dt + (or (string-match "\\`\\* \\(.*?\\)\\(\\.\\)?\\'" dt) + (string-match "\\`\\(.*(.*)\\)\\(\\.\\)?\\'" dt))) + ;; `dt' is already "complete". + (format "* %s." (match-string 1 dt))) + ((and dt (not (equal dt file))) + (format "* %s: (%s)." dt file)) + (t (format "* %s." file))))) + (when dircat (concat "@dircategory " dircat "\n" "@direntry\n" (let ((dirdesc - (let ((desc (plist-get info :texinfo-dirdesc))) + (let ((desc (or (plist-get info :texinfo-dirdesc) + title))) (cond ((not desc) nil) ((string-suffix-p "." desc) desc) (t (concat desc ".")))))) @@ -1590,7 +1582,7 @@ org-texinfo-planning (concat "@noindent" (mapconcat - 'identity + #'identity (delq nil (list (let ((closed (org-element-property :closed planning))) --=-=-=--