From 330228d5c71981d3e2d39387d5222c3670c467c6 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 19 Jan 2020 00:17:42 +0100 Subject: Provide default for describe-keymap prompt * lisp/help-fns.el (describe-keymap): Provide a reasonable default for prompt. (Bug#30660) (help-fns-find-keymap-name) (help-fns--most-relevant-active-keymap): New functions. * test/lisp/help-fns-tests.el (help-fns-test-find-keymap-name): New test. --- test/lisp/help-fns-tests.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index 1d6c062979f..d2dc3d24aec 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el @@ -125,6 +125,15 @@ Return first line of the output of (describe-function-1 FUNC)." ;;; Tests for describe-keymap +(ert-deftest help-fns-test-find-keymap-name () + (should (equal (help-fns-find-keymap-name lisp-mode-map) 'lisp-mode-map)) + ;; Follow aliasing. + (unwind-protect + (progn + (defvaralias 'foo-test-map 'lisp-mode-map) + (should (equal (help-fns-find-keymap-name foo-test-map) 'lisp-mode-map))) + (makunbound 'foo-test-map))) + (ert-deftest help-fns-test-describe-keymap/symbol () (describe-keymap 'minibuffer-local-must-match-map) (with-current-buffer "*Help*" -- cgit v1.2.1