diff options
Diffstat (limited to 'emacs/guix-ui-package.el')
-rw-r--r-- | emacs/guix-ui-package.el | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el index 29514527ce..414bc9b9d2 100644 --- a/emacs/guix-ui-package.el +++ b/emacs/guix-ui-package.el @@ -35,6 +35,8 @@ (require 'guix-entry) (require 'guix-utils) (require 'guix-hydra-build) +(require 'guix-read) +(require 'guix-license) (guix-ui-define-entry-type package) (guix-ui-define-entry-type output) @@ -220,7 +222,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 +340,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 +776,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)) @@ -925,6 +934,17 @@ Interactively with prefix, prompt for PROFILE." (guix-package-get-display profile 'name name)) ;;;###autoload +(defun guix-packages-by-license (license &optional profile) + "Display Guix packages with LICENSE. +LICENSE is a license name string. +If PROFILE is nil, use `guix-current-profile'. +Interactively with prefix, prompt for PROFILE." + (interactive + (list (guix-read-license-name) + (guix-ui-read-profile))) + (guix-package-get-display profile 'license license)) + +;;;###autoload (defun guix-search-by-regexp (regexp &optional params profile) "Search for Guix packages by REGEXP. PARAMS are package parameters that should be searched. |