diff options
| author | Ivan Shmakov | 2016-04-30 17:24:57 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-04-30 17:24:57 +0200 |
| commit | 6f86ec8050c12b131b5a8d54a42fef04445f9482 (patch) | |
| tree | f8e3dc4352e4dc611ebc84b005203811c3958768 | |
| parent | 619e0aedb2f3dbfe6821ac34e2d25b4e5c181117 (diff) | |
| download | emacs-6f86ec8050c12b131b5a8d54a42fef04445f9482.tar.gz emacs-6f86ec8050c12b131b5a8d54a42fef04445f9482.zip | |
Add a variable to control "shorter command" suggestions
* lisp/simple.el (extended-command-suggest-shorter): New variable (bug#19152).
(execute-extended-command): Use it.
| -rw-r--r-- | lisp/simple.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 849cbd6863a..fca739636c6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1634,6 +1634,11 @@ If the value is non-nil and not a number, we wait 2 seconds." | |||
| 1634 | (integer :tag "time" 2) | 1634 | (integer :tag "time" 2) |
| 1635 | (other :tag "on"))) | 1635 | (other :tag "on"))) |
| 1636 | 1636 | ||
| 1637 | (defcustom extended-command-suggest-shorter t | ||
| 1638 | "Non-nil means show a shorter M-x invocation when there is one." | ||
| 1639 | :group 'keyboard | ||
| 1640 | :type 'boolean) | ||
| 1641 | |||
| 1637 | (defun execute-extended-command--shorter-1 (name length) | 1642 | (defun execute-extended-command--shorter-1 (name length) |
| 1638 | (cond | 1643 | (cond |
| 1639 | ((zerop length) (list "")) | 1644 | ((zerop length) (list "")) |
| @@ -1716,7 +1721,8 @@ invoking, give a prefix argument to `execute-extended-command'." | |||
| 1716 | ((numberp suggest-key-bindings) suggest-key-bindings) | 1721 | ((numberp suggest-key-bindings) suggest-key-bindings) |
| 1717 | (t 2)))))) | 1722 | (t 2)))))) |
| 1718 | (when (and waited (not (consp unread-command-events))) | 1723 | (when (and waited (not (consp unread-command-events))) |
| 1719 | (unless (or binding executing-kbd-macro (not (symbolp function)) | 1724 | (unless (or (not extended-command-suggest-shorter) |
| 1725 | binding executing-kbd-macro (not (symbolp function)) | ||
| 1720 | (<= (length (symbol-name function)) 2)) | 1726 | (<= (length (symbol-name function)) 2)) |
| 1721 | ;; There's no binding for CMD. Let's try and find the shortest | 1727 | ;; There's no binding for CMD. Let's try and find the shortest |
| 1722 | ;; string to use in M-x. | 1728 | ;; string to use in M-x. |