From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#10275: speedbar highlights first selected item in speedbar-highlight-face Date: Wed, 14 Dec 2011 18:23:34 +0100 Message-ID: <4EE8DB96.9020500@gmx.at> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1323883497 12274 80.91.229.12 (14 Dec 2011 17:24:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2011 17:24:57 +0000 (UTC) Cc: 10275@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 14 18:24:52 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RasZX-0004cF-Vs for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Dec 2011 18:24:52 +0100 Original-Received: from localhost ([::1]:46136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RasZX-0003kw-Fm for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Dec 2011 12:24:51 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RasZQ-0003dQ-I5 for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2011 12:24:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RasZJ-000595-UJ for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2011 12:24:44 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RasZJ-00058v-Sk for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2011 12:24:37 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Rasag-0003fC-4r for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2011 12:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2011 17:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10275 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10275-submit@debbugs.gnu.org id=B10275.132388350514013 (code B ref 10275); Wed, 14 Dec 2011 17:26:02 +0000 Original-Received: (at 10275) by debbugs.gnu.org; 14 Dec 2011 17:25:05 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RasZk-0003dy-S5 for submit@debbugs.gnu.org; Wed, 14 Dec 2011 12:25:05 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1RasZh-0003dS-Uc for 10275@debbugs.gnu.org; Wed, 14 Dec 2011 12:25:03 -0500 Original-Received: (qmail invoked by alias); 14 Dec 2011 17:23:35 -0000 Original-Received: from 62-47-51-218.adsl.highway.telekom.at (EHLO [62.47.51.218]) [62.47.51.218] by mail.gmx.net (mp055) with SMTP; 14 Dec 2011 18:23:35 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+lE3Qdok2lK9jpT5Nrx8xUUJnGDbfG2jAPA8V5YA Qmt0f8zr+Zj3IS User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 14 Dec 2011 12:26:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:54959 Archived-At: > 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