unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Collin J. Doering" <collin@rekahsoft.ca>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 37364@debbugs.gnu.org
Subject: [bug#37364] [PATCH 1/1] gnu: Add z for zsh
Date: Wed, 11 Sep 2019 23:13:02 -0400	[thread overview]
Message-ID: <87lfuu2on5.fsf@rekahsoft.ca> (raw)
In-Reply-To: <87d0g7vx6y.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 2044 bytes --]

Hi Ludovic,

On 11 Sep 2019 at 08:23, Ludovic Courtès wrote:

> Hello Collin,
>
> "Collin J. Doering" <collin@rekahsoft.ca> skribis:
>
>> * gnu/packages/shellutils.scm (z): New variable.
>>
>> Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
>
> [...]
>
>> +(define-public z
>> +  (package
>> +    (name "z")
>
> So far there’s only one package with a one-letter name.  I’d be tempted
> to rename “z” to “sh-z” (because it works with both Zsh and Bash) or
> something similar, WDYT?

I felt uncomfortable with just `z` so I'm happy to change it to `sh-z`.

>
>> +               (mkdir-p man-path)
>> +               (invoke "gzip" "z.1")
>> +               (copy-file "z.1.gz" (string-append man-path "/z.1.gz"))
>
> You can omit the “gzip” invocation because the ‘compress-documentation’
> phase takes care of that, and passes the ‘-n’ flag, which is important
> for bitwise reproducibility.

Makes sense, we wouldn't want timestamps. My mistake.

>
> Also, you can remove the ‘mkdir-p’ call and replace the ‘copy-file’ call
> with:
>
>   (install-file "z.1" man)
>
> Last: please remove ‘-path’ from variable names—in GNU the convention is
> touse the term “path” only for search paths ($PATH, etc.)

Thanks for pointing this out. After going to review some uses of the
`install-file` function, I see this is certainly the case.

>
>> +    (synopsis "Jump about directories")
>> +    (description
>> +     "Tracks your most used directories, based on freecency.  After a short
>> +learning phase, z will take you to the most frecent directory that matches
>> +ALL of the regexes given on the command line in order.")
>
> It’s suggest writing “``frecency''” (with quotes) to make it clear that
> it’s not a typo.  :-)

Agree.

>
> Could you send an updated patch?
>
> Thanks,
> Ludo’.

You will find an updated patch as part of this email with the above
changes.

Kind regards, and thanks for the helpful feedback.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

[-- Attachment #2: 0001-gnu-Add-sh-z-shell-tool.patch --]
[-- Type: text/x-patch, Size: 2807 bytes --]

From f5fd56da740cd2576def4c01c3cc7003f1c9f2d7 Mon Sep 17 00:00:00 2001
From: "Collin J. Doering" <collin@rekahsoft.ca>
Date: Wed, 11 Sep 2019 23:08:37 -0400
Subject: [PATCH] gnu: Add sh-z shell tool

* gnu/packages/shellutils.scm (sh-z): New variable.

Signed-off-by: Collin J. Doering <collin@rekahsoft.ca>
---
 gnu/packages/shellutils.scm | 38 +++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index f7542ea759..bbdfd0dadd 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
+;;; Copyright © 2019 Collin J. Doering <collin@rekahsoft.ca>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,11 +34,48 @@
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages compression)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system python))
 
+(define-public sh-z
+  (package
+    (name "sh-z")
+    (version "1.11")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/rupa/z.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "13zbgkj6y0qhvn5jpkrqbd4jjxjr789k228iwma5hjfh1nx7ghyb"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; No tests provided
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'build)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (man (string-append out "/share/man/man1"))
+                    (bin (string-append out "/bin")))
+               (install-file "z.sh" bin)
+               (chmod (string-append bin "/z.sh") #o755)
+               (install-file "z.1" man)))))))
+    (synopsis "Jump about directories")
+    (description
+     "Tracks your most used directories, based on ``frecency''.  After a short
+learning phase, z will take you to the most ``frecent'' directory that matches
+ALL of the regexes given on the command line in order.")
+    (home-page "https://github.com/rupa/z")
+    (license license:expat)))
+
 (define-public envstore
   (package
     (name "envstore")
-- 
2.23.0


[-- Attachment #3: Type: text/plain, Size: 93 bytes --]


-- 
Collin J. Doering

http://rekahsoft.ca
http://blog.rekahsoft.ca
http://git.rekahsoft.ca

  reply	other threads:[~2019-09-12  3:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10  2:40 [bug#37364] [PATCH 0/1] Add z for zsh Collin J. Doering
2019-09-10  2:45 ` [bug#37364] [PATCH 1/1] gnu: " Collin J. Doering
2019-09-11 12:23   ` Ludovic Courtès
2019-09-12  3:13     ` Collin J. Doering [this message]
2019-09-13  8:47       ` Ludovic Courtès
2019-09-10 14:41 ` [bug#37364] [PATCH] - Amended: Add copyright line and gpg sign email Collin J. Doering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfuu2on5.fsf@rekahsoft.ca \
    --to=collin@rekahsoft.ca \
    --cc=37364@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).