help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs and buffer switching


From: Hadron Quark
Subject: Re: emacs and buffer switching
Date: Wed, 06 Dec 2006 22:32:24 +0100

Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Hadron Quark wrote:
>> Kevin Rodgers <ihs_4664@yahoo.com> 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, #<window 53>
>>
>>
>> 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 :(





-- 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]