unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Adam Porter <adam@alphapapa.net>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [ELPA] :doc with "README.org" doesn't rename exported texi file correctly
Date: Thu, 22 Sep 2022 13:06:34 -0400	[thread overview]
Message-ID: <jwv5yhf2voi.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <595ef82a-78fe-023b-75c4-8ccb30db1a8d@alphapapa.net> (Adam Porter's message of "Thu, 22 Sep 2022 10:16:24 -0500")

Adam Porter [2022-09-22 10:16:24] wrote:
> I noticed that, even though the `ement' recipe in `elpa-packages' has the
> same :doc setting as some other packages:
>
>   ("ement" :url "https://github.com/alphapapa/ement.el.git"
>     :doc "README.org"
>     :auto-sync t)
>
> ...the Info manual generated from its readme is not available for viewing in
>  Emacs after the package is installed.  To solve that, I had to add this
> line to the readme (learning from other packages in ELPA):
>
>   #+EXPORT_FILE_NAME: ement.texi

Hmm... I must say that I don't know why that is nor do I know at which
level it fails (whether it's in the .org => .texi or .texi => .info or
in the generation of the `dir` file, or yet elsewhere).

The fact that the above line seems to fix it suggests that the problem
is in the generation of the `.texi`.  `elpa-admin.el` uses the following
code for that:

      (with-temp-buffer
        (elpaa--call-sandboxed
         t "emacs" "--batch" "-l" "ox-texinfo"
         ;; When building :core packages, don't follow the symlink,
         ;; otherwise Org will want to export into the Emacs tree!
         "--eval" "(setq vc-follow-symlinks nil)"
         docfile
         "--eval" "(setq org-babel-confirm-evaluate-answer-no t)"
         "--eval" "(message \"ELPATEXI=%s\" (org-texinfo-export-to-texinfo))")
        (message "%s" (buffer-string))
        (goto-char (point-max))
        (when (re-search-backward "ELPATEXI=\\(.*\\)\n?" nil t)
          (setq docfile (concat (file-name-directory docfile)
                                (match-string 1)))
          (push docfile tmpfiles)
          (elpaa--temp-file docfile)))

IOW the ELisp code doesn't know before hand which will be the name of
the generated file and uses the `(message \"ELPATEXI=%s\"` trick to
output to stdout the name of the file that Org chose for its
output file.

Which makes me think it would work without an explicit
`EXPORT_FILE_NAME`, but my knowledge of Org is much too limited to
actually know it to be the case.

If someone wants to investigate, the following steps should be able to
reproduce the build:

    git clone --single-branch git://git.sv.gnu.org/emacs/elpa.git
    cd elpa
    make
    make packages/org
    make build/org

Where the last `make` is the one that matters to build the tarball
that's placed in `archive-devel/org-<version>.tar` (and if the file
already exists, nothing is done).


        Stefan




      reply	other threads:[~2022-09-22 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 15:16 [ELPA] :doc with "README.org" doesn't rename exported texi file correctly Adam Porter
2022-09-22 17:06 ` Stefan Monnier [this message]

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=jwv5yhf2voi.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=adam@alphapapa.net \
    --cc=emacs-devel@gnu.org \
    /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).