From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id t2OPN/RHUGFYCgAAgWs5BA (envelope-from ) for ; Sun, 26 Sep 2021 12:14:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id EPSRMvRHUGFpRAAAbx9fmQ (envelope-from ) for ; Sun, 26 Sep 2021 10:14:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E06B92F1F6 for ; Sun, 26 Sep 2021 12:14:11 +0200 (CEST) Received: from localhost ([::1]:50926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mURAg-0003CX-SR for larch@yhetil.org; Sun, 26 Sep 2021 06:14:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mURAY-0003CO-KK for guix-patches@gnu.org; Sun, 26 Sep 2021 06:14:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mURAY-0008Vr-Cf for guix-patches@gnu.org; Sun, 26 Sep 2021 06:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mURAY-0006x4-5s for guix-patches@gnu.org; Sun, 26 Sep 2021 06:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50709] [PATCH] gnu: Add zsh-syntax-highlighting. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 26 Sep 2021 10:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50709 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Alexandr Vityazev , 50709@debbugs.gnu.org Received: via spool by 50709-submit@debbugs.gnu.org id=B50709.163265119626659 (code B ref 50709); Sun, 26 Sep 2021 10:14:02 +0000 Received: (at 50709) by debbugs.gnu.org; 26 Sep 2021 10:13:16 +0000 Received: from localhost ([127.0.0.1]:35966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUR9h-0006vp-HV for submit@debbugs.gnu.org; Sun, 26 Sep 2021 06:13:16 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:45112 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUR9e-0006vI-H0 for 50709@debbugs.gnu.org; Sun, 26 Sep 2021 06:13:08 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1632651176; bh=eBBqjYpk41bnHKOZPn7Ziy4DUGZi+Rz4rlYKufu6aFs=; h=From:To:Subject:In-Reply-To:References:Date; b=NZX8+rVAGXx79vZk81LiEbcJ1ogK5Huua00BNwkCsVgW7REE2XU5FQkQ2kctrRh6r ddbHOoez+R7WH+vAswLSvyPZZiYT8jyZz5Rll6ulUGLF8ier6vLplUXDyEfg/M+K+b N0hPXMjsa/fSSJ9Xt56bh4rucBIhL7hvZvDVzKtU= In-Reply-To: <87sfxy4zpa.fsf@posteo.org> References: <87sfxy4zpa.fsf@posteo.org> Date: Sun, 26 Sep 2021 12:12:51 +0200 Message-ID: <8735prk5lo.fsf@yoctocell.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632651252; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=tT+OV4vAFVYOFNRnkkft/PM+NfNfD8JzlqJZDQHw9F8=; b=TgJd5WZ9SQy9fXsBoqeL6ffqq7LhBbj9r0DjRx9xzvF7IpSuFsABvdwLnW4gla1nBVHRh4 FDKQeTmeUUqJpuowHr6ezraMYC23pls3EbnMwVsUtMhtt+pWOgywL631RfVYjLlkzN9V38 ET0UeYR2w3Twwd3w/QJyXK7+JTpVzYEbBwmnzjAc8w0TE8+rUZ8F/sh4SlpIlmjpkfLefo gToowMnTkDwBJhBzsNTD27oBTzA6Y1+sZ9NIDinvtE1CwCGEHgBiCJcY7qSwjgABvBGtuN oF+YD2K+Hvl4m9zBYQbsed4dxp3Qckfn6idXC4KPfYi9D6HLfnUQMnrx2ExXgQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632651252; a=rsa-sha256; cv=none; b=gfWmTtFcRXGgBWT9oz82+ALvw5emzCFhIoClfgbcIN7WIC7cn2UuYkC277w+afJ8Zb5wHF e4U+k4JorRt5a9eGqrHdE291g5hBT7tSSe9Ua3wzqD85p8DBl+VlvUIWfVNp4q0FT0LTVh qiXfIa6Ye/fNxXLRrHD6hdWm0iTnoYvEtoMeY08Vt9J5ub8eU9cgojuD8RB8CnWxNrrOHF yf4FlmUmI94/z5mTXJ8ATn+YktjMmPC/TvxYu8XhYSRQTR91An7rrTGfOXKdVJWm//Zo1u cL/QKsACnaCcXQiNpOv6YP/AroLoIxkOL841zl8ew2PSdzljQHCKGMdu1PIv7Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=NZX8+rVA; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.89 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=NZX8+rVA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: E06B92F1F6 X-Spam-Score: -1.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: grf8KxWYChUs --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Sep 20 2021, Alexandr Vityazev wrote: > * 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))) >=20=20 > +(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-highli= ghting") > + (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)) Why not just invoke =E2=80=98make all=E2=80=99? Also, phases no longer have to return #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-h= ighlighting")) > + (highlighters-dir (string-append zsh-plugins "/highl= ighters"))) > + (invoke "make" "all") Why is =E2=80=98make all=E2=80=99 invoked in the =E2=80=98install=E2=80=99 = phase? > + (install-file "zsh-syntax-highlighting.zsh" zsh-plugins) > + (install-file ".version" zsh-plugins) > + (install-file ".revision-hash" zsh-plugins) > + (copy-recursively "highlighters" highlighters-dir) Wouldn=E2=80=99t these things be handled by =E2=80=98make install=E2=80=99,= assuming that =E2=80=98PREFIX=E2=80=99 and =E2=80=98SHARE_DIR=E2=80=99 are set correctly. > + #t)))))) > + (home-page "https://github.com/zsh-users/zsh-syntax-highlighting") > + (synopsis "Fish shell-like syntax highlighting for zsh") =E2=80=9CZsh=E2=80=9D should be capitalized. > + (description > + "This package provides syntax highlighting for the shell zsh. =E2=80=9CThis package provides syntax highlighting for Zsh.=E2=80=9D > +It enables highlighting of commands whilst they are typed at a zsh Capitalize =E2=80=9CZsh=E2=80=9D. > +prompt into an interactive terminal. This helps in reviewing commands > +before running them, particularly in catching syntax errors.") > + (license license:expat))) =E2=80=98COPYING.md=E2=80=99 says BSD-3. And I couldn=E2=80=99t resist, so I just went ahead and made those changes= =E2=80=A6 :-) --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-Add-zsh-syntax-highlighting.patch Content-Transfer-Encoding: quoted-printable From=202cb00a93974f7efc7891e8f77fff1a3d96c7f692 Mon Sep 17 00:00:00 2001 Message-Id: <2cb00a93974f7efc7891e8f77fff1a3d96c7f692.1632651051.git.public= @yoctocell.xyz> From: Alexandr Vityazev Date: Mon, 20 Sep 2021 23:03:29 +0000 Subject: [PATCH] gnu: Add zsh-syntax-highlighting. * gnu/packages/shellutils.scm (zsh-syntax-highlighting): New variable. Co-authored-by: Xinglu Chen =2D-- gnu/packages/shellutils.scm | 56 ++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm index 94b5536df7..8726020ab3 100644 =2D-- a/gnu/packages/shellutils.scm +++ b/gnu/packages/shellutils.scm @@ -10,6 +10,8 @@ ;;; Copyright =C2=A9 2020 aecepoglu ;;; Copyright =C2=A9 2020 Dion Mendel ;;; Copyright =C2=A9 2021 Brice Waegeneire +;;; Copyright =C2=A9 2021 Alexandr Vityazev +;;; Copyright =C2=A9 2021 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -46,7 +48,8 @@ (define-module (gnu packages shellutils) #:use-module (gnu packages readline) #:use-module (gnu packages ruby) #:use-module (gnu packages shells) =2D #:use-module (gnu packages tmux)) + #:use-module (gnu packages tmux) + #:use-module (ice-9 regex)) =20 (define-public boxes (package @@ -138,6 +141,57 @@ (define-public zsh-autosuggestions as you type.") (license license:expat))) =20 +(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-highligh= ting") + (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-after 'unpack 'patch-paths + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "Makefile" + (("/usr/local") out) + ((,(regexp-quote "share/$(NAME)")) "share/zsh/plugins/$(N= AME)"))))) + (add-after 'patch-paths 'make-writable + (lambda _ + (for-each make-file-writable + '("docs/highlighters.md" + "README.md")))) + (add-before 'build 'add-all-md + (lambda _ + (invoke "make" "all"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "make" "test") + (invoke "make" "perf"))))))) + (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 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 the= m, +particularly in catching syntax errors.") + (license license:bsd-3))) + (define-public sh-z (package (name "sh-z") base-commit: c1bc2a43200d6c6016c2a4154799c73c86a54021 =2D-=20 2.33.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmFQR6MVHHB1YmxpY0B5 b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5oTcP/0MNgMiqasAbPnHfcRzFxp8Y6OpR hxDZKnK/aswOLqVkkXWPHJ5ANkQoU72RCjw1YvcdL44OqV4PI54bVEsKhOUbLMuk nLVPu9jtvrl+OWeCzAhPNuY2itvIIlHq+ftMzAdE4L/47dCV9V+z93qkofLTMjJY e6PCPfsPiedNczqU78L5Bhcqz0vJ+jeojDabhrfleVIDlR8bjRf4wDqaVoHJeg/y GHUoN6DlwWgFAmFNQfoBq+a4acS6G94viOvypRFe00yVKRQUlKFaCpIDkfgWY3zL 7scjjfQXXJDrVU3B1VpKvtZuaSZ3NIKg/Y/22Paq029RpTeQng4GoFSNl7++tvX2 cXXt8mKtEB8czdsTM6ZdrUgEF9FnnHDPC12D55jySRUmsjoJQljAErSy3cN+K2Xw XZhZs5pnM8VsaCoEDnQ7hgszBdvicK0UDJjvrUZ2lR+DGu8E4tWE2DjDRtCCi/P9 vaGe+RM+X6RK9sWQnCoNiNqZMkJtHHtZvf/PGt2XXcZPZlFpWgMtmNKTX0HT/xC6 nC9XDWtIKY283zMi/AZLX7kVt99toJ/ebT31CDBVlwlLxp7DuOKcKBOhIqc68/To +mTqOxCEQKVyZHuihe3cd1dXnDUCIR7chS0App98ZXm0Bx24Pcyc00K+VJSJVc1G Zu8pxIQTpUIIPqZn =YhX2 -----END PGP SIGNATURE----- --==-=-=--