diff options
| author | Eivind Fonn <evfonn@gmail.com> | 2019-12-31 16:15:18 +0100 |
|---|---|---|
| committer | Eivind Fonn <evfonn@gmail.com> | 2019-12-31 16:22:26 +0100 |
| commit | ef4f345b8bfa45f61448cb6dc747496d3b561dcc (patch) | |
| tree | bd9920ce2b57c3f8465c328e9b22346cc48ec366 /scripts | |
| parent | 30e951fd41ae408fab7fc19004f88c31205c0e4a (diff) | |
Docs: fix use of \\[...] to display key sequences
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/evil-extract-docstrings | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/scripts/evil-extract-docstrings b/scripts/evil-extract-docstrings index 9e636b6..72a9198 100755 --- a/scripts/evil-extract-docstrings +++ b/scripts/evil-extract-docstrings @@ -7,6 +7,27 @@ (require 'json) (require 'help) +(defun keymap-funcs (map) + (let (funcs) + (dolist (elt (cdr map)) + (when (consp elt) + (cond + ((and (cdr elt) (symbolp (cdr elt))) + (push (cdr elt) funcs)) + ((keymapp (cdr elt)) + (setq funcs (append (keymap-funcs (cdr elt)) funcs)))))) + funcs)) + +(defun keymap-bindings (map) + (let ((funcs (keymap-funcs map)) + bindings) + (dolist (func funcs) + (unless (memq func '(undefined)) + ;; (push (cons func (key-description (where-is-internal func map t))) bindings) + ;; (message (format "%s %s" func (key-description (where-is-internal func map t)))) + (push (cons func (key-description (where-is-internal func map t))) bindings))) + bindings)) + (with-temp-file (format "%s../doc/docstringdb.json" cur-path) (let (vars) (mapatoms @@ -15,6 +36,8 @@ (let ((default (car (get sym 'standard-value)))) (while (and (consp default) (memq (car default) '(function quote))) (setq default (cadr default))) + ;; (when (and (boundp sym) (keymapp (symbol-value sym))) + ;; (message (format "%S" sym))) (push `(,sym (default . ,(cond ((consp default) (format "%S" default)) ((symbolp default) (symbol-name default)) @@ -25,6 +48,9 @@ (fn-docstring . ,(ignore-errors (documentation sym 'raw))) (arglist . ,(help-function-arglist sym)) (functionp . ,(functionp sym)) - (macrop . ,(macrop sym))) + (macrop . ,(macrop sym)) + (keymap-inv . ,(and (boundp sym) + (keymapp (symbol-value sym)) + (keymap-bindings (symbol-value sym))))) vars))))) (insert (json-encode vars)))) |
