]> git.lyx.org Git - features.git/commitdiff
various fixes from John, Martin and Kayvan, plus one of mine. Read ChangeLogs
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 7 Jan 2002 10:17:44 +0000 (10:17 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 7 Jan 2002 10:17:44 +0000 (10:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3299 a592a061-630c-0410-9148-cb99ea01b6c8

18 files changed:
lib/ChangeLog
lib/examples/noweb2lyx.lyx
src/BufferView_pimpl.C
src/ChangeLog
src/box.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/xforms_helpers.C
src/insets/ChangeLog
src/insets/insetinclude.C
src/insets/insettext.C
src/lyxfunc.C
src/support/ChangeLog
src/support/FileInfo.C
src/support/FileInfo.h
src/support/filetools.C
src/vc-backend.C

index 42521e498da06bd7586aa43667217e9dd4d5ccc9..ccaedb2c2eef9f0c4e6dd934a5628cd145ff3dd4 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-05 Kayvan A. Sylvan <kayvan@sylvan.com>
+
+       * examples/noweb2lyx.lyx: Updated for lyx-1.2.0. Also got rid of
+       a harmless noweb error.
+
 2002-01-04  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * ui/default.ui: added dots "..." to insert->include file.
index 3ff5261cd13e7c027fc49bd50cc9b01f3ad3e403..60204b04eb01b000ecddadad5b2bd68b8cc80d95 100644 (file)
@@ -1,6 +1,5 @@
-#This file was created by <kayvan> Sun May  2 15:56:35 1999
-#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
-\lyxformat 2.15
+#LyX 1.2 created this file. For more info see http://www.lyx.org/
+\lyxformat 220
 \textclass literate-article
 \begin_preamble
 %
@@ -22,6 +21,8 @@
 \paperpackage a4
 \use_geometry 0
 \use_amsmath 0
+\use_natbib 0
+\use_numerical_citations 0
 \paperorientation portrait
 \secnumdepth 3
 \tocdepth 3
@@ -98,30 +99,22 @@ noweb
 # Copyright (C) 1999 Kayvan A.
  Sylvan <kayvan@sylvan.com>
 \newline 
-#
-\protected_separator 
-You are free to use and modify this code under the terms of
+# You are free to use and modify this code under the terms of
 \newline 
 # the GNU General Public Licence version 2 or later.
 \newline 
 #
 \newline 
-#
-\protected_separator 
-Written with assistance from:
+# Written with assistance from:
 \newline 
-# 
-\protected_separator 
- Edmar Wienskoski Jr.
+#   Edmar Wienskoski Jr.
  <edmar-w-jr@technologist.com>
 \newline 
-# 
-\protected_separator 
- Amir Karger <karger@post.harvard.edu>
+#   Amir Karger <karger@post.harvard.edu>
 \newline 
 #
 \newline 
-# $Id: noweb2lyx.lyx,v 1.2 2000/11/03 11:21:36 lasgouttes Exp $
+# $Id: noweb2lyx.lyx,v 1.3 2002/01/07 10:17:42 lasgouttes Exp $
 \newline 
 #
 \newline 
@@ -160,7 +153,23 @@ We can do arbitrary LaTeX code here.
 Code chunks look like this:
 \layout LyX-Code
 
-<<Name of chunk here>>=
+<
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+{}
+\end_inset 
+
+<Name of chunk here>
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+{}
+\end_inset 
+
+>=
 \newline 
 {...
  code for the chunk goes here ...}
@@ -172,7 +181,23 @@ The ``@'' is a necessary delimiter to end the code chunk.
  The other form that the ``@'' line takes is as follows:
 \layout LyX-Code
 
-<<Name of chunk here>>=
+<
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+{}
+\end_inset 
+
+<Name of chunk here>
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+{}
+\end_inset 
+
+>=
 \newline 
 {...
  code for the chunk ...}
@@ -198,11 +223,14 @@ noweb
 \noun default 
  code chunks.
  This proved to be too hard and presents other problems
-\begin_float footnote 
+\begin_inset Foot
+collapsed true
+
 \layout Standard
 
 Not the least of these problems is the fact that << is a quote in French.
-\end_float 
+\end_inset 
+
 .
  On the other hand, it turns out that reLyX contains a very useful literal
  quoting mechanism.
@@ -251,13 +279,57 @@ noweb2lyx
  We want to be able to run it as a simple pre-processor and post-processor
  from within reLyX.
  We can accomplish this by setting the flags 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[pre_only]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  and 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[post_only]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  before we reach the main conversion code.
 \layout Standard
 
@@ -269,31 +341,19 @@ With all that preamble out of the way, we now have the basic high-level
 \newline 
 if (!$post_only) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-<<Transform noweb for reLyX>>
+  <<Transform noweb for reLyX>>
 \newline 
 }
 \newline 
 if ((!$pre_only) && (!$post_only)) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-<<Run reLyX on intermediate file>>
+  <<Run reLyX on intermediate file>>
 \newline 
 }
 \newline 
 if (!$pre_only) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-<<Fix up LyX file>>
+  <<Fix up LyX file>>
 \newline 
 }
 \newline 
@@ -319,11 +379,7 @@ inputline: while(<INPUT>)
 \newline 
 {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-if (/^
+  if (/^
 \backslash 
 s*
 \backslash 
@@ -335,39 +391,15 @@ s*
 \backslash 
 >=/) { # Beginning of a noweb scrap
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-<<Read in and output the noweb code chunk>>
+    <<Read in and output the noweb code chunk>>
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-} elsif (/^@
+  } elsif (/^@
 \backslash 
 s+(.*)/) { # Beginning of a documentation chunk
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-print OUTPUT $1; # We do not need the ``@'' part
+    print OUTPUT $1; # We do not need the ``@'' part
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-} elsif (/
+  } elsif (/
 \backslash 
 [
 \backslash 
@@ -377,37 +409,13 @@ print OUTPUT $1; # We do not need the ``@'' part
 \backslash 
 ]/) { # noweb quoted code
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-<<Perform special input quoting of [[var]]>>
+    <<Perform special input quoting of [[var]]>>
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-} else {
+  } else {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-print OUTPUT; # Just let the line pass through
+    print OUTPUT; # Just let the line pass through
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-}
+  }
 \newline 
 }
 \newline 
@@ -437,9 +445,31 @@ print OUTPUT;
 \layout Standard
 
 While reading in the 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[INPUT]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  file, once we have identified a 
 \noun on 
 noweb
@@ -466,13 +496,57 @@ In
 noweb2lyx
 \noun default 
 , we will use 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[INPUT]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  and 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[OUTPUT]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  to read and write files.
  In the code fragment above, we need to read from the input file and write
  to a file that will be later transformed by reLyX.
@@ -484,25 +558,13 @@ noweb2lyx
 \newline 
 if ($pre_only) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-&setup_files($input_file, $output_file);
+  &setup_files($input_file, $output_file);
 \newline 
 } else {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-$relyx_file = "temp$$";
+  $relyx_file = "temp$$";
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-&setup_files($input_file, $relyx_file);
+  &setup_files($input_file, $relyx_file);
 \newline 
 }
 \newline 
@@ -510,9 +572,31 @@ $relyx_file = "temp$$";
 \layout Standard
 
 This code uses a small perl subroutine, 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[setup_files]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
 , which we define below:
 \layout Scrap
 
@@ -520,35 +604,19 @@ This code uses a small perl subroutine,
 \newline 
 sub setup_files {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-my($in, $out) = @_;
+  my($in, $out) = @_;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-open(INPUT, "<$in") || die "Can not read $in: $!
+  open(INPUT, "<$in") || die "Can not read $in: $!
 \backslash 
 n";
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-open(OUTPUT, ">$out") || die "Can not write $out: $!
+  open(OUTPUT, ">$out") || die "Can not write $out: $!
 \backslash 
 n";
 \newline 
 }
 \newline 
-@ %def setup_files 
-\protected_separator 
-
-\protected_separator 
-
+@ %def setup_files   
 \layout Subsection
 
 Reading in the 
@@ -575,45 +643,25 @@ $endLine = "";
 \newline 
 scrapline: while (<INPUT>) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-last scrapline if /^@
