diff --git a/doc/emacs.texi b/doc/emacs.texi index 7edaedc078f230d4fd11c4e7511b03780610ab05..eb470ab4ca192657915a75eab315bf2ebf754dce 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 0696c4b5651dd9ce18d7c4253e7e7b71c9aecee0..29514527ce73fe708ea4722d4aafcf320b28f245 100644 --- a/emacs/guix-ui-package.el +++ b/emacs/guix-ui-package.el @@ -938,6 +938,17 @@ Interactively with prefix, prompt for PROFILE." (guix-package-get-display profile 'regexp regexp (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.