unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
@ 2014-06-03 15:17 Michael Welsh Duggan
  2014-06-03 16:08 ` martin rudalics
  2015-03-09 14:02 ` bug#17675: patch Dima Kogan
  0 siblings, 2 replies; 19+ messages in thread
From: Michael Welsh Duggan @ 2014-06-03 15:17 UTC (permalink / raw)
  To: 17675

[-- Attachment #1: Type: text/plain, Size: 1662 bytes --]

This regression might have been around for a couple emacs versions.  I
don't recall when it started.  Probably about the same time as the
window management overhaul.

Assuming that you are in the same directory as the included foo.c
file...

Compile the file with debugging support:
    gcc -ggdb -o foo foo.c

Then start emacs:
    emacs -Q

Split the frame into two windows:
    C-x 4 f foo.c RET

Debugging sequence 1

    M-x gdb RET
    RET         (accepting default "gdb -i=me foo")
    start RET

At this point, notice that *gud-foo* buffer is gone, as foo.c has
replaced it.  At some point in time in the past, foo.c would end up
replacing the other window (the *scratch* buffer).  That would be the
desired behavior, as I would be able to continue using the *gud* buffer.

    C-x 4 b RET   (accepting default "*gud-foo*")
    n RET RET

Now *input/output of foo* replaced the *gud-foo* buffer.  I can't say
much about this, as I normally use gdb a different way.  But it seems
sub-optimal.  For my usual debugging habits, see Sequence 2.

Debugging sequence 2

Same set-up as for sequence 1, then as follows:

    M-x gud-gdb RET
    RET               (accepting default "gdb --fullname foo")
    start RET

At this point, notice that *gud-foo* buffer is gone, as foo.c has
replaced it.  At some point in time in the past, foo.c would end up
replacing the other window (the *scratch* buffer).  That would be the
desired behavior, as I would be able to continue using the *gud* buffer.

If need be, I can create a slightly more elaborate example containing
more than one C file, and we can see *gud-foo* getting buried again as
other C files pop up.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: foo.c --]
[-- Type: text/x-csrc, Size: 130 bytes --]

#include <stdio.h>

int main(void)
{
    int i;

    for (i = 0; i < 10; ++i) {
        printf("%d\n", i);
    }

    return 1;
}

