Solved! helm-descbinds solved the problem.
https://github.com/emacs-helm/helm-descbinds
Thank you for your help.
I was trying to work out if I could build a simple script to narrow down key bindings, somewhat similar to IDO. I know of Icicle, but for some reason I didn't like it.
During my search I ran into many problems and beging to think that the only way out is to run:
(describe-bindings)
and then try to parse Help buffer.
Is there a way to get pre-parsed flat list of biding? I got lost trying to understand the keymap structure.
I guess recursively parsing the keymap structure is too much work. Is there a simple solution?
This is example of my early progress.
https://github.com/bigos/Pyrulis/blob/master/Emacs/key-bindings-lister/lisp/key-bindings-lister.el
After a while of trying, looks like getting the info from Help buffer didnt work. I got some strange structures with the string and when I tried to use print, it didn't print what I wanted. Perhaps I will have to parse the keymap?
After playing with keymap for a while, I think this is the way to go. More in my github link.
My last attempt.
;;; run in ielm like this: (my-list-bindings 11)
;;; n=11 for global
(defun my-list-bindings (n)
"almost clean way of listing key bindings"
(map-keymap
(lambda (x y)
(print "!!!!!!!!!!!!!!!!!!!!!")
(princ x)
(if (eq x 'menu-bar)
(print "*** skipping menu bar ***")
(print y)))
(elt (current-active-maps) n )))
M-x describe-bindings
will show you all bindings. C-h m(M-x describe-mode)
is also handy to list bindings by mode.