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 22:32:24 +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 1165441249 6873 80.91.229.10 (6 Dec 2006 21:40:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Dec 2006 21:40:49 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 06 22:40:49 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 1Gs4VR-0003sj-K2 for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Dec 2006 22:40:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gs4VR-0000xG-3d for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Dec 2006 16:40:45 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsserver.news.garr.it!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 67 Original-X-Trace: individual.net E4fVGjuSKwp0hWn70EFPEgOW2c+3cgq+EAnSwdaEw81Rety8eS 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:pSUZZuF53gwg/1XEhsaYvmCUcKU= Original-Xref: shelby.stanford.edu gnu.emacs.help:143693 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:39295 Archived-At: Kevin Rodgers writes: > Hadron Quark wrote: >> Kevin Rodgers writes: >>> (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? > > (setq debug-on-error t) > >> 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()? > > Isn't it just > > (if (derived-mode-p 'c-mode) > (ecb-activate) > (ecb-deactivate)) Actually, I had already done that but thanks for the reply. Alas, its all a little more complicated. I need to call winring-init on the FIRST call to my ecb function but not on the others. In addition, if I manually turn off ecb, it should not turn it back on when I move to a c derivative. at the mo I have: (defun ecb-first () (interactive) (ecb-activate) (ecb-winman-winring-enable-support) (winring-initialize) ) (defun ecb-window-configuration () (if(derived-mode-p 'c-mode) (ecb-activate) ;; **** call ecb-first on FIRST call?? ;; (ecb-deactivate); )) (add-hook 'window-configuration-change-hook 'ecb-window-configuration) The problem is the need to activate ecb before winring if you want winring to support ecb. its all very messy and my elisp istn up to the task :( --