unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#74158] [PATCH 0/4] Add emacs-parinfer-rust-mode
@ 2024-11-01 11:13 Lee Thompson
  2024-11-01 13:28 ` [bug#74158] [PATCH 1/4] * gnu/packages/emacs-xyz.scm (emacs-track-changes): New variable Lee Thompson
  0 siblings, 1 reply; 5+ messages in thread
From: Lee Thompson @ 2024-11-01 11:13 UTC (permalink / raw)
  To: 74158; +Cc: Lee Thompson

Hello Guix,

This patch series adds justinbarclay's parinfer-rust-mode package for Emacs.
This package loads a shared Rust library to do all the parinfer heavy-lifting.

I ported the most recent version of parinfer-rust-mode and the Rust library
parinfer-rust-emacs and left the older emacs-parinfer-mode and parinfer-rust
untouched because I didn't know if it was within the scope of this work to get
rid of them.

Note also for parinfer-rust-emacs I copied all the `modify-phases' stuff from
parinfer-rust above, I can't imagine someone needs all the non-Emacs files
installing but who knows.

Could I please get some feedback or review on these patches? This is my first
time sending patches into Guix so apologies if I've made any obvious mistakes.
I wasn't sure also if it was appropriate to add my name to the tops of files
etc.

Apologies also if I've made a mess sending this a few times, I think my email
client and get send-email have been acting up.

Lee Thompson (4):
  * gnu/packages/emacs-xyz.scm (emacs-track-changes): New variable.
  * gnu/packages/crates-io.scm (rust-emacs-0.19): New variable.
  * gnu/packages/text-editors.scm (parinfer-rust-emacs): New variable.
  * gnu/packages/emacs-xyz.scm (emacs-parinfer-rust-mode): New variable.

 gnu/packages/crates-io.scm    | 24 +++++++++++++
 gnu/packages/emacs-xyz.scm    | 66 +++++++++++++++++++++++++++++++++++
 gnu/packages/text-editors.scm | 53 ++++++++++++++++++++++++++++
 3 files changed, 143 insertions(+)


