From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp2.migadu.com ([2001:41d0:303:e16b::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms8.migadu.com with LMTPS
	id YGioNCir5WV55QAAe85BDQ:P1
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Mon, 04 Mar 2024 12:06:17 +0100
Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp2.migadu.com with LMTPS
	id YGioNCir5WV55QAAe85BDQ
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Mon, 04 Mar 2024 12:06:16 +0100
X-Envelope-To: larch@yhetil.org
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b=TM+A3g8t;
	dmarc=pass (policy=none) header.from=posteo.net;
	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=1709550376;
	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:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=T+zdGOGGHZXO76RO+262FE5B2iGjBfBVbyqcjIOrTXU=;
	b=BfLqwfQs+8jsfU1Lwl+rHzUCSNYTeZIEnyy/kgn+qBjfGbd7l8xGFyWrq792OuUjnC/3hc
	xZqu6XMjfXEq9hz7vBlQCAHoYbZPT1/VNGJ1Tk7lshUaf53HmjWrAuL1GLKcvLBLSF53Gq
	5c8gGCouYO/IHgbc+2kxnLharucxJm192MDeOgzRU5+7gXhBIL6Es4nOCtq9RVAhIO5AQN
	Wq+IvldB4UQyN5VSCHtBbfKguVWklLm8Tm26gvc2Wwyv1Qn4NA8nFAZQPiYwQDJkz+xAiO
	qfirpcbLfjn1RsttzDi79W8T5Zny1SGyv5PHAX0z7hBB0j1wc+cqG9hSd1pMUg==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b=TM+A3g8t;
	dmarc=pass (policy=none) header.from=posteo.net;
	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-Seal: i=1; s=key1; d=yhetil.org; t=1709550376; a=rsa-sha256; cv=none;
	b=J1mQ6z/DoydXPABwqFZlNGifObg1i48Pt5VR+YU2Gr7fCP2Pdp8huIlQKR5B+cAiXNYoL2
	r3WvLdPk+82U5S5C51QBskBeaVS5U7X7fCM228u46ba8ZRN+X7gOOiPdTDkFxD9iyRldn9
	oLw0ERPmxt8S42LSmPMxpFwjCIXdSghZcEv+MVYGFeQpQlqK/Fsp5enZbzUNkUx3KTOheM
	VxUfs9kzzVeiaIvnvMODPLDQPtguu8Rwbs6wU17CRkU57brtlvX1PthzO3EafmT8hidlqW
	NOFsFe46pXEqvpkdsqtG4malZ/CfzT2ZcyA2sTZOsOVtxSDJlZGzASVeV720gg==
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 60F931581C
	for <larch@yhetil.org>; Mon,  4 Mar 2024 12:06:16 +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 1rh68D-0001PK-7h; Mon, 04 Mar 2024 06:05:17 -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 1rh68B-0001P6-GE
 for emacs-orgmode@gnu.org; Mon, 04 Mar 2024 06:05:15 -0500
Received: from mout02.posteo.de ([185.67.36.66])
 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 1rh687-0008Oe-7a
 for emacs-orgmode@gnu.org; Mon, 04 Mar 2024 06:05:15 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 49A20240101
 for <emacs-orgmode@gnu.org>; Mon,  4 Mar 2024 12:05:09 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1709550309; bh=v/nCIw/SoH1anzwWxfDio0x0VZ7zLclnkQoFf5tr9H4=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=TM+A3g8tURRj+9qVwn3YwLWQ7kf7mxLnwKi85UWrurRRFKzggJJpQ8L7riuk5UxYz
 2+AzeNrgDvUP/4aMQYB0GQc8sgmcyO0FJbJkUAASpRwE4TGtZkVI8ucW1FWgy2ehas
 pFyRasBecAXVeLjzrljnS+ZdJ75it+4LSTLMcpwx/VXqREjb1gXQXp25SPNm+yJkvd
 knB447c+5iFgUgKk2T6NNjy8MO0fwaLbdXw+wQs1xcYa1ANlWool+INSAH0XTMFaoh
 4vvAB9xaNt4zNLjyFxbRDNE8oACkf5GDolaw3+2uOdj3RYIcSOEcrqUuJeZsCbt89t
 cGo9RemvBedIQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TpG7S1x1Kz9rxB;
 Mon,  4 Mar 2024 12:05:07 +0100 (CET)
From: Ihor Radchenko <yantar92@posteo.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: Provide sane default for the @direntry
In-Reply-To: <jwvv864h09c.fsf-monnier+emacs@gnu.org>
References: <jwvwmqpjvhq.fsf-monnier+emacs@gnu.org>
 <87v868khb2.fsf@localhost> <jwvv864h09c.fsf-monnier+emacs@gnu.org>
Date: Mon, 04 Mar 2024 11:09:10 +0000
Message-ID: <871q8q1cfd.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net;
 helo=mout02.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, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01,
 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." <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-Flow: FLOW_IN
X-Migadu-Country: US
X-Migadu-Spam-Score: -9.48
X-Spam-Score: -9.48
X-Migadu-Queue-Id: 60F931581C
X-Migadu-Scanner: mx13.migadu.com
X-TUID: qD+h9uQoTkVb

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> May you please supply a ChangeLog entry? I am not sure if I understand
>> the purpose of each change in the diff.
>>
>> Also, it looks like you introduce some DWIM behaviour for auto-generating
>> @direntry contents. Such new behaviour ought to be documented in the
>> manual and announced in the news.
>
> New patch attached,

Thanks!
See my comments inline.

> * lisp/org/ox-texinfo.el: Remove redundant `:group` arguments.
> Prefer #' to quote function names.

May you please split unrelated changes into a separate patch?

> * doc/misc/org.org (Texinfo specific export settings): Adjust accordingly.

It would be nice to provide etc/ORG-NEWS entry as well.

>    #+cindex: @samp{TEXINFO_DIR_TITLE}, keyword
>    The directory title of the document.
> +  This is the short name under which the ~m~ command will find your
> +  manual in the main Info directory.  It defaults to the base name of
> +  the Texinfo file.
> +
> +  If you need more control, it can also be the full entry using the
> +  syntax ~* TITLE: (FILENAME).~.

This example is a bit confusing. How will it look like in Org document?
#+TEXINFO_DIR_TITLE: * title: (filename). ?
If yes, it is confusing because you just mention that default value is
filename, but you have both "title" and "filename" in the example.

Maybe

: #+TEXINFO_DIR_TITLE: * name: (filename).

?
  
>  - =TEXINFO_DIR_DESC= ::
>  
>    #+cindex: @samp{TEXINFO_DIR_DESC}, keyword
>    The directory description of the document.
> +  Defaults to the title of the document.

I'd also add that it should be a short sentence.
  
>      (:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t)
> +    ;; FIXME: The naming of these options is unsatisfactory:
> +    ;; TEXINFO_DIR_DESC corresponds (and defaults) to the document's
> +    ;; title, whereas TEXINFO_DIR_TITLE corresponds (and defaults) to
> +    ;; its filename.

What about TEXINFO_DIR_NAME + TECINFO_DIR_DESC?

I do not see a big problem with description defaulting to document title
given that it should be a short sentence - an equivalent of proper
document title.

> +     ;; Info directory information.  Only supply if category is provided.
> +     ;; FIXME: A Texinfo doc without a direntry is significantly less useful
> +     ;; since it won't appear in the main Info-directory, so maybe we should
> +     ;; use a default category like "misc"?

Sounds reasonable. We may add a new custom option with default category.

> +     (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))

It would be nice to add a comment saying that dt values like
"Foo (filename)" are already captured by the previous cond clause.

> +              (t (format "* %s." file)))))

What if dt is "Foo."?

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