unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* gdb-ui and hl-line-mode
@ 2005-12-28 20:42 Eli Zaretskii
  2005-12-29  2:26 ` Nick Roberts
  0 siblings, 1 reply; 2+ messages in thread
From: Eli Zaretskii @ 2005-12-28 20:42 UTC (permalink / raw)


Some people, when they debug a program, like to have the current line
in the source window to be clearly visible.  One way to do that in
Emacs is to turn on the hl-line-mode in the source buffer, but the
results are strange: if you step through the code when the source
window is the currently selected one, the highlighted line stays one
step behind the fringe arrow and the cursor (e.g., the arrow points to
line 10, whereas line 9 is highlighted); switching to another window
and back fixes the overlay position.  And if you step with the source
window is not the selected one (e.g., you type `next' commands into
the GUD buffer), the highlight overlay does not move at all; however,
if you switch to the source window, the highlight overlay is correctly
moved to the current source line.

Is this some snafu with post-command hook being run a tad too early?

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

* gdb-ui and hl-line-mode
  2005-12-28 20:42 gdb-ui and hl-line-mode Eli Zaretskii
@ 2005-12-29  2:26 ` Nick Roberts
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Roberts @ 2005-12-29  2:26 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii writes:
 > Some people, when they debug a program, like to have the current line
 > in the source window to be clearly visible.  One way to do that in
 > Emacs is to turn on the hl-line-mode in the source buffer, but the
 > results are strange: if you step through the code when the source
 > window is the currently selected one, the highlighted line stays one
 > step behind the fringe arrow and the cursor (e.g., the arrow points to
 > line 10, whereas line 9 is highlighted); switching to another window
 > and back fixes the overlay position. 

Is this due to the fact GDB runs asynchronously i.e gud-call finishes
before the output of GDB is collected through gud-filter?

 >                                     And if you step with the source
 > window is not the selected one (e.g., you type `next' commands into
 > the GUD buffer), the highlight overlay does not move at all; however,
 > if you switch to the source window, the highlight overlay is correctly
 > moved to the current source line.

The commentary says:

;; Caveat: the buffer's point might be different from the point of a
;; non-selected window.

which presumably has something to do with point and window-point having
different values.

Nick

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

end of thread, other threads:[~2005-12-29  2:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-28 20:42 gdb-ui and hl-line-mode Eli Zaretskii
2005-12-29  2:26 ` Nick Roberts

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