base-commit: 6e50b0c56a8cc767bd3acb26638f78c450bde718
-- 
2.43.0





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#74158] [PATCH 1/4] * gnu/packages/emacs-xyz.scm (emacs-track-changes): New variable.
  2024-11-01 11:13 [bug#74158] [PATCH 0/4] Add emacs-parinfer-rust-mode Lee Thompson
@ 2024-11-01 13:28 ` Lee Thompson
  2024-11-01 13:28   ` [bug#74158] [PATCH 2/4] * gnu/packages/crates-io.scm (rust-emacs-0.19): " Lee Thompson
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lee Thompson @ 2024-11-01 13:28 UTC (permalink / raw)
  To: 74158; +Cc: Lee Thompson

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

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 488b4cb5d7..e7a75d51a3 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -27436,6 +27436,27 @@ (define-public emacs-parinfer-mode
 keep Parens and Indentation inline with one another.")
     (license license:gpl3+)))
 
+(define-public emacs-track-changes
+  (package
+    (name "emacs-track-changes")
+    (version "1.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://elpa.gnu.org/packages/track-changes-"
+                           version ".tar"))
+       (sha256
+        (base32 "0al6a1xjs6p2pn6z976pnmfqz2x5xcz99b5gkdzz90ywbn7018m4"))))
+    (build-system emacs-build-system)
+    (home-page "https://elpa.gnu.org/packages/track-changes.html")
+    (synopsis "An abstraction library which handles accumulating file changes")
+    (description
+     "This library is a layer of abstraction above
+@code{before-change-functions} and @code{after-change-functions} which takes
+care of accumulating changes until a time when its client finds it convenient
+to react to them.")
+    (license license:gpl3+)))
+
 (define-public emacs-helm-eww
   (package
     (name "emacs-helm-eww")
-- 
2.43.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#74158] [PATCH 2/4] * gnu/packages/crates-io.scm (rust-emacs-0.19): New variable.
  2024-11-01 13:28 ` [bug#74158] [PATCH 1/4] * gnu/packages/emacs-xyz.scm (emacs-track-changes): New variable Lee Thompson
@ 2024-11-01 13:28   ` Lee Thompson
  2024-11-01 13:28   ` [bug#74158] [PATCH 3/4] * gnu/packages/text-editors.scm (parinfer-rust-emacs): " Lee Thompson
  2024-11-01 13:28   ` [bug#74158] [PATCH 4/4] * gnu/packages/emacs-xyz.scm (emacs-parinfer-rust-mode): " Lee Thompson
  2 siblings, 0 replies; 5+ messages in thread
From: Lee Thompson @ 2024-11-01 13:28 UTC (permalink / raw)
  To: 74158; +Cc: Lee Thompson

Change-Id: I7791c869e8fdde96734499722d35f8f6aa2445fa
---
 gnu/packages/crates-io.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index c08ccd29fd..07185752c5 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -23138,6 +23138,30 @@ (define-public rust-emacs-0.18
 Emacs' support for dynamic modules.")
     (license license:bsd-3)))
 
+(define-public rust-emacs-0.19
+  (package (inherit rust-emacs-0.18)
+    (name "rust-emacs")
+    (version "0.19.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "emacs" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "133ip19m1nq8krf04klh1jpm833wpw6kdy2jksgylbw4xcp3yxws"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-anyhow" ,rust-anyhow-1)
+        ("rust-ctor" ,rust-ctor-0.1)
+        ("rust-emacs-macros" ,rust-emacs-macros-0.17)
+        ("rust-emacs-module" ,rust-emacs-module-0.18)
+        ("rust-failure-derive" ,rust-failure-derive-0.1)
+        ("rust-once-cell" ,rust-once-cell-1)
+        ("rust-thiserror" ,rust-thiserror-1))))))
+
 (define-public rust-emacs-0.11
   (package (inherit rust-emacs-0.18)
     (name "rust-emacs")
-- 
2.43.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#74158] [PATCH 3/4] * gnu/packages/text-editors.scm (parinfer-rust-emacs): New variable.
  2024-11-01 13:28 ` [bug#74158] [PATCH 1/4] * gnu/packages/emacs-xyz.scm (emacs-track-changes): New variable Lee Thompson
  2024-11-01 13:28   ` [bug#74158] [PATCH 2/4] * gnu/packages/crates-io.scm (rust-emacs-0.19): " Lee Thompson
@ 2024-11-01 13:28   ` Lee Thompson
  2024-11-01 13:28   ` [bug#74158] [PATCH 4/4] * gnu/packages/emacs-xyz.scm (emacs-parinfer-rust-mode): " Lee Thompson
  2 siblings, 0 replies; 5+ messages in thread
From: Lee Thompson @ 2024-11-01 13:28 UTC (permalink / raw)
  To: 74158; +Cc: Lee Thompson

Change-Id: I6c6fb384edb03b55bae63137576c364cf11e42a5
---
 gnu/packages/text-editors.scm | 53 +++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index fae021f012..027f8adb6c 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -467,6 +467,59 @@ (define-public parinfer-rust
 can load dynamic libraries.")
     (license license:expat)))
 
+(define-public parinfer-rust-emacs
+  (package
+    (name "parinfer-rust-emacs")
+    (version "0.4.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/justinbarclay/parinfer-rust-emacs")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32 "1v5lcbs1x4f3b428sj9rkjbmfpzyxzny7i0pgdpnr8nyjvpkzns8"))
+       (file-name (git-file-name name version))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:install-source? #f
+       #:cargo-inputs (("rust-getopts" ,rust-getopts-0.2)
+                       ("rust-libc" ,rust-libc-0.2)
+                       ("rust-emacs" ,rust-emacs-0.19)
+                       ("rust-serde" ,rust-serde-1)
+                       ("rust-serde-json" ,rust-serde-json-1)
+                       ("rust-serde-derive" ,rust-serde-derive-1)
+                       ("rust-unicode-segmentation" ,rust-unicode-segmentation-1)
+                       ("rust-unicode-width" ,rust-unicode-width-0.1))
+       #:phases (modify-phases %standard-phases
+                  (add-after 'install 'install-plugins-and-libs
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (lib (string-append out "/lib"))
+                             (vimfiles (string-append out
+                                        "/share/vim/vimfiles/"
+                                        "pack/guix/start/parinfer")))
+                        (with-directory-excursion "target/release"
+                          (install-file "libparinfer_rust.so" lib))
+                        (substitute* "plugin/parinfer.vim"
+                          (("(let s:libdir = ).*" all libdir)
+                           (format #f "~a'~a'\n" libdir lib)))
+                        (install-file "doc/parinfer.txt"
+                                      (string-append vimfiles "/doc"))
+                        (install-file "plugin/parinfer.vim"
+                                      (string-append vimfiles "/plugin"))
+                        (install-file "rc/parinfer.kak"
+                                      (string-append out "/share/kak/autoload"))))))))
+    (inputs (list clang))
+    (home-page "https://github.com/justinbarclay/parinfer-rust-emacs")
+    (synopsis "Emacs-centric fork of parinfer-rust")
+    (description
+     "A full-featured, super fast implementation of Shaun Lebron’s
+@code{parinfer}.  This repo has Vim, Neovim, and Kakoune plugins, and an Emacs
+plugin is available.  The Rust library can be called from other editors that
+can load dynamic libraries.")
+    (license license:isc)))
+
 (define-public joe
   (package
     (name "joe")
-- 
2.43.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#74158] [PATCH 4/4] * gnu/packages/emacs-xyz.scm (emacs-parinfer-rust-mode): New variable.
  2024-11-01 13:28 ` [bug#74158] [PATCH 1/4] * gnu/packages/emacs-xyz.scm (emacs-track-changes): New variable Lee Thompson
  2024-11-01 13:28   ` [bug#74158] [PATCH 2/4] * gnu/packages/crates-io.scm (rust-emacs-0.19): " Lee Thompson
  2024-11-01 13:28   ` [bug#74158] [PATCH 3/4] * gnu/packages/text-editors.scm (parinfer-rust-emacs): " Lee Thompson
@ 2024-11-01 13:28   ` Lee Thompson
  2 siblings, 0 replies; 5+ messages in thread
From: Lee Thompson @ 2024-11-01 13:28 UTC (permalink / raw)
  To: 74158; +Cc: Lee Thompson

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)
+                      (let ((parinfer (assoc-ref inputs "parinfer-rust-emacs")))
+                        ;; 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
+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")
-- 
2.43.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-01 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-01 11:13 [bug#74158] [PATCH 0/4] Add emacs-parinfer-rust-mode Lee Thompson
2024-11-01 13:28 ` [bug#74158] [PATCH 1/4] * gnu/packages/emacs-xyz.scm (emacs-track-changes): New variable Lee Thompson
2024-11-01 13:28   ` [bug#74158] [PATCH 2/4] * gnu/packages/crates-io.scm (rust-emacs-0.19): " Lee Thompson
2024-11-01 13:28   ` [bug#74158] [PATCH 3/4] * gnu/packages/text-editors.scm (parinfer-rust-emacs): " Lee Thompson
2024-11-01 13:28   ` [bug#74158] [PATCH 4/4] * gnu/packages/emacs-xyz.scm (emacs-parinfer-rust-mode): " Lee Thompson

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).