emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
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: Tue, 05 Mar 2024 12:49:48 +0000	[thread overview]
Message-ID: <87o7bs4zdf.fsf@localhost> (raw)
In-Reply-To: <jwvedcq7zzq.fsf-monnier+emacs@gnu.org>

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

> The "* DIRTITLE: (FILENAME)." syntax is Texinfo's syntax, and currently the
> Org user needs to know that syntax and abide by it (even though it's
> not well defined nor well documented, IME).  My change mostly makes it
> unnecessary for the user to know that syntax because ox-texinfo already
> knows the FILENAME, so it only needs the DIRTITLE.

If it is not well-documented, we may as well help users by explaining a
bit in a footnote in the Org manual.

> The new code supports the "* DIRTITLE: (FILENAME)." syntax mostly for
> backward compatibility, tho it can also be useful in corner cases such
> as when the final filename will be different than the one ox-texinfo
> knows about.
>
> Not sure how to adjust the text to clarify that, without including
> a discussion of the "* DIRTITLE: (FILENAME)." and how things used to be,
> and how the filename is controlled.

... then we can also include this discussion in a footnote and put the
new syntax into the main visible part of the manual.

> The old(current) situation is arguably worse because it doesn't even
> document the syntax that needs to be used.

Agree.

>>>  - =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.
>
> Not sure if it needs to be a sentence, but yes, it should usually be
> short tho I don't think there's a technical need for it, so I think the
> "defaults to the title" should be a good enough hint about the kind of
> length expected.

Also ok. I do not have a strong opinion here - referring to title is
also clear enough for me; I am just not sure if it is clear enough for
all the readers of the manual.

>>>      (: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?
>
> Fine by me, yes.

I can add it after we finalize your patch.
Or you can do it as a part of the patch, if you are willing to.
(Just make sure that old keyword name is supported for backwards-compatibility)

>>> +	    (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.
>
> I don't understand what you mean by that.

I had a hard time understanding why the second clause of `cond' never
matches things like "Foo (filename)" - the test (equal dt file) looks
suspicious from the first glance; until I spend some time parsing the
above regexps.

So, I am asking you to add code comment explaining why (equal dt file)
is sufficient.

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


  reply	other threads:[~2024-03-05 12:46 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
2024-03-04 16:16       ` Stefan Monnier
2024-03-05 12:49         ` Ihor Radchenko [this message]
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=87o7bs4zdf.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).