From: Philip Kaludercic <philipk@posteo.net>
To: Joseph Turner <joseph@breatheoutbreathe.in>
Cc: 63337@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#63337: [PATCH] package-vc--build-documentation: Fix relative @include statements
Date: Wed, 10 May 2023 06:51:53 +0000 [thread overview]
Message-ID: <87lehwfzli.fsf@posteo.net> (raw)
In-Reply-To: <87bkitgj3c.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Tue, 09 May 2023 16:49:24 -0700")
Joseph Turner <joseph@breatheoutbreathe.in> writes:
> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>> Cc: Eli Zaretskii <eliz@gnu.org>, 63337@debbugs.gnu.org
>>> Date: Mon, 08 May 2023 12:05:51 -0700
>>>
>>> Note about the following two lines:
>>>
>>> + (file-path (expand-file-name file (package-desc-dir pkg-desc)))
>>> + (default-directory (expand-file-name (file-name-directory file-path)))
>>>
>>> (package-desc-dir pkg-desc) may return a relative path with or without a
>>> directory, e.g. "doc/manual.org" or "manual.org". In the latter case,
>>> (file-name-directory "manual.org") would return `nil' and
>>> (expand-file-name nil) would signal an error.
>>>
>>> Therefore, in the `file-path' `let'-binding, we first expand the return
>>> value of (package-desc-dir pkg-desc) to ensure that it contains a directory.
>>
>> Please don't use "path" for anything that is not a PATH-style list of
>> directory: the GNU Coding Standards frown on such usage. We use
>> file-name instead. For the same reasons, please don't give your
>> variables names that include "path" unless they are lists of
>> directories.
>
> Good to know, thank you! I changed `file-path' to `file-name'.
>
>>> --- a/lisp/emacs-lisp/package-vc.el
>>> +++ b/lisp/emacs-lisp/package-vc.el
>>> @@ -376,14 +376,17 @@ Package specs are loaded from trusted package archives."
>>> FILE can be an Org file, indicated by its \".org\" extension,
>>> otherwise it's assumed to be an Info file."
>>> (let* ((pkg-name (package-desc-name pkg-desc))
>>> - (default-directory (package-desc-dir pkg-desc))
>>> + (file-path (expand-file-name file (package-desc-dir pkg-desc)))
>>> + ;; `let'-bind `default-directory' to the directory containing the .org or .info FILE
>>> + ;; so that makeinfo can resolve relative @include statements in the docs directory.
>>> + (default-directory (expand-file-name (file-name-directory file-path)))
>>
>> There should be no reason to call expand-file-name in the last line,
>> since the argument of file-name-directory is already expanded.
>
> Good catch! Fixed.
>
>> Also, please make the comment lines shorter, preferably less than 75
>> columns.
>
> Done.
>
> Thank you!!
>
> Joseph
Ok, do you have a few example repositories that we can use to test edge-cases?
next prev parent reply other threads:[~2023-05-10 6:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-06 20:54 bug#63337: [PATCH] package-vc--build-documentation: Fix relative @include statements Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-07 9:58 ` Philip Kaludercic
2023-05-07 10:56 ` Eli Zaretskii
2023-05-07 18:40 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-07 19:11 ` Eli Zaretskii
2023-05-07 19:19 ` Philip Kaludercic
2023-05-07 20:29 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-08 13:51 ` Philip Kaludercic
2023-05-08 19:05 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-09 1:34 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-09 2:48 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-09 4:36 ` Eli Zaretskii
2023-05-09 23:49 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-10 6:51 ` Philip Kaludercic [this message]
2023-05-11 2:04 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-12 6:51 ` Philip Kaludercic
2023-05-12 7:14 ` Eli Zaretskii
2023-05-12 7:35 ` Philip Kaludercic
2023-05-13 5:54 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-12 6:56 ` Philip Kaludercic
2023-05-13 5:47 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-13 8:41 ` Philip Kaludercic
2023-05-13 16:38 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-13 17:14 ` Philip Kaludercic
2023-05-13 18:31 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lehwfzli.fsf@posteo.net \
--to=philipk@posteo.net \
--cc=63337@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=joseph@breatheoutbreathe.in \
/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.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).