unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org, "Kim F. Storm" <storm@cua.dk>
Subject: Re: Window/buffer management in gdb-ui
Date: Fri, 26 Nov 2004 17:43:51 -0500	[thread overview]
Message-ID: <87llcotfpw.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <16807.20180.223615.625880@farnswood.snap.net.nz> (Nick Roberts's message of "Sat, 27 Nov 2004 04:42:12 +1300")

[ 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	other threads:[~2004-11-26 22:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-24 14:59 Window/buffer management in gdb-ui Stefan Monnier
2004-11-24 20:09 ` Nick Roberts
2004-11-24 20:42   ` {Spam?} " Stefan Monnier
2004-11-25  2:30     ` Nick Roberts
2004-11-25 16:26       ` {Spam?} " Stefan
2004-11-24 21:30   ` Kai Grossjohann
2004-11-24 21:39     ` Kai Grossjohann
     [not found] ` <jwvpt23arhf.fsf-monnier+emacs@gnu.org>
2004-11-25  2:14   ` Nick Roberts
2004-11-25 16:07     ` Stefan Monnier
2004-11-25 23:59       ` Nick Roberts
2004-11-26  4:21         ` Stefan Monnier
2004-11-26 15:53           ` Nick Roberts
2004-11-26 22:46             ` {Spam?} " Stefan Monnier
2004-11-26 10:16         ` Kim F. Storm
2004-11-26 15:42           ` Nick Roberts
2004-11-26 22:43             ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87llcotfpw.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=storm@cua.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).