Function: help-fns-find-keymap-name

help-fns-find-keymap-name is a byte-compiled function defined in help-fns.el.gz.

Signature

(help-fns-find-keymap-name KEYMAP)

Documentation

Find the name of the variable with value KEYMAP.

Return nil if KEYMAP is not a valid keymap, or if there is no variable with value KEYMAP.

Source Code

;; Defined in /usr/src/emacs/lisp/help-fns.el.gz
(defun help-fns-find-keymap-name (keymap)
  "Find the name of the variable with value KEYMAP.
Return nil if KEYMAP is not a valid keymap, or if there is no
variable with value KEYMAP."
  (when (keymapp keymap)
    (let ((name (catch 'found-keymap
                  (mapatoms (lambda (symb)
                              (when (and (boundp symb)
                                         (eq (symbol-value symb) keymap)
                                         (not (eq symb 'keymap)))
                                (throw 'found-keymap symb))))
                  nil)))
      ;; Follow aliasing.
      (or (ignore-errors (indirect-variable name)) name))))