* [PATCH 0/2] "M-x guix-search-by-name" and "M-x guix-packages-by-name".
@ 2016-01-13 23:14 Alex Kost
2016-01-13 23:14 ` [PATCH 1/2] emacs: Rename 'guix-search-by-name' to 'guix-packages-by-name' Alex Kost
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alex Kost @ 2016-01-13 23:14 UTC (permalink / raw)
To: guix-devel
I almost never use "M-x guix-search-by-name" because I need to know a
real name of a package, and I rarely use "M-x guix-search-by-regexp",
because along with names it also searches in synopses and descriptions
(by default).
But I often use another command that allows me to display packages with
names matching regexp. For example, I use it when I want to look at
packages with names that contain 'xml' or 'emacs'. I believe this is
exactly what most people would expect from "M-x guix-search-by-name".
So what about renaming 'guix-search-by-name' into
'guix-packages-by-name' and adding a real 'guix-search-by-name' command
that will search for regexp in package names?
So:
- "M-x guix-packages-by-name guile" will display only guile packages
(different versions and outputs)
- "M-x guix-search-by-name guile" will display all packages with "guile"
string in names (like "guile-charting" or "guile-sly").
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] emacs: Rename 'guix-search-by-name' to 'guix-packages-by-name'.
2016-01-13 23:14 [PATCH 0/2] "M-x guix-search-by-name" and "M-x guix-packages-by-name" Alex Kost
@ 2016-01-13 23:14 ` Alex Kost
2016-01-17 20:31 ` Ludovic Courtès
2016-01-13 23:14 ` [PATCH 2/2] emacs: Add 'guix-search-by-name' Alex Kost
2016-01-17 20:31 ` [PATCH 0/2] "M-x guix-search-by-name" and "M-x guix-packages-by-name" Ludovic Courtès
2 siblings, 1 reply; 6+ messages in thread
From: Alex Kost @ 2016-01-13 23:14 UTC (permalink / raw)
To: guix-devel
* emacs/guix-ui-package.el (guix-search-by-name): Rename to...
(guix-packages-by-name): ... this. Complete package name.
* doc/emacs.texi (Emacs Commands): Likewise.
---
doc/emacs.texi | 2 +-
emacs/guix-ui-package.el | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/doc/emacs.texi b/doc/emacs.texi
index b2a3d47..7edaedc 100644
--- a/doc/emacs.texi
+++ b/doc/emacs.texi
@@ -155,7 +155,7 @@ Display all installed packages.
Display obsolete packages (the packages that are installed in a profile
but cannot be found among available packages).
-@item M-x guix-search-by-name
+@item M-x guix-packages-by-name
Display package(s) with the specified name.
@item M-x guix-search-by-regexp
diff --git a/emacs/guix-ui-package.el b/emacs/guix-ui-package.el
index 7cf1a7d..0696c4b 100644
--- a/emacs/guix-ui-package.el
+++ b/emacs/guix-ui-package.el
@@ -912,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))
--
2.6.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] emacs: Add 'guix-search-by-name'.
2016-01-13 23:14 [PATCH 0/2] "M-x guix-search-by-name" and "M-x guix-packages-by-name" Alex Kost
2016-01-13 23:14 ` [PATCH 1/2] emacs: Rename 'guix-search-by-name' to 'guix-packages-by-name' Alex Kost
@ 2016-01-13 23:14 ` Alex Kost
2016-01-17 20:32 ` Ludovic Courtès
2016-01-17 20:31 ` [PATCH 0/2] "M-x guix-search-by-name" and "M-x guix-packages-by-name" Ludovic Courtès
2 siblings, 1 reply; 6+ messages in thread
From: Alex Kost @ 2016-01-13 23:14 UTC (permalink / raw)
To: guix-devel
* 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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] "M-x guix-search-by-name" and "M-x guix-packages-by-name".
2016-01-13 23:14 [PATCH 0/2] "M-x guix-search-by-name" and "M-x guix-packages-by-name" Alex Kost
2016-01-13 23:14 ` [PATCH 1/2] emacs: Rename 'guix-search-by-name' to 'guix-packages-by-name' Alex Kost
2016-01-13 23:14 ` [PATCH 2/2] emacs: Add 'guix-search-by-name' Alex Kost
@ 2016-01-17 20:31 ` Ludovic Courtès
2 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-01-17 20:31 UTC (permalink / raw)
To: Alex Kost; +Cc: guix-devel
Alex Kost <alezost@gmail.com> skribis:
> So what about renaming 'guix-search-by-name' into
> 'guix-packages-by-name' and adding a real 'guix-search-by-name' command
> that will search for regexp in package names?
>
> So:
>
> - "M-x guix-packages-by-name guile" will display only guile packages
> (different versions and outputs)
>
> - "M-x guix-search-by-name guile" will display all packages with "guile"
> string in names (like "guile-charting" or "guile-sly").
Good idea!
Ludo’.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-01-17 20:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-13 23:14 [PATCH 0/2] "M-x guix-search-by-name" and "M-x guix-packages-by-name" Alex Kost
2016-01-13 23:14 ` [PATCH 1/2] emacs: Rename 'guix-search-by-name' to 'guix-packages-by-name' Alex Kost
2016-01-17 20:31 ` Ludovic Courtès
2016-01-13 23:14 ` [PATCH 2/2] emacs: Add 'guix-search-by-name' Alex Kost
2016-01-17 20:32 ` Ludovic Courtès
2016-01-17 20:31 ` [PATCH 0/2] "M-x guix-search-by-name" and "M-x guix-packages-by-name" Ludovic Courtès
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).