[Top][All Lists]

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

*gud* mode - auto-recentering

From: Pascal Durocher
Subject: *gud* mode - auto-recentering
Date: Fri, 3 Aug 2001 11:41:56 -0400

This bug report will be sent to the Free Software Foundation,
 not to your local site managers!!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

In GNU Emacs 20.7.1 (i386-redhat-linux-gnu, X toolkit)
 of Thu Aug 24 2000 on porky.devel.redhat.com
configured using `configure  --mandir=/usr/share/man
--infodir=/usr/share/info --prefix=/usr --libexecdir=/usr/lib
--sharedstatedir=/var --with-gcc --with-pop --with-x-toolkit

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

Let's say you have a C program consisting of a single source file
named "foo.c".  You feed that source file to "gcc" with "gcc -g foo.c"
and get an "a.out" out of it.

Now, from GNU Emacs, you call "M-x gdb RET gdb a.out RET" (and, of
course, you are in the proper directory for "a.out" to be found).

A new buffer named *gud-a.out* is created.  You enter "break main"
inside the *gud-a.out* buffer and then "run".  *GUD* opens the "foo.c"
source file in a separate window and positions the "=>" at the first
statement of "main()".

Now, if "scroll-margin" is, say, set to 3 and I do "C-c C-n"
repeatedly the "=>" in the "foo.c" buffer will eventually move all the
way down it's window.  When "=>" gets 3 lines from the bottom of the
"foo.c" buffer window, it will NOT automatically recenter itself.  It
only do so for the active window.  And it does so for the active
window ONLY if the point is manually displaced (by C-n'ing).  If the
point gets moved because I once enter, say, the command "until" in the
*gud-a.out* buffer and then repeatedly press RET to repeat the same
command, the point will eventually get at the very bottom of the *GUD*
window without an automatic recenter.

It is rather annoying because, currently, if the point gets too much
at the bottom of it's window, you loose context information (i.e., you
can't see every lines surrounding the current line anymore) and (at
least in my case) you always find yourself doing a (if inside the
*gud* buffer window) "C-l C-x o C-l C-x o" to recenter both windows.
You will agree this is not very efficient.

If I may, my proposition is the have a dedicated *gud* mode variable
that would be similar to the "scroll-margin" variable in spirit.  Just
like the "scroll-margin" variable, it would allow the user to specify
at which relative line, from the top or bottom of the window,
recentering would have to be accomplished.  The main difference would
be that recentering would be applied to every *gud* mode related
windows (e.g. the gdb buffer and the "active" source file window).
There would be tracking of the point in all these windows and if the
point in a related window gets to the, e.g. "gud-scroll-margin" value,
recenter would happen in that window.

Thanks for your time.

p.s.: Please, CC the eventual follow up of this bug to

reply via email to

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