[-- Attachment #3: Type: text/plain, Size: 20903 bytes --]


In GNU Emacs 24.4.50.2 (x86_64-unknown-linux-gnu, X toolkit)
 of 2014-05-17 on maru2
Repository revision: 111224 md5i@md5i.com-20140518034804-31o5ypzs63e0g96q
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Debian GNU/Linux unstable (sid)

Configured using:
 `configure --without-toolkit-scroll-bars --with-x-toolkit=lucid
 'CFLAGS=-Og -ggdb' --with-wide-int'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: C/l

Minor modes in effect:
  flyspell-mode: t
  shell-dirtrack-mode: t
  display-time-mode: t
  diff-auto-refine-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  abbrev-mode: t

Recent input:
C-x 1 d d C-e C-a SPC <help-echo> <switch-frame> C-x 
C-f / C-g C-g C-x C-f / t m <tab> f o <tab> . <tab> 
<return> C-x 1 C-v M-v C-x h C-w i n t SPC m a i n 
( ) <backspace> v o i d ) <return> { <return> } C-p 
<return> <tab> r e t u r n SPC 1 ; <return> C-k C-p 
C-p C-e <return> <tab> i n t SPC i l ; <backspace> 
<backspace> ; <return> <return> <tab> C-p <tab> f r 
p <backspace> <backspace> <escape> < <return> <return> 
C-p C-p # i n c l u d e SPC < s t d i o . h > C-n C-n 
C-n C-n C-n o f SPC <backspace> <backspace> r C-a <return> 
C-e SPC ( i SPC = SPC 0 ; SPC i SPC < SPC 1 0 ; SPC 
+ + i ) SPC { <return> } C-p <tab> C-n <tab> C-p C-e 
<return> <tab> C-_ C-_ C-_ C-_ C-_ <return> <tab> p 
r i n t f ( " % d " SPC i <backspace> <backspace> <backspace> 
\ n " , SPC i ) ; <return> } <tab> M-x e l e c <tab> 
<tab> <tab> i n <tab> m <tab> <return> <backspace> 
C-p C-e <return> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <return> } C-n C-a C-k C-x C-s <switch-frame> 
<switch-frame> M-x c o m p i l e <return> C-g C-g M-x 
c o m p i l e <return> C-a C-k g c c SPC - i o <backspace> 
<backspace> g g d b SPC - o SPC f o o SPC f o o . c 
<return> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> M-x r 
e p o r t - e m <tab> <return>

Recent messages:
Wrote /home/md5i/.newsrc-dribble [2 times]
(Saved .newsrc-dribble)
Compilation finished
You can run the command `compile' with M-RET
Compilation finished
Checking new news...
Reading active file from ~/Mail via nnml...done
nnimap read 0k from localhost
Reading active file via nndraft...done
Checking new news...done

Load-path shadows:
/home/md5i/src/elisp/gnus/lisp/compface hides /home/md5i/src/elisp/gnus/contrib/compface
/home/md5i/src/elisp/gnus/lisp/md4 hides /usr/local/share/emacs/24.4.50/lisp/md4
/home/md5i/src/elisp/gnus/lisp/format-spec hides /usr/local/share/emacs/24.4.50/lisp/format-spec
/home/md5i/src/elisp/gnus/lisp/password-cache hides /usr/local/share/emacs/24.4.50/lisp/password-cache
/home/md5i/src/elisp/gnus/lisp/hex-util hides /usr/local/share/emacs/24.4.50/lisp/hex-util
/home/md5i/src/elisp/gnus/lisp/color hides /usr/local/share/emacs/24.4.50/lisp/color
/home/md5i/src/elisp/gnus/lisp/dns-mode hides /usr/local/share/emacs/24.4.50/lisp/textmodes/dns-mode
/home/md5i/src/elisp/gnus/lisp/tls hides /usr/local/share/emacs/24.4.50/lisp/net/tls
/home/md5i/src/elisp/gnus/lisp/ntlm hides /usr/local/share/emacs/24.4.50/lisp/net/ntlm
/home/md5i/src/elisp/gnus/lisp/sasl hides /usr/local/share/emacs/24.4.50/lisp/net/sasl
/home/md5i/src/elisp/gnus/lisp/sasl-ntlm hides /usr/local/share/emacs/24.4.50/lisp/net/sasl-ntlm
/home/md5i/src/elisp/gnus/lisp/sasl-digest hides /usr/local/share/emacs/24.4.50/lisp/net/sasl-digest
/home/md5i/src/elisp/gnus/lisp/sasl-cram hides /usr/local/share/emacs/24.4.50/lisp/net/sasl-cram
/home/md5i/src/elisp/gnus/lisp/netrc hides /usr/local/share/emacs/24.4.50/lisp/net/netrc
/home/md5i/src/elisp/gnus/lisp/hmac-def hides /usr/local/share/emacs/24.4.50/lisp/net/hmac-def
/home/md5i/src/elisp/gnus/lisp/hmac-md5 hides /usr/local/share/emacs/24.4.50/lisp/net/hmac-md5
/home/md5i/src/elisp/gnus/lisp/dig hides /usr/local/share/emacs/24.4.50/lisp/net/dig
/home/md5i/src/elisp/gnus/lisp/dns hides /usr/local/share/emacs/24.4.50/lisp/net/dns
/home/md5i/src/elisp/gnus/lisp/uudecode hides /usr/local/share/emacs/24.4.50/lisp/mail/uudecode
/home/md5i/src/elisp/gnus/lisp/hashcash hides /usr/local/share/emacs/24.4.50/lisp/mail/hashcash
/home/md5i/src/elisp/gnus/lisp/binhex hides /usr/local/share/emacs/24.4.50/lisp/mail/binhex
/home/md5i/src/elisp/gnus/lisp/gnus-icalendar hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-icalendar
/home/md5i/src/elisp/gnus/lisp/gnus-art hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-art
/home/md5i/src/elisp/gnus/lisp/gnus-registry hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-registry
/home/md5i/src/elisp/gnus/lisp/message hides /usr/local/share/emacs/24.4.50/lisp/gnus/message
/home/md5i/src/elisp/gnus/lisp/mml2015 hides /usr/local/share/emacs/24.4.50/lisp/gnus/mml2015
/home/md5i/src/elisp/gnus/lisp/mm-uu hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-uu
/home/md5i/src/elisp/gnus/lisp/auth-source hides /usr/local/share/emacs/24.4.50/lisp/gnus/auth-source
/home/md5i/src/elisp/gnus/lisp/mm-decode hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-decode
/home/md5i/src/elisp/gnus/lisp/mm-view hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-view
/home/md5i/src/elisp/gnus/lisp/gnus-fun hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-fun
/home/md5i/src/elisp/gnus/lisp/gmm-utils hides /usr/local/share/emacs/24.4.50/lisp/gnus/gmm-utils
/home/md5i/src/elisp/gnus/lisp/gnus-start hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-start
/home/md5i/src/elisp/gnus/lisp/gnus-sum hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-sum
/home/md5i/src/elisp/gnus/lisp/gnus-int hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-int
/home/md5i/src/elisp/gnus/lisp/spam hides /usr/local/share/emacs/24.4.50/lisp/gnus/spam
/home/md5i/src/elisp/gnus/lisp/nnagent hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnagent
/home/md5i/src/elisp/gnus/lisp/legacy-gnus-agent hides /usr/local/share/emacs/24.4.50/lisp/gnus/legacy-gnus-agent
/home/md5i/src/elisp/gnus/lisp/smiley hides /usr/local/share/emacs/24.4.50/lisp/gnus/smiley
/home/md5i/src/elisp/gnus/lisp/gnus-msg hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-msg
/home/md5i/src/elisp/gnus/lisp/gnus-uu hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-uu
/home/md5i/src/elisp/gnus/lisp/gnus-draft hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-draft
/home/md5i/src/elisp/gnus/lisp/spam-wash hides /usr/local/share/emacs/24.4.50/lisp/gnus/spam-wash
/home/md5i/src/elisp/gnus/lisp/spam-report hides /usr/local/share/emacs/24.4.50/lisp/gnus/spam-report
/home/md5i/src/elisp/gnus/lisp/nnvirtual hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnvirtual
/home/md5i/src/elisp/gnus/lisp/gnus-mh hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-mh
/home/md5i/src/elisp/gnus/lisp/gnus-html hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-html
/home/md5i/src/elisp/gnus/lisp/gnus-score hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-score
/home/md5i/src/elisp/gnus/lisp/nnmairix hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnmairix
/home/md5i/src/elisp/gnus/lisp/gnus-vm hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-vm
/home/md5i/src/elisp/gnus/lisp/nnir hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnir
/home/md5i/src/elisp/gnus/lisp/gnus-ml hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-ml
/home/md5i/src/elisp/gnus/lisp/gnus-kill hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-kill
/home/md5i/src/elisp/gnus/lisp/nnregistry hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnregistry
/home/md5i/src/elisp/gnus/lisp/nndiary hides /usr/local/share/emacs/24.4.50/lisp/gnus/nndiary
/home/md5i/src/elisp/gnus/lisp/gnus-dup hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-dup
/home/md5i/src/elisp/gnus/lisp/gnus-picon hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-picon
/home/md5i/src/elisp/gnus/lisp/gnus-gravatar hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-gravatar
/home/md5i/src/elisp/gnus/lisp/gnus-diary hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-diary
/home/md5i/src/elisp/gnus/lisp/nntp hides /usr/local/share/emacs/24.4.50/lisp/gnus/nntp
/home/md5i/src/elisp/gnus/lisp/mm-partial hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-partial
/home/md5i/src/elisp/gnus/lisp/gnus-notifications hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-notifications
/home/md5i/src/elisp/gnus/lisp/gnus-logic hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-logic
/home/md5i/src/elisp/gnus/lisp/gnus-sieve hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-sieve
/home/md5i/src/elisp/gnus/lisp/gnus-mlspl hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-mlspl
/home/md5i/src/elisp/gnus/lisp/gnus-salt hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-salt
/home/md5i/src/elisp/gnus/lisp/gnus-group hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-group
/home/md5i/src/elisp/gnus/lisp/gnus-srvr hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-srvr
/home/md5i/src/elisp/gnus/lisp/nnspool hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnspool
/home/md5i/src/elisp/gnus/lisp/gnus-topic hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-topic
/home/md5i/src/elisp/gnus/lisp/gnus-demon hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-demon
/home/md5i/src/elisp/gnus/lisp/nnmaildir hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnmaildir
/home/md5i/src/elisp/gnus/lisp/nndraft hides /usr/local/share/emacs/24.4.50/lisp/gnus/nndraft
/home/md5i/src/elisp/gnus/lisp/nnimap hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnimap
/home/md5i/src/elisp/gnus/lisp/nnmh hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnmh
/home/md5i/src/elisp/gnus/lisp/nndir hides /usr/local/share/emacs/24.4.50/lisp/gnus/nndir
/home/md5i/src/elisp/gnus/lisp/gnus-agent hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-agent
/home/md5i/src/elisp/gnus/lisp/nnrss hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnrss
/home/md5i/src/elisp/gnus/lisp/gnus-sync hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-sync
/home/md5i/src/elisp/gnus/lisp/gnus-delay hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-delay
/home/md5i/src/elisp/gnus/lisp/nnml hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnml
/home/md5i/src/elisp/gnus/lisp/nnfolder hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnfolder
/home/md5i/src/elisp/gnus/lisp/nndoc hides /usr/local/share/emacs/24.4.50/lisp/gnus/nndoc
/home/md5i/src/elisp/gnus/lisp/gnus-cus hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-cus
/home/md5i/src/elisp/gnus/lisp/nnweb hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnweb
/home/md5i/src/elisp/gnus/lisp/nnmbox hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnmbox
/home/md5i/src/elisp/gnus/lisp/nnmail hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnmail
/home/md5i/src/elisp/gnus/lisp/nnbabyl hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnbabyl
/home/md5i/src/elisp/gnus/lisp/gnus-spec hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-spec
/home/md5i/src/elisp/gnus/lisp/nneething hides /usr/local/share/emacs/24.4.50/lisp/gnus/nneething
/home/md5i/src/elisp/gnus/lisp/gnus-eform hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-eform
/home/md5i/src/elisp/gnus/lisp/gnus hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus
/home/md5i/src/elisp/gnus/lisp/mm-url hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-url
/home/md5i/src/elisp/gnus/lisp/mm-extern hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-extern
/home/md5i/src/elisp/gnus/lisp/gnus-undo hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-undo
/home/md5i/src/elisp/gnus/lisp/gnus-win hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-win
/home/md5i/src/elisp/gnus/lisp/mail-source hides /usr/local/share/emacs/24.4.50/lisp/gnus/mail-source
/home/md5i/src/elisp/gnus/lisp/nngateway hides /usr/local/share/emacs/24.4.50/lisp/gnus/nngateway
/home/md5i/src/elisp/gnus/lisp/mml hides /usr/local/share/emacs/24.4.50/lisp/gnus/mml
/home/md5i/src/elisp/gnus/lisp/gnus-cite hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-cite
/home/md5i/src/elisp/gnus/lisp/mml1991 hides /usr/local/share/emacs/24.4.50/lisp/gnus/mml1991
/home/md5i/src/elisp/gnus/lisp/gnus-bookmark hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-bookmark
/home/md5i/src/elisp/gnus/lisp/deuglify hides /usr/local/share/emacs/24.4.50/lisp/gnus/deuglify
/home/md5i/src/elisp/gnus/lisp/gravatar hides /usr/local/share/emacs/24.4.50/lisp/gnus/gravatar
/home/md5i/src/elisp/gnus/lisp/score-mode hides /usr/local/share/emacs/24.4.50/lisp/gnus/score-mode
/home/md5i/src/elisp/gnus/lisp/nnoo hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnoo
/home/md5i/src/elisp/gnus/lisp/nnnil hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnnil
/home/md5i/src/elisp/gnus/lisp/nnheader hides /usr/local/share/emacs/24.4.50/lisp/gnus/nnheader
/home/md5i/src/elisp/gnus/lisp/gnus-util hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-util
/home/md5i/src/elisp/gnus/lisp/spam-stat hides /usr/local/share/emacs/24.4.50/lisp/gnus/spam-stat
/home/md5i/src/elisp/gnus/lisp/rfc2047 hides /usr/local/share/emacs/24.4.50/lisp/gnus/rfc2047
/home/md5i/src/elisp/gnus/lisp/rfc2231 hides /usr/local/share/emacs/24.4.50/lisp/gnus/rfc2231
/home/md5i/src/elisp/gnus/lisp/utf7 hides /usr/local/share/emacs/24.4.50/lisp/gnus/utf7
/home/md5i/src/elisp/gnus/lisp/mml-smime hides /usr/local/share/emacs/24.4.50/lisp/gnus/mml-smime
/home/md5i/src/elisp/gnus/lisp/smime hides /usr/local/share/emacs/24.4.50/lisp/gnus/smime
/home/md5i/src/elisp/gnus/lisp/registry hides /usr/local/share/emacs/24.4.50/lisp/gnus/registry
/home/md5i/src/elisp/gnus/lisp/yenc hides /usr/local/share/emacs/24.4.50/lisp/gnus/yenc
/home/md5i/src/elisp/gnus/lisp/pop3 hides /usr/local/share/emacs/24.4.50/lisp/gnus/pop3
/home/md5i/src/elisp/gnus/lisp/sieve hides /usr/local/share/emacs/24.4.50/lisp/gnus/sieve
/home/md5i/src/elisp/gnus/lisp/starttls hides /usr/local/share/emacs/24.4.50/lisp/gnus/starttls
/home/md5i/src/elisp/gnus/lisp/gnus-async hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-async
/home/md5i/src/elisp/gnus/lisp/mm-archive hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-archive
/home/md5i/src/elisp/gnus/lisp/rfc1843 hides /usr/local/share/emacs/24.4.50/lisp/gnus/rfc1843
/home/md5i/src/elisp/gnus/lisp/rfc2104 hides /usr/local/share/emacs/24.4.50/lisp/gnus/rfc2104
/home/md5i/src/elisp/gnus/lisp/rtree hides /usr/local/share/emacs/24.4.50/lisp/gnus/rtree
/home/md5i/src/elisp/gnus/lisp/plstore hides /usr/local/share/emacs/24.4.50/lisp/gnus/plstore
/home/md5i/src/elisp/gnus/lisp/gnus-cache hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-cache
/home/md5i/src/elisp/gnus/lisp/sieve-mode hides /usr/local/share/emacs/24.4.50/lisp/gnus/sieve-mode
/home/md5i/src/elisp/gnus/lisp/messcompat hides /usr/local/share/emacs/24.4.50/lisp/gnus/messcompat
/home/md5i/src/elisp/gnus/lisp/rfc2045 hides /usr/local/share/emacs/24.4.50/lisp/gnus/rfc2045
/home/md5i/src/elisp/gnus/lisp/qp hides /usr/local/share/emacs/24.4.50/lisp/gnus/qp
/home/md5i/src/elisp/gnus/lisp/mm-bodies hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-bodies
/home/md5i/src/elisp/gnus/lisp/mailcap hides /usr/local/share/emacs/24.4.50/lisp/gnus/mailcap
/home/md5i/src/elisp/gnus/lisp/mm-encode hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-encode
/home/md5i/src/elisp/gnus/lisp/mail-parse hides /usr/local/share/emacs/24.4.50/lisp/gnus/mail-parse
/home/md5i/src/elisp/gnus/lisp/mml-sec hides /usr/local/share/emacs/24.4.50/lisp/gnus/mml-sec
/home/md5i/src/elisp/gnus/lisp/sieve-manage hides /usr/local/share/emacs/24.4.50/lisp/gnus/sieve-manage
/home/md5i/src/elisp/gnus/lisp/ietf-drums hides /usr/local/share/emacs/24.4.50/lisp/gnus/ietf-drums
/home/md5i/src/elisp/gnus/lisp/mail-prsvr hides /usr/local/share/emacs/24.4.50/lisp/gnus/mail-prsvr
/home/md5i/src/elisp/gnus/lisp/mm-util hides /usr/local/share/emacs/24.4.50/lisp/gnus/mm-util
/home/md5i/src/elisp/gnus/lisp/html2text hides /usr/local/share/emacs/24.4.50/lisp/gnus/html2text
/home/md5i/src/elisp/gnus/lisp/gnus-range hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-range
/home/md5i/src/elisp/gnus/lisp/gnus-dired hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-dired
/home/md5i/src/elisp/gnus/lisp/gssapi hides /usr/local/share/emacs/24.4.50/lisp/gnus/gssapi
/home/md5i/src/elisp/gnus/lisp/gnus-ems hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-ems
/home/md5i/src/elisp/gnus/lisp/gnus-bcklg hides /usr/local/share/emacs/24.4.50/lisp/gnus/gnus-bcklg
/home/md5i/src/elisp/gnus/lisp/canlock hides /usr/local/share/emacs/24.4.50/lisp/gnus/canlock
/home/md5i/src/elisp/gnus/lisp/flow-fill hides /usr/local/share/emacs/24.4.50/lisp/gnus/flow-fill
/home/md5i/src/elisp/gnus/lisp/compface hides /usr/local/share/emacs/24.4.50/lisp/gnus/compface
/home/md5i/src/elisp/gnus/lisp/ecomplete hides /usr/local/share/emacs/24.4.50/lisp/gnus/ecomplete
/home/md5i/src/elisp/gnus/lisp/time-date hides /usr/local/share/emacs/24.4.50/lisp/calendar/time-date
/home/md5i/src/elisp/gnus/lisp/parse-time hides /usr/local/share/emacs/24.4.50/lisp/calendar/parse-time

Features:
(shadow emacsbug cus-start cus-load org-element org-rmail org-mhe
org-irc org-info org-gnus org-docview doc-view image-mode org-bibtex
bibtex org-bbdb org-w3m org org-macro org-footnote org-pcomplete
org-list org-faces org-entities noutline outline org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs find-func
cal-menu calendar cal-loaddefs info view dabbrev time-stamp whitespace
tabify calc-alg calc-ext calc-menu calc calc-loaddefs calc-macs vc-hg
jka-compr gnus-uu yenc imenu man canlock rect nndoc bbdb-hooks gnus-fun
gnus-dup grep compile vc-git cc-langs cc-mode cc-fonts cc-guess cc-menus
cc-cmds misearch multi-isearch dired-aux tramp-cache flow-fill shr-color
color shr browse-url mule-util sort gnus-cite qp mm-archive gnus-async
gnus-bcklg gnus-ml disp-table gnus-topic utf-7 nndraft nnmh epa-file epa
derived epg network-stream starttls nnimap parse-time tls utf7 netrc
bbdb-gnus bbdb-snarf mail-extr bbdb-com nnml gnus-agent gnus-srvr
gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015
epg-config mm-view mml-smime smime dig gnus-cache gnus-demon nntp gnutls
nnir gnus-sum gnus-group gnus-undo nnmail mail-source nnoo gnus-start
gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems gnus-compat url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse url-vars nnheader server flyspell ispell
uptimes pp descr-text help-mode tramp tramp-compat auth-source eieio
byte-opt bytecomp byte-compile cconv eieio-core gnus-util time-date
tramp-loaddefs cl-macs trampver shell pcomplete advice help-fns time
sieve-manage password-cache rng-loc rng-uri rng-parse rng-match rng-dt
rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util
sgml-mode psvn wid-edit cl gv log-edit pcvs-util add-log diff-mode
easy-mmode mailcap message sendmail format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
lua-mode edmacro rx gnus-load generated generic-x ediff-merg ediff-wind
ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff debian-el
debian-el-loaddefs dired-x easymenu dired cc-styles cc-align cc-engine
cc-vars cc-defs bbdb-autoloads bbdb timezone ange-ftp comint ansi-color
ring kmacro cl-loaddefs cl-lib tooltip electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
x-toolkit x multi-tty emacs)

Memory information:
((conses 16 801445 80257)
 (symbols 48 52894 0)
 (miscs 40 1765 4411)
 (strings 32 123910 26037)
 (string-bytes 1 6294800)
 (vectors 16 51747)
 (vector-slots 8 1579831 95041)
 (floats 8 600 959)
 (intervals 56 81784 1605)
 (buffers 960 118)
 (heap 1024 98273 10412))

-- 
Michael Welsh Duggan
(md5i@md5i.com)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-06-03 15:17 bug#17675: 24.4.50; *gud* buffer keeps on getting buried Michael Welsh Duggan
@ 2014-06-03 16:08 ` martin rudalics
  2014-06-04  0:52   ` Michael Welsh Duggan
  2015-03-09 14:02 ` bug#17675: patch Dima Kogan
  1 sibling, 1 reply; 19+ messages in thread
From: martin rudalics @ 2014-06-03 16:08 UTC (permalink / raw)
  To: Michael Welsh Duggan, 17675

 > At this point, notice that *gud-foo* buffer is gone, as foo.c has
 > replaced it.  At some point in time in the past, foo.c would end up
 > replacing the other window (the *scratch* buffer).  That would be the
 > desired behavior, as I would be able to continue using the *gud* buffer.
 >
 >      C-x 4 b RET   (accepting default "*gud-foo*")
 >      n RET RET
 >
 > Now *input/output of foo* replaced the *gud-foo* buffer.  I can't say
 > much about this, as I normally use gdb a different way.  But it seems
 > sub-optimal.  For my usual debugging habits, see Sequence 2.

Here ...

 > Same set-up as for sequence 1, then as follows:
 >
 >      M-x gud-gdb RET
 >      RET               (accepting default "gdb --fullname foo")
 >      start RET
 >
 > At this point, notice that *gud-foo* buffer is gone, as foo.c has
 > replaced it.  At some point in time in the past, foo.c would end up
 > replacing the other window (the *scratch* buffer).  That would be the
 > desired behavior, as I would be able to continue using the *gud* buffer.

... and here it would be helpful to check whether `display-buffer' runs
`display-buffer-use-some-window' and why it uses that window.  I usually
edebug this from a second frame.

 > If need be, I can create a slightly more elaborate example containing
 > more than one C file, and we can see *gud-foo* getting buried again as
 > other C files pop up.

In my experience the least recently used window should be used.  Since
you apparently did not touch the *scratch* window for some time we'd
have to find out why it doesn't do that in your case.

martin





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-06-03 16:08 ` martin rudalics
@ 2014-06-04  0:52   ` Michael Welsh Duggan
  2014-06-04  6:41     ` martin rudalics
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Welsh Duggan @ 2014-06-04  0:52 UTC (permalink / raw)
  To: martin rudalics; +Cc: Michael Welsh Duggan, 17675

martin rudalics <rudalics@gmx.at> writes:

>> At this point, notice that *gud-foo* buffer is gone, as foo.c has
>> replaced it.  At some point in time in the past, foo.c would end up
>> replacing the other window (the *scratch* buffer).  That would be the
>> desired behavior, as I would be able to continue using the *gud* buffer.
>>
>>      C-x 4 b RET   (accepting default "*gud-foo*")
>>      n RET RET
>>
>> Now *input/output of foo* replaced the *gud-foo* buffer.  I can't say
>> much about this, as I normally use gdb a different way.  But it seems
>> sub-optimal.  For my usual debugging habits, see Sequence 2.
>
> Here ...
>
>> Same set-up as for sequence 1, then as follows:
>>
>>      M-x gud-gdb RET
>>      RET               (accepting default "gdb --fullname foo")
>>      start RET
>>
>> At this point, notice that *gud-foo* buffer is gone, as foo.c has
>> replaced it.  At some point in time in the past, foo.c would end up
>> replacing the other window (the *scratch* buffer).  That would be the
>> desired behavior, as I would be able to continue using the *gud* buffer.
>
> ... and here it would be helpful to check whether `display-buffer' runs
> `display-buffer-use-some-window' and why it uses that window.  I usually
> edebug this from a second frame.

It's being selected by display-buffer-in-previous-window in this
particular test case.  Maybe gud needs to bind inhibit-same-window to t
before calling display-buffer (from gud-display-line).

-- 
Michael Welsh Duggan
(md5i@md5i.com)





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-06-04  0:52   ` Michael Welsh Duggan
@ 2014-06-04  6:41     ` martin rudalics
  2014-06-04 11:20       ` Michael Welsh Duggan
  0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2014-06-04  6:41 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: 17675

 > It's being selected by display-buffer-in-previous-window in this
 > particular test case.  Maybe gud needs to bind inhibit-same-window to t
 > before calling display-buffer (from gud-display-line).

`display-buffer-in-previous-window' should be alright in the present
case - after all you want to show *gud-foo* in the window it was shown
before.  What we have to find out is why `display-buffer' doesn't
replace *scratch* by foo.c in what you describe as:

   At this point, notice that *gud-foo* buffer is gone, as foo.c has
   replaced it.  At some point in time in the past, foo.c would end up
   replacing the other window (the *scratch* buffer).

So why did foo.c replace *gud-foo* in its window and not use the
*scratch* window instead?  Please try to find out.

Thanks, martin





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-06-04  6:41     ` martin rudalics
@ 2014-06-04 11:20       ` Michael Welsh Duggan
  2014-06-04 14:51         ` martin rudalics
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Welsh Duggan @ 2014-06-04 11:20 UTC (permalink / raw)
  To: martin rudalics; +Cc: Michael Welsh Duggan, 17675

martin rudalics <rudalics@gmx.at> writes:

>> It's being selected by display-buffer-in-previous-window in this
>> particular test case.  Maybe gud needs to bind inhibit-same-window to t
>> before calling display-buffer (from gud-display-line).
>
> `display-buffer-in-previous-window' should be alright in the present
> case - after all you want to show *gud-foo* in the window it was shown
> before.  What we have to find out is why `display-buffer' doesn't
> replace *scratch* by foo.c in what you describe as:
>
>   At this point, notice that *gud-foo* buffer is gone, as foo.c has
>   replaced it.  At some point in time in the past, foo.c would end up
>   replacing the other window (the *scratch* buffer).
>
> So why did foo.c replace *gud-foo* in its window and not use the
> *scratch* window instead?  Please try to find out.

When gud-gdb is started, it uses `switch-to-buffer', which places
*gud-foo* in the window previously occupied by foo.c.  When gdb gets
"start", foo.c replaces *gud-foo* instead of *scratch* because foo.c has
been in the window that *gud-foo* occupies, and not in the window that
*scratch* occupies.  This is what `display-buffer-in-previous-window'
does, no?

-- 
Michael Welsh Duggan
(md5i@md5i.com)





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-06-04 11:20       ` Michael Welsh Duggan
@ 2014-06-04 14:51         ` martin rudalics
  2014-06-05  0:48           ` Michael Welsh Duggan
  0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2014-06-04 14:51 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: 17675

 > When gud-gdb is started, it uses `switch-to-buffer', which places
 > *gud-foo* in the window previously occupied by foo.c.

Then this is the culprit.  It doesn't make sense to keep the *scratch*
window around when debugging foo.c because sooner or later gdb will have
to display foo.c again.  Instead of `switch-to-buffer' we should use
`display-buffer' here.  Where is this `switch-to-buffer' call issued?

BTW, this is an issue that bothers me as well because usually I want to
immediately set a breakpoint at the current position of `window-point'
in the source buffer.  Hence I start displaying the source file in one
window, split it, and then invoke gdb from the lower window.

 > When gdb gets
 > "start", foo.c replaces *gud-foo* instead of *scratch* because foo.c has
 > been in the window that *gud-foo* occupies, and not in the window that
 > *scratch* occupies.  This is what `display-buffer-in-previous-window'
 > does, no?

Correct.  IIRC I wrote `display-buffer-in-previous-window' because
someone using edebug complained about the source code always being
displayed alternately in one of two windows.  So if you want an
instantaneous solution for this you will have to customize
`display-buffer-alist' to avoid `display-buffer-in-previous-window'.

martin





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-06-04 14:51         ` martin rudalics
@ 2014-06-05  0:48           ` Michael Welsh Duggan
  2014-06-05  7:48             ` martin rudalics
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Welsh Duggan @ 2014-06-05  0:48 UTC (permalink / raw)
  To: martin rudalics; +Cc: Michael Welsh Duggan, 17675

martin rudalics <rudalics@gmx.at> writes:

>> When gud-gdb is started, it uses `switch-to-buffer', which places
>> *gud-foo* in the window previously occupied by foo.c.
>
> Then this is the culprit.  It doesn't make sense to keep the *scratch*
> window around when debugging foo.c because sooner or later gdb will have
> to display foo.c again.  Instead of `switch-to-buffer' we should use
> `display-buffer' here.  Where is this `switch-to-buffer' call issued?

In `gud-common-init'.

-- 
Michael Welsh Duggan
(md5i@md5i.com)





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-06-05  0:48           ` Michael Welsh Duggan
@ 2014-06-05  7:48             ` martin rudalics
  2014-11-23 23:27               ` Michael Welsh Duggan
  0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2014-06-05  7:48 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: 17675

 >>  Where is this `switch-to-buffer' call issued?
 >
 > In `gud-common-init'.

Thanks, I haven't looked into that code for years.  And the final
`display-buffer' call that causes trouble is in `gud-display-line'?

In that case how about the following: In `gud-common-init' instead of
`switch-to-buffer' let's call `display-buffer' with an action list that
would go like

   (display-buffer-reuse-window display-buffer-in-previous-window
    display-buffer-same-window display-buffer-pop-up-window)
		
and in `gud-display-line' use `inhibit-same-window' as you proposed
earlier (and maybe `inhibit-switch-frame' as well).  WDYT?  Could you
try writing an according patch for gud.el?

martin





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-06-05  7:48             ` martin rudalics
@ 2014-11-23 23:27               ` Michael Welsh Duggan
  2014-11-23 23:31                 ` Michael Welsh Duggan
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Welsh Duggan @ 2014-11-23 23:27 UTC (permalink / raw)
  To: martin rudalics; +Cc: Michael Welsh Duggan, 17675

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

martin rudalics <rudalics@gmx.at> writes:

>>>  Where is this `switch-to-buffer' call issued?
>>
>> In `gud-common-init'.
>
> Thanks, I haven't looked into that code for years.  And the final
> `display-buffer' call that causes trouble is in `gud-display-line'?
>
> In that case how about the following: In `gud-common-init' instead of
> `switch-to-buffer' let's call `display-buffer' with an action list that
> would go like
>
>   (display-buffer-reuse-window display-buffer-in-previous-window
>    display-buffer-same-window display-buffer-pop-up-window)
> 		
> and in `gud-display-line' use `inhibit-same-window' as you proposed
> earlier (and maybe `inhibit-switch-frame' as well).  WDYT?  Could you
> try writing an according patch for gud.el?

Sorry this took so long.  I've done minimal testing so far, and will
have to test some more under real debugging situations, but the
included patch does alleviate at least one problem I am having.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 708 bytes --]

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 24d5469..82846eb 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2603,6 +2603,10 @@ comint mode, which see."
 		      file-subst)))
 	 (filepart (and file-word (concat "-" (file-name-nondirectory file))))
 	 (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
+    (select-window
+      (display-buffer
+       (get-buffer-create (concat "*gud" filepart "*"))
+       '(display-buffer-reuse-window display-buffer-in-previous-window)))
     (switch-to-buffer (concat "*gud" filepart "*"))
     (when (and existing-buffer (get-buffer-process existing-buffer))
       (error "This program is already being debugged"))

[-- Attachment #3: Type: text/plain, Size: 42 bytes --]


-- 
Michael Welsh Duggan
(md5i@md5i.com)

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-11-23 23:27               ` Michael Welsh Duggan
@ 2014-11-23 23:31                 ` Michael Welsh Duggan
  2014-11-23 23:34                   ` Michael Welsh Duggan
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Welsh Duggan @ 2014-11-23 23:31 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: 17675

[-- Attachment #1: Type: text/plain, Size: 51 bytes --]

Sorry, wrong patch.  The correct one is included.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 786 bytes --]

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 24d5469..51e13f5 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2603,7 +2603,10 @@ comint mode, which see."
 		      file-subst)))
 	 (filepart (and file-word (concat "-" (file-name-nondirectory file))))
 	 (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
-    (switch-to-buffer (concat "*gud" filepart "*"))
+    (select-window
+      (display-buffer
+       (get-buffer-create (concat "*gud" filepart "*"))
+       '(display-buffer-reuse-window display-buffer-in-previous-window)))
     (when (and existing-buffer (get-buffer-process existing-buffer))
       (error "This program is already being debugged"))
     ;; Set the dir, in case the buffer already existed with a different dir.

[-- Attachment #3: Type: text/plain, Size: 42 bytes --]


-- 
Michael Welsh Duggan
(md5i@md5i.com)

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-11-23 23:31                 ` Michael Welsh Duggan
@ 2014-11-23 23:34                   ` Michael Welsh Duggan
  2018-05-20 23:59                     ` Noam Postavsky
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Welsh Duggan @ 2014-11-23 23:34 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: 17675

[-- Attachment #1: Type: text/plain, Size: 77 bytes --]

And one more time, this time incorporating your suggestion more
completely.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 863 bytes --]

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 24d5469..71dc574 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2603,7 +2603,12 @@ comint mode, which see."
 		      file-subst)))
 	 (filepart (and file-word (concat "-" (file-name-nondirectory file))))
 	 (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
-    (switch-to-buffer (concat "*gud" filepart "*"))
+    (select-window
+      (display-buffer
+       (get-buffer-create (concat "*gud" filepart "*"))
+       '(display-buffer-reuse-window 
+         display-buffer-in-previous-window
+         display-buffer-same-window display-buffer-pop-up-window)))
     (when (and existing-buffer (get-buffer-process existing-buffer))
       (error "This program is already being debugged"))
     ;; Set the dir, in case the buffer already existed with a different dir.

[-- Attachment #3: Type: text/plain, Size: 42 bytes --]


-- 
Michael Welsh Duggan
(md5i@md5i.com)

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* bug#17675: patch
  2014-06-03 15:17 bug#17675: 24.4.50; *gud* buffer keeps on getting buried Michael Welsh Duggan
  2014-06-03 16:08 ` martin rudalics
@ 2015-03-09 14:02 ` Dima Kogan
  1 sibling, 0 replies; 19+ messages in thread
From: Dima Kogan @ 2015-03-09 14:02 UTC (permalink / raw)
  To: 19901, 17675

Hi. Does this patch fix your issue?

 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20034





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2014-11-23 23:34                   ` Michael Welsh Duggan
@ 2018-05-20 23:59                     ` Noam Postavsky
  2018-05-21  0:18                       ` Michael Welsh Duggan
  2018-05-21  6:49                       ` martin rudalics
  0 siblings, 2 replies; 19+ messages in thread
From: Noam Postavsky @ 2018-05-20 23:59 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: 17675

Michael Welsh Duggan <mwd@md5i.com> writes:

> And one more time, this time incorporating your suggestion more
> completely.
>
> diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
> index 24d5469..71dc574 100644
> --- a/lisp/progmodes/gud.el
> +++ b/lisp/progmodes/gud.el
> @@ -2603,7 +2603,12 @@ comint mode, which see."
>  		      file-subst)))
>  	 (filepart (and file-word (concat "-" (file-name-nondirectory file))))
>  	 (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
> -    (switch-to-buffer (concat "*gud" filepart "*"))
> +    (select-window

Is this select-window call neeeded?

> +      (display-buffer
> +       (get-buffer-create (concat "*gud" filepart "*"))
> +       '(display-buffer-reuse-window 
> +         display-buffer-in-previous-window
> +         display-buffer-same-window display-buffer-pop-up-window)))
>      (when (and existing-buffer (get-buffer-process existing-buffer))
>        (error "This program is already being debugged"))
>      ;; Set the dir, in case the buffer already existed with a different dir.

Martin, I see the switch-to-buffer is still present in master now,
should it be fixed?






^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2018-05-20 23:59                     ` Noam Postavsky
@ 2018-05-21  0:18                       ` Michael Welsh Duggan
  2018-05-21  1:06                         ` Noam Postavsky
  2018-05-21  6:49                       ` martin rudalics
  1 sibling, 1 reply; 19+ messages in thread
From: Michael Welsh Duggan @ 2018-05-21  0:18 UTC (permalink / raw)
  To: 17675; +Cc: Noam Postavsky

Noam Postavsky <npostavs@gmail.com> writes:

> Michael Welsh Duggan <mwd@md5i.com> writes:
>
>> And one more time, this time incorporating your suggestion more
>> completely.
>>
>> diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
>> index 24d5469..71dc574 100644
>> --- a/lisp/progmodes/gud.el
>> +++ b/lisp/progmodes/gud.el
>> @@ -2603,7 +2603,12 @@ comint mode, which see."
>>  		      file-subst)))
>>  	 (filepart (and file-word (concat "-" (file-name-nondirectory file))))
>>  	 (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
>> -    (switch-to-buffer (concat "*gud" filepart "*"))
>> +    (select-window
>
> Is this select-window call neeeded?

I think so, since `display-buffer' does not necessarily select the window
in which it displays the buffer, whereas the `switch-to-buffer' it is
replacing displays the buffer in the currently selected window.
Certainly in this case you want the "*gud*" buffer to be the selected
buffer after this command.

This bug was actually "fixed" using my original suggestion of binding
`inhibit-same-window' to t, but I am not qualified to say which solution
is "more correct."  See
<URL:http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=fd93edbb1cabfdf0c732dbb0c6892a515b406a65>.

>> +      (display-buffer
>> +       (get-buffer-create (concat "*gud" filepart "*"))
>> +       '(display-buffer-reuse-window 
>> +         display-buffer-in-previous-window
>> +         display-buffer-same-window display-buffer-pop-up-window)))
>>      (when (and existing-buffer (get-buffer-process existing-buffer))
>>        (error "This program is already being debugged"))
>>      ;; Set the dir, in case the buffer already existed with a different dir.
>
> Martin, I see the switch-to-buffer is still present in master now,
> should it be fixed?

-- 
Michael Welsh Duggan
(md5i@md5i.com)





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2018-05-21  0:18                       ` Michael Welsh Duggan
@ 2018-05-21  1:06                         ` Noam Postavsky
  0 siblings, 0 replies; 19+ messages in thread
From: Noam Postavsky @ 2018-05-21  1:06 UTC (permalink / raw)
  To: Michael Welsh Duggan; +Cc: 17675

Michael Welsh Duggan <mwd@md5i.com> writes:

> Noam Postavsky <npostavs@gmail.com> writes:
>
>> Michael Welsh Duggan <mwd@md5i.com> writes:
>>
>>> -    (switch-to-buffer (concat "*gud" filepart "*"))
>>> +    (select-window
>>
>> Is this select-window call neeeded?
>
> I think so, since `display-buffer' does not necessarily select the window
> in which it displays the buffer, whereas the `switch-to-buffer' it is
> replacing displays the buffer in the currently selected window.
> Certainly in this case you want the "*gud*" buffer to be the selected
> buffer after this command.
>
> This bug was actually "fixed" using my original suggestion of binding
> `inhibit-same-window' to t, but I am not qualified to say which solution
> is "more correct."  See
> <URL:http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=fd93edbb1cabfdf0c732dbb0c6892a515b406a65>.

The inhibit-same-window fixes this bug, but your patch above seems to
fix Bug#22374.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#17675: 24.4.50; *gud* buffer keeps on getting buried
  2018-05-20 23:59                     ` Noam Postavsky
  2018-05-21  0:18                       ` Michael Welsh Duggan
@ 2018-05-21  6:49                       ` martin rudalics
  2018-05-21 20:38                         ` bug#22374: Buffers of previously open files appear in gud interaction window instead of source window in many-windows mode Noam Postavsky
  1 sibling, 1 reply; 19+ messages in thread
From: martin rudalics @ 2018-05-21  6:49 UTC (permalink / raw)
  To: Noam Postavsky, Michael Welsh Duggan; +Cc: 17675

 >> diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
 >> index 24d5469..71dc574 100644
 >> --- a/lisp/progmodes/gud.el
 >> +++ b/lisp/progmodes/gud.el
 >> @@ -2603,7 +2603,12 @@ comint mode, which see."
 >>   		      file-subst)))
 >>   	 (filepart (and file-word (concat "-" (file-name-nondirectory file))))
 >>   	 (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
 >> -    (switch-to-buffer (concat "*gud" filepart "*"))
 >> +    (select-window
 >
 > Is this select-window call neeeded?

Yes because 'display-buffer' does not select the window it uses.

 >> +      (display-buffer
 >> +       (get-buffer-create (concat "*gud" filepart "*"))
 >> +       '(display-buffer-reuse-window
 >> +         display-buffer-in-previous-window
 >> +         display-buffer-same-window display-buffer-pop-up-window)))
 >>       (when (and existing-buffer (get-buffer-process existing-buffer))
 >>         (error "This program is already being debugged"))
 >>       ;; Set the dir, in case the buffer already existed with a different dir.
 >
 > Martin, I see the switch-to-buffer is still present in master now,
 > should it be fixed?

If you think that this might solve Bug#22374, I'd go for it.  Can you
explain how it solves that bug?

martin





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#22374: Buffers of previously open files appear in gud interaction window instead of source window in many-windows mode
  2018-05-21  6:49                       ` martin rudalics
@ 2018-05-21 20:38                         ` Noam Postavsky
  2018-05-22  7:24                           ` martin rudalics
  0 siblings, 1 reply; 19+ messages in thread
From: Noam Postavsky @ 2018-05-21 20:38 UTC (permalink / raw)
  To: martin rudalics; +Cc: Michael Welsh Duggan, 22374, Michael Buksas

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

[moving from bug#17675 to #22374]

martin rudalics <rudalics@gmx.at> writes:

> If you think that this might solve Bug#22374, I'd go for it.  Can you
> explain how it solves that bug?

Oh, I only observed that it [35] fixes the bug, I was hoping you could
explain it.  Actually, it looks like the explanation you put before [20]
still applies.  The reason the inhibit-same-window fix doesn't help is
that step 9 (middle-click the single line in the stack frame window)
changes the current window, hence the gud interaction window is no
longer the "same-window" and not inhibited.


[-- Attachment #2: reproducer for bug#22374 --]
[-- Type: text/plain, Size: 957 bytes --]

(defconst bug-22374-dir
  (file-name-directory (or load-file-name
                           buffer-file-name)))

(defun bug-22373-frame0 ()
  (interactive)
  (select-window (get-buffer-window "*stack frames of test*"))
  (let ((new-level "0"))
    (setq gdb-frame-number new-level)
    (gdb-input (concat "-stack-select-frame " new-level)
	       'ignore)
    (gdb-update)))

(mapatoms (lambda (s)
            (when (and (fboundp s)
                       (string-match "\\`display-buffer"
                                     (symbol-name s)))
              (trace-function-background s))))
(trace-function-background 'bug-22373-frame0)


(find-file (expand-file-name "test.cpp" bug-22374-dir))
(gdb "gdb -i=mi ./test")
(gdb-many-windows )
(gdb-input "start" #'ignore)
(run-with-idle-timer
 0.25 nil
 (lambda ()
   (select-window (get-buffer-window "test.cpp"))
   (switch-to-buffer "*scratch*")
   (run-with-idle-timer 0.5 nil #'bug-22373-frame0)
   ))


[-- Attachment #3: Type: text/plain, Size: 124 bytes --]



[20]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=17675#20
[35]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=17675#35

^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#22374: Buffers of previously open files appear in gud interaction window instead of source window in many-windows mode
  2018-05-21 20:38                         ` bug#22374: Buffers of previously open files appear in gud interaction window instead of source window in many-windows mode Noam Postavsky
@ 2018-05-22  7:24                           ` martin rudalics
  2018-05-23 23:11                             ` Noam Postavsky
  0 siblings, 1 reply; 19+ messages in thread
From: martin rudalics @ 2018-05-22  7:24 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Michael Welsh Duggan, 22374, Michael Buksas

 > The reason the inhibit-same-window fix doesn't help is
 > that step 9 (middle-click the single line in the stack frame window)
 > changes the current window, hence the gud interaction window is no
 > longer the "same-window" and not inhibited.

Then I think you should install it and we will see soon enough
whether it has any bad side effects.

martin





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#22374: Buffers of previously open files appear in gud interaction window instead of source window in many-windows mode
  2018-05-22  7:24                           ` martin rudalics
@ 2018-05-23 23:11                             ` Noam Postavsky
  0 siblings, 0 replies; 19+ messages in thread
From: Noam Postavsky @ 2018-05-23 23:11 UTC (permalink / raw)
  To: martin rudalics; +Cc: Michael Welsh Duggan, 22374, Michael Buksas

tags 22374 fixed
close 22374 27.1
quit

martin rudalics <rudalics@gmx.at> writes:

>> The reason the inhibit-same-window fix doesn't help is
>> that step 9 (middle-click the single line in the stack frame window)
>> changes the current window, hence the gud interaction window is no
>> longer the "same-window" and not inhibited.
>
> Then I think you should install it and we will see soon enough
> whether it has any bad side effects.

Done.

[1: 0d224e8241]: 2018-05-23 07:53:58 -0400
  Avoid messing up buffer list when starting gud (Bug#22374)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=0d224e82411d9471f03fc339890d6a2952b5e239





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-05-23 23:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-03 15:17 bug#17675: 24.4.50; *gud* buffer keeps on getting buried Michael Welsh Duggan
2014-06-03 16:08 ` martin rudalics
2014-06-04  0:52   ` Michael Welsh Duggan
2014-06-04  6:41     ` martin rudalics
2014-06-04 11:20       ` Michael Welsh Duggan
2014-06-04 14:51         ` martin rudalics
2014-06-05  0:48           ` Michael Welsh Duggan
2014-06-05  7:48             ` martin rudalics
2014-11-23 23:27               ` Michael Welsh Duggan
2014-11-23 23:31                 ` Michael Welsh Duggan
2014-11-23 23:34                   ` Michael Welsh Duggan
2018-05-20 23:59                     ` Noam Postavsky
2018-05-21  0:18                       ` Michael Welsh Duggan
2018-05-21  1:06                         ` Noam Postavsky
2018-05-21  6:49                       ` martin rudalics
2018-05-21 20:38                         ` bug#22374: Buffers of previously open files appear in gud interaction window instead of source window in many-windows mode Noam Postavsky
2018-05-22  7:24                           ` martin rudalics
2018-05-23 23:11                             ` Noam Postavsky
2015-03-09 14:02 ` bug#17675: patch Dima Kogan

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).