* call-process vs start-process
@ 2002-06-24 21:21 Dan Nicolaescu
0 siblings, 0 replies; only message in thread
From: Dan Nicolaescu @ 2002-06-24 21:21 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]
I am trying to use a new facility in xdvi, opening a .dvi file at a
specific position in the .tex file.
You need a recent xdvi
Do an xdvi -h to check that it has the -sourceposition command line
option.
A recent one can be downloaded from:
http://math.berkeley.edu/~vojta/xdvi.html
I used xdvi-22.58
I run emacs-21.2 on sparc-sun-solaris2.7 and x86-linux-gnu
The following command will not display an xdvi window:
M-: (start-process "MYXDVI" "OUTPUT_BUFFER" "/bin/sh" "-c" "/tmp/xdvi/bin/xdvi -sourceposition 1:test.tex /tmp/test.dvi") RET
but this one will:
M-: (call-process "/bin/sh" nil 0 nil "-c" "/tmp/xdvi/bin/xdvi -sourceposition 1:test.tex /tmp/test.dvi") RET
I used absolute paths to make sure that the right xdvi is run.
When not using -sourceposition both commands work.
When using -sourceposition xdvi forks, the parent process exits and
the child process displays the xdvi window (when not using
-sourceposition xdvi does not fork).
When using `start-process' the child process seems to be killed by a
SIGHUP from emacs. Is this OK? Is emacs supposed to send SIGHUP to the
child process? The parent exits without error? Or this is some problem
with signals?
I have attached the .dvi and tex files for testing.
Thanks.
--dan
[-- Attachment #2: test.dvi --]
[-- Type: application/x-dvi, Size: 2920 bytes --]
[-- Attachment #3: test.tex --]
[-- Type: application/x-tex, Size: 2063 bytes --]
[-- Attachment #4: srcltx.sty --]
[-- Type: application/octet-stream, Size: 3936 bytes --]
%%
%% This is file `srcltx.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% srcltx.dtx (with options: `package,latex')
%%
%% This package is in the public domain. It comes with no guarantees
%% and no reserved rights. You can use or modify this package at your
%% own risk.
%% Originally written by: Aleksander Simonic
%% Current maintainer: Stefan Ulrich <ulrich@cis.uni-muenchen.de>
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{srcltx}[2002/01/21 v1.2b DVI Search]
\newif\ifSRCOK \SRCOKtrue
\newif\ifsrc@debug@
\newif\ifsrc@dviwin@
\newif\ifsrc@everypar@\src@everypar@true
\newif\ifsrc@everymath@\src@everymath@true
\DeclareOption{active}{\SRCOKtrue}
\DeclareOption{inactive}{\SRCOKfalse}
\DeclareOption{debug}{\src@debug@true}
\DeclareOption{nopar}{\global\src@everypar@false}
\DeclareOption{nomath}{\global\src@everymath@false}
\newcommand*\src@maybe@space{}
\let\src@maybe@space\space
\DeclareOption{dviwin}{\let\src@maybe@space\relax}
\ExecuteOptions{active}
\ProcessOptions
\newcount\src@lastline
\global\src@lastline=-1
\newcommand*\src@debug{}
\def\src@debug#1{\ifsrc@debug@\typeout{DBG: |#1|}\fi}
\newcommand*\MainFile{}
\def\MainFile{\jobname.tex}
\newcommand*\CurrentInput{}
\gdef\CurrentInput{\MainFile}
\newcommand*\WinEdt{}
\def\WinEdt#1{\typeout{:#1}}
\newcommand\src@AfterFi{}
\def\src@AfterFi#1\fi{\fi#1}
\AtBeginDocument{%
\@ifpackageloaded{soul}{%
\let\src@SOUL@\SOUL@
\def\SOUL@#1{%
\ifSRCOK
\SRCOKfalse\src@SOUL@{#1}\SRCOKtrue
\else
\src@AfterFi\src@SOUL@{#1}%
\fi
}%
}{}%
}
\newcommand*\src@spec{}
\def\src@spec{%
\ifSRCOK
\ifnum\inputlineno>\src@lastline
\global\src@lastline=\inputlineno
\src@debug{%
src:\the\inputlineno\src@maybe@space\CurrentInput}%
\special{src:\the\inputlineno\src@maybe@space\CurrentInput}%
\fi
\fi
}
\newcommand\src@before@file@hook{}
\newcommand\src@after@file@hook{}
\def\src@before@file@hook#1{%
\protected@xdef\CurrentInput{#1}%
\WinEdt{<+ \CurrentInput}%
\global\src@lastline=0
\ifSRCOK\special{src:1\CurrentInput}\fi
}
\def\src@after@file@hook#1{%
\WinEdt{<-}%
\global\src@lastline=\inputlineno
\global\advance\src@lastline by -1%
\gdef\CurrentInput{#1}%
\src@spec
}
\newcommand*\src@include{}
\newcommand*\src@@include{}
\let\src@include\include
\AtBeginDocument{%
\def\include#1{%
\src@spec
\clearpage
\expandafter\src@@include\expandafter{\CurrentInput}{#1}%
}%
}
\def\src@@include#1#2{%
\src@before@file@hook{#2.tex}%
\src@include{#2}%
\src@after@file@hook{#1}%
}
\newcommand*\src@input{}
\newcommand*\src@@input{}
\newcommand*\src@@@input{}
\let\src@input\input
\AtBeginDocument{%
\def\input{\src@spec\@ifnextchar\bgroup\src@@input\@@input}%
}
\def\src@@input#1{%
\expandafter\src@@@input\expandafter{\CurrentInput}{#1}%
}
\def\src@@@input#1#2{%
\src@before@file@hook{#2}%
\src@input{#2}%
\src@after@file@hook{#1}%
}
\newcommand\Input{}
\let\Input\input
\ifsrc@everypar@
\newcommand*\src@everypar{}
\let\src@everypar\everypar
\newtoks\everypar
\src@everypar{\the\everypar\expandafter\src@spec}
\else
\everypar\expandafter{\the\everypar\expandafter\src@spec}
\fi
\ifsrc@everymath@
\everymath\expandafter{\the\everymath\expandafter\src@spec}
\fi
\newcommand*\src@bibliography{}
\newcommand*\src@@bibliography{}
\let\src@bibliography\bibliography
\def\bibliography#1{%
\expandafter\src@@bibliography\expandafter{\CurrentInput}{#1}%
}
\def\src@@bibliography#1#2{%
\src@before@file@hook{\jobname.bbl}%
\src@bibliography{#2}%
\src@after@file@hook{#1}%
}
\output\expandafter{\expandafter\SRCOKfalse\the\output}
\endinput
%%
%% End of file `srcltx.sty'.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-06-24 21:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-24 21:21 call-process vs start-process Dan Nicolaescu
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).