octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MSVC compilation patch: less from GnuWin32


From: John W. Eaton
Subject: MSVC compilation patch: less from GnuWin32
Date: Mon, 6 Nov 2006 10:49:31 -0500

On  6-Nov-2006, address@hidden wrote:

| This patch allows octave to use less from the GnuWin32 project. The
| single-quote to double-quote replacement shouldn't affect other
| systems. But I'm not sure about the -X command flag. Under less from
| GnuWin32, using -X results in only the last line of the current
| screen being visible, while the rest of the screen is empty.

Index: src/pager.cc
===================================================================
RCS file: /cvs/octave/src/pager.cc,v
retrieving revision 1.101
diff -c -p -r1.101 pager.cc
*** src/pager.cc        19 May 2006 05:32:17 -0000      1.101
--- src/pager.cc        6 Nov 2006 12:44:19 -0000
*************** default_pager (void)
*** 74,80 ****
--- 74,84 ----
          std::string lessflags = octave_env::getenv ("LESS");
          if (lessflags.empty ())
            pager_binary.append
+ #if defined (_MSC_VER)
+             (" -P \"-- less ?pB(%pB\\%):--. (f)orward, (b)ack, (q)uit$\"");
+ #else
              (" -X -P'-- less ?pB(%pB\\%):--. (f)orward, (b)ack, (q)uit$'");
+ #endif
        }
      }
  #endif

I'm not opposed to this change, but I think _MSC_VER is the wrong
thing to test here, so I'm not going to apply it.  The change has more
to do with the capabilities of less than the particular compiler used
to build Octave.  Also, you can fix the behavior by setting the flags
in the environment variable LESS before starting Octave.

The -X option tells less to omit sending the termcap initialization
and finalization strings to the terminal.  The reason it is included
in the default options is that many Unixy termcap entries include
escape sequences that cause the screen to be cleared when less starts,
and then to restore the previous contents when it exits.  For a
program like Octave, than can be fairly annoying.  I find it
surprising that there is trouble if no intialization string is given.
Is this perhaps a bug in the gnuwin32 version of less, or the terminal
description that it uses?

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]