[comp.sys.sun] Crisp/Brief/Grief On Unix

rohit@uunet.uu.net (Rohit Mehrotra) (11/01/90)

Some time back I had posted on the net, inquiring about if some one use
brief/crisp/grief editor on any Unix platform.

I got quite a few replies, either asking about it or detailing their
experience with it. The thing in common was that, who ever uses it loves
it.  Thanks a lot for all the hints / help / inquiries.

This editor goes by the name crisp or grief. Crisp is the most recent name
and the last revision available is version 1.9.  It is available on uunet
archive. 

INFO ABOUT UUNET ARCHIVE:

>Refering to is as the uunet archive should be fine.  Many people know
>how to reach us.  I'm surprised the people need the number since the
>name should work fine.
>
>	internet: uunet.uu.net [192.48.92.2]
>	uucp:	  uunet!PATHNAME
>		  (we can be reached by subscribers via their direct
>		   line or via anonymous uucp using 1-900-GOT-SRCS).

LOCATION OF THE FILES:

The source code is present in the directory:

>/usr/spool/ftp/comp.sources.misc/volume7/crisp1.9:
>-rw-r--r--  1 allbery      2440 Jun 10  1989 part01.Z
>-rw-r--r--  1 allbery     22433 Jun 10  1989 part02.Z
>-rw-r--r--  1 allbery     22730 Jun 10  1989 part03.Z
>-rw-r--r--  1 allbery     22714 Jun 10  1989 part04.Z
>-rw-r--r--  1 allbery     21292 Jun 10  1989 part05.Z
>-rw-r--r--  1 allbery     20746 Jun 10  1989 part06.Z
>-rw-r--r--  1 allbery     21654 Jun 10  1989 part07.Z
>-rw-r--r--  1 allbery     19097 Jun 10  1989 part08.Z
>-rw-r--r--  1 allbery     23253 Jun 11  1989 part09.Z
>-rw-r--r--  1 allbery     22573 Jun 11  1989 part10.Z
>-rw-r--r--  1 allbery     27581 Jun 11  1989 part11.Z
>-rw-r--r--  1 allbery     26312 Jun 11  1989 part12.Z
>-rw-r--r--  1 allbery     24986 Jun 11  1989 part13.Z
>-rw-r--r--  1 allbery     19272 Jun 11  1989 part14.Z
>-rw-r--r--  1 allbery     18710 Jun 11  1989 part15.Z
>-rw-r--r--  1 allbery     18859 Jun 11  1989 part16.Z
>-rw-r--r--  1 allbery     19710 Jun 18  1989 part17.Z
>-rw-r--r--  1 allbery     18728 Jun 18  1989 part18.Z
>-rw-r--r--  1 allbery     18499 Jun 18  1989 part19.Z
>-rw-r--r--  1 allbery     18084 Jun 18  1989 part20.Z
>-rw-r--r--  1 allbery      3986 Jun 18  1989 part21.Z
>-rw-r--r--  1 allbery     23455 Jun 18  1989 part22.Z
>-rw-r--r--  1 allbery     17923 Jun 18  1989 part23.Z
>-rw-r--r--  1 allbery     22119 Jun 18  1989 part24.Z
>-rw-r--r--  1 allbery     22770 Jun 21  1989 part25.Z
>-rw-r--r--  1 allbery     22550 Jun 21  1989 part26.Z
>-rw-r--r--  1 allbery     21776 Jun 21  1989 part27.Z
>-rw-r--r--  1 allbery     21710 Jun 21  1989 part28.Z
>-rw-r--r--  1 allbery     21969 Jun 21  1989 part29.Z
>-rw-r--r--  1 allbery     22189 Jun 21  1989 part30.Z
>-rw-r--r--  1 allbery     23554 Jun 21  1989 part31.Z
>-rw-r--r--  1 allbery     20415 Jun 21  1989 part32.Z
>-rw-r--r--  1 allbery      8198 Jun 21  1989 part33.Z


It did not work for me on SCO-Xenix 2.3.2 initially as the "list_buffer"
macro and "edit_file", "read_file" macro do not function properly. However
I compiled it on SCO-Unix machine by changing the CRISP.Inst file so that
the xenix files get linked, and then brought the executables across on
SCO-Xenix and guess what, that worked.

I am presently running it successfully under Sunview on SunOS4.1 on
SparcStation, on SCO-Xenix 2.3.2 on AT&T 386e and on SCO-Unix 3.2 on AT&T
386e.

If some one out their has terminal and keyboard macros for wyse60, tvi925,
SunMonitors for SunSparcstation etc i.e. the one present in
(/usr/local/crisp/macros/tty and /usr/local/crisp/macros/kbd) Please send
them to me and then I would archive it at uunet.

There are a few bugs, some of them I resolved, and some I could not. If
any one of you happens to know the fixes I would appreciate if you could
EMAIL me your response.  Here is a list of them which I encountered:
_______________________________________________________________

