GNU bug report logs -
#10275
speedbar highlights first selected item in speedbar-highlight-face
Previous Next
Full log
View this message in rfc822 format
> emacs -Q -f speedbar
> ;; then select any source file in speedbar, click to unfold it, and
> click over any variable or function.
>
> What happens:
> - The file is highlighted in the Speedbar frame, with `speedbar-highlight-face'.
> - The file is loaded into a buffer and displayed in a window.
> - The selected variable or function is shown, and also highlighted
> with `speedbar-highlight-face'.
>
> Clicking into another subitem (or even the same one) of the same file
> does not bring back the highlighting. But clicking it into another
> file's subitem does. It happens every time a new file is selected,
> even if previously selected.
>
> I'm not sure this is a bug, because the behavior already happens in
> 22.1, but certainly is unexpected, and the docstring of
> `speedbar-highlight-face' talks only about buttons, not the source
> file.
What happens is that after the mouse click speedbar does highlight the
line via `speedbar-highlight-one-tag-line' which installs in
`pre-command-hook' the function `speedbar-unhighlight-one-tag-line'.
Next comes a switch-frame event to select the frame of the buffer where
the highlight is and executing the corresponding `handle-switch-frame'
command triggers the `pre-command-hook' which swallows the highlight
immediately.
An easy work-around is
(defun speedbar-unhighlight-one-tag-line ()
"Unhighlight the currently highlighted line."
(when (and speedbar-highlight-one-tag-line
(not (eq this-command 'handle-switch-frame)))
(speedbar-delete-overlay speedbar-highlight-one-tag-line)
(setq speedbar-highlight-one-tag-line nil)
(remove-hook 'pre-command-hook 'speedbar-unhighlight-one-tag-line)))
but I have no idea what Eric intended to accomplish in the first place
and delving into the code of speedbar or dframe is no fun at all.
martin
This bug report was last modified 13 years and 159 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.