unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Tropin <andrew@trop.in>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: 57280@debbugs.gnu.org
Subject: [bug#57280] [PATCH 0/3] Add documentation-files argument to emacs build system.
Date: Fri, 19 Aug 2022 06:33:02 +0300	[thread overview]
Message-ID: <87k074gb69.fsf@trop.in> (raw)
In-Reply-To: <107d9c475d47842d67db4f0a7d85d63ae11f9f3c.camel@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3665 bytes --]

On 2022-08-18 20:31, Liliana Marie Prikler wrote:

> Hi Andrew,
>
> if this ought to have went to a mailing list, it didn't.

Yep, I missed To:, resent it yesterday.

>
> Am Donnerstag, dem 18.08.2022 um 17:50 +0300 schrieb Andrew Tropin:
>> 
>> This patch adds a handy way for generating info documentation for
>> emacs packages from texinfo or org files.
>> 
>> Andrew Tropin (3):
>>   build-system: emacs: Add documentation-files argument.
>>   gnu: emacs-orderless: Use documentation-files argument.
>>   gnu: emacs-consult: Use documentation-files argument.
> Is it just those two packages that require this phase?  If so, what
> value is there in making it a "standard" phase?
>

It's just two examples, I think there is much more packages.

>> +(define (default-texinfo)
>> +  "Return the default texinfo package."
>> +  ;; Lazily resolve the binding to avoid a circular dependency.
>> +  (let ((texinfo-mod (resolve-interface '(gnu packages texinfo))))
>> +    (module-ref texinfo-mod 'texinfo)))
>> +
>>  (define* (lower name
>>                  #:key source inputs native-inputs outputs system
>> target
>> +                documentation-files
> I don't think hard-coding this list is useful.  Instead, it would be
> nice if we simply used find-files with the right pattern, and use a
> binary switch as in meson-build-systems #:glib-or-gtk?

It's not clear how to find a documentation file heuristically, it can be
README, DOCUMENTATION, README.org, docs/MANUAL.org docs/PACKAGE.texi or
anything else, morevover a few of them can be present at the same time
and I'm afraid it will be a very tough task to understand which of them
to use.

The idea is inspired by :doc keyword from elpa and the fact that some of
emacs-xyz packages either miss documentation or have custom build phases
for it:
https://git.savannah.gnu.org/cgit/emacs/elpa.git/tree/elpa-packages#n781

>> +                (texinfo (default-texinfo))
>>                  (emacs (default-emacs))
>>                  #:allow-other-keys
>>                  #:rest arguments)
>> @@ -77,6 +85,7 @@ (define private-keywords
>>                          ;; Keep the standard inputs of 'gnu-build-
>> system'.
>>                          ,@(standard-packages)))
>>           (build-inputs `(("emacs" ,emacs)
>> +                         ,@(if (null? documentation-files) '()
>> `(("texinfo" ,texinfo)))
>>                           ,@native-inputs))
> We should probably append rather than prepend implicit inputs.  In
> fact, doing so for emacs itself also means that people could prepend
> their own emacs if emacs-minimal is not enough rather than needing a
> transformer.
>

I thought #:emacs and #:texinfo arguments are enough to specify custom
emacs/texinfo inputs.

>> +(define* (generate-docs #:key outputs documentation-files #:allow-
>> other-keys)
>> +  "Convert texinfo or org files specified in DOCUMENTATION-FILES
>> argument to
>> +info files."
>> +  (map
>> +   (lambda (path)
>> +     (if (or (string-suffix? ".texi" path)
>> +             (string-suffix? ".texinfo" path)
>> +             (string-suffix? ".txi" path))
>> +         (invoke "makeinfo" path)
>> +         (emacs-batch-script ; else org file
>> +          `(progn
>> +            (require 'ox-texinfo)
>> +            (find-file ,path)
>> +            (org-texinfo-export-to-info)))))
>> +   documentation-files))
> (ice-9 match) is your friend.

That's right, I thought about it when was writting this code :)  Will
wait for a few more comments and will refactor in the next revision.

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

       reply	other threads:[~2022-08-19  3:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87wnb5lhyr.fsf@trop.in>
     [not found] ` <107d9c475d47842d67db4f0a7d85d63ae11f9f3c.camel@gmail.com>
2022-08-19  3:33   ` Andrew Tropin [this message]
2022-08-19  4:19     ` [bug#57280] [PATCH 0/3] Add documentation-files argument to emacs build system Liliana Marie Prikler
2022-08-19  6:21       ` Andrew Tropin
2022-08-19 15:39         ` Liliana Marie Prikler
2022-08-26 14:33           ` Andrew Tropin
2022-08-29 16:38             ` Liliana Marie Prikler
2022-08-30  8:15               ` Andrew Tropin
2022-08-30  8:28                 ` Liliana Marie Prikler
2022-08-31  9:36                   ` Andrew Tropin
2022-08-31 10:07                     ` Liliana Marie Prikler
2022-09-02 14:02                       ` Andrew Tropin
2022-09-02 14:52                         ` Liliana Marie Prikler
2023-04-26  4:40                           ` bug#57280: " Andrew Tropin
2022-08-18 18:35 [bug#57280] " Andrew Tropin
2022-08-18 19:31 ` Liliana Marie Prikler

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://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k074gb69.fsf@trop.in \
    --to=andrew@trop.in \
    --cc=57280@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    /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/guix.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).