Skip to content

Instantly share code, notes, and snippets.

@lislon
Created July 25, 2016 10:36
Show Gist options
  • Select an option

  • Save lislon/78d87b55054b50895871b968ecc36c6c to your computer and use it in GitHub Desktop.

Select an option

Save lislon/78d87b55054b50895871b968ecc36c6c to your computer and use it in GitHub Desktop.
(defun my-count-maps (keymap)
(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))))
;; else condition
(setq count (1+ count)))
))
;; return value
count))
(message "total: %d" (my-count-maps org-mode-map))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment