Created
July 25, 2016 10:54
-
-
Save lislon/66d696d6a41379806da49f0957dd9e16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun my-count-maps (keymap depth) | |
| (let ((count 0)) | |
| (cl-loop for touple in (cdr keymap) | |
| ;; touple == (27 keymap (9 . ispell-complete-word)) | |
| do | |
| (progn | |
| (if (eq (car-safe (cdr-safe touple)) 'keymap) | |
| ;; descent into sub keymap | |
| (setq count (+ count | |
| (my-count-maps (cdr touple) (1+ depth)))) | |
| ;; else condition | |
| (if (characterp (car-safe touple)) | |
| (progn | |
| (setq count (1+ count)) | |
| (message "Map: %s%s %s" (make-string depth (string-to-char "-")) (char-to-string (car touple)) (cdr touple))) | |
| (message "not character keymap %s" touple))) | |
| ;; (message "touple: %s" (car-safe touple)) | |
| )) | |
| ;; return value | |
| count)) | |
| (message "total: %d" (my-count-maps org-mode-map 0)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment