Command line history for magic This patch, to the file textio/txInput.c in the magic source tree, gives the magic use the benefit command-line history on all full-text lines entered, usually the commands proceeded by ':'. This is very helpful for doing repetitive work, for example labeling a lot of nodes. The patch has been tested on magic 6.5.1, and magic 6.3, but I think it should work on most any decendant of magic v6. In addition to patching txInput.c, you need one of these command-line-editing libaries: - GNU Readline 2.1 or 2.2.1 - Editline by Rich Salz and Simmule Turner, with a minor patch Editline is much smaller and simpler than GNU readline, but feels about the same. What you give up with editline is the ability to rebind keys, vi-mode, and the ability to enter lines that are wider than the terminal. If using GNU readline 2.1 or later (earlier versions won't work), unpack readline in a seperate directory, run configure and then make. This builds libreadline.a. In the magic directory, add "-DUSE_READLINE" to the file misc/CFLAGS, and add "-lreadline -ltermcap" to the file magic/LIBS, and rebuild magic. If using editline version 1.11, patch editline.c with the file editline.patch. Editline's interface is similar to GNU readline, but this tweaks it to add a few Readline-2.1 features that we need. Edit editline's makefile, and build libedit.a with "make." In the magic directory, add "-DUSE_READLINE" to the file misc/CFLAGS, and add "-lreadline -ltermcap" to the file magic/LIBS, and rebuild magic. The following are available from : magic-readline.README - this file magic-readline.tar.gz - contains README - this file txInput.c.patch - patch for magic/textio/txInput.c editline.c.patch - patch for editline version 1.11 editline.tar.gz - unmodified editline source readline-2.2.1.tar.gz - unmodified GNU readline source Other sources for readline include prep.ai.mit.edu and all of the GNU mirrors. Other sources for editline.tar.gz include ftp://ftp.pipex.net/people/tim/ Steve Tell tell@cs.unc.edu September 11, 1997 updated October 21, 1998