From cdd2934d0dc9d90b897d7a7028501ef2e918df41 Mon Sep 17 00:00:00 2001 From: Iqbal Ansari Date: Sat, 10 Oct 2015 18:37:04 +0530 Subject: [PATCH] Allow function key bindings to be displayed in toplevel help --- which-key.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/which-key.el b/which-key.el index a66d4fcac96..14fc5b050d4 100644 --- a/which-key.el +++ b/which-key.el @@ -1247,20 +1247,21 @@ BUFFER that follow the key sequence KEY-SEQ." key-str-qt) ;; For toplevel binding, we search for lines which ;; start with a sequence of characters other than - ;; space and tab and '<', '>' (these are ignored - ;; since mostly these are the keyboard input - ;; definitions provided by iso-transl or (mouse) - ;; bindings for the `fringe' or `modeline' which - ;; might not be as interesting), the initial - ;; sequence should be followed by one or more - ;; tab/space which are then followed by a sequence - ;; of non newline/tab characters + ;; space and tab and '<', '>' except function keys + ;; (these are ignored since mostly these + ;; are the keyboard input definitions provided by + ;; iso-transl or (mouse) bindings for the `fringe' + ;; or `modeline' which might not be as interesting) + ;; the initial sequence should be followed by one + ;; or more tab/space which are then followed by a + ;; sequence of non newline/tab characters ;; For example the following should match ;; C-x Prefix Command + ;; Some command ;; But following should not ;; C-x 8 Prefix Command ;; Prefix Command - "^\\([^ <>\t]+\\)[ \t]+\\([^\t\n]+\\)$")) + "^\\([^ <>\t]+\\|\\)[ \t]+\\([^\t\n]+\\)$")) key-match desc-match unformatted) (save-match-data (with-temp-buffer