From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Platon Pronko <platon7pronko@gmail.com>
Cc: 41721@debbugs.gnu.org
Subject: bug#41721: 28.0.50; "f is undefined" in list-packages buffer
Date: Fri, 05 Jun 2020 14:32:24 +0100 [thread overview]
Message-ID: <87sgf9ocyf.fsf@tcd.ie> (raw)
In-Reply-To: <5852dfe1-658b-b35b-5e70-4679026baf0b@gmail.com> (Platon Pronko's message of "Fri, 5 Jun 2020 15:31:15 +0300")
[-- Attachment #1: Type: text/plain, Size: 2162 bytes --]
tags 41721 + patch
found 41721 27.0.50
quit
Platon Pronko <platon7pronko@gmail.com> writes:
> 1. 'emacs -Q'
> 2. 'M-x list-packages'
> 3. 'f'
> 4. Observe message "f is undefined"
This is because Emacs 27 introduced new filtering commands under the '/'
prefix, so the old binding 'f' no longer exists:
Filter packages by name in list-packages. (Bug#36981)
f96b8fd27c 2019-10-08 19:24:12 +0200
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=f96b8fd27c382a941c52c2938544b9b0e3a2fb0e
Here's the relevant etc/NEWS entry:
*** New functions for filtering packages list.
A new function has been added which allows users to filter the
packages list by name: 'package-menu-filter-by-name'. By default, it
is bound to '/ n'. Additionally, the function
'package-menu-filter-by-keyword' has been renamed from
'package-menu-filter'. Its keybinding has also been changed to '/ k'
(from 'f'). To clear any of the two filters, the user can now call
the 'package-menu-clear-filter' function, bound to '/ /' by default.
> When I type "h", in the help popup "f" is reserved to mean
> "filter". Online documentation also mentions only "f" to filter the
> packages:
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Menu.html
The online manual has not yet been updated because Emacs 27 is still at
the pretest stage and not officially released.
> In describe-mode I see that filtering is done using "/" prefix key, not with "f".
Indeed.
The problem with 'h' (package-menu-quick-help) is that it is both
overengineered and limited in what it can do. What it does is take a
word such as 'filter' and highlight a single character to indicate the
corresponding key binding. E.g. ("filter" . 1) would highlight the 'i',
and "/-filter" would highlight the '/'. This naively assumes that the
key binding is a single character, which is no longer the case.
On emacs-27, I propose we either remove the mention of filtering from
the quick help altogether, or write "/-filter" and let the user figure
out that '/' is actually a prefix that can be inspected in the usual
ways, such as by following it with C-h or <f1>. For example:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Update-package-menu-quick-help.patch --]
[-- Type: text/x-diff, Size: 2124 bytes --]
From 2525ae19d7154abda896f0d2cad2fd57ee3e5c8c Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Fri, 5 Jun 2020 14:02:41 +0100
Subject: [PATCH] Update package-menu-quick-help
* lisp/emacs-lisp/package.el (package--quick-help-keys): Filtering
is now bound to the prefix '/', not the key 'f' (bug#41721).
Advertise only the standard 'g' binding now that both it and 'r' are
bound to revert-buffer (bug#35504).
(package--prettify-quick-help-key): Avoid modifying string literals.
(package-menu-filter): Reintroduce as obsolete alias of
package-menu-filter-by-keyword for backward
compatibility (bug#36981).
---
lisp/emacs-lisp/package.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 7af40247f3..7d6be3cf4e 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -3279,7 +3279,7 @@ package--quick-help-keys
'(("install," "delete," "unmark," ("execute" . 1))
("next," "previous")
("Hide-package," "(-toggle-hidden")
- ("refresh-contents," "g-redisplay," "filter," "help")))
+ ("g-refresh-contents," "/-filter," "help")))
(defun package--prettify-quick-help-key (desc)
"Prettify DESC to be displayed as a help menu."
@@ -3287,7 +3287,7 @@ package--prettify-quick-help-key
(if (listp (cdr desc))
(mapconcat #'package--prettify-quick-help-key desc " ")
(let ((place (cdr desc))
- (out (car desc)))
+ (out (copy-sequence (car desc))))
(add-text-properties place (1+ place)
'(face (bold font-lock-warning-face))
out)
@@ -3719,6 +3719,9 @@ package-menu-filter-by-keyword
(list keyword)
keyword)))
+(define-obsolete-function-alias
+ 'package-menu-filter #'package-menu-filter-by-keyword "27.1")
+
(defun package-menu-filter-by-name (name)
"Filter the \"*Packages*\" buffer by NAME.
Show only those items whose name matches the regular expression
--
2.26.2
[-- Attachment #3: Type: text/plain, Size: 105 bytes --]
On master, we could change package-menu-quick-help to support arbitrary
key bindings.
WDYT?
--
Basil
next prev parent reply other threads:[~2020-06-05 13:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-05 12:31 bug#41721: 28.0.50; "f is undefined" in list-packages buffer Platon Pronko
[not found] ` <handler.41721.B.15913602888633.ack@debbugs.gnu.org>
2020-06-05 13:16 ` bug#41721: Acknowledgement (28.0.50; "f is undefined" in list-packages buffer) Platon Pronko
2020-06-05 13:32 ` Basil L. Contovounesios [this message]
2020-06-05 13:39 ` bug#41721: 28.0.50; "f is undefined" in list-packages buffer Platon Pronko
2020-06-05 13:55 ` Basil L. Contovounesios
2020-06-05 14:10 ` Platon Pronko
2020-06-05 14:18 ` Basil L. Contovounesios
2020-06-05 14:24 ` Eli Zaretskii
2020-06-05 15:53 ` Basil L. Contovounesios
2020-06-05 17:26 ` Eli Zaretskii
2020-06-05 18:09 ` Basil L. Contovounesios
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sgf9ocyf.fsf@tcd.ie \
--to=contovob@tcd.ie \
--cc=41721@debbugs.gnu.org \
--cc=platon7pronko@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).