Hello,

This is my preliminary patch for inverse (dvi) search in lyx. It relies on
latex to insert 'source specials', so latex must support the option
--src-specials. Also, xdvi must support 'source specials'. My versions
are:

tetex: 1.0.7+20011202
xdvi: 22.40f

Both support 'source special'.

How to use it:

1. Apply the patch :)
2. Copy 'lyxeditor' to somewere and make it executable.
3. Define the environment variable XEDITOR (needed by xdvi)

     export XEDITOR='/path/to/lyxeditor %f %l'

4. Configure lyx to use pipes named ~/lyxpipe.in and ~/lyxpipe.out (put
~/.lyx/lyxpipe in Edit->Preferences->Paths->Lyxserver pipe.

5. Change the contents of Edit->Preferences->Converters->
(Latex -> DVI)->Converter to 'latex --src-specials $$i'

Now open some file, View->DVI, scroll some pages down and press the first
mouse button holding the Control key. Lyx will jump to the selected point
in text. If you have multiple lyx files opened, the correct buffer will be
selected.

The patch should work both using temporary directory or not.

I will be glad to work more on it if needed.

Regards,
Joao.

PS. Thanks to Angus and Lars for .emacs lines. I'm using them!
#!/bin/bash

lyxpipe=~/.lyx/lyxpipe

if ! [ -p $lyxpipe.in ]; then
    echo "No fifo to communicate with lyx."
    exit 0
fi

echo LYXCMD:xdvi:server-goto-file-row:$1 $2 > $lyxpipe.in
read < $lyxpipe.out

Attachment: inverse-search.diff.gz
Description: Binary data

Reply via email to