aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2016-01-12 18:10:14 +0300
committerAlex Kost <alezost@gmail.com>2016-01-18 19:11:46 +0300
commit27a2e483370f9d08b9724a2c82b1fee9b15ce58a (patch)
treef60a021d284758212762f4d78baac0eea9013096
parente119ba900877970325b2158dd6d3c700feaab516 (diff)
downloadguix-27a2e483370f9d08b9724a2c82b1fee9b15ce58a.tar
guix-27a2e483370f9d08b9724a2c82b1fee9b15ce58a.tar.gz
emacs: Add 'guix-search-by-name'.
* emacs/guix-ui-package.el (guix-search-by-name): New command. * doc/emacs.texi (Emacs Commands): Document it.
-rw-r--r--doc/emacs.texi5
-rw-r--r--emacs/guix-ui-package.el11
2 files changed, 16 insertions, 0 deletions
diff --git a/doc/emacs.texi b/doc/emacs.texi
index 7edaedc078..eb470ab4ca 100644
--- a/doc/emacs.texi
+++ b/doc/emacs.texi
@@ -163,6 +163,11 @@ Search for packages by a specified regexp. By default ``name'',
``synopsis'' and ``description'' of the packages will be searched. This
can be changed by modifying @code{guix-package-search-params} variable.
+@item M-x guix-search-by-name
+Search for packages with names matching a specified regexp. This
+command is the same as @code{guix-search-by-regexp}, except only a
+package ``name'' is searched.
+
@end table
By default, these commands display each output on a separate line. If
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index 0696c4b565..29514527ce 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -939,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'.