Subject: [bug#77349] [PATCH] gnu: Add emacs-yari.

From: gemmaro <[email-masked]>
Date: Sun, 30 Mar 2025 08:01:18 +0900

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

Change-Id: I1caca3772efff15d2155fdc5eaf648100bed1895
---

Hi Ian,

I have updated the following items in the patch:

* [arguments]<#:phases>: Updated to utilize search-input-file.
* [description]: Revised the description to begin with "This package
provides...".  Utilized @code for inline ri commands.  Removed the sentence
regarding yari-helm.

Thanks,
gemmaro.

 gnu/packages/emacs-xyz.scm | 39 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index a633bf76b1..b5dc07acbb 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -17323,6 +17323,45 @@ (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)
+                (emacs-substitute-variables "yari.el"
+                  ("yari-ri-program-name"
+                   (search-input-file inputs "/bin/ri"))
+                  ("yari-ruby-program-name"
+                   (search-input-file inputs "/bin/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
+       "This package provides an Emacs frontend to Ruby's @code{ri}
+documentation tool, and offers lookup and completion.  The main
+function you should use as interface to @code{ri} is @samp{M-x yari}.")
+      (license license:gpl3+))))
+
 (define-public emacs-gitlab-ci-mode
   (package
     (name "emacs-gitlab-ci-mode")

base-commit: d17c20911361844ff6479704d3e26bef8f73aa5c
-- 
2.49.0