unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#59930] [PATCH] gnu: Add emacs-islisp-mode
@ 2022-12-09 21:01 Joeke de Graaf
  2022-12-14 16:36 ` Nicolas Goaziou
  2022-12-16 13:14 ` Joeke de Graaf
  0 siblings, 2 replies; 4+ messages in thread
From: Joeke de Graaf @ 2022-12-09 21:01 UTC (permalink / raw)
  To: 59930

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

This patch adds emacs-islisp-mode to emacs-xyz.scm

Best regards,

Joeke de Graaf


[-- Attachment #2: 0001-gnu-Add-emacs-islisp-mode.patch --]
[-- Type: text/x-patch, Size: 3041 bytes --]

From fc661dcc856de74034964fd0734cabce5cef4eaa Mon Sep 17 00:00:00 2001
From: Joeke <joeke@posteo.net>
Date: Fri, 9 Dec 2022 21:52:40 +0100
Subject: [PATCH] gnu: Add emacs-islisp-mode

---
 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 0d11c59b48..4170787ca1 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -118,6 +118,7 @@
 ;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
 ;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
 ;;; Copyright © 2022 Thiago Jung Bauermann <bauermann@kolabnow.com>
+;;; Copyright © 2022 Joeke de Graaf <joeke@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -13125,6 +13126,46 @@ (define-public emacs-helm-make
 target will call @code{compile} on it.")
       (license license:gpl3+))))
 
