aboutsummaryrefslogtreecommitdiff
path: root/emacs/guix-ui-package.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/guix-ui-package.el')
-rw-r--r--emacs/guix-ui-package.el24
1 files changed, 19 insertions, 5 deletions
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index 12bfaeef68..29514527ce 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -349,6 +349,10 @@ formatted with this string, an action button is inserted.")
'name (button-label btn))
'add)))
+(define-button-type 'guix-package-heading
+ :supertype 'guix-package-name
+ 'face 'guix-package-info-heading)
+
(define-button-type 'guix-package-source
:supertype 'guix
'face 'guix-package-info-source
@@ -362,8 +366,7 @@ formatted with this string, an action button is inserted.")
"Insert package ENTRY heading (name specification) at point."
(guix-insert-button
(guix-package-entry->name-specification entry)
- 'guix-package-name
- 'face 'guix-package-info-heading))
+ 'guix-package-heading))
(defun guix-package-info-insert-systems (systems entry)
"Insert supported package SYSTEMS at point."
@@ -909,15 +912,15 @@ See `guix-package-info-type'."
"A history of minibuffer prompts.")
;;;###autoload
-(defun guix-search-by-name (name &optional profile)
- "Search for Guix packages by NAME.
+(defun guix-packages-by-name (name &optional profile)
+ "Display Guix packages with NAME.
NAME is a string with name specification. It may optionally contain
a version number. Examples: \"guile\", \"guile-2.0.11\".
If PROFILE is nil, use `guix-current-profile'.
Interactively with prefix, prompt for PROFILE."
(interactive
- (list (read-string "Package name: " nil 'guix-package-search-history)
+ (list (guix-read-package-name)
(guix-ui-read-profile)))
(guix-package-get-display profile 'name name))
@@ -936,6 +939,17 @@ Interactively with prefix, prompt for PROFILE."
(or params guix-package-search-params)))
;;;###autoload
+(defun guix-search-by-name (regexp &optional profile)
+ "Search for Guix packages matching REGEXP in a package name.
+If PROFILE is nil, use `guix-current-profile'.
+Interactively with prefix, prompt for PROFILE."
+ (interactive
+ (list (read-string "Package name by regexp: "
+ nil 'guix-package-search-history)
+ (guix-ui-read-profile)))
+ (guix-search-by-regexp regexp '(name) profile))
+
+;;;###autoload
(defun guix-installed-packages (&optional profile)
"Display information about installed Guix packages.
If PROFILE is nil, use `guix-current-profile'.