03/03/83 qedx, qx Syntax: qx {-control_args} {macro_path} {macro_args} Function: The qedx editor is used to create and edit ASCII segments. This description summarizes the editing requests and addressing features provided by qedx. Complete tutorial information on qedx is available in the qedx Text Editor Users' Guide, Order No. CG40. Arguments: macro_path specifies the pathname of a segment from which the editor is to take its initial instructions. Such a set of instructions is commonly referred to as a macro. The editor automatically concatenates the suffix qedx to path to obtain the complete pathname of the segment containing the qedx instructions. The editor executes the qedx requests contained in the specified segment and then waits for you to type further requests. If macro_path is omitted, the editor waits for you to type a qedx request. The archive component pathname convention (::) is accepted. macro_args are optional arguments that are appended, each as a separate line, to the buffer named args (the first optional argument becomes the first line in the buffer and the last optional argument becomes the last line). Arguments are used in conjunction with a macro specified by the macro_path argument. Control arguments: -pathname path, -pn path causes qedx to read the segment specified by path into buffer 0, simulating "r path", before executing a macro (see macro_path). This control argument must precede macro_path. If no macro is specified, the user is placed in the editor request loop. The archive component pathname convention (::) is accepted. -no_rw_path prevents the user from making read (r) or write (w) requests with a pathname. All read and write requests affect the pathname specified by the -pathname control argument. The -no_rw_path control argument is intended to be used within exec_coms which are providing a limited environment; the user is prevented from examining or altering segments other than the one specified with -pathname. Notes: You can create and edit any number of segments with a single invocation of the editor as long as the contents of the buffer are deleted before work is started on each new segment. Notes on addressing: Most editing requests are preceded by an address specifying the line or lines in the buffer on which the request is to operate. Lines in the buffer can be addressed by absolute line number; relative line number, i.e., relative to the "current" line (+2 means the line that is two lines ahead of the current line, -2 means the line that is two lines behind); and context (locate the line containing /any string between these slashes/). Current line is denoted by period (.); last line of buffer, by dollar sign ($). Notes on regular expressions: The following characters have specialized meanings when used in a regular expression. A regular expression is the character string between delimiters, such as in a substitute request, or a search string. You can reinvoke the last used regular expression by giving a null regular expression (//). * signifies any number (or none) of the preceding character. ^ when used as the first character of a regular expression, signifies the (imaginary) character preceding the first character on a line. $ when used as the last character of a regular expression, signifies the (imaginary) character following the last character on a line. . matches any character on a line. List of escape sequence requests: \f exits from input mode and terminates the input request; returns the user in edit mode. It is used constantly when editing a document, and is the key to understanding the difference between input mode and edit mode. \c suppresses the meaning of the escape sequence or special character following it. \b(X) redirects editor stream to read subsequent input from buffer X. \r temporarily redirects the input stream to read a single line from your terminal. Notes on requests: In the list given below, editor requests are divided into four categories: input requests, basic edit requests, extended edit requests, and buffer requests. The input requests and basic edit requests are sufficient to allow a user to create and edit segments. The extended requests give the user the ability to execute commands in the Multics system without leaving the editor and also to effect global changes. Because the extended requests are, in general, more difficult to use properly, they should be learned only after mastering the input and basic edit requests. The buffer requests require a knowledge of auxiliary buffers. (Since the nothing and comment requests are generally used in macros, they are included with the buffer requests.) The buffer requests, used with any of the other requests, and special escape sequences allow the user to make qedx function as an interpretive programming language through the use of macros. The character given in parentheses is the actual character used to invoke the request in qedx and does not always bear a relation to the name of the request. The second part of each entry shows the format, default in parentheses, and brief description. For the value of ADR, see "Notes on Addressing" above; for the value of regexp, see "Notes on Regular Expressions" above. List of input requests: These requests enter input mode and must be terminated with \f. append (a) ADRa (.a) Enter input mode, append lines typed from the terminal after a specified line. change (c) ADR1,ADR2c (.,.c) Enter input mode, replace the specified line or lines with lines typed from the terminal. insert (i) ADRi (.i) Enter input mode, insert lines typed from the terminal before a specified line. List of basic edit requests: delete (d) ADR1,ADR2d (.,.d) Delete specified line or lines from the buffer. print (p) ADR1,ADR2p (.,.p) Print specified line or lines on the terminal; special case print needs address only. print-line-number (=) ADR= (.=) Print line number of specified line. quit (q) q exits the editor but first checks for modified buffers. If any modified buffers are present, qedx will display their status and ask for permission to exit. If permission is granted, all changes made to those buffers since they were last written will be lost. quit-force (qf) (Q) qf exits the editor without checking for modified buffers. If any modified buffers are present, all changes made to those buffers since they were last written will be lost. read (r) ADRr {path} ($r path) appends the contents of the segment named path after the specified line. The archive component pathname convention (::) is accepted. If path is ommitted, a default pathname is used if possible. See "Notes of default pathnames" below for more information. substitute (s) ADR1,ADR2s/regexp/string/ (.,.s/regexp/string/) substitute every string matching regexp in the line(s) with string. If string contains &, & is replaced by the characters which matched regexp. First character after s is delimiter; it can be any character not in either regexp or string. Strings matching regexp do not overlap and the result of substitution is not rescanned. write (w) ADR1,ADR2w {path} (1,$w path) writes the specified lines of the buffer into the segment named path. The archive component pathname convention (::) is not accepted. If path is ommitted, a default pathname is used if possible; however, if the default pathname identifies an archive component, an error message is printed. See "Notes on default pathnames" below for more information. List of extended edit requests: execute (e) e passes the remainder of a request line to the Multics command processor without leaving the qedx editor. global (g) ADR1,ADR2gX/regexp/ (1,$gX/regexp/) perform operation on lines that contain a match for regexp; X can be d for delete, p for print, or = for print line numbers. exclude (v) ADR1,ADR2vX/regexp/ (1,$vX/regexp/) perform operation on lines that do not contain a match for regexp; X can be d for delete, p for print, or = for print line numbers. List of buffer requests: buffer (b) b(X) switches all subsequent editor operations to the specified buffer X. move (m) ADR1,ADR2m(X) (.,.m(X)) move line(s) from current buffer into buffer named X; destroy old contents of buffer X. status (x) x prints a summary status of all buffers currently in use. nothing (n) ADRn (.n) does not perform a task; addresses a line with no other action. comment (") ADR" (.") ignores rest of line; used for comments. Notes on default pathnames: qedx maintains a default pathname for each buffer. This default pathname is used whenever a read (r) or write (w) request is given without a pathname. Initially, the default pathname for a buffer is null; ie: any attempt to read or write without a pathname results in an error message. Whenever a read request is issued with a pathname and the buffer is empty, qedx saves that pathname as the default for the buffer. Whenever, a write request is issued with a pathname which writes the entire contents of the buffer (ie: no address range is given), qedx saves that pathname as the default for the buffer. If a read request is given when the buffer is not empty or a write request is given which does not write the entire buffer, qedx will consider the default pathname of that buffer to no longer be trustworthy. The next use of the read or write requests without a pathname in that buffer will cause qedx to ask for permission to use the default pathname. If permission is given, qedx will once again consider the pathname to be trustworthy. For example, given the following sequence -- qedx r first r second w qedx will ask for permission to write the buffer to the segment named "first" because the "r second" request was issued when the buffer was not empty. On the other hand, if the following sequence were given -- qedx r first 1,$d r second w qedx will write the buffer to the segment named "second" without asking permission because the buffer was empty when the "r second" request was given. Notes on spacing: The following rules govern the use of spaces in editor requests. 1. Spaces are taken as literal text when appearing inside of regular expressions. Thus, /the n/ is not the same as /then/. 2. Spaces cannot appear in numbers, e.g., if 13 is written as 1 3, it is interpreted as 1+3 or 4. 3. Spaces within addresses except as indicated above are ignored. 4. The treatment of spaces in the body of an editor request depends on the nature of the request. Responses from the editor: In general, the editor does not respond with output on the terminal unless explicitly requested to do so (e.g., with a print or print line number request). The editor does not comment when you enter or exit from the editor or change to and from input and edit modes. The use of frequent print requests is recommended for new users of the qedx editor. If you inadvertently request a large amount of terminal output from the editor and wish to abort the output without abandoning all previous editing, you can issue the quit signal (by pressing the proper key on your terminal, e.g., BREAK, ATTN, INTERRUPT), and, after the quit response, you can reenter the editor by invoking the program_interrupt (pi) command. This action causes the editor to abandon its printout, but leaves the value of "." as if the printout had gone to completion. If an error is encountered by the editor, an error message is printed on your terminal and any editor requests already input (i.e., read ahead from the terminal) are discarded. If you interrupt an invocation of qedx (eg: via use of the quit signal) and invoke qedx again before using the "start", "program_interrupt", or "release" commands, qedx will inform you that you have one or more suspended invocations and ask if you wish to continue. If you answer "?" to this query, qedx will print an explanation of the implications of answering "yes" to this query along with our recommendation of the proper response to this situation. Notes on macro usage: You can place elaborate editor request sequences (called macros) into auxiliary buffers and then use the editor as an interpretive language. This use of qedx requires a fairly detailed understanding of the editor. To invoke a qedx macro from command level, you merely place your macro in a segment that has the letters qedx as the last component of its name, then type: ! qedx macro_path macro_args Notes on I/O switches: While most users interact with the qedx editor through a terminal, the editor is designed to accept input through the user_input I/O switch and transmit output through the user_output I/O switch. These switches can be controlled (using the iox_ subroutine described in the MPM Subroutines) to interface with other devices/files in addition to the user's terminal. For convenience, the qedx editor description assumes that the user's input/output device is a terminal. ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved