Path: utzoo!attcan!uunet!kddlab!titcca!sragwa!utashiro@sran84.sra.JUNET From: utashiro@sran84.sra.JUNET (Kazumasa Utashiro) Newsgroups: comp.unix.wizards Subject: Re: Input Line Editing Message-ID: <609@sragwa.sra.JUNET> Date: 25 Jul 88 04:29:09 GMT References: <16456@brl-adm.ARPA> <9666@eddie.MIT.EDU> Sender: news@sragwa.sra.JUNET Reply-To: utashiro%sra.junet@uunet.uu.net (Kazumasa Utashiro) Organization: Software Research Associates, Inc., Japan Lines: 397 In article <9666@eddie.MIT.EDU> nessus@wonko.MIT.EDU (Doug Alan) writes: >> In article <16456@brl-adm.ARPA> rbj@nav.icst.nbs.gov (Root Boy Jim) writes: >> >> > I suspect that the real place for line editing is either in the shell >> > itsef (as in tcsh, ksh, (and brlsh?)) or in the kernel. >> >> Putting line editing in the shell is wrong, because it should work in >> all programs and be consistent. Putting it in the kernal is gross. >> Thus, the right place to put it is precisely where Bob Pendleton wants >> to put it -- in a process which gets input from the user and feeds >> edited input to the user's other programs. If needed, mods to the >> kernal and convention, however, should be made to make this as easy >> and efficient as possible. I have a program that provide input line editing function for any old fashioned UNIX style commands. It is distributed as a free program in JUNET (UNIX network in Japan), but I'm not sure that it is to be distributed for world. So I include man page of this command and want to hear about its function. It looks almost like newcsh except that it works as a front-end for *any* program (even for vi :-). Note that this command is not based on any great concept like user interface should be something, but just a simple tool. Please don't talk to me about where the line editing should be placed as a comment for this program. If somebody want this program, I can post it to appropriate news group. Thank you for reading my bad English. Kazumasa Kayo Utashiro Software Research Associates, Inc. 1-1-1 Hirakawa-cho, Chiyoda-ku, Tokyo 102, Japan UUCP: kddlab!srava.sra.junet!utashiro ARPA: utashiro%sra.junet@uunet.uu.net JUNET: utashiro@sra.junet NAME fep - general purpose front end processor SYNOPSIS fep [-emacs|-vi] [-h history-length] UNIX-command DESCRIPTION Fep is a general purpose front end processor applicable to most UNIX commands that features vi(1)- or emacs(1)-like line editing and a command history mechanism like that of csh(1). Choice of editing style is made by selecting either the emacs mode or the vi mode (named for the editors they emu- late), specified either by command line option or by setting a variable interactively or in the start-up file or environ- ment EDITMODE (see editmode variable). The default key bindings are shown below for both edit modes. These can be customized using the fep-bind command. Emacs Bindings Here follow the default key bindings for the emacs mode. Each function name should be self-explanatory. The function names are defined as similarly to Gosling's emacs as possi- ble. ... Vi bindings The vi mode has two sub-modes, the command mode and the text insert mode. The commands of vi are emulated as correctly as possible. Here is a list of the default key bindings of the vi mode that differ from normal vi commands. The tty driver control characters are also inherited in this mode. ... Built-in commands Fep has some built-in commands that are not passed to the child process but understood and processed by fep itself. These commands can be issued from the terminal or from the start-up file. fep-bind function-name key-binding Change key bindings. For example, to bind the func- tion list-file-name to the string "^X-^X", type the following: fep-bind list-file-name "\^X\^X" fep-alias fep-alias name fep-alias name string The first form prints all aliases. The second form prints the alias for name. The last form set the alias for name to string. If you use fep without auto-tty-fix, following alias could be usefull. if $command == sh fep-alias more "fep-command more" fep-alias vi "fep-command vi" endif fep-unalias list Remove alias for each name in list. fep-set variable = value Set a variable of fep to some value. fep-unset variable Unset a variable. fep-cd [ directory ] fep-chdir [ directory ] Change directory. It sometimes happens that a child process has changed directory, but fep is still in the old directory. In such a case, neither list- file-name nor expand-file-name will function as expected. This command allows you to change fep's current working directory (default = home direc- tory). fep-pwd Print fep's current working directory. fep-history [ number of line ] Show the history of commands under fep. fep-echo arguments Only print the arguments. Variable names can be used prefixed by the "$" character. fep-source file Read the specified file and execute it. The con- tents of the file are not sent to sub-processes. fep-save-history [ number of lines to save ] file Save the current history buffer in the specified file. fep-read-history [ file ] Read in the command history from the specified file. The default file is the value of the history-file variable. This file name is understood as a path relative to the home directory. If you want to specify the name relative to the current directory instead, prefix the path by "./". fep-command command fep-! command Execute command. fep-exit Kill the sub-process and exit. fep-suspend Suspend fep itself. In the unlikely possibility that fep falls into a dead-lock in which the sub- processes have stopped but fep is still running, use one of these commands to escape from the situation. fep-read-from-file file fep-< file Read data from specified file and send them to sub- process. The sub-process will read the data from the file as if they are typed at the keyboard. fep-read-from-command command fep-