unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] emacs: Display supported systems in "Package Info".
@ 2016-01-02 14:38 Alex Kost
  2016-01-04 16:25 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Kost @ 2016-01-02 14:38 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

"guix package --show=foo" displays supported systems, but emacs
interface ("Guix Package Info" buffer) does not.  The attached patch
fixes it.  Also the shown systems are buttons that can be used to
display latest Hydra builds of the current package/system (unhappily
Hydra does not handle such queries fast).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-emacs-Display-supported-systems-in-Package-Info.patch --]
[-- Type: text/x-patch, Size: 3467 bytes --]

From 2138811ed5d5a18f90b9745bd5c59c270508e6ec Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Mon, 28 Dec 2015 21:40:06 +0300
Subject: [PATCH] emacs: Display supported systems in "Package Info".

* emacs/guix-main.scm (%package-param-alist): Add 'systems'.
* emacs/guix-ui-package.el (guix-package-info-insert-systems): New
  procedure.
  (guix-package-info-format): Add it.
  (guix-output-info-format): Likewise.
  (guix-package-info-titles): Add "Supported systems" title.
---
 emacs/guix-main.scm      |  1 +
 emacs/guix-ui-package.el | 19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index 6f9eb42..8c38e7c 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -307,6 +307,7 @@ Example:
     (description       . ,package-description-string)
     (home-url          . ,package-home-page)
     (outputs           . ,package-outputs)
+    (systems           . ,package-supported-systems)
     (non-unique        . ,(negate package-unique?))
     (inputs            . ,(lambda (pkg)
                             (package-inputs-names
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index e0c98ea..12bfaee 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -221,11 +221,13 @@ ENTRIES is a list of package entries to get info about packages."
             (location format (format guix-package-location))
             (home-url format (format guix-url))
             (license format (format guix-package-info-license))
+            (systems format guix-package-info-insert-systems)
             (inputs format (format guix-package-input))
             (native-inputs format (format guix-package-native-input))
             (propagated-inputs format
                                (format guix-package-propagated-input)))
-  :titles '((home-url . "Home page"))
+  :titles '((home-url . "Home page")
+            (systems . "Supported systems"))
   :required '(id name version installed non-unique))
 
 (guix-info-define-interface installed-output
@@ -363,6 +365,20 @@ formatted with this string, an action button is inserted.")
    'guix-package-name
    'face 'guix-package-info-heading))
 
+(defun guix-package-info-insert-systems (systems entry)
+  "Insert supported package SYSTEMS at point."
+  (guix-info-insert-value-format
+   systems 'guix-hydra-build-system
+   'action (lambda (btn)
+             (let ((args (guix-hydra-build-latest-prompt-args
+                          :job (button-get btn 'job-name)
+                          :system (button-label btn))))
+               (apply #'guix-hydra-build-get-display
+                      'latest args)))
+   'job-name (guix-package-name-specification
+              (guix-entry-value entry 'name)
+              (guix-entry-value entry 'version))))
+
 (defmacro guix-package-info-define-insert-inputs (&optional type)
   "Define a face and a function for inserting package inputs.
 TYPE is a type of inputs.
@@ -749,6 +765,7 @@ for all ARGS."
             (location format (format guix-package-location))
             (home-url format (format guix-url))
             (license format (format guix-package-info-license))
+            (systems format guix-package-info-insert-systems)
             (inputs format (format guix-package-input))
             (native-inputs format (format guix-package-native-input))
             (propagated-inputs format
-- 
2.6.3


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

* Re: [PATCH] emacs: Display supported systems in "Package Info".
  2016-01-02 14:38 [PATCH] emacs: Display supported systems in "Package Info" Alex Kost
@ 2016-01-04 16:25 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2016-01-04 16:25 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> "guix package --show=foo" displays supported systems, but emacs
> interface ("Guix Package Info" buffer) does not.  The attached patch
> fixes it.  Also the shown systems are buttons that can be used to
> display latest Hydra builds of the current package/system (unhappily
> Hydra does not handle such queries fast).

Nice!

> From 2138811ed5d5a18f90b9745bd5c59c270508e6ec Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Mon, 28 Dec 2015 21:40:06 +0300
> Subject: [PATCH] emacs: Display supported systems in "Package Info".
>
> * emacs/guix-main.scm (%package-param-alist): Add 'systems'.
> * emacs/guix-ui-package.el (guix-package-info-insert-systems): New
>   procedure.
>   (guix-package-info-format): Add it.
>   (guix-output-info-format): Likewise.
>   (guix-package-info-titles): Add "Supported systems" title.

LGTM, thank you!

Ludo’.

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

end of thread, other threads:[~2016-01-04 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-02 14:38 [PATCH] emacs: Display supported systems in "Package Info" Alex Kost
2016-01-04 16:25 ` Ludovic Courtès

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