UNRESOLVED ISSUES:

1) If some one out their has terminal and keyboard macros for wyse60,
   tvi925, SunMonitors for SunSparcstation etc i.e. the one present in
   (/usr/local/crisp/macros/tty and /usr/local/crisp/macros/kbd) Please send
   them to me and then I would archive it at uunet.

2) The column marking (mark 2) and inserting do not behave properly.  No
   Solution.

3) I am wondering if any one has written a macro which basically emulates
   "repeat the last command of vi i.e the "." command".  For example, if I
   issue a command like 10dd in vi, and then want go another part in the file
   and issue "." command, it again deletes 10 lines.
_____________________________________________________________________

RESOLVED ISSUES:

1) SEARCH AND TRANSLATE DO NOT WORK WHEN USING F5 AND F6 KEY PROPERLY.
   Solution: the problem is that in the config.c file which came long with
   the source code, F5 is defined as "search_fwd", which does not work.
   There are two fixes to it, any one would work: Note the difference between
   "_" and "-".

a) change the definition of F5 in config.c to "search-fwd" and F6 to
   "translate-fwd" and then recompile.

b) in the file ../src/crisp/crisp.m insert the following statement:

     (assign_to_key "<F5>"  "search-fwd");
     (assign_to_key "<F6>"  "translate-fwd");

   and then compile it as:

      cm -o /usr/local/crisp/macros/crisp.cm crisp.m

  you can do the same modifications in the ../src/crisp/tty/<termtype.m>
  file with the same result.

2)  USING BOOKMARKS GIVES A CORE DUMP.
    Solution: courtsey: uunet!proto!cims2!kew
	                and shj@login.dkuug.dk

There are actually a couple of fixes for this one, one of which was my
very lazy way out, and the other which addresses the low-level problem
(which makes my lazy fix make sense).

My fix was to add a macro:

---cut here---cut here---cut here---cut here---cut here---cut here---cut here

(macro _Goto_Bookmark
	(
		/* There's a major bug in the default goto_bookmark code
		** will cause it to dump core on occasion.  The code is
		** OK for the actual moving, but for some reason, when the
		** code has to prompt for a bookmark number, it gets goofy.
		** This code simply does the prompting.
		*/
		(int bm_number)

		(if (! (get_parm 0 bm_number "Goto Bookmarker [0-9]: "))
			(return))

		(if (&& (>= bm_number 0) (<= bm_number 10))
			(
				(goto_bookmark bm_number)
				(set_center_of_window)
			)
			;else
			(
				(message "Out of Range")
			)
		)
	)
)

---cut here---cut here---cut here---cut here---cut here---cut here---cut here

and you also have to add the following to crisp.m (where all of the other
autoloads are), assuming that the abovemacro is contained in a file named
bookmark.m:

	(autoload "bookmark" "_Goto_Bookmark")

This works but only puts a band-aid on the real problem which is addressed
by the following fix that came across the net the other day (Danger! I've
not tested this one):

(This was posted by:
	Stig Jacobsen
	shj@login.dkuug.dk )

Here's a ugly, kludgy patch for the bug that makes Crisp 1.9 coredump when
you try to goto a bookmark with Alt-G or the goto_bookmark built-in. Feed
the below text as input to patch.

== cut ==
*** builtin.c	Tue Sep 25 02:30:07 1990
--- ../crisp/builtin.c	Tue Sep  4 22:40:40 1990
***************
*** 397,402 ****
--- 397,407 ----
  		trace_acc();
  	bp->reference++;
  # endif
+    /* Couldn't find the size of 'argv', but 5 is a nice number... */
+    /* bookmark.goto_bookmark doesn't test argc and crashes if argv's */
+    /* beyond argc contains bogus stuff. This kludges around it. */
+    for (i=argc; i<5; i++)                                        /* shj */
+       argv[i].l_flags = F_NULL;                                  /* shj */
  	return free_saved(saved_str, ss_cnt);
  }
  free_saved(saved_str, ss_cnt)
== cut ==

So there you go.  Two fixes (one lazy, one more sophisticated), for one
problem. Hope this helps.

Also, I don't know if you're interested, but I developed a set of macros
that make crisp work well with sccs, doing automatic check-in's if the
file was checked out, searching for an sccs file if the file you asked for
doesn't exist, etc.  Give me a holler if you want the stuff; it's rather
poorly commented (as things we write for ourselves usually is). I also
have some rcs macros, but they are really peculiar to my circumstance, so
I'm hesitant to offer them (twist my arm).
_____________________________________________________________________


Thanks
Rohit

Rohit Mehrotra
Fleet Credit Corporation
8325 NW 53rd St, Miami, Fl 33166.
EMAIL: dmdev!rohit@uunet.UU.NET or uunet!dmdev!rohit or dmdev!rohit@uunet.UUCP
VMAIL: 1-800-289-7500 ext 469, 1-305-477-0390 ext 469