an extension to ved_cdiff ( ved_nextcsame ) 
Author Message
 an extension to ved_cdiff ( ved_nextcsame )

This is the message sent to pop-forum (Sun May  9 15:30:17 BST 1993)
which apparently didn't get through the gateway to comp.lang.pop
Aaron
-----------------------------------------------------------------------


I have an experimental extension to LIB VED_CDIFF that I am willing
to send to anyone interested. It provides a new library program
ved_nextcsame that extends ved_cdiff in the same way that ved_nextsame
extends ved_diff.

To be more precise, ved_cdiff allows you to compare two files
character by character ignoring differences due to spaces, tabs,
newlines, or other characters in the string ved_cdiff_ignore -- which,
by the way, should now be extended to include the new VED special space
characters i.e. '\s\t\n\r\St\Sp\Sn' -> ved_cdiff_ignore;

At present the version of ved_cdiff provided with Poplog stops when it
finds a difference between the two files, and then leaves it to you to
find the next "matching" location in the two files if you then want to
go on searching. When comparing old and new versions of a document this
can be tedious, to say the least.

The experimental new procedure will enable you to type

    ENTER nextcsame

(or use a key sequence mapped to ved_nextcsame) whereupon it looks in
both files for a matching sequence of
    - ved_min_char_match (default 20) characters not in the ignore set,
    - within ved_nextcsame_lines (default 6) of the current locations in
      the two files.

(Where there's more than one possible match it may not get the one you
want!)

It ignores space characters that differ, but it does not match a
sequence that's broken in one file against a sequence not broken in the
other. I.e. if ved_min_char_match is set to 6 then it will match
'the cat' against 'the      catch', but will not match 'the set' against
'these tables'.

Having found a pair of matching locations in the two files it uses a
wiggling VED cursor to show you where they are. (Or use ESC x).

If you set ved_nextcsame_lines to be too large it can be slow because of
all the comparisons. Probably instead of using a fixed number for
ved_min_char_match it should be a bit more flexible. I.e. it should
require more characters to match the further it has had to search for
lines with matching characters, since the more lines you examine
the greater the chance of a spurious match because there are two
unrelated occurrences of a long word. (This is specially true when
comparing code files as there are quite long identifier names that occur
often.)

You can also alter ved_cdiff so that it prepares the status line with a
call of ved_nextcsame (as ved_diff does with ved_nextsame), and vice
versa. So that you can go through two files comparing them using the
VED "REDO" key.

Let me know if you want a copy of ved_nextcsame.
Aaron
--
Aaron Sloman,
School of Computer Science, The University of Birmingham, B15 2TT, England

Phone: +44-(0)21-414-3711       Fax:   +44-(0)21-414-4281



Fri, 27 Oct 1995 04:50:20 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. C Extensions: calling across extensions

2. Extension Classes, Python Extension Types Become Classes

3. ODBC TCL Extension and LDAP Extension

4. Building extensions with MinGW on Win2K - formerly "Extension module import error with MinGW, SWIG, and distutils"

5. C/C++ extension: subclassing an extension type with Python code?

6. creating an instance of a C extension type from another C extension type (HOW?)

7. extensions! extensions!

8. IDE Extensions problem

9. Shell Extension Handler

10. UDP extension to sockets package?

11. Getting the icon associated with a file extension

12. CDE and CDE extension

 

 
Powered by phpBB® Forum Software