Newsgroups: comp.lang.lisp.x,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!ix.netcom.com!netcom.com!mayer
From: mayer@netcom.com (Niels P. Mayer)
Subject: Re: Small lisp-intended editor
Message-ID: <mayerCz0LDE.A6r@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <39m42f$6g0@obelix.cica.es>
Distribution: inet
Date: Wed, 9 Nov 1994 19:12:49 GMT
Lines: 491
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp.x:1353 comp.lang.lisp:15560

In article <39m42f$6g0@obelix.cica.es>, garciagu@risc39.fie.us.es (Gonzalo G Agullo) writes:
> Hi all out there
> I'm looking for a small/easy for beginers editor to be used with xlisp
> in a AI premier class.
> 
> We're currently running xlisp within a Emacs 19.28 buffer under AIX 3.2.5+
> but when the simultaneous Emacs users number grows up, the system will
> slow down in response times.
> 

(1) For editing Lisp, there is simply no substitute for emacs. Perhaps
what you need to do is replace those IBM machines with low-cost PC's
running Linux or BSDI or some other free-unix for the PC variant.  For
the cost of one of the IBM machines you could have 20 students sharing
5 PCs with significantly better performance. Of course, this isn't 
going to help your current situation....

(2) WINTERP 2.0 (which is XLISP based, with Motif/X graphics/animation
extensions) has a "control panel" (winterp/examples/w_ctrlpnl.lsp) that you
can use to interactively load, edit, and evaluate code in WINTERP/Xlisp.
Similar to emacs' C-M-X (eval-defun) binding, you can use the winterp
control panel to edit a lisp form, and issue a command to interactively
send the form under the cursor to the evaluator; there are also commands
that do the equivalent of C-M-F (forw-sexp), C-M-B (back-sexp), and C-M-Q
(reformat-defun)... The editor is based on the Motif Text widget, and
WINTERP's defaults set emacs-key-bindings on all XmText widgets.

If you don't like the features of the control panel, you can extend it
in WINTERP/Xlisp itself. WINTERP runs on AIX, Linux, and most other
unix machines. (And if you end up buying more memory, WINTERP also has
an emacs interface too)... I believe this may help your current
situation because you won't have to swap out xlisp and swap in emacs,
then swap xlisp back in each time you do an evaluation. I presume that
this is the problem that you're seeing on your AIX machines.

Here's some documentation on the winterp control panel from 
winterp/doc/winterp.doc; following that is some info on WINTERP itself.

** Interacting with WINTERP via the "WINTERP Control Panel":

        The Winterp-Lisp file ./../examples/w_ctrlpnl.lsp is a simple
        control panel for WINTERP providing a file browser for
        loading/editing/saving Winterp-Lisp files, and an editor allowing
        interactive evaluation of the s-expression under the editor cursor.
        Other editor commands include traversing forwards/backwards through
        s-expressions, and formatting your code. Other XLISP commands include
        control over the XLISP debugger and WINTERP/XLISP evaluation error
        dialogues.

        The "WINTERP Control Panel" is entirely written in Winterp-Lisp; it
        is typically loaded from your ~/.winterpapp file, which is
        automatically loaded by WINTERP when it is started without
        a -init_file command-line argument or .lispInitFile resource.
        (see <<~/.winterpapp -- WINTERP development session startup file.>>
        for details).

