Using forward search from emacs used to show boxes around area searched to, but I don't have this behaviour any more. Could be related to bug 418215? Ctrl-x and Ctrl-click work perfectly, while Ctrl-v doesn't. Changing highlight colour doesn't work (and other features that use highlight colour, e.g. ruler, do work).
xdvik version 22.84.16 (Xaw toolkit)
I can reproduce the problem with Ctrl-v, there's a bug in the handling of this event, but not with the bounding boxes. Could you post the output of doing a forward search with "xdvi -debug 'src,event'"?
Bug with Ctrl-v fixed in v. 1.403 of events.c
You mean "events" instead of "event", right? Using "events":
Debugging option: "src,events" = "src", debug: 8192
Debugging option: "events" = "events", debug: 8208
KPATHSEA_DEBUG = 128
main.c:439: EVENT: watching: new file opened successfully.
xdvik 22.84.16 (Xaw toolkit), kpathsea: kpathsea version 3.5.7
configured with: ppi=600 shrink=9 mfmode=<NONE> alt_font=cmr10 paper=a4
--- G_depth: 24
XtAppAddTimeOut: 100 msecs
events.c:4577: set_timer
=======after set_timer; timers:
timer 0x8315480: 1250774182
=======
=======XtAppAddTimeOut; timers:
timer 0x8315480: 1250774182
=======
dvi-init.c:1146: EVENT: Created temp file: |/tmp/xdvi-hHeAa0|
=======beginning of cancel_timer; timers:
timer 0x8315480: 1250774182
=======
events.c:4621: cancel_timer 0x810d604 from 0x8315480
=======XtRemoveTimeOut; timers:
=======
events.c:4877: read_events 262143
events.c:4928: (flaky) sig_flags = 0
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 8199; ev_newpage: 8192, ev_newdoc: 65536, ev_reload: 32768
events.c:5323: EVENT: EV_NEWPAGE | ...
events.c:5387: EVENT: redraw_page()
events.c:4877: read_events 262112
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 8199; ev_newpage: 8192, ev_newdoc: 65536, ev_reload: 32768
events.c:5323: EVENT: EV_NEWPAGE | ...
events.c:5387: EVENT: redraw_page()
events.c:4877: read_events 262143
util.c:1386: SRC: checking filename "pstricks.pro"
util.c:1416: SRC: Trying globals.dvi_file.dirname: "/home/otter/HD/docs/phd/rssbpaper/pstricks.pro"
util.c:1459: SRC: trying kpathsearch for filename "pstricks.pro" from /home/otter/HD/docs/phd/rssbpaper/
util.c:1478: SRC: Found file: `/usr/share/texmf/dvips/pstricks/pstricks.pro'
util.c:1386: SRC: checking filename "pst-dots.pro"
util.c:1416: SRC: Trying globals.dvi_file.dirname: "/home/otter/HD/docs/phd/rssbpaper/pst-dots.pro"
util.c:1459: SRC: trying kpathsearch for filename "pst-dots.pro" from /home/otter/HD/docs/phd/rssbpaper/
util.c:1478: SRC: Found file: `/usr/share/texmf/dvips/pstricks/pst-dots.pro'
util.c:1386: SRC: checking filename "pst-node.pro"
util.c:1416: SRC: Trying globals.dvi_file.dirname: "/home/otter/HD/docs/phd/rssbpaper/pst-node.pro"
util.c:1459: SRC: trying kpathsearch for filename "pst-node.pro" from /home/otter/HD/docs/phd/rssbpaper/
util.c:1478: SRC: Found file: `/usr/share/texmf/dvips/pstricks/pst-node.pro'
events.c:4877: read_events 262112
events.c:5117: EVENT: Redraw 539 x 714 at (0, 0) (base=0,0) **** This is the first line after I use forward search
events.c:4877: read_events 262143
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 3; ev_newpage: 8192, ev_newdoc: 65536, ev_reload: 32768
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 65; ev_newpage: 8192, ev_newdoc: 65536, ev_reload: 32768
x_util.c:91: SRC: test_scroll vertically: -171
x_util.c:108: SRC: test_scroll horizontally: -411
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 8193; ev_newpage: 8192, ev_newdoc: 65536, ev_reload: 32768
events.c:5323: EVENT: EV_NEWPAGE | ...
events.c:5387: EVENT: redraw_page()
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:4877: read_events 262143
events.c:5117: EVENT: Redraw 539 x 714 at (0, 0) (base=0,0)
events.c:5121: EVENT: Cursor: 0
events.c:4877: read_events 262143
events.c:4877: read_events 262142
events.c:5320: EVENT: globals.ev.flags: 3; ev_newpage: 8192, ev_newdoc: 65536, ev_reload: 32768
events.c:4877: read_events 262142
> You mean "events" instead of "event", right?
Right. The output doesn't show a problem - what changed in your system from the time when highlighting still worked? Could you send me a sample DVI file that shows the problem?
To be honest I don't remember when this behaviour changed... and I'm afraid to say that this is happening for all dvi files here. Perhaps I should try compile with motif as a workaround?
> I'm afraid to say that this is happening for all dvi files here.
just to make sure that it's not the source specials, please just send me one - e.g. a very small one consisting of 2 paragraphs, for which 'backward' search works and 'forward search' doesn't show the markers.
Did you compile xdvik yourself?
Simple DVI file
I've uploaded a simple DVI file where I can confirm that backward search and forward search work but nothing is shown in the latter case.
I did compile xdvik myself, but only because the binary supplied with openSUSE didn't work either...
Thanks for your help so far!
OK, there's nothing wrong with the source specials in that file, so it's a problem in xdvik itself. Could you experiment a bit with window redraw events, e.g. drag a window partly over the region where you would expect the bounding box to see if that makes the box appear? What's the output of "X -version"?
Another thing you could check is if the underlines for hyperlinks which are implemented similarly work: for the following example file, is the "Test" section entry in the TOC underlined?
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{Test}
test
\end{document}
X -version :
X.Org X Server 1.5.2
Release Date: 10 October 2008
X Protocol Version 11, Revision 0
Build Operating System: openSUSE SUSE LINUX
Current Operating System: Linux otter-laptop 2.6.27.25-0.1-default #1 SMP 2009-07-01 15:37:09 +0200 i686
Build Date: 02 July 2009 08:02:13AM
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Module Loader present
Underline was shown correctly in the TOC in the dvi once I used a \label macro under the \section macro... Forcing a window redraw in the in the way you suggested doesn't work though. Any more ideas?
patch for dvi-draw.c
At this point it's probably best to add more debugging code; I've attached a diff for texk/xdvik/dvi-draw.c, could you please apply it with:
cd texk/xdvik
patch < diffs
then recompile, do another forward search for your minimal DVI file and send me the output? It should print something for every redraw/expose event.
currwin.win == mane.win; -1
currwin.win == mane.win; -1
currwin.win == mane.win; 0
drawing bbox
drawing box 0
drawing at: 136, 128, 286, 652
The first two lines appear when xdvi starts from the console, and the last four when I attempt a forward search. Did I mention that the xdvi window doesn't gain focus when I attempt a forward search? I don't know if that's important, or even if this was always the normal behaviour... Reverse search from xdvik does return focus to the editor though.
And if you run xdvi with
-sync -debug dvi
does the "drawing at: ...." occur after the SETCHAR... commands?
Another thing to try: in read_events in texk/xdvik/events.c, replace:
for (;;) {
globals.ev.ctr = event_freq;
by:
for (;;) {
sleep(1);
globals.ev.ctr = event_freq;
recompile, and run this on your minimal example file - this will make drawing really slow, and you might see something, e.g. if the box is drawn and then disappears again.
"drawing at" comes last after everything else, especially SETCHAR commands
Adding the delay you suggested let me see letters being put down one at a time... And when it's over, nothing happening. I see the "drawing bbox" command and the like being printed in the console, but nothing happening in the application. Is there another debugging option I can turn on to see what is happening?
really strange. The next line would be the XDrawRectangle command. Maybe there's something wrong with that function? Could you try the following code in dvi-draw.c:
XPoint points[2];
points[0] = ul;
points[1] = ll;
fprintf(stderr, "drawing at: %d, %d, %d, %d\n",
min_x, min_y, max_x, max_y);
XDrawLines(DISP, mane.win, globals.gc.fore, points, 2, CoordModeOrigin);
/*
XDrawRectangle(DISP, mane.win, globals.gc.high,
min_x, min_y, max_x - min_x, max_y - min_y);
*/
Do you see a line then? What if you replace globals.gc.fore with globals.gc.high?
OK perhaps it is the XDrawRectangle command, because I saw a foreground colour (black) line on the left of the "special" text the first time, and highlight colour (red) the second time. At least I can see where the relevant text is now :) What next?
That's really weird - it must mean that XDrawRectangle is somehow broken in your X implementation ... searching the web for bug reports didn't turn up anything though. Does using the following work?
XPoint points[5];
points[0] = ll;
points[1] = ul;
points[2] = ur;
points[3] = lr;
points[4] = ll;
XDrawLines(DISP, mane.win, globals.gc.high, points, 5, CoordModeOrigin);
/*
XDrawRectangle(DISP, mane.win, globals.gc.high,
min_x, min_y, max_x - min_x, max_y - min_y);
*/
Great that works :) I suppose it wasn't a bug in xdvik after all... Thank you for all your help!
good :-) Closing as "Invalid/not a bug" since XDrawRectangle ought to work - but I guess I'll replace it by XDrawLines in future releases just to be on the safe side.