- (let (allbind bind minorbind localbind globalbind)
- (setq bind (key-binding keyseq))
- ;; If KEYSEQ is a prefix key, then BIND is either nil
- ;; or a symbol defined as a keymap (which satisfies keymapp).
- (if (keymapp bind)
- (setq bind nil))
- ;; If we have a non-keymap definition, return that.
- (or bind
- (progn
- ;; Otherwise, it is a prefix, so make a list of the subcommands.
- ;; Make a list of all the bindings in all the keymaps.
- (setq minorbind (mapcar 'cdr (minor-mode-key-binding keyseq)))
- (setq localbind (local-key-binding keyseq))
- (setq globalbind (copy-sequence (cdr (global-key-binding keyseq))))
-
- ;; If items have been redefined/undefined locally, remove them from
- ;; the global list.
- (dolist (minor minorbind)
- (dolist (item (cdr minor))
- (setq globalbind (assq-delete-all (car-safe item) globalbind))))
- (dolist (item (cdr localbind))
- (setq globalbind (assq-delete-all (car-safe item) globalbind)))
-
- (setq globalbind (cons 'keymap globalbind))
- (setq allbind (cons globalbind (cons localbind minorbind)))
-
- ;; Merge all the elements of ALLBIND into one keymap.
- (mapc (lambda (in)
- (if (and (symbolp in) (keymapp in))
- (setq in (symbol-function in)))
- (and in (keymapp in)
- (if (keymapp bind)
- (setq bind (nconc bind (copy-sequence (cdr in))))
- (setq bind (copy-sequence in)))))
- allbind)
- ;; Return that keymap.
- bind))))
-
-;; Huh? What's that about? --Stef
-(add-hook 'calendar-load-hook (lambda () (require 'cal-menu)))