This patch enhances the viewer command line syntax by adding special
tokens $$p (path) and $$i (input file). This allows to support
mozilla, which needs a command like
mozilla file://$$p$$i
Note that the command line for mozilla can be improved (maybe
OpenUrl?) and that I am open to adding other html viewrs later
(although I'd think mozilla is the most important and other people can
do it themselves).
OK to apply? I'd like to have comments from Dekel, since it is his
code in the first place.
JMarc
? config.h.in
Index: lib/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v
retrieving revision 1.304
diff -u -p -r1.304 ChangeLog
--- lib/ChangeLog 14 Oct 2002 12:56:21 -0000 1.304
+++ lib/ChangeLog 16 Oct 2002 14:56:37 -0000
@@ -1,3 +1,7 @@
+2002-10-16 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
+
+ * configure.m4: add mozilla as default previewer for html
+
2002-10-14 Andr� P�nitz <[EMAIL PROTECTED]>
* ui/default.ui: support for flalign
Index: lib/configure.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v
retrieving revision 1.53
diff -u -p -r1.53 configure.m4
--- lib/configure.m4 11 Oct 2002 18:17:24 -0000 1.53
+++ lib/configure.m4 16 Oct 2002 14:56:37 -0000
@@ -253,7 +253,7 @@ SEARCH_PROG([for a PDF preview],PDF_VIEW
SEARCH_PROG([for a DVI previewer],DVI_VIEWER, xdvi windvi yap)
# Search something to preview html
-SEARCH_PROG([for a HTML previewer],HTML_VIEWER, netscape)
+SEARCH_PROG([for a HTML previewer],HTML_VIEWER, "mozilla file://\$\$p\$\$i" netscape)
# Search for a program to preview latex code
SEARCH_PROG([for a LaTeX preview],LATEX_VIEWER, "xterm -e less")
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.955
diff -u -p -r1.955 ChangeLog
--- src/ChangeLog 14 Oct 2002 14:59:50 -0000 1.955
+++ src/ChangeLog 16 Oct 2002 14:56:38 -0000
@@ -1,3 +1,9 @@
+2002-10-16 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
+
+ * converter.C (view): add support for $$i (file name) and $$p
+ (file path) for the viewer command. If $$i is not specified, then
+ it is appended to the command (for compatibility with old syntax)
+
2002-10-14 Juergen Vigna <[EMAIL PROTECTED]>
* undo_funcs.C (textHandleUndo): alter the order in which the
Index: src/converter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/converter.C,v
retrieving revision 1.56
diff -u -p -r1.56 converter.C
--- src/converter.C 13 Aug 2002 14:40:30 -0000 1.56
+++ src/converter.C 16 Oct 2002 14:56:38 -0000
@@ -51,6 +51,7 @@ namespace {
string const token_from("$$i");
string const token_base("$$b");
string const token_to("$$o");
+string const token_path("$$p");
//////////////////////////////////////////////////////////////////////////////
@@ -194,7 +195,12 @@ bool Formats::view(Buffer const * buffer
command += 'r';
}
- command += " " + QuoteName(OnlyFilename((filename)));
+ if (!contains(command, token_from))
+ command += " " + token_from;
+
+ command = subst(command, token_from,
+ QuoteName(OnlyFilename(filename)));
+ command = subst(command, token_path, QuoteName(OnlyPath(filename)));
lyxerr[Debug::FILES] << "Executing command: " << command << endl;
ShowMessage(buffer, _("Executing command:"), command);