From unknown Thu Aug 14 21:49:32 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#43709 <43709@debbugs.gnu.org> To: bug#43709 <43709@debbugs.gnu.org> Subject: Status: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Reply-To: bug#43709 <43709@debbugs.gnu.org> Date: Fri, 15 Aug 2025 04:49:32 +0000 retitle 43709 minibuffer keybinding cheatsheet and launcher [CODE SUBMISSIO= N] reassign 43709 emacs submitter 43709 Boruch Baum severity 43709 normal tag 43709 patch wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 29 13:00:15 2020 Received: (at submit) by debbugs.gnu.org; 29 Sep 2020 17:00:15 +0000 Received: from localhost ([127.0.0.1]:57035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNIz8-0000sD-RD for submit@debbugs.gnu.org; Tue, 29 Sep 2020 13:00:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:60046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNIz6-0000s5-Aw for submit@debbugs.gnu.org; Tue, 29 Sep 2020 13:00:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNIz4-0007RN-H9 for bug-gnu-emacs@gnu.org; Tue, 29 Sep 2020 13:00:10 -0400 Received: from mout.gmx.net ([212.227.17.20]:57707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNIz0-0000Ar-B9 for bug-gnu-emacs@gnu.org; Tue, 29 Sep 2020 13:00:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601398800; bh=x/prd6ycfv8FgCfheIkxELMB8n5KRBZory+qMGm3XWQ=; h=X-UI-Sender-Class:Date:From:To:Subject; b=emmIY8WjGc+t7bbduRr/4oWY4Kx3Z1PcUk/NzxidfBBwNqvt490CDCxD6hciaLr1e KL16meXRFmE0Pd7nNp/+HxylFUxH6xJQwUWEYE8xWW1eW6QjP45j7SQiR75OQWWLrp 6Q1pL2jvD8pfxbwgyVzT6B8VljfLRAbUL6kHvcIk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MeCtj-1kwvJQ3SwZ-00bH1Y for ; Tue, 29 Sep 2020 19:00:00 +0200 Date: Tue, 29 Sep 2020 12:59:57 -0400 From: Boruch Baum To: Emacs Bug Reporting Subject: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Message-ID: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="6mzweytivy3davt4" Content-Disposition: inline User-Agent: NeoMutt/20180716 X-Provags-ID: V03:K1:4ODrfoiEzcs3tS0x/EgbwGQL+a11iB/h/CuTfLO+FTfoGyvIQy8 AGI9XT6U5mMBqilfUSc1bmpMYRF2xP/3r0x02QkF13EvcR4jVNlRoxBqZIpIsTxktD6WdKe nbZNKAuqtTwMKyqkIA2sDUCZUj2r9k/MjPW/piKi94NbC4jEdvn9AKhCllwL2E+6aAyJzJJ OMBwUSTGakQXbusNAIbJA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:wRy5TLbBJUU=:1rdq8k2YDF8Nj9k/j2NCDP ybirLQCSqKHELkZAieVJvIa7DBAfyBmaro36798prRB+B/GYoygOHwnnfKmgIbTAMLmUXfBUz stCnA7DG7V9WK02lqzl/hzIjyCMmrdwZN50n/TO6dbF7a0hUuhYizKuN1VAvzWfETByc5g2oe mRZZF7SReJVzspU6sakMuv0taPwkdjPnHC8Ph5YFmYSJz5nf6FRKGp4qyvh9txIu4CLRAGv27 InQJKS3hKsZgGEebtRjBO6dQaIUJsn/VXf5kF9AnkD6ZI6w6Jrk6ZEqc8UvDMpjkZCQAh4WF6 pXTVIfAg5L+B4NuMhnvXLbz2slpLKwjLPXFnPDJfXoLFzN+3WjnCJ0vZtfPcUgQ0kJMMtUxPI tFcgdEvUb+xqkTqpnEXLsgHbnw4sYxQPf1hD+QBTdGFsHkVfEa7TVQjkCtG3OOP9vcrllxraC Q9ucWgzLbAmcREeoe/GUxhszYe7VfcfPcY8649sRZoWfcz9ipcz+mZ/tQ7EVqYO2940R5zvTf iHDHAYcVb6WWLaVwnr5hbvVNgXWCYqqkqUHPLX6Rpdxybofr6RIPk/UgELZ75jr9Zb1X7zqfc yH9LAs008jZM7D/6Pvk82pD7E+inboZfqHBh1HSUeIsvAR0GRyf5KYC2ukwYnw0zQ3/5lOfZq 9roSAgmJc+sFRQaFNjlzusBvgQXynF7SESOmVj/qlBfDv5qK8zXhCUKq374sqeJomSgGCAwiC eX7stGGVS+79jSpNurJ7t3eFkig2L7DPumtzBzTyovdKSCuGG0//jq2Mgbr5ZX6nOHVtSEJtU 4SpFsf5gwKMzcibwFf+Jibvr+uR1W8QMw2WTEtYPD4ywo/vCiqt2T33Wm2u5G9C1OmMWKr/uD UQfpI7hp57UMWRCgMZAI3hGxIMDoV5knxyhBiu0c7jbbL15N0q5D2Ek6AFRcoX65vDwFHjl73 CY666DgYpcFeTUxh4hFjmmPeD6TNMUioPrQt/WRl0TMJzvm02TcNei8YQMtfsoCXcllpYDxbM QILcaJ0RkaIBzFflg319X9kwUJPRX61GGtUQIDmS768+OJaBVfC4tc+/ba+8FwR/wUov/oENz PLghP4lJsGM22nOq0Uuz5M2oXO27iRO48PaIb6SEB1bNlFmrxicmjTf2Mp2SFxI3FL/WF/BPY XviWRcIh/D2zFLteI+vcJBLYI64x/Fk3zpKjG56Awu/GGgeYc0ezvgmxvIMT1T6rIctRhpbEB 1veKvvGQpvSTJe81Oc8g1J3ZB/0VOG4tHXE5ZUQ== Received-SPF: pass client-ip=212.227.17.20; envelope-from=boruch_baum@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/29 13:00:00 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.614, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --6mzweytivy3davt4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable If you've ever used packages such as `ivy' or `magit', you've probably benefited from each's custom combination keybinding cheatsheet and launcher: `hydra' in the case of `ivy', and `transient' for `magit'. The attached package `key-assist' attempts to offer a generic and very simple alternative requiring only the `completing-read' function commonly used in core vanilla emacs. `key-assist' is trivial to implement "on-the-fly" interactively for any buffer, and programmatically much simpler to customize that either `hydra' or `transient'. And did I mention that it only requires `completing-read'? =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --6mzweytivy3davt4 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="key-assist.el" Content-Transfer-Encoding: quoted-printable ;;; key-assist.el --- minibuffer keybinding cheatsheet and launcher -*- le= xical-binding: t -*- ;; Copyright =A9 2020, Boruch Baum ;; Available for assignment to the Free Software Foundation, Inc. ;; Author: Boruch Baum ;; Maintainer: Boruch Baum ;; Keywords: minibuffer keybindings ;; Package: key-assist ;; This file is NOT part of GNU Emacs. ;; This is free software: you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This software is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this software. If not, see . ;; ;;; Commentary: ;; If you've ever used packages such as `ivy' or `magit', you've ;; probably benefited from each's custom combination keybinding ;; cheatsheet and launcher: `hydra' in the case of `ivy', and ;; `transient' for `magit'. The current package `key-assist' ;; attempts to offer a generic and very simple alternative requiring ;; only the `completing-read' function commonly used in core vanilla ;; emacs. `key-assist' is trivial to implement "on-the-fly" ;; interactively for any buffer, and programmatically much simpler ;; to customize that either `hydra' or `transient'. And did I ;; mention that it only requires `completing-read'? ;; ;;; Dependencies: ;; `cl-seq' - For `cl-position', but `cl-lib' is long part of all ;; modern emcasen. ;; ;;; Installation: ;; 1) Evaluate or load this file. ;; ;;; Interactive operation: ;; Run M-x key-assist from the buffer of interest. Specify a ;; selection (or don't), press to view the presentation, and ;; then either exit with your new-found knowledge of the command ;; keybindings, or use standard emacs tab completion to select an ;; option, and press to perform the action. ;; ;; If you choose not to respond to the initial prompt, a list of ;; keybindings and command descriptions will be generated based upon ;; the first word of the buffer's major mode. For, example, in a ;; `w3m' buffer, the list will be of all interactive functions ;; beginning `w3m-'. This works out to be great as a default, but ;; isn't always useful. For example, in an `emacs-lisp-mode' buffer, ;; what would you expect it to usefully produce? At the other ;; extreme might be a case of a buffer too many obscure keybindings ;; of little use. ;; You can also respond to the prompt with your own regexp of ;; commands to show, or with the name of a keymap of your choice. ;; For the purposes of `key-assist', a regexp can be just a ;; substring, without REQUIRING any leading or trailing globs. ;; In all cases, note that the package can only present keybindings ;; currently active in the current buffer, so if a sub-package ;; hasn't been loaded yet, that package's keybindings would not be ;; presented. Also note that the commands are presented sorted by ;; keybinding length, alphabetically. ;; ;;; Programmatic operation: ;; See the docstrings for functions `key-assist' and ;; `key-assist--get-cmds'. ;; ;;; Configuration: ;; Two variables are available to exclude items from the ;; presentation list: `key-assist-exclude-cmds' and ;; `key-assist-exclude-regexps'. See there for further information. ;; ;;; Compatability ;; Tested with emacs 26.1 in debian. ;; TODO: ;; ;; * In a vanilla emacs environment, the sorting appears wrong ;; seemingly partially because of how the completion buffer is ;; constructed, bottom-up. This isn't an issue when using one of ;; the supplemental minibuffer completion packages. =0C ;; ;;; Code (require 'cl-seq) ;; cl-member, cl-position ;; ;;; Variables (defvar key-assist-exclude-cmds '(ignore self-insert-command digit-argument negative-argument describe-mode) "List of commands to always exclude from `key-assist' output.") (defvar key-assist-exclude-regexps '("-mouse-") "List of regexps of commands to exclude from `key-assist' output.") ;; TODO: Don't depend upon a mouse command having the word '-mouse-' in it= . ;; ;;; Internal functions (defun key-assist--get-keybinding (cmd &optional key-map) "Return a string with CMD's shortest keybinding." (let (shortest) (dolist (key (mapcar 'key-description (where-is-internal cmd key-map nil t))) (when (or (not shortest) (> (length shortest) (length key))) (setq shortest key))) shortest)) (defun key-assist--get-description (cmd) "Return a string with CMD's description. CMD is a symbol of an interactive command." ;; TODO: Change hard-coded length to an ARG. (let ((doc (documentation cmd t))) (format "\t%s" (if (or (not doc) (not (string-match "\n" doc)) (zerop (match-beginning 0))) (concat (symbol-name cmd) " (not documented)") (substring doc 0 (match-beginning 0)))))) (defun key-assist--vet-cmd (cmd result-list) "Check whether CMD should be on a `key-assist' list. See `key-assist-exclude-cmds' and `key-assist-exclude-regexps'." (and (symbolp cmd) (commandp cmd) (not (cl-member cmd result-list :test (lambda (cmd l) (equal cmd (nth 1 l))))) ; (assq= cmd result-list)) (not (memq cmd key-assist-exclude-cmds)) (let ((not-found t)) (mapc (lambda (x) (when (string-match x (format "%s" cmd)) (setq not-found nil))) key-assist-exclude-regexps) not-found))) (defun key-assist--parse-cmd (cmd result-list &optional key-map) "Extract commands and shortest keybindings from a keymap. This is an internal function used by `key-assist'. Returns a list whose elements are a keybinding string, a command symbol, and a description string." (when (key-assist--vet-cmd cmd result-list) (let* ((key-map (when (keymapp key-map) key-map)) (shortest (key-assist--get-keybinding cmd key-map))) (when shortest (list shortest cmd (concat shortest (key-assist--get-description c= md))))))) (defun key-assist--get-cmds (&optional spec nosort nofinish) "Return a list of commands, keybindings, and descriptions. Returns a list of CONS, whose CAR is the command, and whose CDR is a string of the form \"shortest-keybinding tab-character command-description\". Optional arg SPEC may be a regexp string of desired commands. If NIL, a regexp is generated based upon the first word of the buffer's major mode. SPEC may also be a keymap of desired commands. In both of these cases, the resulting list is sorted alphabetically by keybinding length. SPEC has additional options of being either a list of commands, or a list of CONS whose CAR is a command, and whose CDR is either a description-string or a function which returns a description string. A final programmatic option is for SPEC to be any combination of the above options. For that most complex case, the first list element of SPEC must be the symbol 'collection. For none of these additional options is sorting performed. Optional arg NOSORT can be a function to replace the default sort algorithm with the programmer's desired post-processing, or some other non-nil value for no sorting at all. If a function, it should accept a single list of elements (keybinding-string commandp description-string) and should return a list of elements (anything commandp description-string). Optional arg NOFINSH return a list in `key-assist--parse-cmd' format instead of the list of CONS described above. It is used internally for processing 'collection lists." (setq spec (cond ((or (not spec) (and (stringp spec) (zerop (length spec)))) (let ((str (symbol-name major-mode))) (substring str 0 (1+ (string-match "-" str))))) ((and (stringp spec) (boundp (intern spec)) (keymapp (symbol-value (intern spec)))) (symbol-value (intern spec))) (t spec))) (let (name result-elem (result-list '())) (cond ((keymapp spec) (let (cmd) (dolist (elem spec) (cond ((atom elem)) ;; eg. 'keymap ((listp (setq cmd (cdr elem)))) ;; TODO: possibly also embedde= d keymap? ((commandp cmd) ;; this excludes 'menubar (when (setq result-elem (key-assist--parse-cmd cmd result-li= st)) (push result-elem result-list))))))) ((stringp spec) (mapatoms (lambda (x) (and (commandp x) (string-match spec (setq name (symbol-name x))) (when (setq result-elem (key-assist--parse-cmd x result-list)) (push result-elem result-list)))))) ((listp spec) (cond ((eq (car spec) 'collection) (dolist (collection-element (cdr spec)) ;; Maybe it's more efficient to sort each collection element? (let ((temp-list (key-assist--get-cmds collection-element 'nos= ort 'nofinish))) (dolist (elem temp-list) (push elem result-list))))) ((commandp (car spec)) (dolist (cmd spec) (when (setq result-elem (key-assist--parse-cmd cmd result-list= )) (push result-elem result-list)))) (t ; spec is a list of CONS (cmd . (or string function)) (dolist (elem spec) (when (key-assist--vet-cmd (car elem) result-list) (let ((shortest (key-assist--get-keybinding (car elem)))) (when shortest (push (list shortest (car elem) (if (stringp (cadr elem)) (cadr elem) (funcall (cadr elem)))) result-list)))))))) (t (error "Improper SPEC format."))) (when (not nosort) (setq result-list (if (functionp nosort) (funcall nosort result-list) (sort result-list (lambda (a b) (cond ((=3D (length (car a)) (length (car b))) (string< (car a) (car b))) ((< (length (car a)) (length (car b)))) (t nil))))))) (if nofinish result-list (mapcar (lambda (x) (cons (nth 1 x) (nth 2 x))) result-list)))) ;; ;;; Interactive functions (defun key-assist (&optional spec prompt nosort) "Prompt to eval a locally relevant function, with hints and keybindings. Press TAB to see the hints. Interactively, the optional arg SPEC is either a regexp string for candidate commands to match, or a keymap from which to prepare the hints. If NIL, a regexp is generated based upon the first word of the buffer's major mode. Results are presented sorted alphabetically by keybinding length. Programmatically, optional arg PROMPT can be used to customize the prompt. For the further programmatic options of SPEC and for a description of arg NOSORT, see function `key-assist--get-cmds'. See also variables `key-assist-exclude-regexps' and `key-assist-exclude-cmds'." (interactive "MOptional: Enter command regexp or keymap name: ") (let* ((prompt (or prompt "Select: ")) (commands (key-assist--get-cmds spec nosort)) (choices (mapcar 'cdr commands)) choice minibuffer-history) (if (not choices) (user-error "No choices found.") (while (not (setq choice (cl-position (substring-no-properties ; Is -no-properties necessar= y? (completing-read prompt choices nil t)) choices :test 'equal)))) (funcall (car (nth choice commands)))))) =0C ;; ;;; Conclusion (provide 'key-assist) ;;; key-assist.el ends here --6mzweytivy3davt4-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 29 13:41:51 2020 Received: (at 43709) by debbugs.gnu.org; 29 Sep 2020 17:41:51 +0000 Received: from localhost ([127.0.0.1]:57073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNJdP-0001q9-41 for submit@debbugs.gnu.org; Tue, 29 Sep 2020 13:41:51 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:53548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNJdJ-0001pu-UY for 43709@debbugs.gnu.org; Tue, 29 Sep 2020 13:41:49 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08THdW8q026439; Tue, 29 Sep 2020 17:41:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=XMGB+clbtwvU6CQnvE9n3vEAiR7z1+qRbQm1ldDMDeI=; b=Dpyt9ZvxxpwJhURDSoHfZjQZE97y4TlZaWmW/oEEApYgLqrNGL/mj08M/yoJo+SINIUg yQxaliUk8jldR4ITI5HYsbsa/pg7zt7GyKGIgXUhanLCf+s/RSnhFryu1scoyU92CHLf 7nsFwQbHwPo/OBUI93Lnrcmj6LFEn7yo1DCy9nVxLeSPo+3ghmqHCTs9YescUGvpXgTZ ud3iihecG4Wc33a61LNsyLFpLLU2XDZvRTsnk5rUy6yQZ25OdFDCit/wkOc71vCDtnip IvirNlsJVoZOQfZPjySvCgqiifTssv6Bsh5msF3a3Fylh/mbwlrQUPAJGlbzIya4E4ri Vw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 33swkkv9w6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 29 Sep 2020 17:41:39 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08THekMM111487; Tue, 29 Sep 2020 17:41:39 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 33tfdsfwtd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Sep 2020 17:41:39 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 08THfbmE016539; Tue, 29 Sep 2020 17:41:37 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 29 Sep 2020 10:41:36 -0700 (PDT) From: Drew Adams To: Boruch Baum , 43709@debbugs.gnu.org Subject: RE: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] References: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> In-Reply-To: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5056.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009290149 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 clxscore=1011 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009290149 X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 43709 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) > If you've ever used packages such as `ivy' or `magit', you've probably > benefited from each's custom combination keybinding cheatsheet and > launcher: `hydra' in the case of `ivy', and `transient' for `magit'. The > attached package `key-assist' attempts to offer a generic and very > simple alternative requiring only the `completing-read' function > commonly used in core vanilla emacs. `key-assist' is trivial to > implement "on-the-fly" interactively for any buffer, and > programmatically much simpler to customize that either `hydra' or > `transient'. And did I mention that it only requires `completing-read'? Cf. `keysee.el' https://www.emacswiki.org/emacs/KeySee https://www.emacswiki.org/emacs/download/keysee.el From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 29 14:22:37 2020 Received: (at 43709) by debbugs.gnu.org; 29 Sep 2020 18:22:38 +0000 Received: from localhost ([127.0.0.1]:57116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNKGr-0002o3-IF for submit@debbugs.gnu.org; Tue, 29 Sep 2020 14:22:37 -0400 Received: from mout.gmx.net ([212.227.17.22]:42997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNKGp-0002np-7h for 43709@debbugs.gnu.org; Tue, 29 Sep 2020 14:22:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601403742; bh=1wKPyL6uaS16qZDu68drFI6N0Bcu7ytVHSxqKJuDF8o=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=VuUBFdlmiVfimcmGAs0Ttj6WtbJw3HuEU3Hu3VM+q9L7E//2DvwL/cyM+pRk+6NZA Qeh2L4LyG/Dmp1aPExeEEblUdVK9JFKKzIsVnL9CCc1JqU/eCD4shyVudMSrXmPGcu Vn/8yIpX+yfaQ+2vnO/hyR8EcBZZjy2pSFRNG8uM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MNbkp-1k2bW10H4V-00P6mg; Tue, 29 Sep 2020 20:22:22 +0200 Date: Tue, 29 Sep 2020 14:22:19 -0400 From: Boruch Baum To: Drew Adams Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Message-ID: <20200929182219.5r5nbvmipo33l24q@E15-2016.optimum.net> References: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="jlyugc4je2zrr3gx" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Provags-ID: V03:K1:yWxw94tTzsuXoaodueWT6NOxubGoVJMotnTWm4SelIo6UphZS94 +U+L06YacyO8z48OAdICWFGfcZHifVqYlYc1kwZ/q7rQy3eeOqwp0t7H+0CfQ2twBmP8pDZ IDaxBEu6FwTHcaNcJ71dsgSuV4HJniP17usxQ6n9nLUJeqSXIQL0TMCErQfE9+rgmaV4pI4 +5mGpdD6NC89Dt87SXVIQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:ZxphVb80qhg=:4Tguy72oiadsz2Iy36Mh1T rrdG7G6+ao70fdlqERZwErEFvL3oWOvVI4sHo+tGO0IJOiNJJdvQ5YloIPO6zIwre3EfeS99g tOREeGK0bG3zR95g/LYNXcRrLqVrhOy4e/qbzzx5cEnqa/I2iCz74PBo/C5B4R/q4+sURzIpZ 8czo2/HwdazhmPaKmDQAphPev9/S2Qt4PJxvteFmFfHNLW1kJATM/9Dytkd1xECS8Zny+zTv5 aewttXk8WbcUgdLDtNdybTZ2URKvTQsfXxUCWJLdpZta0TcVvlRtCRFSM6b68YUZYWm+Fq3j8 ffWyh4XCBNaEqUePy7GLJtIrmEi5Pl+iov/zIba3vPc6q682ZfR0IBhkKDOtLPRzxNdOGjJLR hcnH3gAs71oGgI8qBznXpF1+lzOoUnMVNcSEVjFINmCqauxJ75b1fkpevRzmBBN7V/eUiw7Nj Dx9ZAM2ryG+1FB0nnEQyDQ3pRKyq5WhpCldDNfBBma1HRPGfw1v3E+pX7ZmsDsiEbDBjxy8EH C3JPw1Uv+T3Y3/pUMXgXxqWOG0usm1jFeh/YUZiltebNH+9vsyx34D6r9Tzc8GtIFlxMkEexA TeOxctI52FKzjEiey4GCsaAEtFxDAHrObN9ki201W5shfp20RGByrLnD+b8FzOPNkZ3oZt+xm lnnFeGkr7ySBb+kRjuWWaiaPr+a8IF/uWkXXE6Cx0GZfdZrz9BCoK82xvDly44aGDm0LYg4wp 9Uya4MUTzowPsPuWgxRJx6cHJlQS1GIohlawCw9CzvDjpqzsvL3b3N+Q+1gEfUeeE1/a+YlS5 GQLvj1ZgOKriQ304XhC0vWRcHe02XRinUfRc9weviCfPCVHEyTt6b+VYeZ642aNGm4R0pFmaD 9Fbz6TpqK4QZwHnSGQuDdqUuZPIWMdkWmoD/0PNRxsfwNEg0RPnOiUS26P7gJaatDDyWJmeKC W5R595Npu8PA9u4yu+WJ8k4VLUNNs5SboxrErYN3YTGSx3X5vQrMSHD7GfZuj+0V8EkvjE8Dv 6Ky1M6BmFvE1GEEypEx1Ggi7j52Iw6cj7i/hAXjS27y6ErC8aXy1uXJsYdSxWJcM1MuRJAWNr V7fUG417rZ+g+4f5yEOZg1hINi/6I9FJbNdp9dV7TMab9bMlooI+Cm/9VKh37yZDJVVa8VUcC dGx4bNdCFjxiPvXqDH9QgATNbwkqb8sOIPPa13itBn12Rvl80sPUmCji14BesfyrT3FqOxuin CTr7VW0CzPZgGhNcGVZGudosY6hFXjw2Vdxluwg== X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --jlyugc4je2zrr3gx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2020-09-29 10:41, Drew Adams wrote: > Cf. `keysee.el' > > https://www.emacswiki.org/emacs/KeySee > > https://www.emacswiki.org/emacs/download/keysee.el Oh. Had I known... Would I? / Wouldn't have I? From reading the emacswiki description, it seems that there are some differences in presentation. My motivation was specifically to write just a few lines for an element of another code submission I have pending, and then the idea got out of control. It didn't occur to me to check emacs-wiki. BACKGROUND: I have a collection of dired extensions that'll be ready for submission as soon as I complete the documentation. It includes a set of 'trash' management functions, eg. smart empty trash, restore trashed file(s), report trash status. But who can be expected to remember all the arcane keybindings of all the arcane modes? So I wrote it hard-wired for about four commands of diredc-trash, and then ... ATTACHED: I'm attaching that original function because someone may ask why include in `key-assist.el' a programmatic option to supply a list of elements (command . function). In the attached example, you can see that I'm presenting a description of the command `diredc-trash-toggle' based upon what it would do at any particular time. FOLLOW-UP: Another follow-up might be to supply some specific code for some notorious major modes. I'm thinking in particular of `calc-mode', which is such a beauty-in-the-rough, but suffers from a particularly bad case of keybinding hell (it also suffers from a consistent absence of docstrings). =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --jlyugc4je2zrr3gx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diredc-trash-assistant.el" (defun diredc-trash-assistant () "Minibuffer cheatsheet and launcher for diredc-trash functions." ;; This was the inspiration for `key-assist.el' (interactive) (let ((zz (lambda (x) (let (shortest) (dolist (key (mapcar 'key-description (where-is-internal x diredc-mode-map nil t))) (when (or (not shortest) (> (length shortest) (length key))) (setq shortest key))) shortest))) (options (list (list (if delete-by-moving-to-trash "Switch to using deletion" "Switch to using trash") 'diredc-trash-toggle) '("Jump to trash files dir" diredc-trash-view) '("Report trash size" diredc-trash-info) '("Empty the trash" diredc-trash-empty) '("Restore file at point" diredc-trash-restore))) (prompt (concat (diredc-trash-info) "\nSelect: ")) choices choice) (setq choices (mapcar (lambda(x) (format "%-23s %s" (car x) (funcall zz (cadr x)))) options)) (while (not (setq choice (cl-position (completing-read prompt choices nil t nil 'choices ) choices :test 'equal)))) (funcall (cadr (nth choice options))))) --jlyugc4je2zrr3gx-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 29 14:26:56 2020 Received: (at 43709) by debbugs.gnu.org; 29 Sep 2020 18:26:56 +0000 Received: from localhost ([127.0.0.1]:57124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNKL2-0002uP-IH for submit@debbugs.gnu.org; Tue, 29 Sep 2020 14:26:56 -0400 Received: from mout.gmx.net ([212.227.17.21]:33733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNKKz-0002uA-8M for 43709@debbugs.gnu.org; Tue, 29 Sep 2020 14:26:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601404002; bh=TVXWQuC0/hUynx/mILluKDzIwUSbynEFXI4uLtmUgFA=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=eKLIYPbBvJjP0tmmNufKJGbrFdC/VJC6dY3Hubqtw48TaZmRkBoVrAzlug6SalwqA x1NknSJIrEVrqj2FPIcUrp5yPMIGpZ2Ywv76ydmr8MLtt9PBdM7yFMN74B/VB8EGVE lp+7U+Ks7e2Q9vTPvgA1zd/QtpR29AHuCDyRlcVg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MI5UN-1kALll1CP1-00FB3w; Tue, 29 Sep 2020 20:26:42 +0200 Date: Tue, 29 Sep 2020 14:26:39 -0400 From: Boruch Baum To: Drew Adams Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Message-ID: <20200929182639.2eemc2fmpps42mp6@E15-2016.optimum.net> References: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Provags-ID: V03:K1:jZoqkCu6KMA7NMb+A4fzlQKRKb1Q4CorybondcogNdIRlq2nLty HYxhixX3+Q1PvMOq9a34Z6vy9038dy47oe3uHcVZBPS6l/ko+w0+VrAxPaYEyjI1z3ug58g mQMQk9j0GlLlNlw8lNT0oX+NJN0PkMcBgqrVkVTsDhrt2tM2W6fy3lqs1sXpjQaVe8s81uM ULB0USRI6ktKug1h7ZHig== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:e2Pf+xN8+4w=:9mkS0VgqOLJ3Q5YS+yZctD 3YOzpvqnqmKrihZ8hEMPuskIrzJVMlxtAARqI2OUhmKSlRDG3SeGuYzd885RG/7whcnf867rt Cpx25TCxGu087txhOiRAYcvBcWt2ctnd0ONjyr5Ev/LLG2CeSSrRTeYaicxbF482bRqOWGNQN bDSKNq3LWngJo9xTyt74xOKTLFl47geDMTDLFoewtczwq498F5SvwewhFR8L3mv1Ax3Sv86ol NJzkWoTcspFu2B/ESFd98wZt0xjSlZALCZ4ArjmJydop35NG/I8aQ56BNT/Uf4IxTiyzpnFlJ y+gxvQYPt85EoLcJupOCAoFvqzRlwl4n8OLd8ffvL07yXvdu8oCllnNkKb56Mexmbkl8Xmdq3 i9kFNjsZtUi0kZvfdtDZ5s8lswXhTIMQxzwO15iHI1c60wdm2ZKGH7SDT1nVpXv+a7ian7A7Q eZkRDuwXetlLWeAg/+3ZXpLuCwJc7A4HBm7wpCie5h1t4mNNayEaYiSNv2wMOCH8b8Z2GPOkM 8SNWgbjYBMhmCsWX0rkT4IqpzDLJoM6A7D3usrwOeDMMG+NToSEyR3LMo7VbivgTf/c7UkhW4 FO/VhGflUDB2WqQNX0nTQ37K2bwgvp2r6DFoLNQYxJqcdtL26hsd2gGcCWJGrqUmgHe7kHIxJ WrS7jnlnUq3r9twzMw/7jae0umgAJTddl6CERDyNKKv8FItVjH7upCw5ETzcMl+gVCbhCu9Kz TEsuxvnb32MVc0As5Enhod14zfbcLy7TROiKsctBIMqC2fRcawS/LHHm9iFz2zZTUBeZJeF/a u+77uZtwzPogPrPyETC4GiB7mIxP6qlSdwnd4nEYcqyIBteXBRxeSsTm491tl0dSAf9nyFXn3 Sm0+ElAKFXeJkAhBOI/gGMA+OuYwK90U3fuZLcHO4zXf8u5vkuWZ06g2wpIUDbWRCCT5j17vI VQnExZNYn5GQqMxBLjapCPIykfRXRzu/qITHqq6awj847XjG4gpj2CHF/YBGThRcY3Bac1rSX oq2S0XgBbr/1oZ0b94ct/sEuG6bQ7xtFSvsf7BQUJhKgW+LJ4FuxuKqvroOqieWSSBbj/labW jFxP/SaZeWA0rlW7r4v69UAVpSDacGSGWGKZodxnB7J/+Ixzqb1322dRj6REgP3ZE2CZVZghz tfZ9qa8jziEA/VIyNGxzUngjVNkipO8GBa/W/UV/znamyCw29CDY9y6l3x+vNToZvPLB3zpNZ xsvMB4Sr5+uRWq1in7/rR8BhZ2p3HUYI0/SHsjQ== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Also, note how in the `diredc-trash-assistant' prototype, how I exploited the PROMPT arg to sneak in extra status information. =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 29 15:07:38 2020 Received: (at 43709) by debbugs.gnu.org; 29 Sep 2020 19:07:38 +0000 Received: from localhost ([127.0.0.1]:57221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNKyQ-0003uQ-Gb for submit@debbugs.gnu.org; Tue, 29 Sep 2020 15:07:38 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:33868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNKyN-0003uC-U3 for 43709@debbugs.gnu.org; Tue, 29 Sep 2020 15:07:37 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08TJ53kR136968; Tue, 29 Sep 2020 19:07:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=OPFF7HUIzsj5tKtftR63/s+BhR9M0j5xOQHy1RdR/w4=; b=k5qSjpzivUH6Mr7Q5Crf7Gqq4ioRTM4nBSjtx3cYp5rsv3DFQ2bn4wltICdcJZ+E/DDM +NVpe+lXnkq+dvhXeviCc7o15vj5f+9OW2d5x5nXgQaTfFHz5Nh6RSFfNm9C6AuqLryt F2+XPKTjymesQNNGpb2L99gbupmHOt//xdCbtsjb0mZPVcwRWBiNITwkB820mpGYY+XC 47Gm85L1K4asEU36LH/idlwrVw9qnBA69qXCMLtvT7yBEKvQF63fUgyHVcZf5HR9banQ 80wptO7iHCyHZVM3Y/ivo9JT3r/SRTMqgLVrGRDsRLjxgs0yaDqeoNRG9f61ptnyHS1P nQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 33sx9n4k6d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 29 Sep 2020 19:07:28 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08TJ0qGO087064; Tue, 29 Sep 2020 19:05:27 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 33uv2eb57v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Sep 2020 19:05:27 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 08TJ5OCM025406; Tue, 29 Sep 2020 19:05:25 GMT MIME-Version: 1.0 Message-ID: <85477a60-4296-4ae5-9ce9-a82b8787dec4@default> Date: Tue, 29 Sep 2020 12:05:23 -0700 (PDT) From: Drew Adams To: Boruch Baum Subject: RE: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] References: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> <20200929182219.5r5nbvmipo33l24q@E15-2016.optimum.net> In-Reply-To: <20200929182219.5r5nbvmipo33l24q@E15-2016.optimum.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5056.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009290158 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 spamscore=0 impostorscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009290158 X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) > Oh. Had I known... Would I? / Wouldn't have I?=20 Yes, you should. And thanks for doing so. Dunno whether filing a bug is the best way to provide it, but that will work, no doubt. Another possibility is to use emacs-devel@gnu.org. Many more people read that mailing list, including most who also pay attention to the bug list. > BACKGROUND: ... > ATTACHED: ... > FOLLOW-UP: ... That all sounds good. Keep it up. FYI: Another related library is `which-key.el', which you may already be aware of. https://github.com/justbur/emacs-which-key From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 29 21:56:05 2020 Received: (at control) by debbugs.gnu.org; 30 Sep 2020 01:56:05 +0000 Received: from localhost ([127.0.0.1]:57644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNRLg-0007pD-Ok for submit@debbugs.gnu.org; Tue, 29 Sep 2020 21:56:05 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNRLf-0007oi-3Q for control@debbugs.gnu.org; Tue, 29 Sep 2020 21:56:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xoiCtwu1o8QQJfVEaJ6YwNUSS3N4+PwiBncQtbZ3uqY=; b=NgCsYrcb3fZLDXH9RkkSAdqQ2g xRuHZWKD9DoLBB8pjAsV4xhBUe2203ANiiQ77SLeVEmnG0rMKyWP76OF46DtRlXIxvds2lHWasoe7 kN3Swi09NlktetEk8UBHYrhUAAPwbeVsofTcjQ7Vb5IphPTIL4hqEV4dGc8ohYS5HgeI=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNRLW-00055v-Vx for control@debbugs.gnu.org; Wed, 30 Sep 2020 03:55:57 +0200 Date: Wed, 30 Sep 2020 03:55:54 +0200 Message-Id: <8736309get.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #43709 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 43709 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 43709 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 01 09:51:49 2020 Received: (at 43709) by debbugs.gnu.org; 1 Oct 2020 13:51:49 +0000 Received: from localhost ([127.0.0.1]:34984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNyzs-000253-NS for submit@debbugs.gnu.org; Thu, 01 Oct 2020 09:51:49 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63523) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNyzp-00024o-SG for 43709@debbugs.gnu.org; Thu, 01 Oct 2020 09:51:47 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F398B1002CF; Thu, 1 Oct 2020 09:51:39 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D6E381001D2; Thu, 1 Oct 2020 09:51:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1601560297; bh=wTxiU2h5F3+F+OxMS/MpKykS6uZ7doXIgPUTSfRrMkk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=l5c7Im19L4DzvPJxwt0MJhdYy1okHW5wKMcTGOu4pjLxX652HkReOckA3QCOclFpg a01QWHKHuXtdDEjMwCt9JUThZLMTmfz/YbQZOuCPpjmrWOtecN81bpWn3vwtrQ60wF G8BAfSjgMfqFiWQQrfHdxEjuyJSK/euCE5HbkaBM4/RlT9MH6hIX9rcph+fH5wC4No 1tZHauh8OYi+MDKHXRlEA4I1Su1eLqcqYUncQsPpP56hyDCMt5z3AXZvwGJwVV2vnJ Pw4FMLHEZhJ5wCdMp6Bn96mXmHszChfnm0yaXBFQrNT7YR23NSbSqNUIrr3zKP8oRb ftApw2kX8MVzg== Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A38E6120225; Thu, 1 Oct 2020 09:51:37 -0400 (EDT) From: Stefan Monnier To: Boruch Baum Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Message-ID: References: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> Date: Thu, 01 Oct 2020 09:51:36 -0400 In-Reply-To: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> (Boruch Baum's message of "Tue, 29 Sep 2020 12:59:57 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.055 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > If you've ever used packages such as `ivy' or `magit', you've probably > benefited from each's custom combination keybinding cheatsheet and > launcher: `hydra' in the case of `ivy', and `transient' for `magit'. The > attached package `key-assist' attempts to offer a generic and very > simple alternative requiring only the `completing-read' function > commonly used in core vanilla emacs. `key-assist' is trivial to > implement "on-the-fly" interactively for any buffer, and > programmatically much simpler to customize that either `hydra' or > `transient'. And did I mention that it only requires `completing-read'? I'm not completely sure what is the intended use scenario. I mean, I understand the package is not 100% ready, so I'm interested to know how you imagine it working *ideally* once the various kinks have been sorted out. [ To see why I say it's not quite ready, here's my experience with it: I just tried it in a fresh new Emacs session, and after `M-x key-assist` (which itself is a problem because most users won't know/bother to run this command way, so we'd need some more "obvious" way to run it) I get a prompt for something and without reading more the description I wouldn't know what the prompt wants (I think this prompt should only appear if requested explicitly) and then it said "no choices found". So I tried again in a dired buffer, where it instead showed me a minibuffer prompt "Select: " with no indication of what it is I should be selecting, after that I hit TAB (because I read that it uses `completing-read`, but for the un-initiated it might not be obvious) at which point it did show me a list of bindings and short descriptions and when I selected the first entry (i.e. `!`) it signal'd an error about wrong number of arguments. ] I do think it would be nice to have something like it, since it's an alternative to the menus which has the advantage of being auto-constructed, doesn't need the mouse, and focuses on the keybindings. It would also be nice to make it usable from minibuffers as well ;-) See some comments below based on a quick look at the code. Stefan > ;; If you've ever used packages such as `ivy' or `magit', you've For those who haven't, it would be good to describe what your package does. > ;;; Dependencies: > > ;; `cl-seq' - For `cl-position', but `cl-lib' is long part of all > ;; modern emcasen. There's no such thing as a `cl-seq` package. There's a `cl-seq.el` file, which is part of the `cl-lib` package. > (require 'cl-seq) ;; cl-member, cl-position Please require `cl-lib` rather than `cl-seq` since which function is implemented in which file of `cl-lib` is an internal detail (e.g. in Emacs-24.1 `cl-seq` does not provide `cl-position` but `cl-lib` still does). > (defun key-assist--get-keybinding (cmd &optional key-map) > "Return a string with CMD's shortest keybinding." > (let (shortest) > (dolist (key (mapcar 'key-description > (where-is-internal > cmd key-map nil t))) > (when (or (not shortest) > (> (length shortest) (length key))) > (setq shortest key))) > shortest)) `where-is-internal` is supposed to return the shortest binding already when asked to return the "firstonly". Your notion of length is slightly different, admittedly, but I wonder what were the concrete cases that motivated doing your own sorting (might be worth adding that as a comment in the code). > (let ((not-found t)) > (mapc (lambda (x) > (when (string-match x (format "%s" cmd)) > (setq not-found nil))) > key-assist-exclude-regexps) > not-found))) You should move the `(format "%s" cmd)` out of the loop (and use `dolist` instead of `mapc`). > ((keymapp spec) > (let (cmd) > (dolist (elem spec) Please use `map-keymap` rather than `dolist` so as to handle all the different keymap formats. > (while (not (setq choice > (cl-position > (substring-no-properties ; Is -no-properties necessary? > (completing-read prompt choices nil t)) > choices :test 'equal)))) Why do you have this loop? Doesn't the `require-match` arg of `completing-read` make it unnecessary? > (funcall (car (nth choice commands)))))) This should probably be `command-execute` rather than `funcall` to fix the wrong-number-of-arguments error I bumped into. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 01 11:32:08 2020 Received: (at 43709) by debbugs.gnu.org; 1 Oct 2020 15:32:08 +0000 Received: from localhost ([127.0.0.1]:37966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO0Yy-0005F1-43 for submit@debbugs.gnu.org; Thu, 01 Oct 2020 11:32:08 -0400 Received: from mout.gmx.net ([212.227.17.20]:57541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO0Yv-0005EW-AP for 43709@debbugs.gnu.org; Thu, 01 Oct 2020 11:32:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601566316; bh=xcgPch1ketr0lJMtVrK4zlCZQ3Sa6Qu/P8NYM7GtgYQ=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=UIZSmVEvSnfz4+eBYuT8qkpDf26KWhN0Z6UnUysff22rByEx+9sA7TvPXqFSryrH4 2ZIilHgLKTpwKB7EZspctSKcnNVrU9xZLkh8mk3eR9DuoC0t6o9xB382Z5sknbrrB7 lRRkb0/yYLDJiAY2BqfqU+P4G4dXccF1co2Nt1/g= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mi2O1-1ksNVD3dbN-00e2Fm; Thu, 01 Oct 2020 17:31:56 +0200 Date: Thu, 1 Oct 2020 11:31:47 -0400 From: Boruch Baum To: Stefan Monnier Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Message-ID: <20201001153147.3ucillviu62t2prf@E15-2016.optimum.net> References: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Provags-ID: V03:K1:C+2r/LsSPPS0ul2FtJnLtGAA4MnY5ikxiDG1Nl86KSIRyWDWaME Tr1qQubajsUoGOVPtDGTwROBaB0aAkZSE1uaU2yoobBG2w94LVlg2Mr52fsGD2/dU3JfddL YHZN5PRznq7xhBwa1NkN4xllIDluwsXGE3pjFE/q/C3WXpczcCqGpU995agIRZU6fkwHV44 3N6MwupDG3Qm9UFoUdO9Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Xam8xrCHQaE=:JiIFgfYk6TJok+BpPl2nWi I5ML5L2md84gh/394q8QwjAN+49P1TMqbwyFFuJcWj8ZVoP5IwMJ6zuo++pKN0+Nnt38HtGck 5fOGxRpfyyIIJrK+2OT6qWLOoh/MI9MMjrOyTMV9RpvelWpyUIK+BToce/58LiUv2UiivK1Mj LLHThBZ824ZuF8+v1OSdt4XPxDEIo06ldDRkgoaGfbLkXfdjbrnGOdeduEFMVMTiGEMKAiCvw XIcp3SPw+yGwvlt973KimFie9PxyUA4wE7wmodJmNHUERZRb06E3oBDXT6LT/Ftus9XRAh0fc mKkJm8vrDkNutqUfG2abAVrDz8ExGv6E7PVI6IHCtYqUqCDCb+YfTYQ8KHY0+K8ppPJwr/mGo 0RCt4vRraUuOyKo5FqTxr/RplSBLVenjzfxNSXKZ6+pN5nWeSTdFixgEOYcugphq6tZny/+rW 5jTUE8Crn/P1HTRxrilRacTK2Yg1PqPMHX5ncagt5dITxP5LhswHFyigGyKIyAj8VnQtuX9nX twhIp8ZSfb8k6W/5hJ4OWMV+9Ri91SKJRZacyDRiAeE5LavfjWD1x3M2FJi1VW5ZJOasimdvI g+TzcZtUJeuM5aIVBbUYkQpZOUcFKvn8NkJR9jPuxI7oBXIfwgbmpCH6e1B24dz6pg8UU5gTh Cpm4UWeRU8RQvU9Zqigtt/1xdoC3XGb+mBC1e+8eMsDe6EmCbdbyvOq38w93smZc057cZIKQk AsRKd4cNqDbomn+vbuHVZ3FiLmUjHiGE3qBFPQ6EaxEZWSVUY3ywqzQxIVFgiH7Iojun46qhA vNmrrrCdpH25xjpu+/IXGSqYqDWhSQvgJ5mGm3fQ4ovSL6dV9mY8pOEbrwuzM73+QNYzMDfXG C/0NU21H60OoGjCjo3tp7CHcfbL/GfYMetOfqn9hFDBTtPGLPw+3CF5J+0/HfelKJKd7kzNhT G9o8Jk1NIcD2PebCT/xo8V/GdBeE0xy+RTShvL3pLC9ryytY5BCgkXPgi6nwFJAGzbSeTMp6p XK8xtITU26w8GEkMj+JE5ydhy0ZTWNN02UCVdY85MvB9T8fHB9V4z1CDq3mX+s1t3CZN9Mma3 czfuuaFYgd5e7iHUZ7uZSZxuSYsuDiluRADs2kUcv1jqr1n4LrA0FjxE10Iy+dXJdfOMreprK 6OXsbV/sQpDlGjBaxorYLFszYL7wO31IHqgpKV50ZEPqnex4zKdfp3mIKHnU06ZSFrMe4M4eO OU93siX53XAhKDuSDF+VYyPkacSW7VYQsJHastg== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2020-10-01 09:51, Stefan Monnier wrote: > I'm not completely sure what is the intended use scenario. 1) Interactively... 1.1) A user finds himself in an unfamiliar mode buffer, and isn't sure what that mode's options are and how to use them. You mention further that you tried it in a dired-mode, so you saw its default operation in such a case. For dired-mode, the result-list is very long; for other modes, such as occur-mode or a packages buffer, you'll get a shorter list. The more obscure the mode, the more useful this use-case. 1.2) A user has a vague idea of a command name of interest, so enters a regex or substring of it to see a list of keybindings and descriptions of matches (as relevant for the current buffer). 2) Programmatically... 2.1) A developer wants to offer a cheat sheet / launcher for a package (similar in function to transient/hydra) but with less programming. This package offers wide latitude of how to compose a command list, what to display, how to sort, how to prompt. The args can be trivially simple to quite complex. (defun my-mode-low-budget-transient () (interactive) (when (eq major-mode my-mode) (key-assist ...))) (define-key my-mode-map "?" 'my-mode-low-budget-transient) BTW, On the emacs-bug thread/URL, I shared with Drew Adams the original inspiration for the package, which includes the motivation for what seems like an obscure arg option (cmd . function) > [ To see why I say it's not quite ready, here's my experience with it: > I just tried it in a fresh new Emacs session, and after `M-x > key-assist` (which itself is a problem because most users won't > know/bother to run this command way, so we'd need some more "obvious" > way to run it) Always a problem with a new feature. When you say 'obvious', you seem to mean more than the normal publicizing of a new feature? > I get a prompt for something You mean the prompt "Optional: Enter command regexp or keymap name:"? > and without reading more the description I wouldn't know what the > prompt wants True of very many emacs commands. Not a justification though. It could be a multi-line verbose explanatory prompt. > (I think this prompt should only appear if requested explicitly) Reasonable. Could be argued both ways. I have no preference, and just thought it friendlier this way to explicitly present to the user all the options, especially since this is supposed to be a 'help' function. Programmatically, this prompt shouldn't ever appear. > and then it said "no choices found". That's curious. I haven't seen that in my testing. What was your response to the first prompt? What was the value of 'major-mode' of the 'current-buffer' when you ran the command? > So I tried again in a dired buffer, where it instead showed me a > minibuffer prompt "Select: " with no indication of what it is I > should be selecting, I had difficulty deciding what text to use for this prompt because many users can be expected to be using some non-default minibuffer completion supplemental package (eg. ido, icicles, ivy), and those all have slightly different behavior; many present a result-list without needing to TAB. > after that I hit TAB (because I read that it uses `completing-read`, > but for the un-initiated it might not be obvious) Again, true of very many emacs commands. Not a justification though. I'm not a regular on this list, but even slashdot.org is reporting that the list has been discussing making emacs friendlier to new users, and I'm on board with that, so I'll take any suggestions for improvement here, but it might be better done as a patch to 'completing-read'. > at which point it did show me a list of bindings and short > descriptions and when I selected the first entry (i.e. `!`) it > signal'd an error about wrong number of arguments. ] Got it. Thanks much for your concrete suggestion further down on how to correct this bug. Many of the other options *DO* work though; this is a bug in the improper way the function calls some interactive functions. > I do think it would be nice to have something like it, since it's an > alternative to the menus which has the advantage of being > auto-constructed, doesn't need the mouse, and focuses on the keybindings= . Yep. Also, for me it was important that it present command descriptions, even if in the end it came at the expense of omitting command names to make the strings shorter. > It would also be nice to make it usable from minibuffers as well ;-) Hmm, I wonder.. Maybe it already does programmatically on a per-case basis. Interactively, do you mean integrating into the minibuffer codebase? I've long wanted something like this for the minibuffer options to isearch- > See some comments below based on a quick look at the code. I appreciate the comments a lot. Thanks for the constructive review. > `where-is-internal` is supposed to return the shortest binding already > when asked to return the "firstonly". I wasn't getting my desired result with it.. > Your notion of length is slightly different, admittedly, but I wonder > what were the concrete cases that motivated doing your own sorting Oops. Forgetting just now. A secondary motivation for the sort was to offer multiple sort options. In the end, I left it as an option for programmers to pass their own sort function. For example, someone may want to treat prefixes / upper-case differently. > > (while (not (setq choice > > (cl-position > > (substring-no-properties ; Is -no-properties nece= ssary? > > (completing-read prompt choices nil t)) > > choices :test 'equal)))) > > Why do you have this loop? Doesn't the `require-match` arg of > `completing-read` make it unnecessary? I remember thinking so, too, and then needing to add the loop because completing-read was accepting a RET. My recollection is that it was sending an empty string to cl-position. > .... But besides all that, it's great, right? =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 01 12:04:58 2020 Received: (at 43709) by debbugs.gnu.org; 1 Oct 2020 16:04:58 +0000 Received: from localhost ([127.0.0.1]:38044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO14j-00066i-BA for submit@debbugs.gnu.org; Thu, 01 Oct 2020 12:04:58 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO14g-00066R-E8 for 43709@debbugs.gnu.org; Thu, 01 Oct 2020 12:04:55 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B693780B9B; Thu, 1 Oct 2020 12:04:48 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A7DD58073F; Thu, 1 Oct 2020 12:04:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1601568286; bh=f0FxeC60RJV8tMI0FaD0VDRgFCV0jjlg45CH63Xrojk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=X3+4w0pB0PqdZrcraeA6sOFk8Ii2oVHB932Gbpoc+5ZGn3RM3slCCNqzN4w7x3xdU OUDY81sAKmpYRD3K/s/Zppeei00uX9yP+nr3vRPw1ychzNCJZbSI+4xdwKkN5JSuE7 yg8IufS2terJlbpiqQTOg89DpjoM8I+SEYfI6tGSGFQXTGBX98GC6A6w83dusz9guI UnwrJ5uLm72gZquSLwG8S73TRGy/ZzoIILC04ai7MWUNIAX+aJeiAL6sWUYcS/vCY1 VS1c5YVubsrT6/sojp5/TEgq2BnWH96Qllgdsl4ahooJG06UOTvhY2x9qhjjEB57xz 219VO9ollEwMw== Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 42FA41202C5; Thu, 1 Oct 2020 12:04:46 -0400 (EDT) From: Stefan Monnier To: Boruch Baum Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Message-ID: References: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> <20201001153147.3ucillviu62t2prf@E15-2016.optimum.net> Date: Thu, 01 Oct 2020 12:04:45 -0400 In-Reply-To: <20201001153147.3ucillviu62t2prf@E15-2016.optimum.net> (Boruch Baum's message of "Thu, 1 Oct 2020 11:31:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.078 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> [ To see why I say it's not quite ready, here's my experience with it: >> I just tried it in a fresh new Emacs session, and after `M-x >> key-assist` (which itself is a problem because most users won't >> know/bother to run this command way, so we'd need some more "obvious" >> way to run it) > Always a problem with a new feature. When you say 'obvious', you seem to > mean more than the normal publicizing of a new feature? I'm thinking that this would be useful for someone that not very familiar with Emacs, which also explains my further comments about the behavior. As it is, it seems instead geared toward users that are already familiar with Emacs and want to get to know some new mode or something like that. For a novice, we'd ideally want the user to be able to find and use this functionality "naturally" without even knowing beforehand how to look for it and how Emacs generally works ;-) >> I get a prompt for something > You mean the prompt "Optional: Enter command regexp or keymap name:"? Yes. >> and without reading more the description I wouldn't know what the >> prompt wants > True of very many emacs commands. Not a justification though. It could > be a multi-line verbose explanatory prompt. I think skipping the prompt is an easier way to avoid the confusion. Only prompt if the user asks for it (e.g. with a `C-u` prefix, an alternative entry-point, ...). > Reasonable. Could be argued both ways. I have no preference, and just > thought it friendlier this way to explicitly present to the user all the > options, especially since this is supposed to be a 'help' function. Or maybe we'd want to offer this prompt *afterwards*, as a special command to change&recompute the completion table based on a new criterion. >> and then it said "no choices found". > That's curious. I haven't seen that in my testing. What was your > response to the first prompt? RET > What was the value of 'major-mode' of the 'current-buffer' when you > ran the command? I was in *scratch*, so should have been `lisp-interaction-mode`. Maybe the "no choices found" message should mention the search string that was used (that's also a good way to teach the user what the first prompt means). >> So I tried again in a dired buffer, where it instead showed me a >> minibuffer prompt "Select: " with no indication of what it is I >> should be selecting, > > I had difficulty deciding what text to use for this prompt because many > users can be expected to be using some non-default minibuffer completion > supplemental package (eg. ido, icicles, ivy), and those all have > slightly different behavior; many present a result-list without needing > to TAB. Good point. For the plain old default, it would make a lot of sense to eagerly popup the *Completions*, but I'm not sure how we could do it without getting in the way for ivy and friends. > Again, true of very many emacs commands. Not a justification though. I'm > not a regular on this list, but even slashdot.org is reporting that the > list has been discussing making emacs friendlier to new users, and I'm > on board with that, so I'll take any suggestions for improvement here, > but it might be better done as a patch to 'completing-read'. Ah, now that makes more sense. I thought you'd sent your package in the context of that discussion of improving the experience for novice users. >> I do think it would be nice to have something like it, since it's an >> alternative to the menus which has the advantage of being >> auto-constructed, doesn't need the mouse, and focuses on the keybindings. > Yep. Also, for me it was important that it present command descriptions, Agreed. > even if in the end it came at the expense of omitting command names to > make the strings shorter. That's a good tradeoff. >> It would also be nice to make it usable from minibuffers as well ;-) > Hmm, I wonder.. Maybe it already does programmatically on a per-case > basis. Interactively, do you mean integrating into the minibuffer > codebase? I've long wanted something like this for the minibuffer > options to isearch- I'm not sure exactly how it should do it. But yes, `isearch` is an obvious use case as well (I say "as well", because isearch doesn't actually use the minibuffer). >> > (while (not (setq choice >> > (cl-position >> > (substring-no-properties ; Is -no-properties necessary? >> > (completing-read prompt choices nil t)) >> > choices :test 'equal)))) >> >> Why do you have this loop? Doesn't the `require-match` arg of >> `completing-read` make it unnecessary? > > I remember thinking so, too, and then needing to add the loop because > completing-read was accepting a RET. My recollection is that it was > sending an empty string to cl-position. Ah, OK, that makes sense. > But besides all that, it's great, right? Yes, I like it, Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 01 14:25:21 2020 Received: (at 43709) by debbugs.gnu.org; 1 Oct 2020 18:25:22 +0000 Received: from localhost ([127.0.0.1]:38270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO3Gb-0005XB-MG for submit@debbugs.gnu.org; Thu, 01 Oct 2020 14:25:21 -0400 Received: from mout.gmx.net ([212.227.17.22]:33991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO3GX-0005Wt-6r for 43709@debbugs.gnu.org; Thu, 01 Oct 2020 14:25:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601576708; bh=NCNnfNoWMu0JWE+V0QrE7Q2n3EJdJgNzpIRr1aKAmB4=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=TfEmmIjdTok1ZO4OrFHq/uRdk5a+MYIvTl8Y6wil9l8jkDxdWEOnjQNpPKK8OklA/ he2Uid9XJKPcefMkhIo/RYISkcea3JZUsBkowC8lUipvJCtph/H7lC05kgTffTwQds bnVU78qr/cx96QilCZB7DJMDqVqJdiA7RbJKrj7Q= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1McpJq-1kwpqj2w2k-00ZtX4; Thu, 01 Oct 2020 20:25:08 +0200 Date: Thu, 1 Oct 2020 14:25:04 -0400 From: Boruch Baum To: Stefan Monnier Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Message-ID: <20201001182504.mrdldh3rdf3uuvbm@E15-2016.optimum.net> References: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Provags-ID: V03:K1:oZckP0OIoHIMAN9FeUPG+A+iJHZ/bQKpyxtHnSnhgRAuoz8R4Kp C/L7mThy6CQ+2Ki+m077R4/PQdXTv0UKgHgcrp4U4RQC4YKrLf2bz7DV+X/s7LKScHZOvcK 37jk9i7NKJ+6I1GgmnvZA6TnLUaY9Z/yzo37xckSKSot5AtTlG73CfAgOVF/JGCJGB5NCfW U5qRZn1RRMEKApeOsqmSg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:uAT1P2RPIiE=:8fTNjX7pHbtAepg8i4FwtC 5iYqg/DfJqmWNg6qOLlDTt0khh2ODVSpwZ5Wh44UcZq5R0s352u2LH0xRDBKDGbJ5Tz6MSRUS m5BTpyOP16HhTzDxdxQmQqPkZPhF+TmvZ1iqQL6iqg872LofYy9lm16Ynq3nbx8cKqVNYMUZ6 kmk58BScDAZg57UId47lMgpnEY3MBVQdL+J4XO+KFAPrE3BfgOj3PyG0b05rVSyblocnkhPg/ f5Tu9lgP2lZJTcTYiBIDXsEOD31gjo7wTMzPfltBc9yzeQ6oyLinZEcLQPtntY1qCXsz67a1w NZDBHEDTI/iljXzFgkjTOB5o1xKtgmcDEJVrkq2rQ0gjaOYO8erSU9s9SEAJ8XmlBTXR5PqjN Z7t6pJte5lbwvlrVFCS8W0TkQ4ONaiKEkTpPMB3hRZk5jWxv2xZ7RmziVGsUci+GLlYGzyC5k B60GOcC5zLpUO16FMK3CSSGv9rcOvEEyJFbUHRY3QhxCX/K61jCMoG2u75Tce4r3yLBAMBRPo TgZK4G2PIhVGzsVO00TaDoPwhl7SISQCoF3bqCWJwA6etMXmEr9YJs1hBhbeHJS4rQC56ItlK zBDA+G1hNRcqdlGDMKT2Hsho1XBRghLgU4zdQO8FCttWFG0sDfrAQtUDlFI/4Vd056LppcPSm nlRt0HJ35wrtPSgdf5agZhEWapumhs7FWbRO9Q3ObJer4wqIqx2sGL9DVfsNDQxmVYY/6lfXN VlWIZKs7I19sR4BA/WcAvOJSs7CRHJOFmBLmHeiOZcAQTkhrhiIvowjGMoQf/s5GYFbcdoQg2 QKCMMq/A0xuFKKTKJl7Z30BWJJAzlIXoe2ttMboErgtB/o8a+E4ipnGaY44wPVaXl5XTKC1HU uvhG/NKKYFH4D3XbsxgHwi2OakKBzo21LHTN2/K/pTyX5wYArEbpZ1r/f2Dw1vvJABHdYL/lM uQ9pmPaZeflsmuWzMZxVyWwSgt5he9lJw0mCibzNTjVoFAkvmgW6lINuaNEBouGdOmPnrUL6R L51RXEB/2++GK2wdpTTwNFtbaw85uNTivJSkNG04R9IfE0Ujrm/MKp+BK+b28IrB58QMaW3C1 i95kxD8827V8sH7nf6J4Y+MbcQucOFuUMcyIaE1FuuejMgjnnaF6nlNyZKy+hxIFxzhR54N2O kZV43EimxsekgfJiJ5gIghL1y1garZxIF571QwVOvdJx15n/23KcekQ7rgNTQfpMW9PfNe0CA BBnYYGsadouWr+/XCV9WusnBK3EP3Gv4Z9i5CmA== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2020-10-01 09:51, Stefan Monnier wrote: > > ;; If you've ever used packages such as `ivy' or `magit', you've > For those who haven't, it would be good to describe what your package do= es. In progress... > > (require 'cl-seq) ;; cl-member, cl-position > Please require `cl-lib`grather than `cl-seq` Done. > > (let ((not-found t)) > > (mapc (lambda (x) > > (when (string-match x (format "%s" cmd)) > > (setq not-found nil))) > > key-assist-exclude-regexps) > > not-found))) > > You should move the `(format "%s" cmd)` out of the loop (and use > `dolist` instead of `mapc`). Done, but I went with symbol-name instead of format. > > ((keymapp spec) > > (let (cmd) > > (dolist (elem spec) > > Please use `map-keymap` rather than `dolist` so as to handle all the > different keymap formats. I had tried that originally, but map-keymap brings in data from parent keymaps, which is undesirable in this case. There is a function map-keymap-internal which might be a usable alternative, but it returns a single unusable cruft element (the parent keymap) when it exists, so the result doesn't seem much better than the current code, no? > > (funcall (car (nth choice commands)))))) > > This should probably be `command-execute` rather than `funcall` to fix > the wrong-number-of-arguments error I bumped into. Great catch. It solves the bug you found. Done. As for posting updates to the code submission, I can do any combination of the following, or something else, but want guidance before proceeding: 1) post to this list; 2) post to the pre-existing thread on emacs-bugs; 3) create a github repo, and post there (and gain potential wider audience, more features, but fragment communication over two platforms); 4) create a repo on some imagined savannah / gnu server; Finally: Tomorrow approaching sunset I go offline for about nine days[1], so what I can squeeze in before then, great; afterwards I welcome any continued feedback but please be patient and don't expect any response for ~10-12 days. But really finally this time: I've twice already made passing reference to another package about ready to submit, that adds a lot of new functionality to dired. I can post it now in its current state, and inconsiderately disappear offline for 9+ days, or I could just as inconsiderately not post it and deny you for 9+ days. I'm undecided, so unless I hear otherwise, I'll wait. =2D- [1] https://en.wikipedia.org/wiki/Sukkot =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 01 16:46:34 2020 Received: (at 43709) by debbugs.gnu.org; 1 Oct 2020 20:46:34 +0000 Received: from localhost ([127.0.0.1]:38551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO5TF-0000lp-Jd for submit@debbugs.gnu.org; Thu, 01 Oct 2020 16:46:33 -0400 Received: from mout.gmx.net ([212.227.17.21]:55515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO5TC-0000la-Ck for 43709@debbugs.gnu.org; Thu, 01 Oct 2020 16:46:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601585181; bh=rvWnc8vGNewk4O8Qr12xl0Yql8cQt/8DPyqiw3jmkCY=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=gVyuxxcunwhNaZmGjNs1Ktxh30L8qoC7NpCyFZnsQGXUJo1pFII3HjX2858tdJW8e mpfZ+oET5YgWolatVL9u2PjM8YSen17/9Xx1DjawLUlzX1Lusbw9Ka+qs37ACndXyc CaqZx1nFVLTu1cps6j2IGHa7jvniYq0EaqRKiXA4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1M5QFB-1kNGeX2t9B-001NIz; Thu, 01 Oct 2020 22:46:21 +0200 Date: Thu, 1 Oct 2020 16:46:17 -0400 From: Boruch Baum To: Stefan Monnier Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Message-ID: <20201001204617.qbpxwnyoqlckjgsl@E15-2016.optimum.net> References: <20200929165957.ibj67dnyaem6nezg@E15-2016.optimum.net> <20201001153147.3ucillviu62t2prf@E15-2016.optimum.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Provags-ID: V03:K1:KngoGShS0gAT1EETsB7YWiOHV3+8olcavt60iEjI3gyGc2buBpb Z6tgsZdaY4FJuM5CaZual7qeG/jypIwDwc1SAEKZ7ORBDkdlCAdU8Lxb7ZapyLZWkdO5C7r jP7C60cin/ZoPufjaPdHsGDm3bPkOr3c5NxTwTH98Vt6a4E86IMqQ76TWbQ4a0MI1xESxE/ GQPt05aUKC5mGdJvYK61Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:8rKNQDIWGYo=:W9dlvnwzVSe5lZEPUYPS/D ZY/OwFWL0UYix/2Cijt1kvoT6HtTsmzUUcQf5fUfW2FuJwxSr0cZpm1qEMXRPrNz+WP+Eb88T pLrd+bIKUkBjk7F1/awivCLe4CnJsZuiulpXR6GiM+8zftqDY5bvluBp94QVfCgec7ex/aS30 gm7PpCnFkviWvNMndNmpXKgqQRy8pBqivST/ONhwNpeMikI+abT92jsRorH6twP3X5GTNe9Bo qo3LNR0XYsT8pz9yrmINBw+Wh9bNLkkLOVrcgQPZpmKO/Bm2z2zmJSyW/XbjFFXX9/OaXgwHl +KLtcWq3bhEMV7gLJR5w6gQnOZeBieeTGv9mw1GuTpFp1aZIG2ghGwFd4MLj2l324H0EX9CbG ez5Rtjqb5JypMyaExJfBzWC2lKrV5jJ0agcNa2EthUK1l3W65CCvR3ZLUViJpLgte7VDyCjmf ofv4K336letvWU2R1xhKqwkokvWM2PyrZkDDTtx/ONc+4//5mlJMbNKIUyGhT+TVc0jZkFgWN 0349lnfnpeXhKSh6cjEO8Qz2X2dYaKVLBwu/pYmJLiTxf5a6pP5ovWPfR1LEupRJ9kQ0Sqmxt 72Z1XgBaSvWqkxCVuDYh4XAACLXIEwNxBr2wT0wzL//LgGmViL9d9ZAg+Kkm3i4QPkzqI8gYY YCnWdIYMiiJMuaKwmhkTfW2ShGxg6KBT/58UzG3zBTi4w7N+6aRejRnziByTKZKgM1tXGRTbg J2mmR0fcSKRC7W5xHft/HMgHivvf3kBOmrBhC9NJUqAJ2b1kdbZgM8s/DfkcNNdqTe7ra3bC8 aL2lT11fqxUgWdrl/GhWSCCuTgDE7B/MI1hcMj5erLrQ+t7j7QtgPUoOcreu62TSfIfCm+BK/ QU3aU94gfE/+N2q7rtewH/7Zb0c2z5dywHTQ2D0p0NHtZ93mOmYx1lOeI8bOGRbN7rn6XdE5L +Jhk4VJuAef+cyJPgql3ylabzZzsjR819k6gIU116UP4z5Uq6xFvNjqQMASrn+l8IGCfiSuFg kXCqXekoC7XfhzISLD7rTL+Aiqu/dspwY7+/nJWtwvt8ceCJN38mbrMzXPQSB/T2p1xyKv+sf YZ0jFhSSbkRDzp4yA1sFrVkBYHJBL2edwd3xK1SbKWF3deICYJWFZ8Jovv9f5eGyjOfp8f83w OEDWjAtLjpHLOfHiTYL6M248g4bvX+Xa9nUzLprPVw2VgDpyUvsBpYhSrHQsS3tJjluJgldTL XY0OpJ7DgIb2RVz2SO2y9OAHDMNzx20k6D60cvw== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2020-10-01 12:04, Stefan Monnier wrote: > I'm thinking that this would be useful for someone that not very > familiar with Emacs, It could be, yes. > it seems instead geared toward users that are already familiar with > Emacs and want to get to know some new mode or something like that. True. > For a novice, we'd ideally want the user to be able to find and use this > functionality "naturally" without even knowing beforehand how to look > for it and how Emacs generally works ;-) Oh, emacs. I'm the wrong person to ask because my reflexive response was to assume everyone should expect something like 'C-u C-h k'. BTW, a few months (years?) ago I had an email exchange with Eli Zaretskii in which he mentioned the help feature that he felt was most useful and important ... and it turned out not to even have a keybinding o even a mention in 'C-h ?' (and now I've forgotten even what it was the command was...) > I think skipping the prompt is an easier way to avoid the confusion. > Only prompt if the user asks for it (e.g. with a `C-u` prefix, an > alternative entry-point, ...). My initial inclination was to go for the prefix-arg option, but that wouldn't be friendly to novice users. And then I thought the same thing about an alternative entry-point, because it's asking someone to remember two separate commands. If the goal is to deal with the confusion of novices, the way to do it is with a single command and verbose interface. Even for non-novices, the goal here is to reduce the requirement to memorize, so having multiple ways of invoking the command is contradictory in that it asks for more memorization. A golden mean would be to come up with a short and clear prompt that can be ignored for most cases. > Or maybe we'd want to offer this prompt *afterwards*, as a special > command to change&recompute the completion table based on > a new criterion. Not difficult to program, but when I think about it, I see two obstacles: 1) The prompt ends up being at least as messy or confusing. What I end up with is a three-line prompt, something like (example being a dired buffer): Presenting list of 'dired-' commands. Select an item on the current list, or to present a list using a different regexp 2) What could you use to guarantee no conflict with any other entry on the list? Remember that we're inside 'completing-read' at this point, so we can't be using control characters, can we? Even if we can dynamically change the based upon a uniqueness check of all characters in the list, that would just add to confusion, because each different invocation would generate a different . In practice, it would be difficult to generate such a unique key because completing-read matches against all characters in list, which in our case includes all characters in the description, not just those of the keybindings. > >> and then it said "no choices found". > I was in *scratch*, so should have been `lisp-interaction-mode`. > Maybe the "no choices found" message should mention the search string > that was used (that's also a good way to teach the user what the first > prompt means). Agreed. I'll work on it. My preference would then be for a verbose minibuffer message, maybe as much as three long lines, amounting to a mini-tutorial, the goal being to reduce confusion for novices or people unfamiliar with the operation. > >> So I tried again in a dired buffer, where it instead showed me a > >> minibuffer prompt "Select: " with no indication of what it is I > >> should be selecting, > > > > I had difficulty deciding what text to use for this prompt because man= y > > users can be expected to be using some non-default minibuffer completi= on > > supplemental package (eg. ido, icicles, ivy), and those all have > > slightly different behavior; many present a result-list without needin= g > > to TAB. > > Good point. For the plain old default, it would make a lot of sense to > eagerly popup the *Completions*, but I'm not sure how we could do it > without getting in the way for ivy and friends. Is this again something to consider implementing as a patch inside completing-read, ie. change the message/prompt inside completing-read; would users of the packages that commandeer the mini-buffer interface ("ivy and friends") see the completing-read prompt at that point? At that point, they've already commandeered the interface. =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 02 03:14:36 2020 Received: (at 43709) by debbugs.gnu.org; 2 Oct 2020 07:14:36 +0000 Received: from localhost ([127.0.0.1]:39256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOFH1-0008BT-Iu for submit@debbugs.gnu.org; Fri, 02 Oct 2020 03:14:36 -0400 Received: from mout.gmx.net ([212.227.17.20]:47601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOFGy-0008BE-Vh for 43709@debbugs.gnu.org; Fri, 02 Oct 2020 03:14:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601622864; bh=fx22Rsykm68O6kA8yl4H3cy1u+UM4q/vn8yufq+3M1U=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=d6WJSizFqI1PVeFet1KWl6wlW2KcGJCSpXcrSIZEGnz1hsh084EyoV1VsVzXVXPpm tUl9QSQcY3zb62q/kJqZ8kXUNw0GDVXfcIF8dS2LFhuefEUAKTgOf4biCYK59BTBpl 7kiWQU7wZPnMfEepXF4b/ipmVVZVRsqltoodTMWY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MdefJ-1kxa1O1qVt-00Zcgu; Fri, 02 Oct 2020 09:14:23 +0200 Date: Fri, 2 Oct 2020 03:14:19 -0400 From: Boruch Baum To: 43709@debbugs.gnu.org Subject: bug#43709: minibuffer keybinding cheatsheet and launcher [V2 CODE SUBMISSION] Message-ID: <20201002071419.qw33jc3rpcywlucm@E15-2016.optimum.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="fuym2uf3c66hb4tc" Content-Disposition: inline User-Agent: NeoMutt/20180716 X-Provags-ID: V03:K1:qfkKRdWPjl1k50GG0J7BBqrIlmbXiIagVuJAdQQbLx0h9h4uOMB +6lI0JabmQd+rO+807PZmmPPvCTw4xKyDKbMvmozERLpaNdXMdVklQMr07X6dI9fhCZXMDo Ub2A4eJ/nBYu7fG8BDKM6h/trV6QtEX8Gz3IpTKYYBniQIztswnFqf48mSmSxYY/iZ9MzmX Ag3VbrEMWbn2YfOHc03tg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:OkqgJ8oKT8g=:Gf+7ksaw/YVKulp55lDif9 gGJ3uQaS2/DX5TEKEco/NrzRfDSY9QWRxkHvdj/g5EUidhZpKKOz32o99Pc6IsIcnvflE9lmf rOMz2s3gBVmvfBrhjPeZjpBEe5pCuQW8k0C8a0RgoHryV9HeuMwyLAvsbXJCC2SHdZOrULVMg WMp2K5xfb9lZq6ATUrfqlNvm2ZlCrI3AGJNqCOKMGshT0tisTSGGXFLZG/On6HgA/kZ4x2iIJ 5V9NjjMlKuq5mGBzaQcN2hj1sCqtR7yp2h7Xbb5/RFdirzWrsRwFoyRruAUoFVMPKkdbr4e/+ jEkaPiDmigUmgVY4LHWVQrhDhtLlNonC4CfvuMh3weBlHK4H5CYnfQTUbXvjYWZ5bfQNXZudq vh2XF3ZDzxKo3aaQ3P4bjGarAaT37lV2Vx4wRMvZHgAiMTT4O8ICTn4Q9zFhI9OGZDKuNhQpm 0h8ch8GBye/8XIcXLP1dNZxfENM5fiMJcogwFdFM+YpCUFipazBp5liBg4CLTZd1yGUMIOJsS RGuBku04sCzgxcnOxf3RZO/5JkjFMR2B/7lrvHHffViGNvpMt7D+iTFVWj9cGDuuHjpdPaYNP rNW5/xVoE5W95m82bpgTz2gLPhmxWgzzHTD4YSvYPGo6PyLeVsBPnQbVnuoMbHcebLIm1+3u3 47/p5uLgi9Hz6Dy1mY2ta91sBGCDmxpTU9qdmDVr8Izb2e4GGzEYVzXxM+otWuys+8c69dU+a hHTMFa7L2GN0LMqIxHv9tUZsnrLrzAl8XcY10DbeGsO/tLdDAJtVBOscEAYb8l+uIuHzg+bQz ddaIqKQBItPHKT7L9c6YL7py2T1J5RBn8yCSji6KCqragftvroLfC8BgcwgfDtJkD2V/cfj6C z6vgntZbUeUEi6Ov8DaTJbVu1iWlUAbNdARmMA3leJ6iF7/cDen+3Y0QAc2z2QWi1bqa2aSRA XBBUE8/Ky6HEUDcjeLbphRJXUCiiUgjPjCMOcGn/v99jYMsahhIRUbzGtUcCShEPSj2s8y6lI Ivc5TeiG5ljMwhdjnvyXI2fVD+ZdZVZWWjA+Ez/5lXRF3CW7b0+Sgv1lUfozyczZSSQY5tBoJ JbaknuVlNbs8z6qBjZX5pulP0556o+Dsp/MbXUWcgYd46sEKIxjdTwtNxhNq1WXsA+QEk3Dld /jPXrRtAbs46Pqz1mYPlXw2PiKo1LbvTagGrkTiIL9iqa+d1QjQzaJb+9ntIFCWBt6IEjkNn6 OkugLERfvVlfxntN6MedZjCu+Zfrledaf1ywIIw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43709 Cc: Stefan Monnier , Emacs-Devel List X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --fuym2uf3c66hb4tc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Here's an update to key-assist.el: 1) Improved commentary documentation and more helpful prompts 2) Fixes a launcher bug =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --fuym2uf3c66hb4tc Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="key-assist.el" Content-Transfer-Encoding: quoted-printable ;;; key-assist.el --- minibuffer keybinding cheatsheet and launcher -*- le= xical-binding: t -*- ;; Copyright =A9 2020, Boruch Baum ;; Available for assignment to the Free Software Foundation, Inc. ;; Author: Boruch Baum ;; Maintainer: Boruch Baum ;; Keywords: minibuffer keybindings ;; Package: key-assist ;; This file is NOT part of GNU Emacs. ;; This is free software: you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This software is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this software. If not, see . ;; ;;; Commentary: ;; For emacs *users*: This package provides an interactive command ;; to easily produce a keybinding cheat-sheet "on-the-fly", and then ;; to launch any command on the cheat-sheet list. At its simplest, ;; it gives the user a list of keybindings for commands specific to ;; the current buffer's major-mode, but it's trivially simple to ask ;; it to build an alternative (see below). ;; Use this package to: learn keybindings; learn what commands are ;; available specifically for the current buffer; run a command ;; from a descriptive list; and afterwards return to work quickly. ;; For emacs *programmers*: This package provides a simple, flexible ;; way to produce custom keybinding cheat-sheets and command ;; launchers for sets of commands, with each command being ;; described, along with its direct keybinding for direct use ;; without the launcher (see below). ;; If you've ever used packages such as `ivy' or `magit', you've ;; probably benefited from each's custom combination keybinding ;; cheatsheet and launcher: `hydra' in the case of `ivy', and ;; `transient' for `magit'. The current package `key-assist' offers ;; a generic and very simple alternative requiring only the ;; `completing-read' function commonly used in core vanilla emacs. ;; `key-assist' is trivial to implement "on-the-fly" interactively ;; for any buffer, and programmatically much simpler to customize ;; that either `hydra' or `transient'. And did I mention that it ;; only requires `completing-read'? ;; ;;; Dependencies: ;; `cl-lib': For `cl-member',`cl-position' ;; ;;; Installation: ;; 1) Evaluate or load this file. ;; ;;; Interactive operation: ;; Run M-x key-assist from the buffer of interest. Specify a ;; selection (or don't), press to view the presentation, and ;; then either exit with your new-found knowledge of the command ;; keybindings, or use standard emacs tab completion to select an ;; option, and press to perform the action. ;; ;; If you choose not to respond to the initial prompt, a list of ;; keybindings and command descriptions will be generated based upon ;; the first word of the buffer's major mode. For, example, in a ;; `w3m' buffer, the list will be of all interactive functions ;; beginning `w3m-'. This works out to be great as a default, but ;; isn't always useful. For example, in an `emacs-lisp-mode' buffer, ;; what would you expect it to usefully produce? At the other ;; extreme might be a case of a buffer too many obscure keybindings ;; of little use. ;; You can also respond to the prompt with your own regexp of ;; commands to show, or with the name of a keymap of your choice. ;; For the purposes of `key-assist', a regexp can be just a ;; substring, without REQUIRING any leading or trailing globs. ;; In all cases, note that the package can only present keybindings ;; currently active in the current buffer, so if a sub-package ;; hasn't been loaded yet, that package's keybindings would not be ;; presented. Also note that the commands are presented sorted by ;; keybinding length, alphabetically. ;; ;;; Programmatic operation: ;; See the docstrings for functions `key-assist' and ;; `key-assist--get-cmds'. ;; ;;; Configuration: ;; Two variables are available to exclude items from the ;; presentation list: `key-assist-exclude-cmds' and ;; `key-assist-exclude-regexps'. See there for further information. ;; ;;; Compatability ;; Tested with emacs 26.1 in debian. ;; TODO: ;; ;; * In a vanilla emacs environment, the sorting appears wrong ;; seemingly partially because of how the completion buffer is ;; constructed, bottom-up. This isn't an issue when using one of ;; the supplemental minibuffer completion packages. =0C ;; ;;; Code (require 'cl-lib) ;; cl-member, cl-position ;; ;;; Variables (defvar key-assist-exclude-cmds '(ignore self-insert-command digit-argument negative-argument describe-mode) "List of commands to always exclude from `key-assist' output.") (defvar key-assist-exclude-regexps '("-mouse-") "List of regexps of commands to exclude from `key-assist' output.") ;; TODO: Don't depend upon a mouse command having the word '-mouse-' in it= . ;; ;;; Internal functions (defun key-assist--get-keybinding (cmd &optional key-map) "Return a string with CMD's shortest keybinding." (let (shortest) (dolist (key (mapcar 'key-description (where-is-internal cmd key-map nil t))) (when (or (not shortest) (> (length shortest) (length key))) (setq shortest key))) shortest)) (defun key-assist--get-description (cmd) "Return a string with CMD's description. CMD is a symbol of an interactive command." ;; TODO: Change hard-coded length to an ARG. (let ((doc (documentation cmd t))) (format "\t%s" (if (or (not doc) (not (string-match "\n" doc)) (zerop (match-beginning 0))) (concat (symbol-name cmd) " (not documented)") (substring doc 0 (match-beginning 0)))))) (defun key-assist--vet-cmd (cmd result-list) "Check whether CMD should be on a `key-assist' list. See `key-assist-exclude-cmds' and `key-assist-exclude-regexps'." (and (symbolp cmd) (commandp cmd) (not (cl-member cmd result-list :test (lambda (cmd l) (equal cmd (nth 1 l))))) ; (assq= cmd result-list)) (not (memq cmd key-assist-exclude-cmds)) (let ((not-found t) (cmd-string (symbol-name cmd))) (dolist (regexp key-assist-exclude-regexps) (when (string-match regexp cmd-string) (setq not-found nil))) not-found))) (defun key-assist--parse-cmd (cmd result-list &optional key-map) "Extract commands and shortest keybindings from a keymap. This is an internal function used by `key-assist'. Returns a list whose elements are a keybinding string, a command symbol, and a description string." (when (key-assist--vet-cmd cmd result-list) (let* ((key-map (when (keymapp key-map) key-map)) (shortest (key-assist--get-keybinding cmd key-map))) (when shortest (list shortest cmd (concat shortest (key-assist--get-description c= md))))))) (defun key-assist--get-cmds (spec &optional nosort nofinish) "Return a list of commands, keybindings, and descriptions. Returns a list of CONS, whose CAR is the command, and whose CDR is a string of the form \"shortest-keybinding tab-character command-description\". Optional arg SPEC may be a regexp string of desired commands. If NIL, a regexp is generated based upon the first word of the buffer's major mode. SPEC may also be a keymap of desired commands. In both of these cases, the resulting list is sorted alphabetically by keybinding length. SPEC has additional options of being either a list of commands, or a list of CONS whose CAR is a command, and whose CDR is either a description-string or a function which returns a description string. A final programmatic option is for SPEC to be any combination of the above options. For that most complex case, the first list element of SPEC must be the symbol 'collection. For none of these additional options is sorting performed. Optional arg NOSORT can be a function to replace the default sort algorithm with the programmer's desired post-processing, or some other non-nil value for no sorting at all. If a function, it should accept a single list of elements (keybinding-string commandp description-string) and should return a list of elements (anything commandp description-string). Optional arg NOFINSH return a list in `key-assist--parse-cmd' format instead of the list of CONS described above. It is used internally for processing 'collection lists." (when (and spec (not (and (stringp spec) (zerop (length spec))))) (when (and (stringp spec) (boundp (intern spec)) (keymapp (symbol-value (intern spec)))) (setq spec (symbol-value (intern spec)))) (let (name result-elem (result-list '())) (cond ((keymapp spec) (let (cmd) (dolist (elem spec) (cond ((atom elem)) ;; eg. 'keymap ((listp (setq cmd (cdr elem)))) ;; TODO: possibly also embed= ded keymap? ((commandp cmd) ;; this excludes 'menubar (when (setq result-elem (key-assist--parse-cmd cmd result-= list)) (push result-elem result-list))))))) ((stringp spec) (mapatoms (lambda (x) (and (commandp x) (string-match spec (setq name (symbol-name x))) (when (setq result-elem (key-assist--parse-cmd x result-list)) (push result-elem result-list)))))) ((listp spec) (cond ((eq (car spec) 'collection) (dolist (collection-element (cdr spec)) ;; Maybe it's more efficient to sort each collection element= ? (let ((temp-list (key-assist--get-cmds collection-element 'n= osort 'nofinish))) (dolist (elem temp-list) (push elem result-list))))) ((commandp (car spec)) (dolist (cmd spec) (when (setq result-elem (key-assist--parse-cmd cmd result-li= st)) (push result-elem result-list)))) (t ; spec is a list of CONS (cmd . (or string function)) (dolist (elem spec) (when (key-assist--vet-cmd (car elem) result-list) (let ((shortest (key-assist--get-keybinding (car elem)))) (when shortest (push (list shortest (car elem) (if (stringp (cadr elem)) (cadr elem) (funcall (cadr elem)))) result-list)))))))) (t (error "Improper SPEC format."))) (when (not nosort) (setq result-list (if (functionp nosort) (funcall nosort result-list) (sort result-list (lambda (a b) (cond ((=3D (length (car a)) (length (car b))) (string< (car a) (car b))) ((< (length (car a)) (length (car b)))) (t nil))))))) (if nofinish result-list (mapcar (lambda (x) (cons (nth 1 x) (nth 2 x))) result-list))))) ;; ;;; Interactive functions (defun key-assist (&optional spec prompt nosort) "Prompt to eval a locally relevant function, with hints and keybindings. Press TAB to see the hints. Interactively, the optional arg SPEC is either a regexp string for candidate commands to match, or a keymap from which to prepare the hints. If NIL, a regexp is generated based upon the first word of the buffer's major mode. Results are presented sorted alphabetically by keybinding length. Programmatically, optional arg PROMPT can be used to customize the prompt. For the further programmatic options of SPEC and for a description of arg NOSORT, see function `key-assist--get-cmds'. See also variables `key-assist-exclude-regexps' and `key-assist-exclude-cmds'." (interactive) (when (not spec) (setq spec (symbol-name major-mode) spec (substring spec 0 (1+ (string-match "-" spec))) spec (read-regexp (format "Press RET for keybinding cheatsheet/launcher for= \"%s\" commands, Or enter a different command regexp or keymap name: " spec) spec))) (when (or (not spec) (and (stringp spec) (zerop (length spec)))) (user-error "Nothing to do!")) (let (commands choices choice minibuffer-history) (while (not choices) (setq commands (key-assist--get-cmds spec nosort)) (when (not (setq choices (mapcar 'cdr commands))) (setq spec (read-regexp (format "No choices found for \"%s\". Try a differernt command regexp or keymap name: " spec) spec)))) (while (not (setq choice (cl-position (completing-read (or prompt "You may need to press TAB to see the r= esult list. Select an item on the list to launch it: ") choices nil t) choices :test 'equal)))) (command-execute (car (nth choice commands))))) =0C ;; ;;; Conclusion ;; FIXME: This command can be very slow for very large regexp ;; collections. Try giving it ".*" and see how long it takes to ;; collect and present (for me, ~460 results). (provide 'key-assist) ;;; key-assist.el ends here --fuym2uf3c66hb4tc-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 02 14:24:58 2020 Received: (at 43709) by debbugs.gnu.org; 2 Oct 2020 18:24:58 +0000 Received: from localhost ([127.0.0.1]:42545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPjl-0002LV-6f for submit@debbugs.gnu.org; Fri, 02 Oct 2020 14:24:58 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:41278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kOPjg-0002LG-Ph for 43709@debbugs.gnu.org; Fri, 02 Oct 2020 14:24:56 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 092INuoD070141; Fri, 2 Oct 2020 18:24:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=eeFOvnJJ4N+Vs2A0LSO3UnpMeHTogI7ML6NV6XfuhKM=; b=lyNEyY6DBXi+fTNK/148+jjrRD4QERdXO0c/LlKZ0OnGPifZvaR4QIWQFwDhRDMs/Bat ItB5bJxjAL+hVgJasnP6OELDf3VffAAkPsPJwgea+h8EHu0JzCcOpBNEMbXPZYZ40DFa R4Z6RrSlxCIFhYoALhXTcsZj++rAET1K0J1jUEg7pXZGkJm7HAu06UoCgB26xF7L0JmQ D3jIkaVTL3l0rc6mrsyQIdi6TqCZn2KiLnZpPRYXIEWgMU/tbAfcYqSh24NNcSpNtI/B T/PyClcpVT3kXJ5oTzDuRE4WfP3CXTpufRAMGYGMWDmYFGgJ1NLmIqK4Bwl44D3rbsQm Vg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 33wupg372t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 02 Oct 2020 18:24:46 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 092IOjHA196582; Fri, 2 Oct 2020 18:24:46 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 33tfj3e1pj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Oct 2020 18:24:46 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 092IOj6F021224; Fri, 2 Oct 2020 18:24:45 GMT MIME-Version: 1.0 Message-ID: <99eeecac-729c-42fc-8b51-67a0e8de14f5@default> Date: Fri, 2 Oct 2020 11:24:44 -0700 (PDT) From: Drew Adams To: Boruch Baum , 43709@debbugs.gnu.org Subject: RE: bug#43709: minibuffer keybinding cheatsheet and launcher [V2 CODE SUBMISSION] References: <20201002071419.qw33jc3rpcywlucm@E15-2016.optimum.net> In-Reply-To: <20201002071419.qw33jc3rpcywlucm@E15-2016.optimum.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5056.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9762 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010020134 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9762 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 phishscore=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010020134 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43709 Cc: Emacs-Devel List X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Please don't send messages to both the bug list and emacs-devel. Please pi= ck one. Thx. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 15 14:54:04 2020 Received: (at 43709) by debbugs.gnu.org; 15 Oct 2020 18:54:04 +0000 Received: from localhost ([127.0.0.1]:56554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT8O3-00063y-AX for submit@debbugs.gnu.org; Thu, 15 Oct 2020 14:54:03 -0400 Received: from mout.gmx.net ([212.227.17.21]:56331) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT8O1-00063S-DE for 43709@debbugs.gnu.org; Thu, 15 Oct 2020 14:54:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602788033; bh=mvgDYNglJuPPVX1TTn5F0Dcxgpdx0NEAP9TjoK14Lhg=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=k9b9vLbxaeiD6EgMHZJp+hdz5tZCX2zlriNXLl35wzcs/tcysUNug9L6j8l1H/RCk VrFhOypByPC2K6o4pXVmtDQD0y8Md5d7F22QaalV3jkhpQuaBx+yNUDJx+7hYfKMuL zf6QGo9F9tLlUsnkKnr0vySCoqvw6nEhEGVCOH4k= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MVeMG-1kujvZ0W3g-00RVaI; Thu, 15 Oct 2020 20:53:53 +0200 Date: Thu, 15 Oct 2020 14:53:48 -0400 From: Boruch Baum To: 43709@debbugs.gnu.org Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [V3 CODE SUBMISSION] Message-ID: <20201015185347.bgavyydizae7qn3f@E15-2016.optimum.net> References: <20201002071419.qw33jc3rpcywlucm@E15-2016.optimum.net> <99eeecac-729c-42fc-8b51-67a0e8de14f5@default> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="kqx2hg7tqgnnrbox" Content-Disposition: inline In-Reply-To: <99eeecac-729c-42fc-8b51-67a0e8de14f5@default> User-Agent: NeoMutt/20180716 X-Provags-ID: V03:K1:Tlns5B14HEv1nk9hN8Ct4KQMAZtX5wnclAzuKmCscLj4tfNdyQ5 3YToInw8JtC5OQoGPzHh1ahTmh6BWaiPqWm+KJ2f2EAHiVs9gDL5pxYh88OF1glmnOzWha2 PnKwqRuchXJja2W9xObTxR2mCff6UR+5vLj+vMZrktV80JwHWxWKUskMLEsLXKePEjLP4FQ V8zE7t9SOSouM/dTIrz6Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:G9yTqjhDMqI=:CyuzlRtJGrjhbX5c7xvisy LRR40LzNiVnT8iUvcA0pk2pdvcd3zQQZtSVJHj6ovda2med1N1ENMjDDfcFbiyWWbf/maMX+I 659Z7f98fUjFHM0vJ2OyhocoEF+Aw3msTOrR84qAZtC+gqbhw51xihZohR4C2WnG7gqakRvBF LlwMM1v3gZLmX7M536Y6OU58fHx5I+WrBI+jZvAM4/JslDeiwjyNs90f7lPpRBTbJ9Bav+Y6P bFrJ6vdZ/ZTPWoxWMoaqhjZPlOsjUbX1cZNIILNaUehkCHHBV64UCc+Opo4GOtsFmUP+tAScW 1xJVSXjhgk135xwKduQoT+NS0CLh0Kgg54jmI2/S0PWmTZLaNlq/+EvaJCFcFuOThB67s9Vnu /Bq/uVmb1LKorr54o5t+6K8hghtFwoKH+CX/V/0Ko3EnB2ySQCqBpXZO5cY0uXN3PsuavFx5v ye2pK9oG7bS1Kj0lUbmTNzuGTYlS5QnRyUsJdr6DV9pG8wwefIn1doJms83YTg+0AxxZU/60n bJoHd4FjPDjRjcXNF/1PBFpgMv1K5aRuMviWjWhe6231LBFlWyzFkzaqrUi2d0SXEskhYrXxN N+9tdZ51s3FtHXfel2tcIL2XB/ic3qJVJpp6ZfGHcPx0i/m/NmA8k4p4q8+3LLYq5LXHtlarb W+Reo13WD5qOsZ+J4DHsZ4TWfZM0ra6DSsnGuB9k5Z7ztMd/CL5iJ2iTcuVchymdjDZBZgw8i VaO9GI8Ltu0TWN9i/S3/lUMPmXf77dJ6QpjQorv3gIFyEv6X4/Ox+7MVCxObcfi7gSxLYhWlA VNKr0ymM8o8drYH9Sc7ctWxNf6rLHLVUxv/sOq7r9W/7lg8GK93N6r1CE52nu+R1oAbfqLHxG klaD0BuM/7JZkMjRhaMQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org, Emacs-Devel List X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --kqx2hg7tqgnnrbox Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable It's been two weeks since I heard any feedback on this proposal. Can I nudge? What's the decision for future action or inaction on this? Attached is the same content with some minor documentation changes, mainly to comply with checkdoc and package-lint. =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --kqx2hg7tqgnnrbox Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="key-assist.el" Content-Transfer-Encoding: quoted-printable ;;; key-assist.el --- Minibuffer keybinding cheatsheet and launcher -*- le= xical-binding: t -*- ;; Copyright =A9 2020, Boruch Baum ;; Available for assignment to the Free Software Foundation, Inc. ;; Author: Boruch Baum ;; Maintainer: Boruch Baum ;; Homepage: --------------------- ;; Keywords: abbrev convenience docs help ;; Package: key-assist ;; Package-Version: 1.0 ;; Package-Requires: ((emacs "24.3")) ;; (emacs "24.3") for: lexical-binding, user-error, cl-lib ;; This file is NOT part of GNU Emacs. ;; This is free software: you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This software is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this software. If not, see . ;; ;;; Commentary: ;; For Emacs *users*: This package provides an interactive command ;; to easily produce a keybinding cheat-sheet "on-the-fly", and then ;; to launch any command on the cheat-sheet list. At its simplest, ;; it gives the user a list of keybindings for commands specific to ;; the current buffer's major-mode, but it's trivially simple to ask ;; it to build an alternative (see below). ;; Use this package to: learn keybindings; learn what commands are ;; available specifically for the current buffer; run a command ;; from a descriptive list; and afterwards return to work quickly. ;; For Emacs *programmers*: This package provides a simple, flexible ;; way to produce custom keybinding cheat-sheets and command ;; launchers for sets of commands, with each command being ;; described, along with its direct keybinding for direct use ;; without the launcher (see below). ;; If you've ever used packages such as `ivy' or `magit', you've ;; probably benefited from each's custom combination keybinding ;; cheatsheet and launcher: `hydra' in the case of `ivy', and ;; `transient' for `magit'. The current package `key-assist' offers ;; a generic and very simple alternative requiring only the ;; `completing-read' function commonly used in core vanilla Emacs. ;; `key-assist' is trivial to implement "on-the-fly" interactively ;; for any buffer, and programmatically much simpler to customize ;; that either `hydra' or `transient'. And did I mention that it ;; only requires `completing-read'? ;; ;;; Dependencies: ;; `cl-lib': For `cl-member',`cl-position' ;; ;;; Installation: ;; 1) Evaluate or load this file. ;; ;;; Interactive operation: ;; Run M-x `key-assist' from the buffer of interest. Specify a ;; selection (or don't), press to view the presentation, and ;; then either exit with your new-found knowledge of the command ;; keybindings, or use standard Emacs tab completion to select an ;; option, and press to perform the action. ;; ;; If you choose not to respond to the initial prompt, a list of ;; keybindings and command descriptions will be generated based upon ;; the first word of the buffer's major mode. For, example, in a ;; `w3m' buffer, the list will be of all interactive functions ;; beginning `w3m-'. This works out to be great as a default, but ;; isn't always useful. For example, in an `emacs-lisp-mode' buffer ;; or a `lisp-interaction-mode', what would you expect it to ;; usefully produce? At the other extreme might be a case of a ;; buffer with too many obscure keybindings of little use. ;; You can also respond to the prompt with your own regexp of ;; commands to show, or with the name of a keymap of your choice. ;; For the purposes of `key-assist', a regexp can be just a ;; substring, without REQUIRING any leading or trailing globs. ;; In all cases, note that the package can only present keybindings ;; currently active in the current buffer, so if a sub-package ;; hasn't been loaded yet, that package's keybindings would not be ;; presented. Also note that the commands are presented sorted by ;; keybinding length, alphabetically. ;; ;;; Programmating example: ;; Here's a most simple example that presents all of the keybindings ;; for 'my-mode: ;; ;; (defun my-mode-keybinding-cheatsheet-launcher () ;; (interactive) ;; (when (eq major-mode my-mode) ;; (key-assist))) ;; (define-key my-mode-map "?" ;; 'my-mode-keybinding-cheatsheet-launcher) ;; See the docstrings for functions `key-assist' and ;; `key-assist--get-cmds' for the description of ARGS that can be ;; used to customize the output. ;; ;;; Configuration: ;; Two variables are available to exclude items from the ;; presentation list: `key-assist-exclude-cmds' and ;; `key-assist-exclude-regexps'. See there for further information. ;; ;;; Compatability ;; Tested with Emacs 26.1 and emacs-snapshot 28(~2020-09-16), both in ;; debian. =0C ;; ;;; Code: (require 'cl-lib) ;; cl-member, cl-position ;; ;;; Variables: (defvar key-assist-exclude-cmds '(ignore self-insert-command digit-argument negative-argument describe-mode) "List of commands to always exclude from `key-assist' output.") (defvar key-assist-exclude-regexps '("-mouse-") "List of regexps of commands to exclude from `key-assist' output.") ;; TODO: Don't depend upon a mouse command having the word '-mouse-' in it= . ;; ;;; Internal functions: (defun key-assist--get-keybinding (cmd &optional key-map) "Return a string with CMD's shortest keybinding. Optional arg KEY-MAP defaults to local map." (let (shortest) (dolist (key (mapcar 'key-description (where-is-internal cmd key-map nil t))) (when (or (not shortest) (> (length shortest) (length key))) (setq shortest key))) shortest)) (defun key-assist--get-description (cmd) "Return a string with CMD's description. CMD is a symbol of an interactive command." ;; TODO: Change hard-coded length to an ARG. (let ((doc (documentation cmd t))) (format "\t%s" (if (or (not doc) (not (string-match "\n" doc)) (zerop (match-beginning 0))) (concat (symbol-name cmd) " (not documented)") (substring doc 0 (match-beginning 0)))))) (defun key-assist--vet-cmd (cmd result-list) "Check whether CMD should be on a `key-assist' list. Each element of RESULT-LIST is a CMD already accepted, in the form '(keybinding-string, CMD, description-string). See `key-assist-exclude-cmds' and `key-assist-exclude-regexps'." (and (symbolp cmd) (commandp cmd) (not (cl-member cmd result-list :test (lambda (cmd l) (equal cmd (nth 1 l))))) (not (memq cmd key-assist-exclude-cmds)) (let ((not-found t) (cmd-string (symbol-name cmd))) (dolist (regexp key-assist-exclude-regexps) (when (string-match regexp cmd-string) (setq not-found nil))) not-found))) (defun key-assist--parse-cmd (cmd result-list &optional key-map) "Extract a command and shortest keybinding from a keymap. If KEY-MAP is nil, use the local map, and look for CMD there. Each element of RESULT-LIST is a CMD already accepted, in the form '(keybinding-string, CMD, description-string). This is an internal function used by `key-assist'. Returns a list whose elements are a keybinding string, a command symbol, and a description string." (when (key-assist--vet-cmd cmd result-list) (let* ((key-map (when (keymapp key-map) key-map)) (shortest (key-assist--get-keybinding cmd key-map))) (when shortest (list shortest cmd (concat shortest (key-assist--get-description c= md))))))) (defun key-assist--get-cmds (spec &optional nosort nofinish) "Return a list of commands, keybindings, and descriptions. Returns a list of CONS, whose CAR is the command, and whose CDR is a string of the form \"shortest-keybinding tab-character command-description\". Optional arg SPEC may be a regexp string of desired commands. If NIL, a regexp is generated based upon the first word of the buffer's major mode. SPEC may also be a keymap of desired commands. In both of these cases, the resulting list is sorted alphabetically by keybinding length. SPEC has additional options of being either a list of commands, or a list of CONS whose CAR is a command, and whose CDR is either a description-string or a function which returns a description string. A final programmatic option is for SPEC to be any combination of the above options. For that most complex case, the first list element of SPEC must be the symbol 'collection. For none of these additional options is sorting performed. Optional arg NOSORT can be a function to replace the default sort algorithm with the programmer's desired post-processing, or some other non-nil value for no sorting at all. If a function, it should accept a single list of elements (keybinding-string commandp description-string) and should return a list of elements (anything commandp description-string). Optional arg NOFINISH return a list in `key-assist--parse-cmd' format instead of the list of CONS described above. It is used internally for processing 'collection lists." (when (and spec (not (and (stringp spec) (zerop (length spec))))) (when (and (stringp spec) (boundp (intern spec)) (keymapp (symbol-value (intern spec)))) (setq spec (symbol-value (intern spec)))) (let (result-elem (result-list '())) (cond ((keymapp spec) (let (cmd) (dolist (elem spec) (cond ((atom elem)) ;; eg. 'keymap ((listp (setq cmd (cdr elem)))) ;; TODO: possibly also embed= ded keymap? ((commandp cmd) ;; this excludes 'menubar (when (setq result-elem (key-assist--parse-cmd cmd result-= list)) (push result-elem result-list))))))) ((stringp spec) (mapatoms (lambda (x) (and (commandp x) (string-match spec (symbol-name x)) (when (setq result-elem (key-assist--parse-cmd x result-list)) (push result-elem result-list)))))) ((listp spec) (cond ((eq (car spec) 'collection) (dolist (collection-element (cdr spec)) ;; Maybe it's more efficient to sort each collection element= ? (let ((temp-list (key-assist--get-cmds collection-element 'n= osort 'nofinish))) (dolist (elem temp-list) (push elem result-list))))) ((commandp (car spec)) (dolist (cmd spec) (when (setq result-elem (key-assist--parse-cmd cmd result-li= st)) (push result-elem result-list)))) (t ; spec is a list of CONS (cmd . (or string function)) (dolist (elem spec) (when (key-assist--vet-cmd (car elem) result-list) (let ((shortest (key-assist--get-keybinding (car elem)))) (when shortest (push (list shortest (car elem) (if (stringp (cadr elem)) (cadr elem) (funcall (cadr elem)))) result-list)))))))) (t (error "Improper SPEC format"))) (when (not nosort) (setq result-list (if (functionp nosort) (funcall nosort result-list) (sort result-list (lambda (a b) (cond ((=3D (length (car a)) (length (car b))) (string< (car a) (car b))) ((< (length (car a)) (length (car b)))) (t nil))))))) (if nofinish result-list (mapcar (lambda (x) (cons (nth 1 x) (nth 2 x))) result-list))))) ;; ;;; Interactive functions: (defun key-assist (&optional spec prompt nosort) "Prompt to eval a locally relevant function, with hints and keybindings. Press TAB to see the hints. Interactively, the optional arg SPEC is either a regexp string for candidate commands to match, or a keymap from which to prepare the hints. If NIL, a regexp is generated based upon the first word of the buffer's major mode. Results are presented sorted alphabetically by keybinding length. Programmatically, optional arg PROMPT can be used to customize the prompt. For the further programmatic options of SPEC and for a description of arg NOSORT, see function `key-assist--get-cmds'. See also variables `key-assist-exclude-regexps' and `key-assist-exclude-cmds'." (interactive) (when (not spec) (setq spec (symbol-name major-mode) spec (substring spec 0 (1+ (string-match "-" spec))) spec (read-regexp (format "Press RET for keybinding cheatsheet/launcher for= \"%s\" commands, Or enter a different command regexp or keymap name: " spec) spec))) (when (or (not spec) (and (stringp spec) (zerop (length spec)))) (user-error "Nothing to do!")) (let (commands choices choice minibuffer-history) (while (not choices) (setq commands (key-assist--get-cmds spec nosort)) (when (not (setq choices (mapcar 'cdr commands))) (setq spec (read-regexp (format "No choices found for \"%s\". Try a differernt command regexp or keymap name: " spec) spec)))) (while (not (setq choice (cl-position (completing-read (or prompt "You may need to press TAB to see the r= esult list. Select an item on the list to launch it: ") choices nil t) choices :test 'equal)))) (command-execute (car (nth choice commands))))) =0C ;; ;;; Conclusion: (provide 'key-assist) ;;; key-assist.el ends here ;; NOTE: For integration into emacs: ;; * defcustoms should include :version "28.1" --kqx2hg7tqgnnrbox-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 15 14:59:12 2020 Received: (at 43709) by debbugs.gnu.org; 15 Oct 2020 18:59:12 +0000 Received: from localhost ([127.0.0.1]:56576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT8T2-0006CI-Cz for submit@debbugs.gnu.org; Thu, 15 Oct 2020 14:59:12 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:35948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kT8T0-0006C2-4M for 43709@debbugs.gnu.org; Thu, 15 Oct 2020 14:59:10 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FIp4om136959; Thu, 15 Oct 2020 18:59:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=nHgm4Q6sRr5/K2+1VbRzJMABtg92kaStOgRex5ZP69U=; b=R+/El4c2nCUf+1lcb1y1pvuJQTcc2zPKbtRBO5fpulveXTQ4UDk0uqHRtYuiqLtCS1uy YxAIEqiEj6PCkHx9ImP+W/2+L3IzNNE1fgEKmbh19xaY2hh8y2qw7jfeChDahCDM/dts ICB3q6XPnqHXuaufyZ/WisDaPwOXYkCSZQRVUmlkxjIW5w59L3LmswGicsPeTW6E0uvz p62M2GEsDyizRciNCQBR639yBgLcYXntV+lX9jpuaWxZI+ftsUM6ycn3Frkhc+4jRKrC nnc6IL+QETFIJXFR8jkS5xZkg96veH1N/UYKEV7ybq5vdxdNGoxE75Mmy/VjQUjqdpJn jA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 3434wkxfwu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 15 Oct 2020 18:59:03 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FIpLgm080202; Thu, 15 Oct 2020 18:57:03 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 343pv27ens-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Oct 2020 18:57:03 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09FIv13u022070; Thu, 15 Oct 2020 18:57:01 GMT MIME-Version: 1.0 Message-ID: <081a9ebb-4b7b-4926-aa55-6c3d99067099@default> Date: Thu, 15 Oct 2020 11:57:00 -0700 (PDT) From: Drew Adams To: Boruch Baum , 43709@debbugs.gnu.org Subject: RE: bug#43709: minibuffer keybinding cheatsheet and launcher [V3 CODE SUBMISSION] References: <20201002071419.qw33jc3rpcywlucm@E15-2016.optimum.net> <99eeecac-729c-42fc-8b51-67a0e8de14f5@default> <20201015185347.bgavyydizae7qn3f@E15-2016.optimum.net> In-Reply-To: <20201015185347.bgavyydizae7qn3f@E15-2016.optimum.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5056.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9775 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150124 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9775 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 impostorscore=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150124 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org, Emacs-Devel List X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Please don't send the same message to both the bug list and emacs-devel. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 21 08:15:08 2021 Received: (at 43709) by debbugs.gnu.org; 21 Jul 2021 12:15:08 +0000 Received: from localhost ([127.0.0.1]:36356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6B80-0002aR-BL for submit@debbugs.gnu.org; Wed, 21 Jul 2021 08:15:08 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6B7y-0002Sj-VU for 43709@debbugs.gnu.org; Wed, 21 Jul 2021 08:15:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cOfJc203Xv3ZgdRr30xIQMWJp9TmO+stB5PjkKPpeWY=; b=jojJjncUl1zqZSjgL7xg0sGcpT yah6pyHcPXN65b/uqPa4NqUM/Un6mRSQUyO4GCSBgjkHxinIVKYTm6UaDEM9ul2QrFScJGdiDkIjm 07VvfIUD80yzOhp+TfXnTJpKUNo48wGVuGd2mN+KDQeWbzOtLbYRbgwiCbqEpqBpeMb4=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6B7q-0006Oe-Gz; Wed, 21 Jul 2021 14:15:00 +0200 From: Lars Ingebrigtsen To: Boruch Baum Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] References: <20201002071419.qw33jc3rpcywlucm@E15-2016.optimum.net> <99eeecac-729c-42fc-8b51-67a0e8de14f5@default> <20201015185347.bgavyydizae7qn3f@E15-2016.optimum.net> X-Now-Playing: Vert's _Broken Breakbeat Bebop_: "Standing On The Verge Of Falling Off" Date: Wed, 21 Jul 2021 14:14:58 +0200 In-Reply-To: <20201015185347.bgavyydizae7qn3f@E15-2016.optimum.net> (Boruch Baum's message of "Thu, 15 Oct 2020 14:53:48 -0400") Message-ID: <87im13kgn1.fsf_-_@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Boruch Baum writes: > It's been two weeks since I heard any feedback on this proposal. Can I > nudge? What's the decision for future action or inaction on this? I've tried out this package, and it's interesting, but I don't think it's generally useful enough to include in Emacs. But packaging it up for ELPA might make sense. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Boruch Baum writes: > It's been two weeks since I heard any feedback on this proposal. Can I > nudge? What's the decision for future action or inaction on this? I've tried out this package, and it's interesting, but I don't think it's generally useful enough to include in Emacs. But packaging it up for ELPA might make sense. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 21 08:15:11 2021 Received: (at control) by debbugs.gnu.org; 21 Jul 2021 12:15:12 +0000 Received: from localhost ([127.0.0.1]:36359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6B83-0002eU-NK for submit@debbugs.gnu.org; Wed, 21 Jul 2021 08:15:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6B82-0002X6-NS for control@debbugs.gnu.org; Wed, 21 Jul 2021 08:15:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VDZ5PDwBxYX8piwRule18vqLdaS+N8b4hGyuyZpVtS8=; b=grVaKqEWJ2LU2KeyXLnkyCblaK /oELYhLJU8G4rtsL+Cwqmq2qqh2l6LgTojbz+GIrTzPfxVzFoRhW8LC09FgbzGWDqhUDTi3BZnQB+ hkasK//ts4ORKz65I2pKop51dawD9pUUigKdDWUDo3cTR/69FB4cxPh5wDJ7snYuGew4=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6B7v-0006Op-74 for control@debbugs.gnu.org; Wed, 21 Jul 2021 14:15:05 +0200 Date: Wed, 21 Jul 2021 14:15:02 +0200 Message-Id: <87h7gnkgmx.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #43709 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 43709 wontfix close 43709 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 43709 wontfix close 43709 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 21 09:48:33 2021 Received: (at 43709) by debbugs.gnu.org; 21 Jul 2021 13:48:33 +0000 Received: from localhost ([127.0.0.1]:36536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6CaP-0000zT-0R for submit@debbugs.gnu.org; Wed, 21 Jul 2021 09:48:33 -0400 Received: from mout.gmx.net ([212.227.17.21]:51163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6CaN-0000zG-Dw for 43709@debbugs.gnu.org; Wed, 21 Jul 2021 09:48:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1626875305; bh=0Cm/8x/DZvrd5r7aTIOGKfKiFA+mQdeZWm8klNiEWtE=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=S6s38rDp3C1JBouI32XB31oyjU28taq4OmfNp8AEdRTqfLWd6DBHw1W6FBoeCDfTA 5ATZCA7NnHrV+LBdksktLTQ53AUqavaQXEryAv6SU8XGSnUCX0nDuiJzrXOkSkVVPb S5auRaOSohFkmPeibj7pI48kYGIjwzhfXwXfXmrc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from E15-2016.optimum.net ([141.157.226.108]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MBlxM-1lwGwv0HWe-00CDwU; Wed, 21 Jul 2021 15:48:25 +0200 Date: Wed, 21 Jul 2021 09:48:22 -0400 From: Boruch Baum To: Lars Ingebrigtsen Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] Message-ID: <20210721134822.hzi35u7wcdfcwbbm@E15-2016.optimum.net> References: <20201002071419.qw33jc3rpcywlucm@E15-2016.optimum.net> <99eeecac-729c-42fc-8b51-67a0e8de14f5@default> <20201015185347.bgavyydizae7qn3f@E15-2016.optimum.net> <87im13kgn1.fsf_-_@gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87im13kgn1.fsf_-_@gnus.org> User-Agent: NeoMutt/20180716 X-Provags-ID: V03:K1:+ubf0R50CpASPYpCmv0xfs7nctPoPQDNUpR+3OK98pPpvbYzxbI /dWWblMaUM+HqMJprB8EtSOhKHtxEg/2IBvIkEINFgVd47ae3yiWuiKhOJJIDKUorUAi7WT 2Dlqzpsi9+ihZxexrtQ63N9IF3XVtCgptO/yENXFYjk0lAG6+Yio6amHqPprKqsFKSSN4s4 8u/4pjsYaW/kdIdGdF/Iw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:IgQARAqPyw0=:O1wmgjfpJL65nUZTTyZCbE XmFMJVgbRxRsoyiALTnxvsMx44TfClg5yUVOu9Hs78C654y6e6XmJXo+h3BdwrHLC7xweWVqK /c1+7AzUs+9fnIue1B34vfEWc4LB80FtOVFXcsHo3dW/iDcbl/2D2n77m30+BrPLL7LB29kJf GoRkXzu5Pfqjb9CrWJffbk0zVxUmlVlJYDEQYR8G5SeZOwDQ2CObJJGu5UcszmDPnr/d74ECF IoTWJOVajD27YOe6vkXSf1IebL/ROBsZ+FB2i6Y30vE0E2AxqqfboGyjfDq3qpX6uTDNrXY87 +nTxBheN3MXn8lVaIQC5GzGP7XKr5yZO6PlahvR1GgPO7ChERBHjL2FznF5B7j98F3norSI7R lt/ZfTqwasErKTgl1ZD+xiPb9lmCJEghdZmST/hG5M6D3pE1tJNwuxo+p+CLrk5q7kfN50Yno cOBJUNjqH0XPuhi5oiofVV7lmz3Gw4qpK26ImTthewRCZ67oYwuWJfR/75LqJQ4jEmw0WFlkp TjknCTQIucYKCaSfCcyRAg+Qp/6qgkgjE4aLrO/5Jwx0AmADjKZTWaxupVx1u5tgmARdNqSFT pguwB1K1DqDYcze9VABdBdSHoLkJEunUWW2Lu5rwNa7USjvnXO/S3BDvGhnS+qHdx4sxJH57G lNisK6DdyFyPEIefJB7tBF/y5FhQcbiUG8txPdT06giLCxL+a1FRl9R9Em+A7tBOOCox2fp4h hf4NmBwdHUE3tAXXrG4SUTrJTI3wQHoi7wLPX9qUQEt2ckUcQ+7+8z2WkFCCURWwO2bb+jOZz ZM4eAYEDu3/9uIykc1fWSIbJpCw7oIu5ZhJJxq2yRwSSBppb/v9iaTYNfY3H90j3kji5gpdI+ smcFQ8mOToeXSTIFfKc36g0ljxYtHw/hpcS83hKq77aVOvXyWbWehfpUuISUL38+sQpUYaYBg 2smjsyzTv8RsCvHXbvBxDObOEQa+VSJ+yeckOIoAcB5u3SCDqumqcJ6LVy1IRvxNMBe6q1g4b aRSP2pUkBOBVlb9jyG1YVqUorfZNlOUaUeAGW5V1wB2l0FKALXza95t6YJxSC16/p1DgHJLqH eB0sr6lx1BhuzpwBm0GeuPmyOjO44qwGAUb Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 43709 Cc: 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2021-07-21 14:14, Lars Ingebrigtsen wrote: > Boruch Baum writes: > > > It's been two weeks since I heard any feedback on this proposal. Can I > > nudge? What's the decision for future action or inaction on this? > > I've tried out this package, and it's interesting, but I don't think > it's generally useful enough to include in Emacs. But packaging it up > for ELPA might make sense. > Done. + https://github.com/melpa/melpa/pull/7198 + https://melpa.org/#/key-assist =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 22 02:49:56 2021 Received: (at 43709) by debbugs.gnu.org; 22 Jul 2021 06:49:56 +0000 Received: from localhost ([127.0.0.1]:39255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6SWp-0006aA-UD for submit@debbugs.gnu.org; Thu, 22 Jul 2021 02:49:56 -0400 Received: from smtp-2.orcon.net.nz ([60.234.4.43]:44645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6SWo-0006a3-OS for 43709@debbugs.gnu.org; Thu, 22 Jul 2021 02:49:55 -0400 Received: from [10.253.37.70] (port=41070 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1m6SWh-0005xq-II; Thu, 22 Jul 2021 18:49:48 +1200 Received: from ip-116-251-162-85.kinect.net.nz ([116.251.162.85]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Thu, 22 Jul 2021 18:49:47 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 22 Jul 2021 18:49:47 +1200 From: Phil Sainty To: Boruch Baum Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION] In-Reply-To: <20210721134822.hzi35u7wcdfcwbbm@E15-2016.optimum.net> References: <20201002071419.qw33jc3rpcywlucm@E15-2016.optimum.net> <99eeecac-729c-42fc-8b51-67a0e8de14f5@default> <20201015185347.bgavyydizae7qn3f@E15-2016.optimum.net> <87im13kgn1.fsf_-_@gnus.org> <20210721134822.hzi35u7wcdfcwbbm@E15-2016.optimum.net> Message-ID: X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43709 Cc: Lars Ingebrigtsen , 43709@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2021-07-22 01:48, Boruch Baum wrote: > On 2021-07-21 14:14, Lars Ingebrigtsen wrote: >> I've tried out this package, and it's interesting, but I don't think >> it's generally useful enough to include in Emacs. But packaging it up >> for ELPA might make sense. > > Done. > + https://github.com/melpa/melpa/pull/7198 > + https://melpa.org/#/key-assist I suspect the suggestion was GNU ELPA rather than MELPA. In any case, as you've already proposed it for Emacs, do consider submitting it to GNU ELPA. -Phil From unknown Thu Aug 14 21:49:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 19 Aug 2021 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator