GNU bug report logs - #50709
[PATCH] gnu: Add zsh-syntax-highlighting.

Previous Next

Package: guix-patches;

Reported by: Alexandr Vityazev <avityazev <at> posteo.org>

Date: Mon, 20 Sep 2021 23:04:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#50709: closed ([PATCH] gnu: Add zsh-syntax-highlighting.)
Date: Wed, 13 Oct 2021 08:42:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 13 Oct 2021 10:40:52 +0200
with message-id <87a6jdtizv.fsf_-_ <at> gnu.org>
and subject line Re: bug#50709: [PATCH] gnu: Add zsh-syntax-highlighting.
has caused the debbugs.gnu.org bug report #50709,
regarding [PATCH] gnu: Add zsh-syntax-highlighting.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
50709: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=50709
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Alexandr Vityazev <avityazev <at> posteo.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add zsh-syntax-highlighting.
Date: Mon, 20 Sep 2021 23:03:29 +0000
* gnu/packages/shellutils.scm (zsh-syntax-highlighting): New variable.
---
 gnu/packages/shellutils.scm | 55 +++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index 94b5536df7..69e1d0d069 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -138,6 +138,61 @@ text.")
 as you type.")
     (license license:expat)))
 
+(define-public zsh-syntax-highlighting
+  (package
+    (name "zsh-syntax-highlighting")
+    (version "0.7.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/zsh-users/zsh-syntax-highlighting")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "039g3n59drk818ylcyvkciv8k9mf739cv6v4vis1h9fv9whbcmwl"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("zsh" ,zsh)))
+    (arguments
+     ;; FIXME: Tests fail when running test regexp
+     ;; there is no pcre module in the Guix zsh package
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-before 'build 'add-all-md
+           (lambda _
+             (copy-file "docs/highlighters.md" "docs/all.md")
+             (make-file-writable "docs/all.md")
+             #t))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "make" "test")
+               (invoke "make" "perf"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (zsh-plugins
+                     (string-append out "/share/zsh/plugins/zsh-syntax-highlighting"))
+                    (highlighters-dir (string-append zsh-plugins "/highlighters")))
+               (invoke "make" "all")
+               (install-file "zsh-syntax-highlighting.zsh" zsh-plugins)
+               (install-file ".version" zsh-plugins)
+               (install-file ".revision-hash" zsh-plugins)
+               (copy-recursively "highlighters" highlighters-dir)
+               #t))))))
+    (home-page "https://github.com/zsh-users/zsh-syntax-highlighting")
+    (synopsis "Fish shell-like syntax highlighting for zsh")
+    (description
+     "This package provides syntax highlighting for the shell zsh.
+It enables highlighting of commands whilst they are typed at a zsh
+prompt into an interactive terminal.  This helps in reviewing commands
+before running them, particularly in catching syntax errors.")
+    (license license:expat)))
+
 (define-public sh-z
   (package
     (name "sh-z")
-- 
2.33.0



-- 

Alexandr Vityazev


[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Alexandr Vityazev <avityazev <at> posteo.org>
Cc: 50709-done <at> debbugs.gnu.org
Subject: Re: bug#50709: [PATCH] gnu: Add zsh-syntax-highlighting.
Date: Wed, 13 Oct 2021 10:40:52 +0200
Hi,

Alexandr Vityazev <avityazev <at> posteo.org> skribis:

> * gnu/packages/shellutils.scm (zsh-syntax-highlighting): New variable.

Applied!  I took the liberty to remove the ‘regexp-quote’ call, which I
think did not help readability.

Thanks,
Ludo’.


This bug report was last modified 3 years and 218 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.