Function: speedbar-reconfigure-keymaps
speedbar-reconfigure-keymaps is a byte-compiled function defined in
speedbar.el.gz.
Signature
(speedbar-reconfigure-keymaps)
Documentation
Reconfigure the menu-bar in a speedbar frame.
Different menu items are displayed depending on the current display mode and the existence of packages.
Source Code
;; Defined in /usr/src/emacs/lisp/speedbar.el.gz
(defun speedbar-reconfigure-keymaps ()
"Reconfigure the menu-bar in a speedbar frame.
Different menu items are displayed depending on the current display mode
and the existence of packages."
(let ((md (append
speedbar-easymenu-definition-base
(if speedbar-shown-directories
;; file display mode version
(speedbar-initial-menu)
(save-excursion
(dframe-select-attached-frame speedbar-frame)
(eval (nth 1 (assoc speedbar-initial-expansion-list-name
speedbar-initial-expansion-mode-alist)))))
;; Dynamic menu stuff
'("-")
(list (cons "Displays"
(let ((displays nil)
(alist speedbar-initial-expansion-mode-alist))
(while alist
(setq displays
(cons
(vector
(capitalize (car (car alist)))
(list
'speedbar-change-initial-expansion-list
(car (car alist)))
:style 'radio
:selected
`(string= ,(car (car alist))
speedbar-initial-expansion-list-name)
)
displays))
(setq alist (cdr alist)))
displays)))
;; The trailer
speedbar-easymenu-definition-trailer))
(localmap (save-excursion
(let ((cf (selected-frame)))
(prog2
(dframe-select-attached-frame speedbar-frame)
(if (local-variable-p
'speedbar-special-mode-key-map
(current-buffer))
speedbar-special-mode-key-map)
(select-frame cf))))))
(with-current-buffer speedbar-buffer
(use-local-map (or localmap
(speedbar-initial-keymap)
;; This creates a small keymap we can glom the
;; menu adjustments into.
(speedbar-make-specialized-keymap)))
;; Now add the new menu
(easy-menu-define speedbar-menu-map (current-local-map)
"Speedbar menu" md))
(run-hooks 'speedbar-reconfigure-keymaps-hook)))