Function: mh-speed-update-current-folder
mh-speed-update-current-folder is a byte-compiled function defined in
mh-speed.el.gz.
Signature
(mh-speed-update-current-folder FORCE)
Documentation
Update speedbar highlighting of the current folder.
The function tries to be smart so that work done is minimized. The currently highlighted folder is cached and no highlighting happens unless it changes. Also highlighting is suspended while the speedbar frame is selected. Otherwise you get the disconcerting behavior of folders popping open on their own when you are trying to navigate around in the speedbar buffer.
The update is always carried out if FORCE is non-nil.
Source Code
;; Defined in /usr/src/emacs/lisp/mh-e/mh-speed.el.gz
(defun mh-speed-update-current-folder (force)
"Update speedbar highlighting of the current folder.
The function tries to be smart so that work done is minimized.
The currently highlighted folder is cached and no highlighting
happens unless it changes.
Also highlighting is suspended while the speedbar frame is selected.
Otherwise you get the disconcerting behavior of folders popping open
on their own when you are trying to navigate around in the speedbar
buffer.
The update is always carried out if FORCE is non-nil."
(let* ((lastf (selected-frame))
(newcf (save-excursion
(mh-speed-select-attached-frame)
(prog1 (mh-speed-extract-folder-name (buffer-name))
(select-frame lastf))))
(lastb (current-buffer))
(case-fold-search t))
(when (or force
(and mh-speed-refresh-flag (not (eq lastf speedbar-frame)))
(and (stringp newcf)
(equal (substring newcf 0 1) "+")
(not (equal newcf mh-speed-last-selected-folder))))
(setq mh-speed-refresh-flag nil)
(select-frame speedbar-frame)
(set-buffer speedbar-buffer)
;; Remove highlight from previous match...
(mh-speed-highlight mh-speed-last-selected-folder 'mh-speedbar-folder)
;; If we found a match highlight it...
(when (mh-speed-goto-folder newcf)
(mh-speed-highlight newcf 'mh-speedbar-selected-folder))
(setq mh-speed-last-selected-folder newcf)
(speedbar-position-cursor-on-line)
(set-window-point (frame-first-window speedbar-frame) (point))
(set-buffer lastb)
(select-frame lastf))
(when (eq lastf speedbar-frame)
(setq mh-speed-refresh-flag t))))