emacs-devel
[Top][All Lists]
Advanced

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

Window/buffer management in gdb-ui


From: Nick Roberts
Subject: Window/buffer management in gdb-ui
Date: Thu, 25 Nov 2004 09:09:31 +1300

 > The window-/buffer management in gdb-ui is not working well in my setup.
 > And the code in gdb-ui looks pretty frightening.  E.g. things like:
 > 
 >    (defun dedicated-switch-to-buffer (name)
 >      (set-window-dedicated-p 
 >       (get-buffer-window
 >        (switch-to-buffer name)) t))
 > 
 > make me cringe:invo
 > - messes up the namespace

I know that standard practice is to prefix such functions, in general, with
gdb but this isn't really a gdb-related function. I felt that the occasional
violation i.e one for the whole of gdb-ui.el, would not cause a problem, in
practice, and may help prevent duplication with locally defined functions
performing the same task.

 > - it changes the currently selected window and makes it dedicated
 >   (because we know that (get-buffer-window (switch-to-buffer name))
 >    is always equal to (selected-window))

Its only used when gdb-ui sets up/restores the windows.

 > I understand that maybe my setup is not representative, but maybe if you
 > could describe what behavior you're trying to get, I can help you come up
 > with a way to code it that doesn't plays nicely in my situation.
 >
 > I.e. what is the behavior you're trying to get.  You can describe it with
 > a mix of description of how *you* want it plus some examples of problematic
 > behaviors you'd like to avoid (i.e. bug-reports).

I noticed two things. Firstly, when the user displays a gdb-related buffer in
another window (M-x gdb-display-BUFFERTYPE-buffer or from the menubar,
GUD->GDB-Windows->...) it can replace an existing buffer that the user wants
to remain visible. These changes ensure that, in this case, a gdb-related
buffer is split to provide space for the new buffer. Secondly, if the user
wants to do something different in between debugging, visit info or list
buffers, for example, it is best for that buffer to appear in a separate
frame.

Its a `work in progress', I haven't thought it through yet. Since the "feature
freeze" could extend to infinity, I figured I'd have enough time to put it
right. Also, as its been quiet recently, I thought maybe everyone was using
"-fullname". I guess this is one way of finding out!

 > As for my own setup, I use 1 buffer per frame and 1 frame per buffer with
 > a separate dedicated minibuffer.  In my setup, any code that uses
 > `switch-to-buffer' is a pain in the rear.

You never have split windows? How do you arrange that? What is a "separate
dedicated minibuffer"?


  Nick




reply via email to

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