+  last scrapline if /^@
 \backslash 
 s+/;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-$savedScrap .= $_;
+  $savedScrap .= $_;
 \newline 
 };
 \newline 
 switch: {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-if (/^@
+  if (/^@
 \backslash 
 s+$/) {$savedScrap .= $_; last switch; }
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-if (/^@
+  if (/^@
 \backslash 
 s+%def.*$/) {$savedScrap .= $_; last switch; }
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-if (/^@
+  if (/^@
 \backslash 
 s+(.*)$/) {$savedScrap .= "@
 \backslash 
@@ -660,13 +708,57 @@ print OUTPUT "$endLine";
 \layout Standard
 
 Finally, we need to close the 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[INPUT]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  and 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[OUTPUT]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  files.
 \layout Scrap
 
@@ -684,9 +776,31 @@ Running reLyX
 
 In this section, we describe and implement the code that runs reLyX on the
  intermediate file 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[relyx_file]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
 .
  
 \layout Subsection
@@ -719,7 +833,9 @@ noweb2lyx
 noweb2lyx.nw
 \emph default 
  file that is generated by LyX
-\begin_float footnote 
+\begin_inset Foot
+collapsed true
+
 \layout Standard
 
 reLyX searches for 
@@ -727,15 +843,60 @@ reLyX searches for
 
 \backslash 
 doc
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 {}
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
 ument
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 {}
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
 class and gets confused, so we have to obfuscate it slightly.
-\end_float 
+\end_inset 
+
 .
  With the regular expression as it is, we can actually run 
 \noun on 
@@ -748,11 +909,7 @@ noweb2lyx
 \newline 
 open(INPUT, "<$relyx_file") ||
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-die "Can not read $relyx_file: $!
+  die "Can not read $relyx_file: $!
 \backslash 
 n";
 \newline 
@@ -760,41 +917,17 @@ $class = "article"; # default if none found
 \newline 
 parse: while(<INPUT>) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-if (/
+  if (/
 \backslash 
 
 \backslash 
 docu[m]entclass{(.*)}/) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-$class = $1;
+    $class = $1;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-last parse;
+    last parse;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-}
+  }
 \newline 
 }
 \newline 
@@ -818,11 +951,7 @@ die "reLyX returned non-zero: $!
 \backslash 
 n"
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-if (system("reLyX -c $doc_class $relyx_file"));
+  if (system("reLyX -c $doc_class $relyx_file"));
 \newline 
 @
 \layout Standard
@@ -856,23 +985,11 @@ line: while(<INPUT>)
 \newline 
 {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-<<Fix code chunks in latex layout>>
+  <<Fix code chunks in latex layout>>
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-<<Fix [[var]] noweb construct>>
+  <<Fix [[var]] noweb construct>>
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-print OUTPUT; # default
+  print OUTPUT; # default
 \newline 
 } 
 \newline 
@@ -882,13 +999,57 @@ print OUTPUT; # default
 \layout Standard
 
 Note that in the perl code that is contained in the 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[while(<INPUT>)]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  loop above, the perl construct 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[next line]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  is sufficient to restart the loop.
  We can use this construct to do some relatively complex parsing of the
  reLyX generated file.
@@ -898,13 +1059,57 @@ File input and output for the post-processing
 \layout Standard
 
 Setting up the 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[INPUT]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  and 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 [[OUTPUT]]
-\latex default 
+\end_inset 
+
+
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
  is taken care of by this code:
 \layout Scrap
 
@@ -912,17 +1117,11 @@ Setting up the
 \newline 
 if ($post_only) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-&setup_files("$input_file", "$output_file");
+  &setup_files("$input_file", "$output_file");
 \newline 
 } else {
 \newline 
-
-\protected_separator 
- &setup_files("$relyx_file.lyx", "$output_file");
+  &setup_files("$relyx_file.lyx", "$output_file");
 \newline 
 }
 \newline 
@@ -944,61 +1143,23 @@ if (/
 \backslash 
 latex latex/) { # Beginning of some latex code
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-if (($line = <INPUT>) =~ /^
+  if (($line = <INPUT>) =~ /^
 \backslash 
 s*<</) { # code scrap
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-\protected_separator 
-<<Transform this chunk into layout scrap>>
+    <<Transform this chunk into layout scrap>>
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-} else {
+  } else {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-# print the 
+    # print the 
 \backslash 
 latex latex line + next line
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-
-\protected_separator 
-print OUTPUT "$_$line";
+    print OUTPUT "$_$line";
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-}
+  }
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-next line;
+  next line;
 \newline 
 }
 \newline 
@@ -1023,17 +1184,9 @@ n$line";
 \newline 
 codeline: while (<INPUT>) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-$savedScrap .= $_;
+  $savedScrap .= $_;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-last codeline if /^@
+  last codeline if /^@
 \backslash 
 s+/;
 \newline 
@@ -1054,39 +1207,23 @@ Okay, now we just need to eat the rest of the latex layout.
 \newline 
 slurp: while (<INPUT>) {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-last slurp if /
+  last slurp if /
 \backslash 
 
 \backslash 
 latex /;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-next slurp if /
+  next slurp if /
 \backslash 
 
 \backslash 
 newline/;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-next slurp if /^
+  next slurp if /^
 \backslash 
 s*$/;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-warn "confused by line: $_";
+  warn "confused by line: $_";
 \newline 
 }
 \newline 
@@ -1136,11 +1273,7 @@ if (/
 \backslash 
 ]/) { # special code for [[var]]
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-s/
+  s/
 \backslash 
 [
 \backslash 
@@ -1164,17 +1297,9 @@ latex default
 \backslash 
 n/g;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-print OUTPUT;
+  print OUTPUT;
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-next line;
+  next line;
 \newline 
 }
 \newline 
@@ -1212,53 +1337,23 @@ noweb2lyx
 \newline 
 if ($ARGV[0] eq "-pre") {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-&usage unless ($#ARGV == 2);
+  &usage unless ($#ARGV == 2);
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-$input_file = $ARGV[1]; $output_file = $ARGV[2]; $pre_only = 1;
+  $input_file = $ARGV[1]; $output_file = $ARGV[2]; $pre_only = 1;
 \newline 
 } elsif ($ARGV[0] eq "-post") {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-&usage unless ($#ARGV == 2);
+  &usage unless ($#ARGV == 2);
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-$input_file = $ARGV[1]; $output_file = $ARGV[2]; $post_only = 1;
+  $input_file = $ARGV[1]; $output_file = $ARGV[2]; $post_only = 1;
 \newline 
 } else {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-&usage unless ($#ARGV == 1);
+  &usage unless ($#ARGV == 1);
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-$input_file = $ARGV[0];
-\protected_separator 
-$output_file = $ARGV[1];
+  $input_file = $ARGV[0]; $output_file = $ARGV[1];
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-$pre_only = 0; $post_only = 0;
+  $pre_only = 0; $post_only = 0;
 \newline 
 }
 \newline 
@@ -1269,11 +1364,7 @@ $pre_only = 0; $post_only = 0;
 \newline 
 sub usage() {
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-print "Usage: noweb2lyx [-pre | -post] input-file output-file
+  print "Usage: noweb2lyx [-pre | -post] input-file output-file
 \newline 
 
 \newline 
@@ -1287,11 +1378,7 @@ In case of bugs, Email Kayvan Sylvan <kayvan
 \backslash 
 n";
 \newline 
-
-\protected_separator 
-
-\protected_separator 
-exit;
+  exit;
 \newline 
 }
 \newline 
@@ -1341,18 +1428,48 @@ Macros
 \layout Standard
 
 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 
 \backslash 
 nowebchunks
+\end_inset 
+
+
 \layout Section*
 
 Identifiers
 \layout Standard
 
 
-\latex latex 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 
 \backslash 
 nowebindex
+\end_inset 
+
+
 \the_end
index da45676c33d8a96f95710361ae71e5a865b643c1..ef79987295c11db738a4c1e8c20dd5aeacfa2712 100644 (file)
@@ -910,6 +910,8 @@ Inset * BufferView::Pimpl::checkInset(LyXText const & text, LyXCursor const & cu
        Box b(insetDimensions(text, cursor));
 
        if (!b.contained(x, y)) {
+               lyxerr[Debug::GUI] << "Missed inset at x,y " << x << "," << y 
+                       << " box " << b << endl;
                return 0;
        }
  
index a7d0c79ba59f11ed2d6fed15a49da7afc065d298..7fe4b654dbdd9c15223c11736af7527bbda855d9 100644 (file)
@@ -1,3 +1,19 @@
+2002-01-06  John Levon  <moz@compsoc.man.ac.uk>
+
+       * box.h: make signed dimensions to allow insets wider than
+         the screen (bug #162)
+
+       * BufferView_pimpl.C: add some insetHit debug
+2002-01-05  John Levon  <moz@compsoc.man.ac.uk>
+
+       * vc-backend.C: add FIXME
+2002-01-03  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * lyxfunc.C (getStatus): enable code for showing math font status
+       in toolbar/menu.
+
 2002-01-07  Juergen Vigna  <jug@sad.it>
 
        * text.C (nextBreakPoint): removed debug output not needed anymore.
 
        * lyxfunc.C (dispatch): add a finishUndo() in LFUN_ESCAPE.
 
-2002-01-03     Martin Vermeer <martin.vermeer@hut.fi>
+2002-01-03  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * FormMathsPanel.C:
        * FormMathsPanel.h
        * MathsSymbols.C:
        * form_maths_panel.C:
        * form_maths_panel.h:
-       * form_maths_panel.fd:
-       implemented sub- and super- buttons in math panel.
+       * form_maths_panel.fd: implemented sub- and super- buttons in math
+       panel. 
 
-       * lyx_main.C:
-       Revised hardwired bindings to allow original _ and ^ (or ^ space)
-       to be used as in TeX (req'd byAndré).
-
-       * lyxfunc.C:
-       Allow ^and _ again to be used both as super/subscript (mathed)
-       and as themselves (in text).
+       * lyx_main.C: Revised hardwired bindings to allow original _ and ^
+       (or ^ space) to be used as in TeX (req'd by André).
 
+       * lyxfunc.C: Allow ^ and _ again to be used both as
+       super/subscript (mathed) and as themselves (in text).
 
 2002-01-03  Allan Rae  <rae@lyx.org>
 
@@ -47,7 +60,7 @@
 
        * XFormsView.C (setWindowTitle): also set icon title.
 
-       * LyXView.h: (setWindowTitle): signature changed.
+       * LyXView.h (setWindowTitle): signature changed.
        * XFormsView.h (setWindowTitle): ditto.
 
 2002-01-02  Juergen Vigna  <jug@sad.it>
index a42a1b84c6768f4e6d6c8a140655f67d8d793730..60efc7556298d393503c1c309896796dec7f6ac0 100644 (file)
--- a/src/box.h
+++ b/src/box.h
  * It is expected that the box be constructed in
  * normalised form, that is to say : x1,y1 is top-left,
  * x2,y2 is bottom-right.
+ *
+ * Negative values are allowed.
  */
 struct Box {
-       unsigned int x1;
-       unsigned int x2;
-       unsigned int y1;
-       unsigned int y2;
+       int x1;
+       int x2;
+       int y1;
+       int y2;
 
-       Box(unsigned int x1_, unsigned int x2_,
-               unsigned int y1_, unsigned int y2_) :
+       Box(int x1_, int x2_,
+               int y1_, int y2_) :
                x1(x1_), x2(x2_), y1(y1_), y2(y2_) {}
 
        /**
@@ -30,10 +32,18 @@ struct Box {
         * the box. Check is exclusive (point on a border
         * returns false).
         */
-       bool contained(unsigned int x, unsigned int y) {
+       bool contained(int x, int y) {
                return (x1 < x && x2 > x &&
                        y1 < y && y2 > y);
        }
+
+        
 };
  
+inline std::ostream & operator<<(std::ostream & o, Box & b)
+{
+       return o << "x1,y1: " << b.x1 << "," << b.y1
+               << " x2,y2: " << b.x2 << "," << b.y2 << std::endl;
+}
 #endif // BOX_H
index 931880984b58f837dc3bba3f47738b81165b73d4..45f67083139bb2d653fbfb143a04f50b73cd7c90 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-05  John Levon  <moz@compsoc.man.ac.uk>
+
+       * FormFiledialog.C: add FIXME
+       * xforms_helpers.C: fix use of FileInfo
 2002-01-07  John Levon  <moz@compsoc.man.ac.uk>
 
        * FormTabular.h:
index 01fe39f2f881af21bec7dd83a816682eee01b09a..f9357d35d2c6559717b3e8efecab3802fcbfa2c5 100644 (file)
@@ -24,8 +24,6 @@
 #include "helper_funcs.h"
 
 using std::vector;
-using std::back_inserter;
-using std::transform;
 using namespace character;
 
 typedef FormCB<ControlCharacter, FormDB<FD_form_character> > base_class;
index dac125c7094bf9f86eafdf32828c21e288e15568..b5dfe5bc29f057ab35fbfaa09429b244f80b6d86 100644 (file)
@@ -241,7 +241,6 @@ void FileDialog::Private::Reread()
        iDepth = 0;
        string line, Temp;
        char szMode[15];
-       FileInfo fileInfo;
        string File = pszDirectory;
        if (File != "/") {
                File = split(File, Temp, '/');
@@ -276,7 +275,8 @@ void FileDialog::Private::Reread()
                // gets file status
                File = AddName(pszDirectory, fname);
 
-               fileInfo.newFile(File, true);
+               // FIXME: we don't get this file exists/stattable
+               FileInfo fileInfo(File, true);
                fileInfo.modeString(szMode);
                unsigned int nlink = fileInfo.getNumberOfLinks();
                string user =   lyxUserCache.find(fileInfo.getUid());
index fed3deae019b4f3a945aa8330e945c7fd9c73017..5675c285bd3417acc7b3b3e1e488a874477905b2 100644 (file)
@@ -400,7 +400,7 @@ bool RWInfo::WriteableDir(string const & name)
        }
 
        FileInfo const tp(name);
-       if (!tp.isDir()) {
+       if (!tp.isOK() || !tp.isDir()) {
                error_message = N_("Directory does not exist.");
                return false;
        }
@@ -424,7 +424,7 @@ bool RWInfo::ReadableDir(string const & name)
        }
 
        FileInfo const tp(name);
-       if (!tp.isDir()) {
+       if (!tp.isOK() || !tp.isDir()) {
                error_message = N_("Directory does not exist.");
                return false;
        }
@@ -459,7 +459,10 @@ bool RWInfo::WriteableFile(string const & name)
        }
 
        FileInfo d(name);
-       if (!d.isDir()) {
+
+       // FIXME: what is this supposed to do ?
+       // .newFile doesn't do what you think it does ... 
+       if (!d.isOK() || !d.isDir()) {
                d.newFile(dir);
        }
 
@@ -474,12 +477,12 @@ bool RWInfo::WriteableFile(string const & name)
        }
 
        FileInfo f(name);
-       if (dir == name || f.isDir()) {
+       if (dir == name || (f.isOK() && f.isDir())) {
                error_message = N_("A file is required, not a directory.");
                return false;
        }
 
-       if (f.exist() && !f.writable()) {
+       if (f.isOK() && f.exist() && !f.writable()) {
                error_message = N_("Cannot write to this file.");
                return false;
        }
@@ -504,7 +507,8 @@ bool RWInfo::ReadableFile(string const & name)
        }
 
        FileInfo d(name);
-       if (!d.isDir()) {
+       // FIXME: what is this supposed to do ?
+       if (!d.isOK() && !d.isDir()) {
                d.newFile(dir);
        }
 
@@ -519,7 +523,7 @@ bool RWInfo::ReadableFile(string const & name)
        }
 
        FileInfo f(name);
-       if (dir == name || f.isDir()) {
+       if (dir == name || (f.isOK() && f.isDir())) {
                error_message = N_("A file is required, not a directory.");
                return false;
        }
index 0778ecea6e8593d7a58d903327e74eebaa7ccb20..1ad6a500f4ed312ea819e69aaaea2c43bf01db1d 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-07  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * insettext.C: fix bug illustrated by attachment #37 of bug #59
+
+2002-01-05  John Levon  <moz@compsoc.man.ac.uk>
+
+       * insetinclude.C: fix use of FileInfo
 2002-01-07  Juergen Vigna  <jug@sad.it>
 
        * insettabular.C (draw): fixed clearing of cell around inset.
index e5bdfa473608d710e0f598616be6ec58f7ddcd75..a7f28753ad4df16b3b64488ad8575d86f1c4562e 100644 (file)
@@ -218,7 +218,7 @@ bool InsetInclude::loadIfNeeded() const
        
        // the readonly flag can/will be wrong, not anymore I think.
        FileInfo finfo(getFileName());
-       bool const ro = !finfo.writable();
+       bool const ro = !(!finfo.isOK() || finfo.writable());
        return bufferlist.readFile(getFileName(), ro) != 0;
 }
 
index c67cd03c4616f31215d27865a05ae8933a6a1ea5..e66a358ed054f3353135ea3ca3f64b423a7c6ffd 100644 (file)
@@ -394,7 +394,8 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
        if (!cleared && (top_x == int(x))
            && ((need_update&(INIT|FULL)) || (top_baseline != baseline)
                ||(last_drawn_width != insetWidth))) {
-               clearInset(bv, baseline, cleared);
+               // Condition necessary to eliminate bug 59 attachment 37
+               if (baseline > 0) clearInset(bv, baseline, cleared);
        }
 
        top_x = int(x);
index 0456ef8bd14433fc78f9389885c5c0a5e0c7eacd..90ef5d5c726bb37402e610414ac1346d024fa5ce 100644 (file)
@@ -723,7 +723,6 @@ func_status::value_type LyXFunc::getStatus(int ac,
                        break;
                }
        }
-#if 0
        else {
                MathTextCodes tc = mathcursor->getLastCode();
                switch (action) {
@@ -752,7 +751,6 @@ func_status::value_type LyXFunc::getStatus(int ac,
                        break;
                }
        }
-       #endif
        
        return flag;
 }
index e7af7d2147b5fac4df5884a930a42659fdadb5f2..a5c56e92a0c930b283a60995357649f74764ff62 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-05  John Levon  <moz@compsoc.man.ac.uk>
+
+       * filetools.C: fix use of FileInfo
+
+       * FileInfo.h:
+       * FileInfo.C: add Asserts and documentation
 2001-12-20  Kayvan A. Sylvan  <kayvan@sylvan.com>
 
        * os_win32.C: compilation fixes
index 49b7ba2c21ba4cc50f88af5d724cb7d1b0c23fc0..959e86363e76a7efbda1b0c4847a98982ff7d31e 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <cerrno>
 #include "FileInfo.h"
+#include "LAssert.h"
 
 #if !S_IRUSR
 # if S_IREAD
@@ -174,6 +175,8 @@ FileInfo & FileInfo::newFile(int fildes)
 // should not be in FileInfo
 char const * FileInfo::typeIndicator() const
 {
+       lyx::Assert(isOK());
        if (S_ISDIR(buf.st_mode)) return ("/");
 #ifdef S_ISLNK
        if (S_ISLNK(buf.st_mode)) return ("@");
@@ -192,6 +195,8 @@ char const * FileInfo::typeIndicator() const
 
 mode_t FileInfo::getMode() const
 {
+       lyx::Assert(isOK());
        return buf.st_mode;
 }
 
@@ -211,6 +216,8 @@ void FileInfo::modeString(char * szString) const
 // should not be in FileInfo
 char FileInfo::typeLetter() const
 {
+       lyx::Assert(isOK());
 #ifdef S_ISBLK
        if (S_ISBLK(buf.st_mode)) return 'b';
 #endif
@@ -248,6 +255,8 @@ void FileInfo::flagRWX(mode_t i, char * szString) const
 // should not be in FileInfo
 void FileInfo::setSticky(char * szString) const
 {
+       lyx::Assert(isOK());
 #ifdef S_ISUID
        if (buf.st_mode & S_ISUID) {
                if (szString[3] != 'x') szString[3] = 'S';
@@ -271,42 +280,49 @@ void FileInfo::setSticky(char * szString) const
 
 time_t FileInfo::getModificationTime() const
 {
+       lyx::Assert(isOK());
        return buf.st_mtime;
 }
 
 
 time_t FileInfo::getAccessTime() const
 {
+       lyx::Assert(isOK());
        return buf.st_atime;
 }
 
 
 time_t FileInfo::getStatusChangeTime() const
 {
+       lyx::Assert(isOK());
        return buf.st_ctime;
 }
 
 
 nlink_t FileInfo::getNumberOfLinks() const
 {
+       lyx::Assert(isOK());
        return buf.st_nlink;
 }
 
 
 uid_t FileInfo::getUid() const
 {
+       lyx::Assert(isOK());
        return buf.st_uid;
 }
 
 
 gid_t FileInfo::getGid() const
 {
+       lyx::Assert(isOK());
        return buf.st_gid;
 }
 
 
 off_t FileInfo::getSize() const
 {
+       lyx::Assert(isOK());
        return buf.st_size;
 }
 
@@ -328,42 +344,49 @@ bool FileInfo::isOK() const
 
 bool FileInfo::isLink() const
 {
+       lyx::Assert(isOK());
        return S_ISLNK(buf.st_mode);
 }
 
 
 bool FileInfo::isRegular() const
 {
+       lyx::Assert(isOK());
        return S_ISREG(buf.st_mode);
 }
 
 
 bool FileInfo::isDir() const
 {
+       lyx::Assert(isOK());
        return S_ISDIR(buf.st_mode);
 }
 
 
 bool FileInfo::isChar() const
 {
+       lyx::Assert(isOK());
        return S_ISCHR(buf.st_mode);
 }
 
 
 bool FileInfo::isBlock() const
 {
+       lyx::Assert(isOK());
        return S_ISBLK(buf.st_mode);
 }
 
 
 bool FileInfo::isFifo() const
 {
+       lyx::Assert(isOK());
        return S_ISFIFO(buf.st_mode);
 }
 
 
 bool FileInfo::isSocket() const
 {
+       lyx::Assert(isOK());
 #ifdef S_ISSOCK
        return S_ISSOCK(buf.st_mode);
 #else
@@ -386,6 +409,3 @@ bool FileInfo::access(int p) const
                return false;
        }
 }
-
-
-
index 4463207f235ebaad7c4bf250a2892657f9c31e19..78a0a99575c58501cd41dffe63519f65f838194a 100644 (file)
@@ -30,6 +30,9 @@
 #endif
 
 /** Use objects of this class to get information about files.
+ *
+ * Users must make sure to check fi.isOK() before any operations
+ * requiring the file to exist such as fi.isDir()
  */
 class FileInfo : boost::noncopyable {
 public:
index 07c577b4e02c8670998460b74358958a41a4a0aa..54d58d7b93e606cd6581d3f713fa8f3c92519bc2 100644 (file)
@@ -435,7 +435,8 @@ int DeleteAllFilesInDir (string const & path)
                                     << endl;
 
                bool deleted = true;
-               if (FileInfo(unlinkpath).isDir())
+               FileInfo fi(unlinkpath);
+               if (fi.isOK() && fi.isDir())
                        deleted = (DeleteAllFilesInDir(unlinkpath) == 0);
                deleted &= (lyx::unlink(unlinkpath) == 0);
                if (!deleted) {
index a5fd7be2a5d532e9a14eb96f6614ae1f4a32a7bc..198fc89cf687d564c7dd6c6f16ea110fd8f3b2a0 100644 (file)
@@ -254,6 +254,7 @@ void CVS::scanMaster()
                        //sm[4]; // options
                        //sm[5]; // tag or tagdate
                        FileInfo fi(file_);
+                       // FIXME: must double check file is stattable/existing
                        time_t mod = fi.getModificationTime();
                        string mod_date = strip(asctime(gmtime(&mod)), '\n');
                        lyxerr[Debug::LYXVC]