Subject: Re: [bug#74158] [PATCH 4/4] * gnu/packages/emacs-xyz.scm (emacs-parinfer-rust-mode): New variable.

From: Nicolas Graves <[email-masked]>
Date: Sun, 03 Nov 2024 21:34:30 +0100

On 2024-11-01 13:28, Lee Thompson wrote:

> Change-Id: I3508c5fd2d6c787ff9ef737e3f6a207d9b852ada
> ---
>  gnu/packages/emacs-xyz.scm | 45 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
>
> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
> index e7a75d51a3..2527a568b2 100644
> --- a/gnu/packages/emacs-xyz.scm
> +++ b/gnu/packages/emacs-xyz.scm
> @@ -290,6 +290,7 @@ (define-module (gnu packages emacs-xyz)
>    #:use-module (gnu packages virtualization)
>    #:use-module (gnu packages web-browsers)
>    #:use-module (gnu packages wget)
> +  #:use-module (gnu packages text-editors)
>    #:use-module (guix utils)
>    #:use-module (srfi srfi-1)
>    #:use-module (ice-9 match))
> @@ -27457,6 +27458,50 @@ (define-public emacs-track-changes
>  to react to them.")
>      (license license:gpl3+)))
>  
> +(define-public emacs-parinfer-rust-mode
> +  (package
> +    (name "emacs-parinfer-rust-mode")
> +    (version "0.9.1")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/justinbarclay/parinfer-rust-mode")
> +             (commit (string-append "v" version))))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "1kbn54v100rh6pxl3lc66pspd3nfy7pkv8iyqkg09xqcwyblbf86"))))
> +    (propagated-inputs (list emacs-track-changes))
> +    (inputs (list parinfer-rust-emacs))
> +    (build-system emacs-build-system)
> +    (arguments
> +     `(#:phases (modify-phases %standard-phases
> +                  (add-after 'unpack 'configure
> +                    (lambda* (#:key inputs outputs #:allow-other-keys)

You don't seem to use outputs so you can drop it there.

> +                      (let ((parinfer (assoc-ref inputs "parinfer-rust-emacs")))

Now we would rather use something like
(let ((parinfer-lib (dirname
                      (search-input-file inputs "/lib/libparinfer_rust.so"))))
                      
> +                        ;; Specify the absolute file names of the parinfer shared
> +                        ;; library.
> +                        (make-file-writable "parinfer-rust-mode.el")
> +                        (emacs-substitute-variables "parinfer-rust-mode.el"
> +                                                    ("parinfer-rust--lib-name"
> +                                                     "libparinfer_rust.so")
> +                                                    ("parinfer-rust-library-dir"
> +                                                     (string-append parinfer
> +                                                                    "/lib/")))
> +                        (emacs-substitute-sexps "parinfer-rust-mode.el"
> +                                                ("defcustom parinfer-rust-library-directory"
> +                                                 (string-append parinfer
> +                                                                "/lib/"))
> +                                                ("defconst parinfer-rust--lib-name"
> +                                                 "libparinfer_rust.so"))))))))
> +    (home-page "https://github.com/justinbarclay/parinfer-rust-mode")
> +    (synopsis "Lisp structure editing mode leveraging parinfer-rust")
> +    (description
> +     "@code{parinfer-rust-mode} aims to be a simple implementation

To confirm with recent commits, but I think we tend to use @command
instead of @code recently.

> +of Parinfer that leverages the parinfer-rust plugin to do most of the heavy
> +lifting.")
> +    (license license:gpl3+)))
> +
>  (define-public emacs-helm-eww
>    (package
>      (name "emacs-helm-eww")

-- 
Best regards,
Nicolas Graves