GNU bug report logs - #66562
[PATCH] gnu: emacs-haskell-snippets: Fix haskell-snippets-dir value.

Previous Next

Package: guix-patches;

Reported by: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>

Date: Sun, 15 Oct 2023 15:19:02 UTC

Severity: normal

Tags: patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 66562 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Rostislav Svoboda <rostislav.svoboda <at> gmail.com>
Cc: 66562 <at> debbugs.gnu.org
Subject: Re: [PATCH v3] gnu: emacs-haskell-snippets: Use correct directory
 for snippets.
Date: Mon, 16 Oct 2023 18:57:56 +0200
Am Montag, dem 16.10.2023 um 12:57 +0200 schrieb Rostislav Svoboda:
> Hi Liliana,
> 
> Your patch works (thank you) and I improved it a tiny bit. (See
> attachment.) BTW shouldn't the revision number in the (git-version
> "0.1.0" "1" commit) be increased to "2" in your patch and to "3" in
> mine?
No.  It should just be one patch anyway and the change doesn't affect
the source code, but the build recipe.  As such, the rebuild is going
to happen either way.

> DRY in the specification of the relative path of the snippets
> directory.
You can just amend my commit.

> -                (let ((snippets
> -                       (string-append
> -                        (elpa-directory (assoc-ref outputs "out"))
> -                        "/snippets/haskell-mode")))
> -                  (mkdir-p snippets)
> -                  (copy-recursively "snippets/haskell-mode"
> snippets)))))))
> +                (let* ((relative-dirpath "snippets/haskell-mode")
> +                       (installation-dir
> +                        (string-append (elpa-directory (assoc-ref
> outputs "out"))
> +                                       "/" relative-dirpath)))
> +                  (mkdir-p installation-dir)
> +                  (copy-recursively relative-dirpath installation-
> dir)))))))
Now you repeat yourself on relative-dirpath (which is a very Java name
anyway, just five characters shorter than the original value won't win
you Kolmogorov complexity).  Plus you're requiring let* instead of let.

Btw. don't 
  ((composeĀ 
    (lambda (src dst) (mkdir-p src) (copy-recursively dst src))
    (lambda (dir store) (values dir (string-append store "/" dir)))
   "snippets/haskell-mode" (elpa-directory (assoc-ref outputs "out")))
to avoid gratuitous repetition.

Sometimes explicit is better than implicit, even if it comes at the
cost of typing a constant twice :)

Cheers




This bug report was last modified 1 year and 290 days ago.

Previous Next


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