From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH 2/2] emacs: Add 'guix-search-by-name'. Date: Thu, 14 Jan 2016 02:14:10 +0300 Message-ID: <1452726850-16850-3-git-send-email-alezost@gmail.com> References: <1452726850-16850-1-git-send-email-alezost@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJUcq-00070w-Qx for guix-devel@gnu.org; Wed, 13 Jan 2016 18:14:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJUco-0001v0-DD for guix-devel@gnu.org; Wed, 13 Jan 2016 18:14:48 -0500 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:34480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJUco-0001uf-64 for guix-devel@gnu.org; Wed, 13 Jan 2016 18:14:46 -0500 Received: by mail-lf0-x241.google.com with SMTP id n70so23162790lfn.1 for ; Wed, 13 Jan 2016 15:14:46 -0800 (PST) Received: from localhost.localdomain ([217.107.192.146]) by smtp.gmail.com with ESMTPSA id ra6sm431751lbb.33.2016.01.13.15.14.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jan 2016 15:14:45 -0800 (PST) In-Reply-To: <1452726850-16850-1-git-send-email-alezost@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * emacs/guix-ui-package.el (guix-search-by-name): New command. * doc/emacs.texi (Emacs Commands): Document it. --- doc/emacs.texi | 5 +++++ emacs/guix-ui-package.el | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/doc/emacs.texi b/doc/emacs.texi index 7edaedc..eb470ab 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 0696c4b..2951452 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'. -- 2.6.3