From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hadron Quark Newsgroups: gmane.emacs.help Subject: Re: emacs and buffer switching Date: Wed, 06 Dec 2006 18:30:30 +0100 Message-ID: References: <0jirgpyjeu.fsf@gmail.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165426825 8317 80.91.229.10 (6 Dec 2006 17:40:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Dec 2006 17:40:25 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 06 18:40:23 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gs0ko-0000a3-HU for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Dec 2006 18:40:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gs0ko-0007AA-2u for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Dec 2006 12:40:22 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-X-Trace: individual.net gr0hZamrk0kV2m/qd6fRcAzS8kpaMdqXT/pj6N6bUK/BWSTe+1 X-Orig-Path: news.individual.net!news X-Face: 2h#||Cd#d%F*NCm59[_6/{1a@jy%; |j>{D~4^gKg(^i%7j0IK?+,/GmW&:CD5fEKb_! Cancel-Lock: sha1:4b/VY6IQsnLbDgcPK4HkSQjmYxI= Original-Xref: shelby.stanford.edu gnu.emacs.help:143687 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:39289 Archived-At: Kevin Rodgers writes: > Hadron Quark wrote: >> I have a c-mode-common hook which activates ecb (code browser) when I >> load a c file. But how to activate it when I switch to an existing c >> buffer? I am already switching layouts with winring, but wish for the >> ecb layout to pop up if I switch from a single buffer frame to an >> already loaded c file. > > c-mode-common-hook is the wrong place to do that. But something like > this might work for you: > > (defun ecb-window-configuration () > (when (derived-mode-p 'c-mode) > ;; activate ECB here > )) > > (add-hook 'window-configuration-change-hook 'ecb-window-configuration) Thanks Kevin : almost there. ecb activates, but I get (instead of the c file in the right hand buffer): Warning: `semantic-before-toplevel-bovination-hook' is an obsolete variable; use `semantic--before-fetch-tags-hook' instead. Error: Wrong type argument: window-live-p, # Advice on how to track down the problem? Also, what code to turn off ecb if its not a c-mode derivative? Some form of "else" in the code above which then calls ecb-deactivate()?