***     Directory Selection:
                Double click on an item in the "Directories" XmList widget,
                or enter a wildcarded filename
                (e.g. /usr/local/winterp/examples/*.lsp) in the "Filter"
                XmText widget and hit <return>. If the directory is valid
                and has files in it, then the files in that direcory will appear
                in the "Files" XmList widget.

***     File Selection:
                To select a file in the "Files" XmList widget, single click
                on it. Alternately you may set the file selection by entering
                a fully qualified pathname to the file in the "Selection"
                XmText widget. The "Edit($EDITOR)", "Load File", "Show File",
                and "Save File" perform their function on the selected file.
                Double clicking an item in the "Files" XmList widget is
                equivalent to selecting a file and clicking "Show File", 
                causing the file to be displayed in the XmText editor widget.
        

***     "Edit($EDITOR)" button:
                The selected file gets edited by the editor set in
                environment variable $EDITOR. You may override $EDITOR by
                setting variable *SYSTEM-EDITOR* in your ~/.winterp file.

                In the XmText editor widget, Control-Meta-E calls this function.

***     "Load File" button:
                The selected file gets loaded into XLISP/WINTERP. This function
                allows the "WINTERP Control Panel" to start up other WINTERP
                applications, set up the environment, or load libraries.
                WINTERP expects the selected file to be a Winterp-Lisp file;
                unknown results will occur if the file is of the wrong type,
                typically, Lisp evaluation or reader errors.
                
                In the XmText editor widget, Control-Meta-L calls this function.

***     "Show File" button:
                The selected file is presented in the XmText editor widget.
                The user may then edit the file, or interactively evaluate
                Winterp-Lisp s-expressions with "Eval(<-->)". 

                Double clicking on a file in the "Files" XmList widget does the
                equivalent of "Show File", displaying the file in the XmText
                widget.

***     "Save File" button:
                Saves the contents of the XmText editor widget; a File
                Selection Box dialog is popped up allowing the user to
                enter the filename; the default filepath for saving is that of
                the current file listed under "Selection" in the
                "WINTERP Control Panel". 

                In the XmText editor widget, Control-Meta-S calls this function.

***     "Eval(<-->)" button:
                Evaluates the s-expression at the current cursor position in
                the XmText editor widget. This command searches backwards
                and forwards for the matching parentheses surrounding the
                current position of the cursor and sends that expression off to
                XLISP's reader and evaluator. The results of the evaluation gets
                printed to stdout and is visible in the terminal emulator
                running WINTERP. For best results, place the cursor on the
                opening parenthesis

                If an error occurs in searching for the matching
                parentheses surrounding the XmText curor, the program will
                beep, without evaluating any Winterp-Lisp expressions.

                In the XmText editor widget, Control-Meta-X calls this function.
                (the same binding is used in Gnu-Emacs).

                BUG: if an evaluation error occurs, the error backtrace
                (which occurs wnen "Error Dialog" or "Error Trace-Back" radio
                buttons are selected) will contain some spurious function call
                frames from the WINTERP Control Panel itself -- you should
                ignore all the call frames printed below the following:
                        "Function: #<Subr-READ_EVAL_PRINT: #10064be0>"

***     "(<---" button:
                Moves the XmText cursor back from the current position to
                the opening parenthesis at the current level of parentheses. Thi
s 
                command is useful for moving back through Winterp-Lisp
                s-expressions one expression at a time.

                If an error occurs in searching for the matching
                parentheses surrounding the XmText curor, the program will
                beep, without moving the cursor.

                In the XmText editor widget, Control-Meta-B calls this function.
                (the same binding as used in Gnu-Emacs).

***     "--->)" button:
                Moves the XmText cursor forward from the current position to
                the opening parenthesis at the current level of parentheses.
                This command is useful for moving forwards through Winterp-Lisp
                s-expressions one expression at a time.

                If an error occurs in searching for the matching
                parentheses surrounding the XmText curor, the program will
                beep, without moving the cursor.

                In the XmText editor widget, Control-Meta-F calls this function.
                (the same binding as used in Gnu-Emacs).

***     "Format(<-->)" button:
                Formats the text within the s-expression at the XmText
                widget's cursor position by running it through an XLISP
                "pretty printer". This function uses the same
                mechanism/rules for determining the extent of the current
                s-expression as used by "Eval(<-->)".

                If an error occurs in searching for the matching
                parentheses surrounding the XmText curor, the program will
                beep, without moving the cursor.

                In the XmText editor widget, Control-Meta-Q calls this function.
                (the same binding as used in Gnu-Emacs).

                BUG: Calling "Format" converts all Winterp-Lisp symbols to
                uppercase (XLISP symbols are case insensitive, so case
                information is lost when text is read/parsed by XLISP. Note
                that case for data is preserved (e.g. CHAR, STRING, etc).

***     "Debug Off" radio button:
                When this debug option is selected, XLISP global variable
                *BREAKENABLE*, and WINTERP global variable *ERRHOOK* are both
                set to NIL. When an XLISP evaluation error occurs, or a
                WINTERP, Motif, or X11 error happens, processing of the
                current function/method terminates and an error message is
                printed on the terminal.

***     "Error Dialog" radio button:
                When this debug option is selected, XLISP global variable
                *BREAKENABLE* is set to NIL, and WINTERP global variable
                *ERRHOOK* is bound to the error hook dialog function from
                <winterp-top-dir>/examples/lib-utils/err-hook.lsp. When an
                XLISP evaluation error occurs, or a WINTERP, Motif, or X11
                error happens, processing of the current function/method
                terminates, an error message is printed on the terminal, and
                a dialog box pops up listing the error message and printing the
                stack trace from the error-causing function/method all the way
                up to the top-level invocation that caused the error.

                The error dialog button "Close Window" can be clicked to remove
                the dialog (since "Close Window" is the default button, you
                can also just hit <return> in the dialog window. The error
                dialog button "Save Backtrace" will save the stack trace to a
                file entered by the user into a file selection dialog box.
                Button "Exit Application" will terminate WINTERP -- typically
                this is only for cases where severe errors have occurred.

***     "Error Break-Loop" radio button:
                When this debug option is selected, XLISP global variable
                *BREAKENABLE* is set to T, XLISP global variable *TRACENABLE*
                is set to NIL, and WINTERP global variable *ERRHOOK* is set
                to NIL. When an XLISP evaluation error occurs, or a
                WINTERP, Motif, or X11 error happens, processing of the
                current function/method terminates, an error message is
                printed and the XLISP "break loop" is entered.

                For more information on the "break loop" see section above
                <<Interacting with WINTERP via the terminal:>>, it is
                especially important that you read the portion titled
                <<IMPORTANT NOTE ON BREAK LOOP>> if you're wondering
                why X windows from WINTERP no longer respond to X when
                you're in the break loop.

***     "Error Trace-Back" radio button:
                When this debug option is selected, XLISP global variable
                *BREAKENABLE* is set to T, XLISP global variable *TRACENABLE*
                is set to T, and WINTERP global variable *ERRHOOK* is set
                to NIL. When an XLISP evaluation error occurs, or a
                WINTERP, Motif, or X11 error happens, processing of the
                current function/method terminates, an error message is
                printed, a stack-trace is printed, and the XLISP "break loop"
                is entered.

                The stack trace printed in this case is just like the stack
                trace that pops up when "Error Dialog" is selected (see above).
                It lists the call to the error-causing function/method all the
                way up to the top-level invocation that caused the error.

                For more information on the "break loop" see section above
                <<Interacting with WINTERP via the terminal:>>, it is
                especially important that you read the portion titled
                <<IMPORTANT NOTE ON BREAK LOOP>> if you're wondering
                why X windows from WINTERP no longer respond to X when
                you're in the break loop.

***     Function 'debug':

                Evaluating '(debug)' will set *BREAKENABLE*, subsequent XLISP
                evaluation errors will cause the XLISP "break loop" to be
                entered. This function from w_ctrlpnl.lsp overrides the one in
                lib-utils/initialize.lsp, causing the "WINTERP Control Panel"
                radiobuttons to indicate the state of the debugger.

***     Function 'nodebug':

                Evaluating '(nodebug)' will clear *BREAKENABLE* and
                *ERRHOOK*, such that XLISP evaluation or WINTERP/Motif/X11
                errors will not invoke the "break loop" nor the
                "Error Dialog" box warning of errors. This function from
                w_ctrlpnl.lsp overrides the one in lib-utils/initialize.lsp, 
                causing the "WINTERP Control Panel" radiobuttons to indicate
                the state of the debugger.

***     Function 'ctrlpnl':

                Evaluating '(ctrlpnl)' will deiconize or raise the "WINTERP
                Control Panel" window. Useful for cases when one is
                interacting with WINTERP via the "stdin eval server" and
                one wants to pop up an interface for evaluating or loading
                Winterp-Lisp files.

-------
Subject: WINTERP 2.0 info (winterp-source@netcom.com)
--------

WINTERP: An object-oriented rapid prototyping, development and delivery
environment for building extensible applications with the OSF/Motif UI
Toolkit and Xtango-based graphics/animation.
			by Niels Mayer
			WINTERP Version 2.03
			July 24, 1994

------------------------------------------------------------------------------
For information on the latest version of WINTERP, and other information (under
construction), see the World-Wide-Web/Mosaic "WINTERP Home Page":
	URL -- http://www.eit.com/software/winterp/winterp.html
------------------------------------------------------------------------------

WINTERP is a Widget INTERPreter, an application development environment
enabling rapid prototyping of graphical user-interfaces (GUI) through the
interactive programmatic manipulation of user interface objects and their
attached actions. The interpreter, based on David Betz, Tom Almy, et al's
XLISP-PLUS, provides an interface to the X11 toolkit Intrinsics, the
OSF/Motif widget set, primitives for collecting data from UN*X processes,
and facilities for interacting with other UN*X processes. WINTERP thus
supports rapid prototyping of GUI-based applications by allowing the user
to interactively change both the UI appearance and application
functionality. These features make WINTERP a good tool for learning and
experimenting with the capabilities of the OSF/Motif UI toolkit, allowing
UI designers to more easily play "what if" games with different interface
styles.

WINTERP is also an excellent platform for delivering extensible or
customizable applications. By embedding a small, efficient language
interpreter with UI primitives within the delivered application, users and
system integrators can tailor the static and dynamic layout of the UI,
UI-to-application dialogue, and application functionality. WINTERP's use of
a real programming language for customization allows WINTERP-based
applications to be much more flexible than applications using customization
schemes provided by the X resource database, OSF/Motif's UIL (user
interface language), and resource-based languages such as WCL.

An environment similar to WINTERP's already exists in the Gnu-Emacs text
editor -- WINTERP was strongly influenced by Gnu-Emacs' successful design.
In Gnu-Emacs, a mini-Lisp interpreter is used to extend the editor to
provide text-browser style interfaces to a number of UN*X applications
(e.g. e-mail user agents, directory browsers, debuggers, etc). Whereas
Emacs-Lisp enables the creation of new applications by tying together
C-implemented primitives operating on text-buffer UI objects, WINTERP-Lisp
ties together operations on graphical UI objects implemented by the Motif
widgets. Both achieve a high degree of customizability that is common for
systems implemented in Lisp, while still attaining the speed of execution
and (relatively) small size associated with C-implemented applications.

Other features:
	* WINTERP is free software -- available via anonymous ftp from
	  ftp.x.org.
	* Portable -- runs without porting on many Unix systems.	
	* Interface to GNU Emacs' lisp-mode allows code to be developed
	  and tested without leaving the editor.
	* Interactive programming also available in the "WINTERP Control Panel",
	  with editing taking place in a Motif text widget controlled by
	  WINTERP.
	* Built-in RPC mechanism for inter-application communications.
	* XLISP provides a simple Smalltalk-like object system.
	* OSF/Motif widgets are real XLISP objects -- widgets can be
	  specialized via subclassing, methods added or altered, etc.
	* Automatic storage management of all Motif/Xt/X data.
	* Contains facilities for "direct manipulation" of UI components.

The WINTERP 2.0 release includes the following new features:
	* High-level, object-oriented 2.5D graphics/animation package featuring
          pixel-independent/resizable/scalable rendering, path-transition
	  animation, and high-level animation operators. This is based on
	  Stasko&Hayes' Xtango system.
	* Using Xtango, the ability to easily create new widget classes
	  employing arbitrary graphical behavior without the tedium of
	  programming in the Xt instrinsics and Xlib.
	* Asynchronous subprocess facility enables non-blocking GUI interfaces
	  to existing interactive unix commands and interactive network
	  services. Enables use of multiple asynchronous subprocesses.
	* XmGraph widget for creating directed acyclic graphs, trees, and
          direct-manipulation displays.
	* Table widget allows constraint-based GUI static layout
          using tbl(1)-style specifications.
	* Uses XLISP-PLUS version 2.1c -- more functionality, better subset of
	  Common Lisp, e.g. good support for sequence operators.
	* Support for OSF/Motif 1.2.*
	* GIF Image Support.
	* Many new examples, improved example WINTERP applications.
	* Major code cleanups, bug fixes, etc.

You may obtain the latest released version of the WINTERP source,
documentation, and examples via anonymous ftp from internet host ftp.x.org
in directory /contrib/devel_tools, file winterp-2.xx.tar.gz, where 'xx'
represents the revision number. Directory /contrib/devel_tools/winterp
contains slides, papers, further documentation, contributed code, etc.

An automated reply indicating the locations and status of the latest
WINTERP source may be obtained by sending an e-mail message to
winterp-source@netcom.com.

winterp@netcom.com is the mailing list for WINTERP-related announcements
and discussions. To get added/removed from the list, send mail to
winterp-request@netcom.com. Please do not send junk mail or subscribe/
unsubscribe messages to the mailing list winterp@netcom.com.

For discussions about XLISP, see the USENET newsgroup comp.lang.lisp.x.

------------------------------------------------------------------------------

AUTHOR:
		Niels P. Mayer
		Enterprise Integration Technologies
		800 El Camino Real, Fourth Floor
		Menlo Park, CA 94025
		mayer@eit.com or mayer@netcom.com
		URL: http://www.eit.com/people/mayer.html

------------------------------------------------------------------------------

DEPENDENCIES and PLATFORMS:

	WINTERP is portable software, and should run on any machine that
	supports Motif versions 1.0, 1.1, or 1.2 and Berkeley
	sockets. WINTERP will not build directly from the X11r6 distribution.
	YOU MUST HAVE MOTIF INSTALLED ON YOUR SYSTEM.

	WINTERP 2.0 has been tested on the following platforms:
		* Sun SunOS 4.1.3 with developer 'cc' compiler, Motif 1.2.3.
		* Sun Solaris 2.3 with Motif/X11/cc provided by Sun's 2.3 SDK
		* HPUX 9.0 on HP9000s300 HP9000s400, HP9000s700
		* HPUX 8.0. on HP9000s300 and HP9000s800
		* SGI Irix 5.1 and 5.2 w/ Motif/X11/cc from Irix IDO.
		* DEC Ultrix 4.3 and its built-in Motif 1.1
		* DEC OSF1, v2.0 and its built-in Motif 1.2
		* NeXT NeXT-Step 3.0 with Pencom Co-Xist X/Motif
		* 386/486 PC running Linux OS and gcc 2.5.8 compiler
		  (reported by Serge Kolgan root@starato.wwb.noaa.gov).
		* AIX 3.2.5 on IBM RS6000 using IBM's product 'cc'.
		  (reported by Duncan Swain -- duncan@chaussegros.architecture.mcgill.ca)
		* Sun SunOS 4.1.3 with gcc 2.5.8
		  (reported by Wolfgang Kechel -- wolfgang@pr-wiesbaden.de).

	The WINTERP distribution contains Makefiles specific to the above
	machines and OSs, and also provides Imakefiles for compiling WINTERP
	on other systems.

-------------------------------------------------------------------------------

OBTAINING WINTERP:

Here's how to ftp WINTERP 2.0: (your input denoted by ^^^^^^^^^^)

jhvh-1-16-~> cd /tmp
jhvh-1-17-/tmp> ftp ftp.x.org
                ^^^^^^^^^^^^^
        [...]
Name (jhvh-1.eit.com:mayer): anonymous
                             ^^^^^^^^^
Password (jhvh-1.eit.com:anonymous): <anypassword you want here>
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
331 Guest login ok, send ident as password.
230 Guest login ok, access restrictions apply.
ftp> cd contrib/devel_tools
     ^^^^^^^^^^^^^^^^^^^^^^
200 CWD command okay.

ftp> binary
     ^^^^^^
200 Type set to I.

ftp> get winterp-2.XX.tar.gz		## replace XX with latest version number
     ^^^^^^^^^^^^^^^^^^^^^^^
200 PORT command okay.
150 Opening data connection for winterp-2.XX.tar.gz (192.100.58.37,3988) (2303809 bytes).
226 Transfer complete.
2303809 bytes received in 690.63 seconds (1.96 Kbytes/sec)

ftp> quit
     ^^^^
221 Goodbye.

jhvh-1-18-/tmp> su     ## become superuser to install in /usr/local/winterp
	        ^^
jhvh-1-ROOT-1-/tmp> cd /usr/local/
                    ^^^^^^^^^^^^^^

jhvh-1-ROOT-2-/usr/local> gunzip -c /tmp/winterp-2.XX.tar.gz | tar xvf -
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        [... lengthy list of files output by tar ...]

jhvh-1-ROOT-3-/usr/local/> rm /tmp/winterp-2.XX.tar.gz
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^

<< If you don't have GNU zip (gzip(1) gunzip(1), retrieve the               >>
<< winterp-2.XX.tar.Z instead of the winterp-2.XX.tar.gz file and use "zcat">>
<< in place of "gunzip -c" above....                                        >>

------------------------------------------------------------------------------

COMPILING and RUNNING:

   * For compilation tips, see winterp/doc/winterp.doc sections:
     <<Compiling and installing WINTERP via Imakefile and 'xmkmf':>>
     or <<Compiling and installing WINTERP via Makefile.* and 'make':>>.

   * For configuration and running hints, see winterp/doc/winterp.doc
     sections: <<Set up X resources and application defaults files:>>,
     <<~/.winterp -- WINTERP session startup file:>>, 
     <<~/.winterpapp -- WINTERP development session startup file.>>,
     and finally, <<Run WINTERP!:>>

   * For known bugs, see winterp/doc/BUGS

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
= Niels Mayer ..... mayer@eit.com .... http://www.eit.com/people/mayer.html =
=  Multimedia Engineering Collaboration Environment (MM authoring for WWW)  =
=  Enterprise Integration Technologies, 800 El Camino Real, Menlo Park, CA  =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