+(define-public emacs-islisp-mode
+  (package
+    (name "emacs-islisp-mode")
+    (version "0.3.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitlab.com/sasanidas/islisp-mode")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1s6alrv1hfi1plj5lh826j0h71xvm2v092kglj3yvy34g73dgrna"))))
+    (build-system emacs-build-system)
+    (arguments
+     (list #:phases #~(modify-phases %standard-phases
+			;; Install Emacs Lisp files from the "advance"
+			;; and "implementations" directories
+                        (add-after 'install 'install-additional-directories
+                          (lambda _
+                            (let ((site-lisp-dir (string-append #$output
+                                                  "/share/emacs/site-lisp/islisp-mode-"
+                                                  #$version)))
+                              (map (lambda (dir)
+                                     (with-directory-excursion dir
+                                       (for-each (lambda (file)
+                                                   (install-file file
+                                                    site-lisp-dir))
+                                                 (find-files "." "\\.el$"))))
+                                   '("advance" "implementations"))))))))
+    (home-page "https://gitlab.com/sasanidas/islisp-mode")
+    (synopsis "ISLisp support for Emacs")
+    (description
+     "This package provides support for programming with ISLisp in
+Emacs.  It features a major mode with syntax highlighting, symbol autocompletion
+and documentation search, among other features.  It also includes an inferior
+mode with REPL integration.  Currently it only supports the Easy ISLisp (eisl)
+implementation.")
+    (license license:gpl3+)))
+
 (define-public emacs-cider
   (package
     (name "emacs-cider")
-- 
2.37.2


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

* [bug#59930] [PATCH] gnu: Add emacs-islisp-mode
  2022-12-09 21:01 [bug#59930] [PATCH] gnu: Add emacs-islisp-mode Joeke de Graaf
@ 2022-12-14 16:36 ` Nicolas Goaziou
  2022-12-16 13:14 ` Joeke de Graaf
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2022-12-14 16:36 UTC (permalink / raw)
  To: Joeke de Graaf; +Cc: 59930

Hello,

Joeke de Graaf <joeke@posteo.net> writes:

> This patch adds emacs-islisp-mode to emacs-xyz.scm

Thank you. Some comments follow.

> +    (build-system emacs-build-system)
> +    (arguments
> +     (list #:phases #~(modify-phases %standard-phases
> +			;; Install Emacs Lisp files from the "advance"
> +			;; and "implementations" directories
> +                        (add-after 'install 'install-additional-directories
> +                          (lambda _
> +                            (let ((site-lisp-dir (string-append #$output
> +                                                  "/share/emacs/site-lisp/islisp-mode-"
> +                                                  #$version)))

You can use (elpa-directory #$output) instead of (string-append ...)

> +                              (map (lambda (dir)
> +                                     (with-directory-excursion dir
> +                                       (for-each (lambda (file)
> +                                                   (install-file file
> +                                                    site-lisp-dir))
> +                                                 (find-files "." "\\.el$"))))
> +                                   '("advance" "implementations"))))))))

You can use for-each instead of map since you don't need the return
value. Moreover, `copy-recursively' is probably shorter.

However, this will catch neither the ".el" file nor the ".lsp" file in
"implementations/easy-islisp" directory. What should we do about the
latter ?

You also need to add `eisl' as an input, and patch "easy-islisp.el"
accordingly (see `easy-islisp-executable').

Could you send an updated patch?

Regards,
-- 
Nicolas Goaziou




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

* [bug#59930] [PATCH] gnu: Add emacs-islisp-mode
  2022-12-09 21:01 [bug#59930] [PATCH] gnu: Add emacs-islisp-mode Joeke de Graaf
  2022-12-14 16:36 ` Nicolas Goaziou
@ 2022-12-16 13:14 ` Joeke de Graaf
  2022-12-16 17:54   ` bug#59930: " Nicolas Goaziou
  1 sibling, 1 reply; 4+ messages in thread
From: Joeke de Graaf @ 2022-12-16 13:14 UTC (permalink / raw)
  To: 59930

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

   > You can use (elpa-directory #$output) instead of (string-append ...)

   Thanks, I did not know about elpa-directory.

   > You can use for-each instead of map since you don't need the return
   > value. Moreover, `copy-recursively' is probably shorter.
   >
   > However, this will catch neither the ".el" file nor the ".lsp" file 
in
   > "implementations/easy-islisp" directory. What should we do about the
   > latter ?

   It seems Emacs has a hard time finding easy-islisp.el when using
   copy-recursively, since it's put inside a directory. The easy solution
   would be to 'expand' the regex in find-files like this:

   (lambda _
     (let ((site-lisp-dir (elpa-directory #$output)))
       (for-each (lambda (dir)
		  (copy-recursively dir elpa-directory)
		  (with-directory-excursion dir
		    (for-each (lambda (file)
				(install-file file
					      site-lisp-dir))
			      (find-files "." "\\.(lsp|el)$"))))
		'("advance" "implementations"))))

   Are there any objections to doing it this way? (Other than it being a
   lot less pretty than a call to copy-recursively 😄)

   > You also need to add `eisl' as an input,
   > and patch "easy-islisp.el"
   > accordingly (see `easy-islisp-executable').

   I incorporated this in the new patch.

   I have attached an updated version below.

   Thanks for reviewing!

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-emacs-islisp-mode.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-emacs-islisp-mode.patch, Size: 3869 bytes --]

From 19437af399658570116e403ec85162369f7db6b0 Mon Sep 17 00:00:00 2001
From: Joeke <joeke@posteo.net>
Date: Fri, 16 Dec 2022 14:05:43 +0100
Subject: [PATCH] gnu: Add emacs-islisp-mode

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

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 0d11c59b48..2322194d6f 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -118,6 +118,7 @@
 ;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
 ;;; Copyright © 2022 Nicolas Graves <ngraves@ngraves.fr>
 ;;; Copyright © 2022 Thiago Jung Bauermann <bauermann@kolabnow.com>
+;;; Copyright © 2022 Joeke de Graaf <joeke@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -13125,6 +13126,57 @@ (define-public emacs-helm-make
 target will call @code{compile} on it.")
       (license license:gpl3+))))
 
+(define-public emacs-islisp-mode
+  (package
+    (name "emacs-islisp-mode")
+    (version "0.3.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitlab.com/sasanidas/islisp-mode")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1s6alrv1hfi1plj5lh826j0h71xvm2v092kglj3yvy34g73dgrna"))))
+    (build-system emacs-build-system)
+    (inputs (list eisl))
+    (arguments
+     (list #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'patch-eisl-variables
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (emacs-substitute-variables
+                             "implementations/easy-islisp/easy-islisp.el"
+                             ("easy-islisp-executable" (search-input-file
+                                                        inputs "/bin/eisl"))
+                             ("easy-islisp-library-directory" `(if (getenv
+                                                                    "EASY_ISLISP")
+                                                                   (getenv
+                                                                    "EASY_ISLISP")
+                                                                   ,(search-input-directory
+                                                                     inputs
+                                                                     "share/eisl/library"))))))
+                        (add-after 'install 'install-additional-directories
+                          (lambda _
+                            (let ((site-lisp-dir (elpa-directory #$output)))
+                              (for-each (lambda (dir)
+                                          (with-directory-excursion dir
+                                            (for-each (lambda (file)
+                                                        (install-file file
+                                                         site-lisp-dir))
+                                                      (find-files "."
+                                                       "\\.(lsp|el)$"))))
+                                        '("advance" "implementations"))))))))
+    (home-page "https://gitlab.com/sasanidas/islisp-mode")
+    (synopsis "ISLisp support for Emacs")
+    (description
+     "This package provides support for programming with ISLisp in
+Emacs.  It features a major mode with syntax highlighting, symbol autocompletion
+and documentation search, among other features.  It also includes an inferior
+mode with REPL integration.  Currently it only supports the Easy ISLisp (eisl)
+implementation.")
+    (license license:gpl3+)))
+
 (define-public emacs-cider
   (package
     (name "emacs-cider")
-- 
2.37.2


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

* bug#59930: [PATCH] gnu: Add emacs-islisp-mode
  2022-12-16 13:14 ` Joeke de Graaf
@ 2022-12-16 17:54   ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2022-12-16 17:54 UTC (permalink / raw)
  To: Joeke de Graaf; +Cc: 59930-done

Hello,

Joeke de Graaf <joeke@posteo.net> writes:

>   I have attached an updated version below.

Thank you. I applied it with a small refactoring.

Regards,
-- 
Nicolas Goaziou




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

end of thread, other threads:[~2022-12-16 17:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 21:01 [bug#59930] [PATCH] gnu: Add emacs-islisp-mode Joeke de Graaf
2022-12-14 16:36 ` Nicolas Goaziou
2022-12-16 13:14 ` Joeke de Graaf
2022-12-16 17:54   ` bug#59930: " Nicolas Goaziou

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