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
Date: Mon, 04 Mar 2024 11:09:10 +0000 [thread overview]
Message-ID: <871q8q1cfd.fsf@localhost> (raw)
In-Reply-To: <jwvv864h09c.fsf-monnier+emacs@gnu.org>
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>
next prev parent reply other threads:[~2024-03-04 11:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-28 0:19 Provide sane default for the @direntry Stefan Monnier
2024-02-28 10:35 ` Ihor Radchenko
2024-03-02 20:01 ` Stefan Monnier
2024-03-04 11:09 ` Ihor Radchenko [this message]
2024-03-04 16:16 ` Stefan Monnier
2024-03-05 12:49 ` Ihor Radchenko
2024-03-05 19:27 ` Stefan Monnier
2024-03-06 11:17 ` Ihor Radchenko
2024-03-06 15:00 ` Stefan Monnier
2024-03-07 13:46 ` Ihor Radchenko
2024-03-08 8:09 ` Stefan Monnier
2024-03-08 10:49 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871q8q1cfd.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).