unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#75986] [PATCH] gnu: Add emacs-khardel.
@ 2025-02-01  7:02 Konrad Hinsen
  2025-02-01  9:03 ` Nicolas Goaziou via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Hinsen @ 2025-02-01  7:02 UTC (permalink / raw)
  To: 75986

* 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




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#75986] [PATCH] gnu: Add emacs-khardel.
  2025-02-01  7:02 [bug#75986] [PATCH] gnu: Add emacs-khardel Konrad Hinsen
@ 2025-02-01  9:03 ` Nicolas Goaziou via Guix-patches via
  2025-02-01  9:09   ` Nicolas Goaziou via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou via Guix-patches via @ 2025-02-01  9:03 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 75986

Hello,

Konrad Hinsen <konrad.hinsen@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






^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#75986] [PATCH] gnu: Add emacs-khardel.
  2025-02-01  9:03 ` Nicolas Goaziou via Guix-patches via
@ 2025-02-01  9:09   ` Nicolas Goaziou via Guix-patches via
  2025-02-04 19:30     ` Konrad Hinsen
  2025-02-04 19:34     ` Konrad Hinsen
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolas Goaziou via Guix-patches via @ 2025-02-01  9:09 UTC (permalink / raw)
  To: 75986; +Cc: konrad.hinsen

Nicolas Goaziou via Guix-patches via <guix-patches@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.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#75986] [PATCH] gnu: Add emacs-khardel.
  2025-02-01  9:09   ` Nicolas Goaziou via Guix-patches via
@ 2025-02-04 19:30     ` Konrad Hinsen
  2025-02-04 19:34     ` Konrad Hinsen
  1 sibling, 0 replies; 5+ messages in thread
From: Konrad Hinsen @ 2025-02-04 19:30 UTC (permalink / raw)
  To: 75986

* 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




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#75986] [PATCH] gnu: Add emacs-khardel.
  2025-02-01  9:09   ` Nicolas Goaziou via Guix-patches via
  2025-02-04 19:30     ` Konrad Hinsen
@ 2025-02-04 19:34     ` Konrad Hinsen
  1 sibling, 0 replies; 5+ messages in thread
From: Konrad Hinsen @ 2025-02-04 19:34 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: 75986

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.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-04 19:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-01  7:02 [bug#75986] [PATCH] gnu: Add emacs-khardel Konrad Hinsen
2025-02-01  9:03 ` Nicolas Goaziou via Guix-patches via
2025-02-01  9:09   ` Nicolas Goaziou via Guix-patches via
2025-02-04 19:30     ` Konrad Hinsen
2025-02-04 19:34     ` Konrad Hinsen

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).