diff options
| author | Stefan Kangas | 2019-08-24 01:02:04 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2020-02-04 02:04:20 +0100 |
| commit | 557b790e0a3fcb2cd4196a3119da3e92647f8def (patch) | |
| tree | f2b6aaf62ae10fea500af2c09296eab5f5a1ab37 /test | |
| parent | f9504ffba2e2604338c243dd77c877bbb8162e4a (diff) | |
| download | emacs-557b790e0a3fcb2cd4196a3119da3e92647f8def.tar.gz emacs-557b790e0a3fcb2cd4196a3119da3e92647f8def.zip | |
Add new help command describe-keymap
* lisp/help-fns.el (describe-keymap): New command to show key bindings
for a given keymap. (Bug#30660)
* doc/emacs/help.texi (Misc Help): Document the new command.
* doc/lispref/keymaps.texi (Scanning Keymaps): Add a cross-reference
to the above documentation.
* etc/NEWS: Announce the new command.
* test/lisp/help-fns-tests.el (help-fns-test-describe-keymap/symbol)
(help-fns-test-describe-keymap/value)
(help-fns-test-describe-keymap/not-keymap)
(help-fns-test-describe-keymap/let-bound)
(help-fns-test-describe-keymap/dynamically-bound-no-file): New tests.
Co-authored-by: Drew Adams <drew.adams@oracle.com>
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/help-fns-tests.el | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index ef42d4bda29..1d6c062979f 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el | |||
| @@ -123,4 +123,32 @@ Return first line of the output of (describe-function-1 FUNC)." | |||
| 123 | (goto-char (point-min)) | 123 | (goto-char (point-min)) |
| 124 | (should (looking-at "^font-lock-comment-face is ")))) | 124 | (should (looking-at "^font-lock-comment-face is ")))) |
| 125 | 125 | ||
| 126 | |||
| 127 | ;;; Tests for describe-keymap | ||
| 128 | (ert-deftest help-fns-test-describe-keymap/symbol () | ||
| 129 | (describe-keymap 'minibuffer-local-must-match-map) | ||
| 130 | (with-current-buffer "*Help*" | ||
| 131 | (should (looking-at "^minibuffer-local-must-match-map is")))) | ||
| 132 | |||
| 133 | (ert-deftest help-fns-test-describe-keymap/value () | ||
| 134 | (describe-keymap minibuffer-local-must-match-map) | ||
| 135 | (with-current-buffer "*Help*" | ||
| 136 | (should (looking-at "^key")))) | ||
| 137 | |||
| 138 | (ert-deftest help-fns-test-describe-keymap/not-keymap () | ||
| 139 | (should-error (describe-keymap nil)) | ||
| 140 | (should-error (describe-keymap emacs-version))) | ||
| 141 | |||
| 142 | (ert-deftest help-fns-test-describe-keymap/let-bound () | ||
| 143 | (let ((foobar minibuffer-local-must-match-map)) | ||
| 144 | (describe-keymap foobar) | ||
| 145 | (with-current-buffer "*Help*" | ||
| 146 | (should (looking-at "^key"))))) | ||
| 147 | |||
| 148 | (ert-deftest help-fns-test-describe-keymap/dynamically-bound-no-file () | ||
| 149 | (setq help-fns-test--describe-keymap-foo minibuffer-local-must-match-map) | ||
| 150 | (describe-keymap 'help-fns-test--describe-keymap-foo) | ||
| 151 | (with-current-buffer "*Help*" | ||
| 152 | (should (looking-at "^help-fns-test--describe-keymap-foo is")))) | ||
| 153 | |||
| 126 | ;;; help-fns-tests.el ends here | 154 | ;;; help-fns-tests.el ends here |