Subject: [PATCH] gnu: Add emacs-yari.

From: gemmaro <[email-masked]>
Date: Sat, 29 Mar 2025 10:00:33 +0900

* gnu/packages/emacs-xyz.scm (emacs-yari): New variable.

Change-Id: I16a5be5ceef46a4d8cb036e1c06994d1b5513a33
---
 gnu/packages/emacs-xyz.scm | 41 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 72f8a8f415..39ac71dc07 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -17295,6 +17295,47 @@ (define-public emacs-yaml-mode
 behavior very similar to that of Python mode.")
     (license license:gpl3+)))
 
+(define-public emacs-yari
+  (let ((revision "0")
+        (commit "de61285ceb21f56c29f4be12e2e65b2aa2bccf56"))
+    (package
+      (name "emacs-yari")
+      (version (git-version "0.8" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/hron/yari.el")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0sik21rifw0q1rw4wrffnnwynsmgrv6w323gz3fw89cz6n8kqsgn"))))
+      (build-system emacs-build-system)
+      (arguments
+       (list
+        #:tests? #t
+        #:test-command #~(list "ert-runner")
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'set-program-names
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let* ((package (assoc-ref inputs "ruby"))
+                       (ri (string-append package "/bin/ri"))
+                       (ruby (string-append package "/bin/ruby")))
+                  (emacs-substitute-variables "yari.el"
+                    ("yari-ri-program-name" ri)
+                    ("yari-ruby-program-name" ruby))))))))
+      (native-inputs (list emacs-ert-runner))
+      (inputs (list ruby))
+      (home-page "https://github.com/hron/yari.el")
+      (synopsis "Yet Another RI interface for Emacs")
+      (description
+       "@samp{yari.el} provides an Emacs frontend to Ruby's @samp{ri}
+documentation tool, and offers lookup and completion.  The main
+function you should use as interface to @samp{ri} is @samp{M-x yari}.
+@samp{yari-helm} is a variant using Helm input framework.")
+      (license license:gpl3+))))
+
 (define-public emacs-gitlab-ci-mode
   (package
     (name "emacs-gitlab-ci-mode")

base-commit: c31662f7294b194663bc521358b01c3a7d7e4e27
-- 
2.48.1