tags:

views:

879

answers:

2
A: 

Well, I decided to not be a reputation-whore and find the answer myself. I looked in cscope.el as shown on the Emacs wiki, as well as the xcscope.el that comes with the cscope RPM package on RHEL.

Neither appear to give a way to do what I'm wanting. The way is probably to edit the ELisp by adding a package variable like *browse-buffer* or something and just initialize that variable if not already initialized the first time the user does [C-c C-s g] or whatever, and always have the resulting code shown in *browse-buffer*. Then the user can put the *browse-buffer* wherever he wants it.

Ben Collins
+8  A: 

Put this in your .emacs file:

;; Toggle window dedication

(defun toggle-window-dedicated ()

"Toggle whether the current active window is dedicated or not"

(interactive)

(message

(if (let (window (get-buffer-window (current-buffer)))

   (set-window-dedicated-p window 

 (not (window-dedicated-p window))))

"Window '%s' is dedicated"

"Window '%s' is normal")

(current-buffer)))

Then bind it to some key - I use the Pause key:

(global-set-key [pause] 'toggle-window-dedicated)

And then use it to "dedicate" the window you want locked. then cscope can only open files from its result window in some OTHER window. Works a charm. I specifically use it for exactly this purpose - keeping one source file always on screen, while using cscope in a second buffer/window, and looking at cscope results in a third.

Frank Klotz
awesome! I knew it could be done...I'm usually just too pressed for time to dig into the elisp api. Thanks!
Ben Collins