GNU bug report logs - #75986
[PATCH] gnu: Add emacs-khardel.

Previous Next

Package: guix-patches;

Reported by: Konrad Hinsen <konrad.hinsen <at> fastmail.net>

Date: Sat, 1 Feb 2025 07:03:01 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75986 in the body.
You can then email your comments to 75986 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Sat, 01 Feb 2025 07:03:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Konrad Hinsen <konrad.hinsen <at> fastmail.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 01 Feb 2025 07:03:01 GMT) Full text and rfc822 format available.

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

From: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add emacs-khardel.
Date: Sat, 01 Feb 2025 08:02:06 +0100
* gnu/packages/emacs-xyz.scm (emacs-khardel): New variable.

Change-Id: I74093cc2cade2330f9981b88e7bb6f8b030d1c85
---
 gnu/packages/emacs-xyz.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 153785e017..6a2e0c8129 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -6773,6 +6773,39 @@ (define-public emacs-keyfreq
 a command.")
     (license license:gpl3+)))
 
+(define-public emacs-khardel
+  (package
+   (name "emacs-khardel")
+   (version "20231126.1502")
+   (source
+    (origin
+     (method git-fetch)
+     (uri (git-reference
+           (url "https://github.com/DamienCassou/khardel.git")
+           (commit "205e374b36252183a146a7a8f857bcf95a77edc3")))
+     (file-name (git-file-name name version))
+     (sha256
+      (base32 "0gqijnmj24phryi6n74iq410k0637j0li1ncdymxhk3bdmp4mb40"))))
+   (build-system emacs-build-system)
+   (inputs
+    (list khard))
+   (propagated-inputs
+    (list emacs-yaml-mode))
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (add-after 'unpack 'fix-path
+          (lambda _
+            (substitute* "khardel.el"
+                         (("\\(executable-find \"khard\"\\)")
+                          (string-append "\"" (which "khard") "\""))))))))
+   (home-page "https://github.com/DamienCassou/khardel")
+   (synopsis "Emacs interface to khard")
+   (description
+    "Emacs integrate with khard, a console carddav application to search and
+edit contacts in carddav/vcard format.")
+   (license license:gpl3+)))
+
 (define-public emacs-ligature
   (let ((commit "3d1460470736777fd8329e4bb4ac359bf4f1460a")
         (revision "1"))

base-commit: d48da2d21610f9cf5f76cd846703b12beedb1fd5
-- 
2.48.1




Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Sat, 01 Feb 2025 09:05:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
Cc: 75986 <at> debbugs.gnu.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Sat, 01 Feb 2025 10:03:48 +0100
Hello,

Konrad Hinsen <konrad.hinsen <at> fastmail.net> writes:

> * gnu/packages/emacs-xyz.scm (emacs-khardel): New variable.

Thank you. Some comments follow.

> +   (version "20231126.1502")
> +   (source
> +    (origin
> +     (method git-fetch)
> +     (uri (git-reference
> +           (url "https://github.com/DamienCassou/khardel.git")

You can drop the ".git" suffix.

> +           (commit "205e374b36252183a146a7a8f857bcf95a77edc3")))

Version is wrong: it should be "2.0.0". You do not need to provide a raw
commit hash either, the "v2.0.0" tag will be fine.

> +     (file-name (git-file-name name version))
> +     (sha256
> +      (base32 "0gqijnmj24phryi6n74iq410k0637j0li1ncdymxhk3bdmp4mb40"))))
> +   (build-system emacs-build-system)
> +   (inputs
> +    (list khard))
> +   (propagated-inputs
> +    (list emacs-yaml-mode))
> +   (arguments
> +    `(#:phases
> +      (modify-phases %standard-phases
> +        (add-after 'unpack 'fix-path
> +          (lambda _
> +            (substitute* "khardel.el"
> +                         (("\\(executable-find \"khard\"\\)")
> +                          (string-append "\"" (which "khard")
> "\""))))))))

I think using `search-input-file' is more elegant than relying on
`which'. Also, the latter may return unpredictable results if "khard"
was already on $PATH.

> +   (home-page "https://github.com/DamienCassou/khardel")
> +   (synopsis "Emacs interface to khard")

Nitpick: khard -> Khard

> +   (description
> +    "Emacs integrate with khard, a console carddav application to search and
> +edit contacts in carddav/vcard format.")

"Khardel provides an Emacs integration with Khard…"

also,

in carddav/vcard-> vCard format

Could you send an updated patch?

Regards,
-- 
Nicolas Goaziou






Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Sat, 01 Feb 2025 09:10:01 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Nicolas Goaziou via Guix-patches via <guix-patches <at> gnu.org>
Cc: 75986 <at> debbugs.gnu.org, Konrad Hinsen <konrad.hinsen <at> fastmail.net>
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Sat, 01 Feb 2025 10:09:06 +0100
Nicolas Goaziou via Guix-patches via <guix-patches <at> gnu.org> writes:

>> +        (add-after 'unpack 'fix-path
>> +          (lambda _
>> +            (substitute* "khardel.el"
>> +                         (("\\(executable-find \"khard\"\\)")
>> +                          (string-append "\"" (which "khard")
>> "\""))))))))

Also, you could use `emacs-substitute-variables' above.






Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Sat, 01 Feb 2025 09:10:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Tue, 04 Feb 2025 19:31:02 GMT) Full text and rfc822 format available.

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

From: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
To: 75986 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add emacs-khardel.
Date: Tue, 04 Feb 2025 20:30:48 +0100
* gnu/packages/emacs-xyz.scm (emacs-khardel): New variable.
---
 gnu/packages/emacs-xyz.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 153785e017..de741928b0 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -6773,6 +6773,39 @@ (define-public emacs-keyfreq
 a command.")
     (license license:gpl3+)))
 
+(define-public emacs-khardel
+  (package
+   (name "emacs-khardel")
+   (version "2.0.0")
+   (source
+    (origin
+     (method git-fetch)
+     (uri (git-reference
+           (url "https://github.com/DamienCassou/khardel")
+           (commit (string-append "v" version))))
+     (file-name (git-file-name name version))
+     (sha256
+      (base32 "0gqijnmj24phryi6n74iq410k0637j0li1ncdymxhk3bdmp4mb40"))))
+   (build-system emacs-build-system)
+   (inputs
+    (list khard))
+   (propagated-inputs
+    (list emacs-yaml-mode))
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (add-after 'unpack 'fix-path
+          (lambda* (#:key inputs #:allow-other-keys)
+            (emacs-substitute-sexps "khardel.el"
+                  ("defcustom khardel-command"
+                   (search-input-file inputs "/bin/khard"))))))))
+   (home-page "https://github.com/DamienCassou/khardel")
+   (synopsis "Emacs interface to Khard")
+   (description
+    "Khardel provide an Emacs integration with Khard, a console application to search and
+edit contacts in vCard format.")
+   (license license:gpl3+)))
+
 (define-public emacs-ligature
   (let ((commit "3d1460470736777fd8329e4bb4ac359bf4f1460a")
         (revision "1"))

base-commit: d48da2d21610f9cf5f76cd846703b12beedb1fd5
-- 
2.48.1




Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Tue, 04 Feb 2025 19:35:02 GMT) Full text and rfc822 format available.

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

From: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 75986 <at> debbugs.gnu.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Tue, 04 Feb 2025 20:34:03 +0100
Hi Nicolas,

Thanks for your comments and suggestions! I just sent an updated patch.

> I think using `search-input-file' is more elegant than relying on
> `which'. Also, the latter may return unpredictable results if "khard"
> was already on $PATH.

That shouldn't happen in the build daemon, right? But I agree that
"explicit is better than implicit", as Pythonistas like to say.

> Nitpick: khard -> Khard

Capitalization of program names is roughly as consensual as Emacs
vs. vi!

> Also, you could use `emacs-substitute-variables' above.

Or, better yet, emacs-substitute-sexp, which I just discovered.

Cheers,
  Konrad.




Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Fri, 14 Mar 2025 13:03:02 GMT) Full text and rfc822 format available.

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

From: Cayetano Santos <csantosb <at> inventati.org>
To: konrad.hinsen <at> fastmail.net
Cc: 75986 <at> debbugs.gnu.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Fri, 14 Mar 2025 14:02:09 +0100
[Message part 1 (text/plain, inline)]
> (inputs (list khard))

Khardel is not a hard dependency ? Is this is the case, you need to
propagate the input.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Fri, 14 Mar 2025 13:42:02 GMT) Full text and rfc822 format available.

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

From: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
To: Cayetano Santos <csantosb <at> inventati.org>
Cc: 75986 <at> debbugs.gnu.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Fri, 14 Mar 2025 14:41:21 +0100
Cayetano Santos <csantosb <at> inventati.org> writes:

>> (inputs (list khard))
>
> Khardel is not a hard dependency ? Is this is the case, you need to
> propagate the input.

It is a hard dependency. The path to the store is resolved at build
time, so I don't see a need to propagate the input.

Cheers,
  Konrad.




Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Sat, 15 Mar 2025 10:40:02 GMT) Full text and rfc822 format available.

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

From: Cayetano Santos <csantosb <at> inventati.org>
To: konrad.hinsen <at> fastmail.net
Cc: 75986 <at> debbugs.gnu.org, csantosb <at> inventati.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Sat, 15 Mar 2025 11:39:03 +0100
[Message part 1 (text/plain, inline)]
> It is a hard dependency. The path to the store is resolved at build
> time, so I don't see a need to propagate the input.

What I meant is, the ‘khard’ package is not neeeded at runtime, right ?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Sun, 16 Mar 2025 19:27:02 GMT) Full text and rfc822 format available.

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

From: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
To: Cayetano Santos <csantosb <at> inventati.org>
Cc: 75986 <at> debbugs.gnu.org, csantosb <at> inventati.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Sun, 16 Mar 2025 20:26:10 +0100
Cayetano Santos <csantosb <at> inventati.org> writes:

>> It is a hard dependency. The path to the store is resolved at build
>> time, so I don't see a need to propagate the input.
>
> What I meant is, the ‘khard’ package is not neeeded at runtime, right ?

Yes, it is, the Emacs package shells out to khard for every operation.

Cheers,
  Konrad




Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Sun, 16 Mar 2025 20:27:01 GMT) Full text and rfc822 format available.

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

From: Cayetano Santos <csantosb <at> inventati.org>
To: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
Cc: 75986 <at> debbugs.gnu.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Sun, 16 Mar 2025 21:26:20 +0100
[Message part 1 (text/plain, inline)]
>dim. 16 mars 2025 at 20:26, Konrad Hinsen <konrad.hinsen <at> fastmail.net> wrote:

> Cayetano Santos <csantosb <at> inventati.org> writes:
>
>>> It is a hard dependency. The path to the store is resolved at build
>>> time, so I don't see a need to propagate the input.
>>
>> What I meant is, the ‘khard’ package is not neeeded at runtime, right ?
>
> Yes, it is, the Emacs package shells out to khard for every operation.

In this case, in my opinion khard needs to be propagated into the
profile. Otherwise, the emacs package is meaningless.

C.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Mon, 17 Mar 2025 10:15:02 GMT) Full text and rfc822 format available.

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

From: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
To: Cayetano Santos <csantosb <at> inventati.org>
Cc: 75986 <at> debbugs.gnu.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Mon, 17 Mar 2025 11:14:23 +0100
Cayetano Santos <csantosb <at> inventati.org> writes:

>> Yes, it is, the Emacs package shells out to khard for every operation.
>
> In this case, in my opinion khard needs to be propagated into the
> profile. Otherwise, the emacs package is meaningless.

With the definition for emacs-khardel from this patch, I get:

   $ guix gc --references $(guix build emacs-khardel)
   /gnu/store/fm5dg48x6zvjypgvi2x6rg24i0m0rara-khard-0.19.1

I think that should be enough to ensure that khard is present in the
store whenever emacs-khardel is installed. And since the Emacs Lisp code
refers to the khard executable by its full path name in the store, khard
doesn't have to be in the profile.

I may be wrong, given that my understanding of how Guix manages output
references is rather superficial. But if I am wrong, please tell me why!

Cheers,
  Konrad.





Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Mon, 17 Mar 2025 10:33:02 GMT) Full text and rfc822 format available.

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

From: Cayetano Santos <csantosb <at> inventati.org>
To: GNU bug tracker automated control server <control <at> debbugs.gnu.org>
Cc: 75986 <at> debbugs.gnu.org, konrad.hinsen <at> fastmail.net
Subject: control message for bug#75986
Date: Mon, 17 Mar 2025 11:32:43 +0100
[Message part 1 (text/plain, inline)]
user guix
usertag 75986 + reviewed-looks-good
thanks

Items marked as checked:

- commit messages
- package builds
- lint warnings
- package style
- no dependent packages
- synopsis and descriptions
- no package tests
- licenses
- synopsis and descriptions
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#75986; Package guix-patches. (Mon, 17 Mar 2025 10:35:03 GMT) Full text and rfc822 format available.

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

From: Cayetano Santos <csantosb <at> inventati.org>
To: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
Cc: 75986 <at> debbugs.gnu.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Mon, 17 Mar 2025 11:34:01 +0100
[Message part 1 (text/plain, inline)]
> I may be wrong, given that my understanding of how Guix manages output
> references is rather superficial. But if I am wrong, please tell me why!

You’re absolutely right ! My bad, I misunderstood your changes.

C.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Sat, 22 Mar 2025 13:38:02 GMT) Full text and rfc822 format available.

Notification sent to Konrad Hinsen <konrad.hinsen <at> fastmail.net>:
bug acknowledged by developer. (Sat, 22 Mar 2025 13:38:03 GMT) Full text and rfc822 format available.

Message #49 received at 75986-done <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
Cc: 75986-done <at> debbugs.gnu.org
Subject: Re: [bug#75986] [PATCH] gnu: Add emacs-khardel.
Date: Sat, 22 Mar 2025 14:37:20 +0100
Hello,

Konrad Hinsen <konrad.hinsen <at> fastmail.net> writes:

> * gnu/packages/emacs-xyz.scm (emacs-khardel): New variable.

Applied with some small changes (I introduced gexps, re-ordered fields
and used emacs-substitute-variables instead of emacs-substitute-sexps).

Thank you!

Regards,
-- 
Nicolas Goaziou






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Apr 2025 11:24:34 GMT) Full text and rfc822 format available.

This bug report was last modified 77 days ago.

Previous Next


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