guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/07: emacs: Buttonize licenses in "Package Info".


From: Alex Kost
Subject: 03/07: emacs: Buttonize licenses in "Package Info".
Date: Mon, 25 Jan 2016 19:17:38 +0000

alezost pushed a commit to branch master
in repository guix.

commit cefb7aea9d068a03c79bb6f26ea87082ea214f10
Author: Alex Kost <address@hidden>
Date:   Tue Jan 19 22:16:20 2016 +0300

    emacs: Buttonize licenses in "Package Info".
    
    * emacs/guix-ui-package.el (guix-package-license): New button type.
      (guix-package-info-format, guix-output-info-format): Use it.
    * doc/emacs.texi (Emacs Info buffer): Mention it.
---
 doc/emacs.texi           |    1 +
 emacs/guix-ui-package.el |   12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/doc/emacs.texi b/doc/emacs.texi
index eb470ab..d321a89 100644
--- a/doc/emacs.texi
+++ b/doc/emacs.texi
@@ -355,6 +355,7 @@ emacs, The GNU Emacs Manual}) which can be used to:
 @item install/remove a package;
 @item jump to a package location;
 @item browse home page of a package;
address@hidden browse license URL;
 @item describe packages from ``Inputs'' fields.
 @end itemize
 
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index 2951452..655ed74 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -35,6 +35,7 @@
 (require 'guix-entry)
 (require 'guix-utils)
 (require 'guix-hydra-build)
+(require 'guix-license)
 
 (guix-ui-define-entry-type package)
 (guix-ui-define-entry-type output)
@@ -220,7 +221,7 @@ ENTRIES is a list of package entries to get info about 
packages."
             (source simple guix-package-info-insert-source)
             (location format (format guix-package-location))
             (home-url format (format guix-url))
-            (license format (format guix-package-info-license))
+            (license format (format guix-package-license))
             (systems format guix-package-info-insert-systems)
             (inputs format (format guix-package-input))
             (native-inputs format (format guix-package-native-input))
@@ -338,6 +339,13 @@ formatted with this string, an action button is inserted.")
   'action (lambda (btn)
             (guix-find-location (button-label btn))))
 
+(define-button-type 'guix-package-license
+  :supertype 'guix
+  'face 'guix-package-info-license
+  'help-echo "Browse license URL"
+  'action (lambda (btn)
+            (guix-browse-license-url (button-label btn))))
+
 (define-button-type 'guix-package-name
   :supertype 'guix
   'face 'guix-package-info-name-button
@@ -767,7 +775,7 @@ for all ARGS."
             (dependencies simple (indent guix-file))
             (location format (format guix-package-location))
             (home-url format (format guix-url))
-            (license format (format guix-package-info-license))
+            (license format (format guix-package-license))
             (systems format guix-package-info-insert-systems)
             (inputs format (format guix-package-input))
             (native-inputs format (format guix-package-native-input))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]