gnu.emacs.help
[Top] [All Lists]

Re: emacs and buffer switching

Subject: Re: emacs and buffer switching
From: Hadron Quark
Date: Wed, 06 Dec 2006 18:30:30 +0100
Newsgroups: gnu.emacs.help
Kevin Rodgers <ihs_4664@xxxxxxxxx> 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, #<window 53>


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()?
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@xxxxxxx
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

<Prev in Thread] Current Thread [Next in Thread>