emacs-devel
[Top][All Lists]
Advanced

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

Re: Window/buffer management in gdb-ui


From: Stefan Monnier
Subject: Re: Window/buffer management in gdb-ui
Date: Fri, 26 Nov 2004 17:43:51 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

[ Maybe you know this already, but all your email to me gets flagged as spam
  because of SORBS.  I know SORBS sucks, but I haven't managed to convince
  the sysadmins here and they control the spam filter.  Luckily SPAM is not
  thrown away, but since your email ends up in a separate "spam" folder,
  it's pretty likely that I might overlook some of your messages to me :-( ]

>> Perhaps it would be better to have only one dedicated source window at
>> a time (the one where the overlay-arrow is).

> I would like the reverse actually: one undedicated window (the source buffer).
> At the moment the GUD and the source and, sometimes the other gdb-related
> buffers will be undedicated. It means that they might be replaced by new
> buffers if they are not in their own frame.

Actually I think GUD might have better luck if it didn't use get-lru-window.
Instead it could have a "gud-source-window" variable that tries to keep
track of where to display source code.  I know you had something like that
in the past and I bitched about it, so obviously it has to be
done carefully.  How 'bout something along the following lines:

 (defvar gud-source-window nil)

 (defun gud-display-source-buffer (buf)
   (cond
    ((get-buffer-window buf 0)
     ;; If it's already displayed, just raise that window.
     (display-buffer buf))
    ((and gud-source-window (window-live-p gud-source-window))
     ;; If there's a source-window, just use it.
     (select-window gud-source-window)
     ;; Problem here: we don't raise the corresponding frame, but normally
     ;; this window is alongside the gud-comint-buffer, so it should
     ;; hopefully be well within sight.  We'd really want to use
     ;; something like (display-buffer buf 'same-window) instead.
     (switch-to-buffer buf))
    (t
     ;; Else, pop a new window.
     (pop-to-buffer gud-comint-buffer) ; Select a GUD-related frame.
     (let ((pop-up-windows t))
       (setq gud-source-window (display-buffer buf))))))

It'll not follow my own setup's normal behavior, but at least it won't mess
it up.


        Stefan




reply via email to

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