From 570a1714808328275b04cb3d9a10cb7f7355c70e Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 10 Mar 2012 15:58:54 +0800 Subject: [PATCH] Fix speedbar highlighting bug. * lisp/speedbar.el (speedbar-unhighlight-one-tag-line): Avoid unhighlighting due to frame switching. Fixes: debbugs:10275 --- lisp/ChangeLog | 5 +++++ lisp/speedbar.el | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3b28cd8777..531c363d3f0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-03-10 Martin Rudalics + + * speedbar.el (speedbar-unhighlight-one-tag-line): Avoid + unhighlighting due to frame switching (Bug#10275). + 2012-03-10 Chong Yidong * minibuffer.el (completion-in-region, completion-help-at-point): diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 89211b2b86e..bb1debb4552 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -3987,11 +3987,11 @@ TEXT is the buffer's name, TOKEN and INDENT are unused." (defun speedbar-unhighlight-one-tag-line () "Unhighlight the currently highlighted line." - (if speedbar-highlight-one-tag-line - (progn - (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)) + (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))) (defun speedbar-recenter-to-top () "Recenter the current buffer so point is on the top of the window." -- 2.39.2