From bffc094ccdd152c4fa0b1e23dc6e5f0cda907697 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 19 Nov 2002 10:33:20 +0000 Subject: [PATCH] allow to specify arguments for viewers; mozilla is now the default HTML viewer git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH-1_2_X@5667 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 ++++ lib/configure.m4 | 2 +- src/ChangeLog | 6 ++++++ src/converter.C | 8 +++++++- status.12x | 5 +++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index f73626033d..bb63a9af6a 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2002-10-16 Jean-Marc Lasgouttes + + * configure.m4: add mozilla as default previewer for html + 2002-11-15 Jean-Marc Lasgouttes * lib/ru_splash.lyx: update from Vitaly Lipatov diff --git a/lib/configure.m4 b/lib/configure.m4 index d73854788b..431969e39f 100644 --- a/lib/configure.m4 +++ b/lib/configure.m4 @@ -253,7 +253,7 @@ SEARCH_PROG([for a PDF preview],PDF_VIEWER,acroread gv ghostview xpdf) 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 convert ps to pdf SEARCH_PROG([for a PS to PDF converter],ps_to_pdf_command,ps2pdf) diff --git a/src/ChangeLog b/src/ChangeLog index 32c0cadb98..899b4e7004 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2002-10-16 Jean-Marc Lasgouttes + + * 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-24 Dekel Tsur * paragraph.C (TeXOnePar): Fix bug with language changes in nested diff --git a/src/converter.C b/src/converter.C index 293fed5f43..99aa60ea79 100644 --- a/src/converter.C +++ b/src/converter.C @@ -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, string const & filename, 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); diff --git a/status.12x b/status.12x index 43e5b0ffbf..ec9e429447 100644 --- a/status.12x +++ b/status.12x @@ -22,6 +22,11 @@ What's new - selecting a word by double clicking now sets the X clipboard (like when dragging the mouse) +- it is now possible to specify the arguments for viewers; in + particular, this means that it is possible to use browsers which + require a file: URL as HTML viewers (mozilla is used as default if + found) + - when changing the current layout with the toolbar, the corresponding keyboard binding is shown in the minibuffer