[PATCH] gnu: Add emacs-khardel.

  • Open
  • quality assurance status badge
Details
3 participants
  • Cayetano Santos
  • Konrad Hinsen
  • Nicolas Goaziou
Owner
unassigned
Submitted by
Konrad Hinsen
Severity
normal

Debbugs page

Konrad Hinsen wrote 1 months ago
(address . guix-patches@gnu.org)
m1seoyb11t.fsf@fastmail.net
* gnu/packages/emacs-xyz.scm (emacs-khardel): New variable.

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

Toggle diff (48 lines)
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
Nicolas Goaziou wrote 1 months ago
(name . Konrad Hinsen)(address . konrad.hinsen@fastmail.net)(address . 75986@debbugs.gnu.org)
87frky5957.fsf@nicolasgoaziou.fr
Hello,

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

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

Thank you. Some comments follow.

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

You can drop the ".git" suffix.

Toggle quote (2 lines)
> + (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.

Toggle quote (18 lines)
> + (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.

Toggle quote (3 lines)
> + (synopsis "Emacs interface to khard")

Nitpick: khard -> Khard

Toggle quote (4 lines)
> + (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
Nicolas Goaziou wrote 1 months ago
(name . Nicolas Goaziou via Guix-patches via)(address . guix-patches@gnu.org)(address . 75986@debbugs.gnu.org)(name . Konrad Hinsen)(address . konrad.hinsen@fastmail.net)
878qqq58wd.fsf@nicolasgoaziou.fr
Nicolas Goaziou via Guix-patches via <guix-patches@gnu.org> writes:

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

Also, you could use `emacs-substitute-variables' above.
Konrad Hinsen wrote 1 months ago
[PATCH] gnu: Add emacs-khardel.
(address . 75986@debbugs.gnu.org)
m1o6zhbj87.fsf@fastmail.net
* gnu/packages/emacs-xyz.scm (emacs-khardel): New variable.
---
gnu/packages/emacs-xyz.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

Toggle diff (48 lines)
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
Konrad Hinsen wrote 1 months ago
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)(address . 75986@debbugs.gnu.org)
m1jza5bj2s.fsf@fastmail.net
Hi Nicolas,

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

Toggle quote (4 lines)
> 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.

Toggle quote (2 lines)
> Nitpick: khard -> Khard

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

Toggle quote (2 lines)
> Also, you could use `emacs-substitute-variables' above.

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

Cheers,
Konrad.
Cayetano Santos wrote 3 days ago
(address . konrad.hinsen@fastmail.net)(address . 75986@debbugs.gnu.org)
877c4r7oku.fsf@inventati.org
Toggle quote (2 lines)
> (inputs (list khard))

Khardel is not a hard dependency ? Is this is the case, you need to
propagate the input.
-----BEGIN PGP SIGNATURE-----

iI0EARYKADUWIQTMuBhC+dcFjs1nN3q/XN9N9r9mggUCZ9Qo0RccY3NhbnRvc2JA
aW52ZW50YXRpLm9yZwAKCRC/XN9N9r9mgpFHAP91ntIpe+HcqVhxApVlgtIGEOaZ
UfLrLopM8/aSSSDf9AD8D+HtypD1vCXgvzxC8jkrMMrW48RuPp1WjOTivjlHkQQ=
=Pp2y
-----END PGP SIGNATURE-----

Konrad Hinsen wrote 3 days ago
(name . Cayetano Santos)(address . csantosb@inventati.org)(address . 75986@debbugs.gnu.org)
m1msdn6872.fsf@fastmail.net
Cayetano Santos <csantosb@inventati.org> writes:

Toggle quote (5 lines)
>> (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.
Cayetano Santos wrote 40 hours ago
(address . konrad.hinsen@fastmail.net)(address . 75986@debbugs.gnu.org)(address . csantosb@inventati.org)
87pliilgs8.fsf@inventati.org
Toggle quote (3 lines)
> 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 ?
-----BEGIN PGP SIGNATURE-----

iI0EARYKADUWIQTMuBhC+dcFjs1nN3q/XN9N9r9mggUCZ9VYxxccY3NhbnRvc2JA
aW52ZW50YXRpLm9yZwAKCRC/XN9N9r9mggLKAP9S+Gi/l9uXiLjsQ4y6BdoyrfJJ
jt4ogEu1kS71CMKAUQEAoZo+Mxdci4zGp83RPsZFIFht7MBqdnhg9kxxl6mdtwc=
=XH2J
-----END PGP SIGNATURE-----

Konrad Hinsen wrote 7 hours ago
(name . Cayetano Santos)(address . csantosb@inventati.org)(address . 75986@debbugs.gnu.org)(address . csantosb@inventati.org)
m1frjcpyjx.fsf@fastmail.net
Cayetano Santos <csantosb@inventati.org> writes:

Toggle quote (5 lines)
>> 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
Cayetano Santos wrote 6 hours ago
(name . Konrad Hinsen)(address . konrad.hinsen@fastmail.net)(address . 75986@debbugs.gnu.org)
877c4o90yb.fsf@inventati.org
Toggle quote (11 lines)
>dim. 16 mars 2025 at 20:26, Konrad Hinsen <konrad.hinsen@fastmail.net> wrote:

> Cayetano Santos <csantosb@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.
-----BEGIN PGP SIGNATURE-----

iI0EARYKADUWIQTMuBhC+dcFjs1nN3q/XN9N9r9mggUCZ9cz7BccY3NhbnRvc2JA
aW52ZW50YXRpLm9yZwAKCRC/XN9N9r9mgtz5AP41Tz9cbNmIW3FUtnF4TeH1+CjU
NlbzpOE4HXc5N5ZtCgD/UZZBKxyjR+0b1CmGOvIUDBkOKeGZklwCuUFlMCFT9gE=
=RYbE
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 75986@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75986
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help