.\"{{{ Notes .\" This manual should be improved in many points, but it is ok for a first .\" impression of Origami. You should have seen the original documentation, .\" and you would be happy about this document... On the other side, have you .\" ever seen the GNU Emacs manual? It is for people who are able to read the .\" whole bible while waiting for the bus. .\" I wrote this manual using Origami and the -ms macros of MROFF, but it .\" is also usable with gtbl/groff and the SunOS nroff. .\" .\" Michael Haardt .\"}}} .\"{{{ roff definitions .\" Although I hate macros in documents, there does not seem .\" to be another way for this manual. I hope that this macro .\" will work with every existing roff and -ms package. .\" .\"{{{ macros for items (can be nested): header, indented body .\"{{{ internal item macros, not used outside these definitions .\"{{{ set vars to not in item .nr PD 1v .nr iT 0 .\"}}} .\"{{{ .hI: header of item .de hI .KS .LP .. .\"}}} .\"{{{ .tI: text for item .de tI .ie \\n(iT .RS .4c .el .RS .75c .nr PD .2v .LP .nr PD .3v .nr iT 1+\\n(iT .. .\"}}} .\"}}} .\"{{{ .bI: begin item with header .de bI .hI \\$1 .tI .. .\"}}} .\"{{{ .nI: begin item without header .de nI .KS .tI .. .\"}}} .\"{{{ .sI: simple item without body .de sI .hI \\$1 .ie \\n(iT .RS .5c .el .RS .75c .nr iT 1+\\n(iT .eI .. .\"}}} .\"{{{ .eI: end item .de eI .RE .KE .nr iT \\n(iT-1 .if !\\n(iT .nr PD 1v .. .\"}}} .\"}}} .\"{{{ warning .de wA .LP \fBWarning\fP: .. .\"}}} .\"{{{ note beside .de nB .LP \fBN.B.\fP: .. .\"}}} .\"{{{ some text-variables .\"{{{ my favourite university machine and my official home in netland :) .ds ac @messua.informatik.rwth-aachen.de .\"}}} .\"{{{ TEX .ds Tx T\v'2p'E\v'-2p'X .\"}}} .\"{{{ get origami's constant names .ds vE 1.6.42 .ds hO HOME .ds tE TERM .ds sH SHELL .ds oT ORITERM .ds oP ORIPID .ds oF ORIFILE .ds oL ORILINE .ds oW ORIWORD .ds oX ORIXPOS .ds oY ORIYPOS .ds oA ORIAREA .ds oD ORIPAGERDIR .ds eN OP_E_FORMATNAME .ds eS OP_E_FORMATSTRING .ds rT read-tab-width .ds cL cursor-level .ds sH screen-height .ds sW screen-width .ds oA ocl-argument .ds mX mouse-x .ds mY mouse-y .ds mB mouse-b .ds mG mouse-go-y .ds mO mouse-outside .\"}}} .\"{{{ page footer/header .ds LH Origami .ds CH - % - .ds RH User Guide .ds LF origami \\*(vE .ds CF - % - .ds RF May 1992 .\"}}} .\"}}} .\"{{{ text-macros, need later, but don't know exactly when, so defined here .\"{{{ warning, about counting lines .de lC .wA the line count begins at start of file. Older versions than 1.6.17 used top of entered folds as starting point for counting! .. .\"}}} .\"{{{ the text for exit-codes and environment variables .nr sY 0 .de sY .ie \\n(sY \{\ .LP \\$1 uses the same environment and exit handling as \\*(fS. .\} .el \{\ .ds fS \\$1 .nr sY 1 .LP The exit code of the called command is stored in the OCL-variable \fB\*(oA\fP (\-1, if no correct value can be given). Environment variables \fB\\*(oF\fP, \fB\\*(oL\fP and \fB\\*(oW\fP are set to current filename, textline and word. Word is the sequence of \fBa\fP..\fBzA\fP..\fBZ_\fP, where the cursor stands on. Environment variables \fB\\*(oX\fP and \fB\\*(oY\fP are set to x position (characters 1,..) and y position (line 1,..) in file. Environment variable \fB\\*(oP\fP is set to Origami's process id. .lC .\} .. .\"}}} .\"{{{ prompt-commands don't store in define-macro-mode .de pM .wA if \\$1 is called during \fBdefine-macro\fP is active, the given input will not be stored in the macro! This command doesn't activate the \fBbegin-\fP / \fBend-prompt-macro\fP, because you can do it explicitly in the OCL-code. .. .\"}}} .\"{{{ fileprompt expands ~ to $HOME .nr fP 0 .de fP .ie \\n(fP \{\ .LP \\$1 uses the same \fB~\fP expansion, as \\*(fT. .\} .el \{\ .ds fT \\$1 .nr fP 1 .LP If the given filename is \fB~\fP or starts with \fB~/\fP, the \fB~\fP will be replaced by the value of environment variable \fBHOME\fP. If this value cannot be read, \fB.\fP is used instead. .\} .. .\"}}} .\"{{{ editor_files .de eF .LP \\$1 adds the file to the list of edited files, if the file isn't in this list. .. .\"}}} .\"}}} .\"}}} .\"{{{ Title and abstract .TL .LG .LG Origami .SM .SM .br User Guide .br .br .AU Michael Haardt u31b3hs\*(ac .AI .\" Grrrr -- I will use something better next time, who knew that groff knows \(oe .if "\(oe"" Auf der Hoern 40 .if !"\(oe"" Auf der H\(oern 40 5100 Aachen Germany .AB This document describes all basic functions of Origami. It never refers to specific keys, because the Emacs-like and the TDS keybindings are completely different. It also explains the OCL macro language. .AE .\"}}} .\"{{{ Using Origami .NH 1 Using Origami .\"{{{ Getting started .NH 2 Getting Started .LP You have the choice either to read the next chapters about using Origami or to use the tutorial to learn by doing. This tutorial is similar to the well known teach-emacs tutorial. You need a copy of the learn directory. Change to this directory and type: .DS \fBstart-me\fP .DE This tutorial must be used in Emacs-mode. .LP It is assumed that Origami is installed and ready to use on your system. It is invoked by typing \fBorigami\fP at the system prompt. Filenames may be typed after \fBorigami\fP \(em if this is not done a prompt for a filename will be issued. .\"{{{ ctrl-char .LP Control characters will be displayed as \fB^\fP followed by the ASCII coding of the control character (\fB@A\fP..\fBZ[\e]^_\fP for characters 0..31). The null character cannot be handled properly for internal reasons. Everything following the null character will be ignored. newline will cause a line break. It cannot be used as input. Use newline-and-indent instead. .\"}}} .\"{{{ tabs + spaces The tab character can be handled in different ways (default is \fB\-t8\fP), depending on the choosen command line option: .bI "\fB\-t\-1\fP:" Handle tabs as normal control character and display it with a inverted \fBI\fP. Tabs in the keyboard input will be handled as normal control character. .eI .bI "\fB\-t0\fP or \fB\-t\fP:" Origami will ask for the tab size in order to preserve your formatting. All tab characters will be converted into the corresponding number of spaces, and the file will contain these spaces instead of tabs when it is written back. Tabs in the keyboard input will be ignored. .eI .bI "\fB\-t\fP\fIn\fP, \fIn\fP>0:" All tabs remain in the text and are handled in the right way. Tabs in the keyboard input will be handled like as such. Tabs are not allowed in front of fold lines or before indentation of current fold. .eI .LP Spaces and tabs at end of line will be deleted when writing the file. .\"}}} .LP If you don't have write permission for the specified file, Origami will enter view only mode. Look at the manual page for advanced command line options. .\"}}} .\"{{{ The screen format .NH 2 The Screen Format .LP On starting an Origami session, a status line appears near the bottom of the screen. This line will remain throughout your edit session and any prompts or warnings issued by the editor will appear below this line. If you started typing a key sequence bound to a command, this sequence will be displayed under the status line, as well. If the second character of the line is a star, your file contains unsaved changes. The current language and the active modes are indicated in parentheses: .\"{{{ table of modes .nI .TS tab(|); l l l. long|short|meaning \fBFolding\fP|\fBF\fP|creating a fold \fBDefMac\fP|\fBD\fP|defining a keyboard macro \fBView\fP|\fBV\fP|Origami is in view only mode. \fBOver\fP|\fBO\fP|Origami is in overwrite mode. \fBAutoSave\fP|\fBS\fP|Origami is in auto save mode. \fBDirView\fP|\fBDV\fP|Current file is a directory. .TE .eI .\"}}} .LP The short forms are used if the statusline is too long. If there is a name defined in your keybinding file, it is displayed to the left of the version number (\*(vE) instead of `\fBOrigami\fP'. If the filename is too long to be shown in the statusline, Origami tries to cut the path and displays `\fB...\fP' instead of the omitted part of the path. .LP If Origami was started with command line option '\fB\-W\fP \fIstring\fP', \fIstring\fP will be displayed in front of the filename. .LP If the current file is a directory, Origami will use a list of filed fold for the directory entries as text. .\"}}} .\"{{{ The editor buffers .NH 2 The Editor Buffers .LP There are three buffers in Origami. The `move buffer' contains up to one text line, the `kill buffer' in which several lines can be collected before inserting them back into the file, and the `delete buffer', which holds the last deleted line (in each case a line can be a closed fold, with all its contents). The operations of these buffers in Origami are slightly different from TDS (INMOS Transputer Development System) \(em move, delete and kill buffers are lost on exit from Origami. .nB the \fBkill-buffer\fP was named \fBpick-buffer\fP in TDS/Multitool and old versions of Origami. .\"}}} .\"{{{ Processing Origami files .NH 2 Processing Origami Files .LP If a saved file is to pass though a particular compiler, the fold structure must be hidden from the compiler by writing it as comments. Origami hides the fold-markers by adding up to 3 characters to the start and end of the fold-marker. As comments differ from one language to another, it is necessary to choose the language before saving a new file for the first time. When reading a file back into Origami the language type is retained (provided that the file contained at least one fold). As a consequence you should take care not to include compiler comments within the fold header, as this will lead to nested comments which are not allowed in some languages. .LP The general technique for hiding a fold is: .\"{{{ example .DS \&{\&{\&{ this is a fold \&.\&.\&.F this is a filed fold for file xyz.a \&}\&}\&} .DE appears as .DS /*\&{\&{\&{ this is a fold*/ /*\&{\&{\&{F this is a filed fold for file xyz.a*/ /*\&:\&:\&:F xyz.a*/ /*\&}\&}\&} */ /*\&}\&}\&} */ .DE in the text file (language C). .\"}}} .LP Origami knows the following languages, to hide fold-markers: .\"{{{ table of values for comments .ne 13 .nI .TS tab(|); l l s l l l l l l l l l l l l l l l l l l l l l l l l l l l l l s l l s. Language|foldline comments: |start|end None|| Occam|\-\-| Pascal|(*|*) C|/*|*/ Lisp|;| Roff|\&.\e"| \*(Tx|%| Script|#| User|any sequences, up to 3 characters| Inmos|a binary format, see below .TE .eI .\"}}} .\"}}} .\"{{{ Inmos files .NH 2 Inmos Files .LP Inmos files can be edited without losing information. There are some restrictions on editing Inmos files: .bI "Filed folds:" Origami cannot open filed folds, only entering is possible. .LP Origami doesn't automatically remove files belonging to deleted filed folds and doesn't generate unique filenames on filing folds. .eI .bI "\fBEXE\fP, \fBLIB\fP, .. :" Origami isn't able to create special fold-types automatically, but can handle existing ones properly. You can use a OCL-command to set fold-type and fold-contents within a macro to integer values. .eI .bI "Inmos and ASCII-files:" Since version 1.6.31, the ASCII-format (using fold-languages \fBNONE\fP, \fBC\fP, .. ) for Inmos files has changed. The differences concern only the additional fold attributes (like \fBEXE\fP, \fBSC\fP, .. ). The new format should be able to save Inmos files with another language without losing of information, but we cannot guarantee this feature! Check this in your environment, before using it widely. .LP Changing the language from Inmos to another one and writing the file does only change the current file. Included filed-folds won't be changed by this! .eI .\"}}} .\"}}} .\"{{{ All Origami functions .\"{{{F functions.MS .\":::F functions.MS .\"}}} .\"{{{ Notes .\" This file will be included by origami.ms and is not for seperate use .\"}}} .NH 1 All Origami functions .LP This chapter lists all Origami functions with their keybind names. If you want to create a new keybinding, regard the files \fB???.keys\fP in the \fBbindings\fP directory of your Origami distribution. .\"{{{ moving around .NH 2 Moving around .sI \fBbackward-character\fP .sI \fBforward-character\fP .sI \fBprevious-line\fP .sI \fBnext-line\fP .sI \fBbeginning-of-line\fP .sI \fBend-of-line\fP .sI \fBprevious-page\fP .sI \fBnext-page\fP .\"{{{ beginning-of-fold .bI "\fBbeginning-of-fold\fP" Moves to the beginning of the entered fold. .eI .\"}}} .\"{{{ end-of-fold .bI "\fBend-of-fold\fP" Moves to the end of the entered fold. .eI .\"}}} .\"{{{ goto-line .bI "\fBgoto-line\fP" Prompts for a line number and moves cursor to this line. If needed, Origami opens closed folds to reach this line. .lC .eI .\"}}} .\"}}} .\"{{{ folding .NH 2 Folding .\"{{{ open-fold .bI "\fBopen-fold\fP" Open fold and show the contents in the context of the current level. .wA unlike TDS, you can not open file folds, just entering them is allowed. .eI .\"}}} .\"{{{ close-fold .bI "\fBclose-fold\fP" If the cursor is located within an opened fold, close this fold. .eI .\"}}} .\"{{{ enter-fold .bI "\fBenter-fold\fP" Enter the fold at the current line. Entering a filed fold saves the current file and switches to the new one. The old file and the line are stored internally. .eF "\fBenter-fold\fP" .LP Unlike TDS, using this function on normal text lines is allowed. Origami uses the string between the cursor position and the next single quote, double quote or whitespace as filename. If Origami cannot open the file, it will prompt for a filename (empty filename uses current file!). The file will be entered as if there was a filed fold for it. .fP .nB this command should be renamed `push-file', but we decided to keep the old name for historical reaons. .eI .\"}}} .\"{{{ exit-fold .bI "\fBexit-fold\fP" Exit fold. Exiting a filed fold saves it. .LP Using this function, without entering a fold, will use a list off all commandline files and edited files as surrounding fold! This fold will be handled as a directory. The cursor is moved to the line, containing the entry for the current file. .eI .\"}}} .\"{{{ unfold-fold .bI "\fBunfold-fold\fP" Remove fold at the current line \(em deletes the fold structure and inserts the contents of the fold instead. .eI .\"}}} .\"{{{ create-fold .bI "\fBcreate-fold\fP" Create fold. Use twice \(em first to indicate the top of a new fold, then to indicate its bottom. Lines to be included within the fold must not be indented less than the fold itself. Tabs are not allowed at the beginning of the folded lines if they appear before the intended indentation of the fold. Several other keys are disabled while create-fold is active. .eI .\"}}} .\"{{{ auto-header .bI "\fBauto-header\fP" When the cursor is on a closed fold this key will copy the first line enclosed by that fold to the fold line. .eI .\"}}} .\"{{{ toggle-file-fold .bI "\fBtoggle-file-fold\fP" File (create a new file) or unfile a fold. Creating a file writes the contents of the fold into a new file named by the fold comment (up to the first whitespace). Unlike TDS Origami does not create a new filename, if the chosen one is already used. It doesn't matter if you change the fold comment after filing a fold, because the filename is stored internally. Unfiling a filed fold replaces the file link with the contents of the file itself. Unlike TDS Origami doesn't remove the original file included this way. .eI .\"}}} .\"{{{ attach-file-to-fold .bI "\fBattach-file-to-fold\fP" Attach a file to a fold. This function links an existing file rather than creating a new one (and thus differs from toggle-create-file-fold). The filename is taken from the comment of the empty fold the cursor is placed on. The filename starts behind the foldmark and ends at the first whitespace. The rest of the line is ignored. After attaching files you can change the fold header because the file information is stored internally. .LP Unlike TDS, this function cannot be used to \fBdetach\fP a filed fold. .eI .\"}}} .\"}}} .\"{{{ editing .NH 2 Editing .\"{{{ delete-to-end-of-line .bI "\fBdelete-to-end-of-line\fP" Delete to end of line. There is no `undo' for this operation. .eI .\"}}} .\"{{{ delete-line .bI "\fBdelete-line\fP" Transfers the current line to the delete buffer, overwriting its old contents. .eI .\"}}} .\"{{{ undo-delete-line .bI "\fBundo-delete-line\fP" Inserts the line currently stored in the delete buffer as previous line. This can be done for exactly one line. .eI .\"}}} .\"{{{ delete-character .bI "\fBdelete-character\fP" Delete character under the cursor. If the cursor was at end of line, the next line will be appended to this line. .eI .\"}}} .\"{{{ delete-previous-character .bI "\fBdelete-previous-character\fP" Deletes the character to the left of the cursor. If the cursor was at the left margin, this line will be appended to the previous line. .eI .\"}}} .\"{{{ undo-delete-character .bI "\fBundo-delete-character\fP" Undeletes the last deleted character. This stored character is only changed by the \fBdelete-character\fP or \fBdelete-previous-character\fP commands. .eI .\"}}} .\"{{{ transpose-characters .bI "\fBtranspose-characters\fP" Transposes the character left of the cursor with the character under the cursor and moves the cursor right one character. .eI .\"}}} .\"{{{ toggle-case .bI "\fBcase-character-toggle\fP" Changes the case of the character under the cursor. .eI .\"}}} .\"{{{ newline-and-indent .bI "\fBnewline-and-indent\fP" Opens the line at cursor position and indents the right part like the left part. For fold comments, this only works at end of line. .eI .\"}}} .\"{{{ kill-line .bI "\fBkill-line\fP" Removes a line from the file and adds it to the end of the kill buffer. Note that the `kill buffer' is lost when exiting Origami, unlike TDS. .eI .\"}}} .\"{{{ copy-to-kill-buffer .bI "\fBcopy-to-kill-buffer\fP" Copies a line to the end of the kill buffer without deleting it from the file. Note that the kill buffer is lost when exiting Origami, unlike TDS. Lines containing filed folds cannot be copied to the kill buffer. .eI .\"}}} .\"{{{ insert-folded-kill-buffer .bI "\fBinsert-folded-kill-buffer\fP" Places the kill buffer before the current line as a fold with no comment. .eI .\"}}} .\"{{{ move-line .bI "\fBmove-line\fP" If the move buffer is empty, the current line is moved to the move buffer. Otherwise the move buffer is inserted before the current line. Note that the move buffer is lost when exiting Origami, unlike TDS. .eI .\"}}} .\"{{{ double-line .bI "\fBdouble-line\fP" Duplicates the current line in the file. Lines containing filed folds cannot be duplicated. .eI .\"}}} .\"}}} .\"{{{ search & replace .NH 2 Search and replace .\"{{{ search-forward .bI "\fBsearch-forward\fP" Prompts for a search string and displays its next occurence. An empty search string repeats the last search. The pattern is searched in the currently entered fold. .eI .\"}}} .\"{{{ search-reverse .bI "\fBsearch-reverse\fP" Same as \fBsearch-forward\fP, but searches backward. .eI .\"}}} .\"{{{ replace-string .bI "\fBreplace-string\fP" Asks for a search and a replace string and replaces all occurences. The replace will be done in the currently entered fold. .eI .\"}}} .\"{{{ quere-replace-string .bI "\fBquery-replace-string\fP" Same as \fBreplace-string\fP, but asks before replacing. .eI .\"}}} .\"{{{ incremental-search-forward .bI "\fBincremental-search-forward\fP" Searches the text for a string. String can be entered incrementally. \fBdelete-character-backward\fP jumps to the position where the character was added to the search string. Adding a character tries to find the new string. Aborting this command jumps to the calling position. \fBnewline-and-indent\fP ends the search. \fBprevious-line\fP, \fBprevious-character\fP, \fBincremental-search-reverse\fP and \fBsearch-reverse\fP switch the search direction to backwards and search the string. \fBnext-line\fP, \fBforward-character\fP, \fBincremental-search\fP and \fBsearch-forward\fP switch the search direction to forward and search the string. The pattern is searched in the currently entered fold. .LP Using \fBprevious-character\fP, \fBincremental-search-reverse\fP, \fBsearch-reverse\fP, \fBnext-line\fP, \fBforward-character\fP, \fBincremental-search\fP, \fBsearch-forward\fP or \fBdelete-character-backward\fP as first input inside the incremental search initialises the search pattern with the last used pattern. Using \fBincremental-search-forward\fP uses \fBgoto-line\fP to move to the old position if lines are different, so that opened folds are not closed automatically! .eI .\"}}} .\"{{{ incremental-search-backward .bI "\fBincremental-search-reverse\fP" Same as \fBincremental-search\fP, but starts with search direction backwards. .eI .\"}}} .\"}}} .\"{{{ files .NH 2 Files .\"{{{ read-file .bI "\fBread-file\fP" Reads another file for editing, saving the current one if required. If no filename is given, the current file is reread. .eF \fBread-file\fP .fP \fBread-file\fP .eI .\"}}} .\"{{{ next-file .bI "\fBnext-file\fP" Read next file given in the command line or edited before, saving the current file if required. If there is no next file, the list of commandline/edited files is used instead. .eI .\"}}} .\"{{{ previous-file .bI "\fBprevious-file\fP" Like \fBnext-file\fP, but reverse. .eI .\"}}} .\"{{{ save-file .bI "\fBsave-file\fP" Saves the current file with the current name and language. This command will only succeed if you haven't entered a fold. .nB if Origami is in view mode, the file will not be saved, even if it was changed. .eI .\"}}} .\"{{{ write-file .bI "\fBwrite-file\fP" Prompts for a filename and listing-mode. If no filename is given, the current filename will be used. Origami writes the text to a new file using the current language. If listing-mode is set, the generated file will be modified in the following way: .DS no heading \fIcomment\fP \fB{\&{\&{}\&}\&}\fP \fIcomment\fP line no \fB{\&{\&{\fP in fold headers no \fIcomment\fP \fB}\&}\&}\fP \fIcomment\fP lines .DE If listing-mode is set, the fold structure in the written file is lost. While using the language \fBInmos\fP it is impossible to set listing-mode, because the the generated files have an incompatible structure. .fP "\fBwrite-file\fP" .eI .\"}}} .\"{{{ insert-file .bI "\fBinsert-file\fP" Insert File. Prompts for a filename and imports this file into the edited file at the current position. If no filename is given, the current filename is used. .fP \fBinsert-file\fP .eI .\"}}} .\"{{{ filter-buffer .bI "\fBfilter-buffer\fP" Filters the current text. Origami prompts for the name of a filter. The current text is saved and piped through this filter. Origami tries to move the cursor back to the line on which the cursor was placed before executing this command. .sY \fBfilter-buffer\fP .eI .\"}}} .\"{{{ pipe-from-command .bI "\fBpipe-from-command\fP" Prompts for a command. The command is executed and its standard output inserted in the text at current position. .sY \fBpipe-from-command\fP .eI .\"}}} .\"{{{ pipe-to-command .bI "\fBpipe-to-command\fP" Prompts for a command. The current file will be piped to this command as standard input. .sY \fBpipe-to-command\fP .eI .\"}}} .\"}}} .\"{{{ macros .NH 2 Macros .\"{{{ define-macro .bI "\fBdefine-macro\fP" Records all keys into the keyboard macro buffer until define-macro is pressed again. Calling fix-macros is allowed during define-macro. This function cannot be executed while Origami prompts for information for another function (like \fBread-file\fP). .eI .\"}}} .\"{{{ execute-macro .bI "\fBexecute-macro\fP" Call keyboard macro. .eI .\"}}} .\"{{{ save-keyboard-macro .bI "\fBsave-keyboard-macro\fP" Asks for the number of a fix macro buffer. The contents of the keyboard macro buffer is copied to this fix macro buffer. Using \fB(deffun \&.. )\fP in keybind makes it impossible to overwrite the fix buffer. Using \fB\&(defusermacros\fP \fIx\fP\fB)\fP in your OCL source places \fIx\fP free macro buffers at places 1..\fIx\fP. .eI .\"}}} .\"{{{ execute-number-macro n .bI "\fBexecute-number-macro\fP \fIn\fP, (\fIn\fP=1,2,..)" Execute fix-macro number \fIn\fP. This command should be used to call macros defined by \fBsave-keyboard-macro\fP. All other macro buffers are used by \fB(deffun\fP \fIfoo\fP \fB(...) )\fP and \fB(keybind\fP \fIfoo\fP \fB(...) )\fP in keybind, so that using these operations has the same effect as calling the macro keysequence by their name! .eI .\"}}} .\"}}} .\"{{{ shell commands .NH 2 Shell commands .\"{{{ shell .bI "\fBshell\fP" Creates a shell according to the environment variable \fB\*(sH\fP. Exiting from this shell will return to Origami. .sY \fBshell\fP .eI .\"}}} .\"{{{ shell-command .bI "\fBshell-command\fP" Prompts for a command and starts a shell which executes it. .sY \fBshell-command\fP .eI .\"}}} .\"{{{ suspend-origami .bI "\fBsuspend-origami\fP" If your system has job control, Origami will be stopped and the calling shell is reactivated. .eI .\"}}} .\"}}} .\"{{{ arguments .KS .NH 2 Arguments .LP Like in Emacs, you can repeat each command by using an numerical argument. The first digit is given by \fBset-argument-\fP\fIdigit\fP. These functions read more digits of the argument until you type a non digit. This non digit may be a key sequence bound to a command or just a single character. It will be repeated argument times. Pressing the abort key will abort the repeated execution. \fBset-argument \fP\fIx\fP stops the definition or execution of a keyboard macro! .LP \fBset-argument-0\fP ... \fBset-argument-9\fP .LP If the argument is set to 0, the command will be executed once. .KE .\"}}} .\"{{{ special functions .NH 2 Special functions .\"{{{ quote-character .bI "\fBquote-character\fP" The next character typed in will be inserted in your text, even if it is bound to a command. .eI .\"}}} .\"{{{ redraw-display .bI "\fBredraw-display\fP" Refresh the screen. This is especially useful if the screen was messed up by messages... .eI .\"}}} .\"{{{ center-and-redraw-display .bI "\fBcenter-and-redraw-display\fP" Refresh and center screen. Like \fBredraw-display\fP, but also resets the window size. If you are working with a window environment which does not send a window changed signal, you may use this command after resizing a window. .eI .\"}}} .\"{{{ help .bI "\fBhelp\fP" Displays the helpfile $\*(hO/.origamihelp. Since there is no default file for this function, you can create your own helpfile. It may be useful for new and very complicated macros or other things you always forget. If there is no file $\*(hO/.origamihelp, Origami tries to get the referencedata from rc file. .eI .\"}}} .\"{{{ describe-bindings .bI "\fBdescribe-bindings\fP" Displays the binding information stored in $\*(hO/.origamirc. All currently recognized keyboard inputs will be printed. .eI .\"}}} .\"{{{ set-language .bI "\fBset-language\fP" Allows you to select the language for which the code is to be saved \(em ie the format in which folds are to be saved. This can be done by entering the first character of the language or by using \fBforward-character\fP, \fBbackward-character\fP. The currently used language is displayed inverse. If you choose \fBUser\fP, Origami prompts for the begin comment and end comment strings used for hiding the fold comments. Each string can be up to three characters in length. .nB if the current language is \fBInmos\fP, Origami prompts for permission, to prevent destruction of internal Inmos information. .eI .\"}}} .\"{{{ describe-fold .bI "\fBdescribe-fold\fP" Displays information on current cursorposition in file, number of entered folds in current file, indentation of currently entered fold and maybe information about the closed foldline under the cursor. The fold information is a pair of numbers. The first number describes the fold type and the second the fold contents (range 0..255). These codings have specific meanings in TDS. The OCL-variable \fB\*(oA\fP is set to: .nI .TS tab(|); l l. 256*type+contents|if type<128 -(256*(type mod 128)+contents)|otherwise .TE .eI .lC .eI .\"}}} .\"{{{ modes .\"{{{ set-file-unchanged .bI "\fBset-file-unchanged\fP" Marks the file as unchanged. .eI .\"}}} .\"{{{ edit/view .bI "\fBadd-mode-view\fP" Sets view only mode. .eI .bI "\fBdelete-mode-view\fP" Sets edit mode. .eI .\"}}} .\"{{{ insert/overwrite .bI "\fBadd-mode-overwrite\fP" Sets overwrite mode. Text input will overwrite other text. .eI .bI "\fBdelete-mode-overwrite\fP" Sets insert mode. Text input will be inserted. .eI .\"}}} .\"{{{ echo on/off .bI "\fBadd-mode-echo\fP" Incomplete keysequences are displayed under the status line. .eI .bI "\fBdelete-mode-echo\fP" Do not show unfinished keysequences. .eI .\"}}} .\"{{{ auto-save on/off .bI "\fBadd-mode-auto-save\fP" Prompts for the auto save interval. Origami will save your files periodically in auto save mode. Default time is 8 minutes. Minimum is 2 minutes and maximum is 60 minutes. .eI .bI "\fBdelete-mode-auto-save\fP" auto save is switched off. The OCL-variable \fB\*(oA\fP is set to the auto save intervall, or 0, if auto save is already switched off. .eI .\"}}} .\"{{{ status-line-off .bI "\fBstatus-line-off\fP" Displaying the status line is disabled. .eI .\"}}} .\"{{{ status-line-on .bI "\fBstatus-line-on\fP" Displaying the status line is enabled. .eI .\"}}} .\"{{{ numeric-keypad .bI "\fBnumeric-keypad\fP" Switches your keypad to numeric mode, if your terminal supports it. .eI .\"}}} .\"{{{ application-keypad .bI "\fBapplication-keypad\fP" Switches your keypad to application mode, if your terminal supports it. .eI .\"}}} .\"}}} .\"{{{ pipe-kbd-from-command .bI "\fBpipe-kbd-from-command\fP" Prompts for a command. This command will be executed and its standard output will be read as keyboard input for Origami. Using this, while another \fBpipe-kbd-from-command\fP is active will close all pipes! The general abort key stops the reading from a pipe. .sY \fBpipe-kbd-from-command\fP .eI .\"}}} .\"{{{ no-operation .bI "\fBno-operation\fP" No operation. This command can be used to explicitly disable keyboard inputs. .eI .\"}}} .\"{{{ bell .bI "\fBbell\fP" Activates the bell of your terminal. .eI .\"}}} .\"{{{ visible-bell .bI "\fBvisible-bell\fP" Activates the `visible bell' of your terminal. .eI .\"}}} .\"{{{ abort .bI "\fBabort\fP" Aborts any operation. There are several commands which can be aborted by this key. This operation can only be bound to a single key. This key will even stop a running macro, which may be useful to interrupt an endless loop. If you are anxious Origami might be doing something wrong, this key returns you to a safe state. \fBabort\fP can abort the reading of ASCII files (by simulating a \fBeof\fP) for the following commands: .\"{{{ table of commands .nI .TS tab(|); l l. Command:|condition: \fBenter-fold\fP|a filed fold \fBexit-fold\fP|a filed fold \fBfile-fold\fP|unfiling a filed fold \fBinsert-file\fP \fBfilter-buffer\fP \fBpipe-from-command\fP reading startup file|edit-file and stdin-pipe .TE .eI .\"}}} .LP For technical reasons, this doesn't work for reading files in \fBTDS\fP\-format. .eI .\"}}} .\"}}} .\"{{{ how to get out .NH 2 How to get out .\"{{{ save-and-exit-origami .bI "\fBsave-and-exit-origami\fP" Exits entered folds as needed, saves the file and exits from Origami. .nB if Origami is in view mode, the file will not be saved. .eI .\"}}} .\"{{{ exit-origami .bI "\fBexit-origami\fP" If there are unsaved changes to your file, Origami asks you if you want to leave anyway. .eI .\"}}} .\"}}} .\"}}} .\"{{{ Programming in OCL .NH 1 Programming in OCL .\"{{{ introduction to this chapter .LP This chapter describes OCL (Origami control language) and gives some examples to show how powerful it is. OCL is a programming language offering capabilities to use conditional statements, subroutines, loops, variables and recursion. It looks like LISP, but it is closer to an assembly language. The keybind program compiles human readable OCL source code into a tokenized binary form which will be interpreted by Origami. Every binding of functions to keyseuences must be done in this binary file. The functions described in the chapter explaining keybindings are very simple OCL statements. .\"}}} .\"{{{ OCL syntax and semantic .\"{{{F ocl.MS .\":::F ocl.MS .\"}}} .\"{{{ Notes .\" This file will be included by origami.ms and is not for seperate use .\"}}} .NH 2 OCL syntax and semantic .\"{{{ general infos .LP This section describes all OCL elements. It is assumed you are familiar with other programming languages. You will find examples in a later section. .LP Newlines and comments can be used anywhere in the text between syntactical structures. A comment starts with \fB;\fP and ends at end of line. .LP Though different machines have different wordlength, we use a 16 bit coding for internal OCL integers. Therefore the only machine dependencies is the character coding (ASCII, ..). .LP Internal integers (adresses in macro code and constants in expressions) are limited to \-32768..32767. .\"}}} .\"{{{ filed folds .NH 3 Handling of filed folds .LP Using language \fBNone\fP, keybind will automatically include the contents of filed folds when reading the source file. Normally multiple includes of the same file won't work, because redefinition of macros is not allowed. To build a clean macro library, you can use the conditional compilation explained below. .\"}}} .\"{{{ naming the bindings .NH 3 Name of a binding .\"{{{ defbinding .bI "\fB(defbinding\fP \fIname-of-binding\fP\fB)\fP" Defines a name for the binding which is displayed in the status line of Origami. If none is given, \fBOrigami\fP will be displayed. Multiple usage of this command is not allowed. The name is limited to 16 characters. .eI .\"}}} .\"}}} .\"{{{ bindings .NH 3 Binding commands to keys .\"{{{ keybind .\"{{{ op .bI "\fB(keybind\fP \fIoperation\fP \fIkeysequence\fP\fB)\fP" The Origami operation named \fIoperation\fP is bound to the keyboard input \fIkeysequence\fP. The bindinghelp will contain the entry: .DS \fBoperation keysequence\fP .DE .eI .\"}}} .\"{{{ char .hI \fB(keybind "\fP\fIsingle-char\fP \fIkeysequence\fP\fB)\fP .tI The normal character \fIsingle-char\fP is bound to the keyboard input \fIkeysequence\fP. The bindinghelp will contain the entry: .DS \fBsingle-char keysequence\fP. .DE For example, this form of keybind can be used to map some keys of a keypad to normal characters like + or * while using others as cursor keys. .eI .\"}}} .\"}}} .\"{{{ alias .bI "\fB(alias\fP \fIname\fP \fIkeysequence\fP\fB)\fP" The keyboard input \fIkeysequence\fP can be addressed as \fB$\fP\fIname\fP in the following definitions. Using \fB$\fP\fIname\fP places the symbolic reference name in the bindinghelp rather than the key sequence itself. .LP The following alias can be used without declaration: .DS \fB$esc\fP = escape key = 27 .DE Use \fBautoalias\fP to create your alias declarations. .eI .\"}}} .\"{{{ description of operands .\"{{{ name .bI \fIname\fP \fIname\fP is a normal identifier not beginning with \fB@\fP. .eI .\"}}} .\"{{{ keysequence .bI \fIkeysequence\fP \fIkeysequence\fP is a sequence of \fIkey\fP enclosed in parentheses. \fIkey\fP specifies a single key (or two keys, because \fBM\-"a\fP requires two keystrokes). Valid declarations for \fIkey\fP are: .\"{{{ table of keys .nI .ne 11 .TS tab(|); l l. coding:|meaning: \fB"\fP\fIx\fP|is the single character \fIx\fP \fBC\-\fP\fIX\fP|is control-\fIx\fP: |\fB@A\fP..\fBZ[\e]^_\fP codes 0..31 |\fB?\fP codes 127=delete-key \fBM\-"\fP\fIx\fP|Meta-key (\fBESC\fP) |followed by \fIx\fP (case sensitive) \fBM\-C\-\fP\fIX\fP|META-control-\fIx\fP \fB$\fP\fIname\fP|the key sequence defined by: |\fB( alias\fP \fIname\fP \&.\&.\&. \fB)\fP \fB0x\fP\fIhexdigits\fP|represents the given numer .TE .eI .\"}}} .eI .\"}}} .\"}}} .\"}}} .\"{{{ marks .NH 3 Other marks for folds .\"{{{ defmark .bI "\fB(defmark\fP \fIname\fP \fB(\fP \fImark1\fP \fImark2\fP \fImark3\fP \fImark4\fP \fB))\fP" This option places the definition of alternative fold marks in the rcfile, so that Origami can switch to these marks when invoked with command line option \fB\-m\fP\fIname\fP. The format for \fImark?\fP is: .DS \fB(\fP \fIsingle-char\fP \fIsingle-char\fP \fIsingle-char\fP \fB)\fP .DE where \fIsingle-char\fP is a \fB"\fP\fIx\fP definition like in \fB(keybind\fP ... \fB)\fP. The meanings of \fImark1\fP ... \fImark4\fP are: .\"{{{ table of marks .nI .ne 7 .TS tab(|); l l l. item:|used for:|default: \fImark1\fP|begin of fold|\fB{\&{\&{\fP \fImark2\fP|closed fold|\fB\&.\&.\&.\fP \fImark3\fP|name of filed fold|\fB:\&:\&:\fP |attributes of fold \fImark4\fP|end of fold|\fB}\&}\&}\fP .TE .eI .\"}}} .eI .\"}}} .\"}}} .\"{{{ Subroutines and macros/control structures .\"{{{F toplevel commands and main macro syntax .\":::F ocl-top.MS .\"}}} .\"{{{ Subroutines and macros .NH 3 Subroutines and macros .\"{{{ defmac .bI "\fB(defmac\fP \fIname\fP \fB(\fP\fIstatement\fP ... \fB))\fP" A macro (not subroutine!) \fIname\fP will be defined. Recursive invocations will be detected and handled inside the macro code. The macrocall will be replaced by inline code. If the OCL-assembler for this macro has a length 1, this macro can be bound to keys too. Longer macros can only be used inside other macro definitions. .eI .\"}}} .\"{{{ deffun .bI "\fB(deffun\fP \fIname\fP \fB(\fP\fIstatement\fP ... \fB))\fP" The operations in \fB(\fP\fIstatement\fP ... \fB)\fP are written to the \&.origamirc file so that Origami can initialize a fix-macro-buffer. Recursion is allowed. In the OCL text following this definition, you can use \fIname\fP as subroutine call or for key bindings. You cannot redefine the fix-macro-buffer. .eI .\"}}} .\"{{{ initfun .bI "\fB(initfun\fP \fIname\fP \fB(\fP\fIstatement\fP ... \fB))\fP" Like \fBdefmac\fP. In addition to this, the code is written to the rc-file to enable the use of \fIname\fP in \fB(keybind\fP \&.\&.\&. \fB)\fP statements. .wA using \fBsave-keyboard-macro x\fP has no effect on macros defined with \fBinitfun\fP when calling them by their name inside a macro. If you want to use such an effect you must use \fBexecute-macro x\fP in the calling macro. .eI .\"}}} .\"{{{ undeclare .bI "\fB(undeclare (\fB \fIname\fP ... \fB))\fP" Remove macros and variables (explained below) from the symbol table. The objects do exist, but the following OCL-source cannot acces them. It can be used, to hide local variables/macros. The names can be used again for other purposes without affecting the earlier usage. .LP You can also undeclare the standard Origami functions (like \fBenter-fold\fP). This can be used to replace the default functions by your own: .DS ( defmac enter-fold-orig ( enter-fold ) ) ( undeclare ( enter-fold ) ) ( deffun enter-fold \&.\&.. your code, using enter-fold-orig ) ( undeclare ( enter-fold-orig ) ) .DE .eI .\"}}} .\"{{{ usermacro .bI "\fB(defusermacros\fP \fInumber\fP\fB)\fP" This command must be used before any \fBdeffun\fP/\fBinitfun\fP statement. The macros 1..\fInumber\fP are not used by OCL. They can be used for \fBsave-keyboard-macro\fP. .eI .\"}}} .\"{{{ which macro places are used .nB Using the commands \fBdeffun\fP and \fBinitfun\fP uses the fix-macro-buffers 1,2,.. (or \fIx\fP,\fIx\fP+1,.., if you have used \fB(defusermacros\fP \fIx\fP\fB)\fP). .\"}}} .\"{{{ no-statusline .bI "\fB(status-line-off)\fP" Origami starts without displaying the status line. The Origami commands \fBstatus-line-on\fP and \fBstatus-line-off\fP can be used during the editing to override this default. .eI .\"}}} .\"{{{ forward .bI "\fB(forward\fP \fIname\fP\fB)\fP" \fIname\fP is declared as a name for a macro defined with \fBinitfun\fP or \fBdeffun\fP. In the following statements, \fIname\fP can be used as macro call even before its actual definition with \fB(deffun\fP \fIname\fP ... \fB)\fP. .eI .\"}}} .\"{{{ automacro .bI "\fB(read-newfile-macro\fP \fIname\fP\fB)\fP" The macro named \fIname\fP is called every time a new file is edited, either explicitly or by entering or exiting a filed fold. .eI .\"}}} .\"{{{ abortmacro .bI "\fB(abort-macro\fP \fIname\fP\fB)\fP" The macro named \fIname\fP is executed each time the abort key is pressed. .eI .\"}}} .\"{{{ view .bI "\fB(view-macro\fP \fIname\fP\fB)\fP" The macro named \fIname\fP is executed at each attempt to change the file in view mode. .eI .\"}}} .\"{{{ promptinmacro .bI "\fB(begin-prompt-macro\fP \fIname\fP\fB)\fP" The macro named \fIname\fP is executed each time prompt mode is entered (except the OCL commands \fBprompt\fP and \fBprompt-counter\fP). The repeat argument function reads its arguments in prompt mode. The macro may only use the following OCL-elements (some of them are explained in the following chapters): .\"{{{ tables of allowed elements .nI .\"{{{ controls .ne 3 .TS tab(|); l l l. controls: \fBif\fP-\fBfi\fP|\fBwhile\fP|\fBcase\fP-\fBdefault\fP-\fBesac\fP \fBif\fP-\fBelse\fP-\fBfi\fP|\fBdo\fP-\fBwhile\fP|\fBlocal\fP .TE .\"}}} .\"{{{ commands .ne 3 .TS tab(|); l l. commands: \fBset-counter\fP|modes from \fB(defmodes\fP \&.\&.\&. \fB)\fP \fBset-file-unchanged\fP|macros using these elements .TE .\"}}} .\"{{{ bools .ne 5 .TS tab(|); l l l. booleans: \fBin-prompt\fP|\fBtest-begin-fold\fP|\fBtest-overwrite\fP \fBtest-fold-line\fP|\fBtest-view\fP|\fBtest-end-fold\fP \fBtest-autosave\fP|\fBtest-filed\fP|\fBtest-echo\fP \fBcounter>0\fP|\fBtest-file-changed\fP|\fBcounter-0\fP \fBtest-language\fP|\fBlast-message\fP|\fBtest-text\fP .TE .\"}}} .\"{{{ expressions .ne 4 .TS tab(|); l l l. terms: \fB\+\fP|\fB\-\fP|\fBmodulo\fP \fBdiv\fP|\fBset-enter\fP|\fBset-space-enter\fP numbers|characters .TE .\"}}} .eI .\"}}} .wA keybind doesn't check if you only use the allowed commands! Only valid commands in such a macro will be executed. All other commands will be ignored. .eI .\"}}} .\"{{{ promptoutmacro .bI "\fB(end-prompt-macro\fP \fIname\fP\fB)\fP" The macro named \fIname\fP is executed each time prompt mode is finished (except the OCL commands \fBprompt\fP and \fBprompt-counter\fP). The command restrictions for the macro are the same as in \fBbegin-prompt-macro\fP. .eI .\"}}} .\"{{{ keynotbound .bI "\fB(key-not-bound-macro\fP \fIname\fP\fB)\fP" The macro named \fIname\fP is executed each time an illegal keysequence was entered. The command restrictions for the macro are the same as in \fBbegin-prompt-macro\fP. .eI .\"}}} .\"}}} .\"{{{ control structures .NH 3 Control structures .LP A \fIstatement\fP can be one of the following control structures or functions: .\"{{{ while .bI "\fBwhile\fP \fIcondition\fP \fB(\fP\fIstatement\fP ... \fB)\fP" Prechecked loop, the macro is repeated while the condition is true. .eI .\"}}} .\"{{{ do while .bI "\fBdo (\fP\fIstatement\fP ... \fB) while\fP \fIcondition\fP" Postchecked loop, the macro is repeated until the condition is false. .eI .\"}}} .\"{{{ if else fi .bI "\fBif\fP \fIcondition\fP \fB(\fP\fIstatement\fP ... \fB)\fP [ \fBelse (\fP\fIstatement\fP ... \fB)\fP ] \fBfi\fP" Conditional statement. If condition is true, the first macro is executed. If condition is false, the else macro, if given, is executed. .eI .\"}}} .\"{{{ case esac .bI "\fBcase (\fP\fIcondition\fP \fB(\fP\fIstatement\fP ... \fB))\fP ... [ \fBdefault (\fP\fIstatement\fP ... \fB)\fP ] \fBesac\fP" Conditional statement. The block of statements following the first conditional expression evaluating to TRUE is executed. If none of the conditions is true, the given default statements are executed. .eI .\"}}} .\"{{{ repeat .bI "\fBrepeat\fP \fIterm\fP \fB(\fP\fIstatement\fP ... \fB)\fP" \fB(\fP\fIstatement\fP ... \fB)\fP is repeated \fIterm\fP times. .wA old versions of keybind stored the called statements \fIterm\fP times. \fIterm\fP had to be a constant! This new version of keybind generates code, which uses an internal OCL-variable to count the loops. The number of repeats must not be a constant! The repeated statement is \fBnot\fP called via a subroutine call, so \fBreturn-from-macro\fP will leave the current macro, not only the \fBrepeat\fP! .eI .\"}}} .\"{{{ prompt .bI "\fBprompt\fP \fIprompt\fP" Displays \fIprompt\fP below the status line and waits for \fBnewline-and-indent\fP. If Origami is in define-macro-mode, the \fBnewline-and-indent\fP will not be stored! \fIprompt\fP can be: .\"{{{ decription of prompt .sI "\fIstring\fP" .bI "\fB(\fP\fIprompt-item\fP ... \fB)\fP" This list of \fIprompt-item\fPs can contain more complicated entries. They are: .sI "\fIstring\fP" .bI "\fBcounter\fP \fIname\fP" This will be replaced by the ASCII-representation of the value of OCL-variable \fIname\fP. .eI .bI "\fIorigami-message\fP" where \fIorigami-message\fP can be one of the message names declared in the Origami sources, file msg. Origami uses empty strings as additional arguments to fill the format descriptors. So string will be removed. Characters and integers will be undefined. .eI .eI .\"}}} Origami displays \fIprompt\fP and waits until you type a \fBnewline-and-indent\fP on your keyboard. The given input will \fBnot\fP be interpreted. Thus, typing a macro name won't execute the macro. .pM \fBprompt\fP .eI .\"}}} .\"{{{ message .bI "\fBmessage\fP \fIprompt\fP" Like \fBprompt\fP, but doesn't wait for input. .eI .\"}}} .\"{{{ exits .bI "\fBexit\fP" All running macros are aborted. .eI .bI "\fBmessage-exit\fP \fIprompt\fP" Same as exit. \fIprompt\fP is displayed under the status line. .eI .\"}}} .\"{{{ return-from-macro .bI "\fBreturn-from-macro\fP" The currently executed macro ends and the caller (keyboard or macro) resumes execution. .eI .\"}}} .\"{{{ local .bI "\fBlocal (\fP\fIname\fP ... \fB) (\fP\fIstatement\fP ... \fB)\fP" The values of the variables \fIname\fP ... are saved during the execution of \fB(\fP\fIstatement\fP ... \fB)\fP and restored to their original values afterwards. .nB \fB(\fP\fIstatement\fP ... \fB)\fP is executed as a subroutine, so that using \fBreturn-from-macro\fP inside will only leave this block and not the current macro. It's allowed to use a empty variable-list inside the \fBlocal\fP-statement. In this case, the statement can be used, to use \fBreturn-from-macro\fP as a kind of break! .eI .\"}}} .\"{{{ show-cursor .bI "\fBshow-cursor\fP \fIterm\fP" The text cursor is displayed and Origami sleeps for \fIterm\fP/10 seconds. \fIterm\fP is explained in the following chapter \fBVariables\fP. .eI .\"}}} .\"{{{ origami-commands .bI "\fIorigami-command\fP" All Origami commands you can use from the keyboard can also be used by their names. \fBabort\fP stops the macro execution and calls the abort macro, if it is defined. .eI .\"}}} .\"{{{ hooks by their names .LP If the corresponding hooks are already defined, you can use these names to call them: .sI \fBread-newfile-macro\fP .sI \fBabort-macro\fP .sI \fBview-macro\fP .sI \fBbegin-prompt-macro\fP .sI \fBend-prompt-macro\fP .sI \fBkey-not-bound-macro\fP .\"}}} .\"{{{ strings .bI "\fIstrings\fP" Normal text can be used. The syntax is: .bI "\fB""\fP\fItext\fP" \fItext\fP can be a any string not containing , \fB"\fP or \fB)\fP. .eI .sI "\fB""\fP to use " .sI "\fB"")\fP to use \fB)\fP" .sI "\fB""""\fP to use \fB""\fP" .wA if you use Origami to edit an OCL file, \fB"\fP should not be the last statement of a line because Origami deletes all spaces at end of line. The problem can be circumvented by appending a comment to the line. .eI .\"}}} .\"}}} .\"}}} .\"{{{ vars, bools .\"{{{F vars and bools in macros .\":::F ocl-vars.MS .\"}}} .\"{{{ variables .NH 3 Variables .\"{{{ standard vars and declare .LP OCL allows the use of variables. OCL variables are global integer variables. The variable \fB\*(rT\fP is a always defined. It is used to store the tab width for reading files. Using command line option \fB\-t\fP\fIn\fP,\fIn\fP>0 initialises it to \fIn\fP, otherwise it is set to 0. Using command line option \fB\-t\fP\fIn\fP,\fIn\fP>0 and OCL statements \fBsetcounter \*(rT\fP \fIm\fP,\fIm\fP!=\fIn\fP causes Origami to replace the tabs by the needed number of spaces. .LP The three OCL variables \fB\*(sH\fP, \fB\*(sW\fP and \fB\*(cL\fP are set to size of the text editing area (including the display area, explained below) on the screen and the number of the line, the cursor is in (top=1). .LP The OCL variable \fB\*(oA\fP can be set by using the command line option \fB-O\fP\fIvalue\fP, otherwise it is initialised with -1. This variable is also used, to store the exit status for \fBshell-command\fP, \fBshell\fP, \fBpipe-area\fP, \fBfilter-buffer\fP, \fBpipe-to-command\fP, \fBpipe-from-command\fP and \fBpipe-kbd-from-command\fP. .LP Except these standard variable, all other OCL variables have to be declared in the OCL source and they are initialized to zero when Origami starts up. .\"}}} .\"{{{ defvar .bI "\fB(defvar (\fP\fIvariablename\fP .. \fB))\fP" All given \fIvariablename\fP are declared as OCL variables. .eI .\"}}} .\"{{{ terms .LP Variables can be used to build expressions. The syntax for these expressions, called \fIterm\fP in this document, is: .\"{{{ expr .bI "\fIbasic\fP | \fB\-\fP\fIterm\fP | [\fB+\fP|\fB\-\fP|\fB*\fP|\fBdiv\fP|\fBmodulo\fP]\fB(\fP\fIterm\fP \fIterm\fP [\fIterm\fP .. ] \fB)\fP" A \fIterm\fP can be a \fIbasic\fP term or a compound term. .eI .\"}}} .LP OCL's \fIbasic\fP terms are: .\"{{{ number .bI "\fInumber\fP" a signed or unsigned integer constant. .eI .\"}}} .\"{{{ char .bI "\fB""\fP\fIchar\fP" the integer coding of the given character. .eI .\"}}} .\"{{{ name .bI "\fIname\fP" a variable .eI .\"}}} .\"{{{ pre .bI "\fBpre (\fP\fIstatement\fP ... \fB)\fP \fIterm\fP" execute \fB(\fP\fIstatement\fP ... \fB)\fP and return the value of \fIterm\fP. .eI .\"}}} .\"{{{ bool .bI "\fBcounter\fP \fIcondition\fP" is 1, if the boolean expression evaluates to TRUE, otherwise 0. .eI .\"}}} .\"{{{ read-repeat .bI "\fBread-repeat\fP" Return the value accumulated by \fBset-argument-x\fP. The repeated execution of the command will be stopped. .eI .\"}}} .\"{{{ store-character .bI "\fBstore-character\fP" Return the ASCII value of the character under the cursor. .eI .\"}}} .\"{{{ set-enter .bI "\fBset-enter\fP" Return number of entered folds. .eI .\"}}} .\"{{{ set-space-enter .bI "\fBset-space-enter\fP" Return the number of leading spaces hidden by entering folds. .eI .\"}}} .\"{{{ store-line .bI "\fBstore-line\fP" Return the current line number. .eI .\"}}} .\"{{{ store-pos .bI "\fBstore-pos\fP" Return the x-position of the cursor. 1 is first displayed character. This may be not the first character on that text line if you have entered indented folds. .eI .\"}}} .\"{{{ origami commands .bI "\fBorigami functions\fP" All Origami commands can be used in terms. It's used set variables with values used in \fBinsert-ascii\fP. .eI .\"}}} .LP \fIop\fP\fB(\fP\fIe1 e2 e3\fP .. \fB)\fP is evaluated like \fIop\fP\fB(\fP\fIop\fP\fB(\fP\fIe1 e2\fP\fB)\fP \fIe3\fP .. \fB)\fP. The expressions are not optimized (for example *(8 9) isn't replaced by 72). Play with the expressions and use viewrc if you need fast/short macros. .\"}}} .LP The following functions deal with variables/terms and can be used in the same way like the above mentioned statements: .\"{{{ prompt-counter .bI "\fBprompt-counter\fP \fIname prompt\fP" Prompts \fIprompt\fP below the status line and reads the new value for \fIname\fP from keyboard. Input \fIy\fP sets it to 1, \fIn\fP sets it to 0. All other inputs have to be decimals or a simple newline-and-indent. \fIprompt\fP is explained in section \fBControl structures\fP. .pM \fBprompt-counter\fP .eI .\"}}} .\"{{{ prompt-char-counter .bI "\fBprompt-char-counter\fP \fIname prompt\fP" Same as \fBprompt-counter\fP, but the counter \fIname\fP is set to the ASCII-value of the next pressed key. The value is undefined, if the pressed key is bound to a macro or Origami-function. The given input will \fBnot\fP be interpreted. So a given macro-call won't be executed! .pM \fBprompt-char-counter\fP .eI .\"}}} .\"{{{ menu-counter .bI "\fBmenu-counter\fP \fIname prompt\fP" Display \fIprompt\fP as a menu and ask for the whished item. Items are the space separeted textparts in \fIprompt\fP. You can choose the items by typing the first character or by moving with \fBbackward-character\fP and \fBforward-character\fP. The currently choosen item is displayed inverse (or with leading and trailling \fB*\fP, if inverse isn't possible). The first choosen item is given by \fIname\fP (or 0, if \fIname\fP is not in the correct range). \fIname\fP is set to the number of the choosen item (0..). .pM \fBmenu-counter\fP \fIname prompt\fP .eI .\"}}} .\"{{{ goto-counter .bI "\fBgoto\fP \fIterm\fP" Move the cursor on x-position \fIterm\fP. 1 is the first displayed character. If you enter a indented fold, position 1 is not the first character on that line. .eI .\"}}} .\"{{{ goto-counter .bI "\fBgoto-counter\fP \fIterm\fP" Same as above. .eI .\"}}} .\"{{{ goto-line-counter .bI "\fBgoto-line-counter\fP \fIterm\fP" Like \fBgoto-line\fP. The line number is the value of the expression. .wA Origami exits entered folds and moves to the given position. .lC .eI .\"}}} .\"{{{ counter .bI "\fBcounter\fP \fIterm\fP" The value of the expression is returned as ASCII-text. .eI .\"}}} .\"{{{ insert-ascii .bI "\fBinsert-ascii\fP \fIterm\fP" Insert the character with ASCII-code given by the expression into the input stream. There is no check whether the given value of name is a correct ascii value. Do it yourself! .LP This command can be used too, to put internal OCL-tokens into the token stream. This should only used by experienced OCL programmers! Using invalid tokens can crash Origami! .eI .\"}}} .\"{{{ set-counter .bI "\fBset-counter\fP \fIname term\fP" The counter-variable \fIname\fP is set to the value of \fIterm\fP. .eI .\"}}} .\"{{{ set-cursor-line .bI "\fBset-cursor-line\fP \fIterm\fP" Like \fBredraw-display\fP, but uses line \fIterm\fP instead of the current line. .eI .\"}}} .\"{{{ change-fold-type .bI "\fBchange-fold-type\fP \fIterm term\fP" Uses the first \fIterm\fP as foldtype and the second as foldcontents and changes the attributes of the fold under the cursor. These values have specific meanings in TDS! The values of the \fIterm\fPs are used modulo 255. .eI .\"}}} .\"{{{ save-and-exit-code .bI "\fBsave-and-exit-origami-code\fP \fIname prompt\fP" Like \fBsave-and-exit-origami\fP, but uses value of OCL-variable \fIname\fP as exit code. \fIprompt\fP is displayed as exit-message. .eI .\"}}} .\"{{{ old syntax .bI "old OCL-syntax:" The following commands are replaced by corresponding `\fBset-counter\fP \fIvar term\fP'-statements. Future releases of Origami are not guaranteed to support the old forms. .nI .ne 11 .TS tab(|); l l. old form:|replace with: \fBread-repeat\fP \fIx\fP|\fBset-counter\fP \fIx\fP \fBread-repeat\fP \fBstore-char\fP \fIx\fP|\fBset-counter\fP \fIx\fP \fBstore-char\fP \fBset-enter\fP \fIx\fP|\fBset-counter\fP \fIx\fP \fBset-enter\fP \fBset-space-enter\fP \fIx\fP|\fBset-counter\fP \fIx\fP \fBset-space-enter\fP \fBstore-line\fP \fIx\fP|\fBset-counter\fP \fIx\fP \fBstore-line\fP \fBstore-pos\fP \fIx\fP|\fBset-counter\fP \fIx\fP \fBstore-pos\fP \fBstore-char\fP \fIx\fP|\fBset-counter\fP \fIx\fP \fBstore-char\fP \fBinv-counter\fP \fIx\fP|\fBset-counter\fP \fIx\fP \fB\-(0\fP \fIx\fP\fB)\fP \fBsum-counter\fP \fIx y\fP|\fBset-counter\fP \fIx\fP \fB\+(\fP\fIx y\fP\fB)\fP \fBadd-counter\fP \fIx c\fP|\fBset-counter\fP \fIx\fP \fB+(\fP\fIx c\fP\fB)\fP .TE .eI .eI .\"}}} .\"}}} .\"{{{ character sets .NH 3 Character sets .LP In OCL you can use character sets to simplify boolean expressions. Predefined character sets are: .\"{{{ table of predefined sets .nI .ne 5 .TS tab(|); l l. name:|characters: \fBalpha\fP|a..zA..Z \fBlower\fP|a..z \fBupper\fP|A..Z \fBdigit\fP|0..9 .TE .eI .\"}}} You can define your own sets with: .\"{{{ defset .bI "\fB(defset\fP \fIname\fP \fB(\fP \fIelement\fP ... \fB))\fP" The character set name is declared. Elements are all characters given in the \fIelement\fP-list. \fIelement\fP can be: .nI .ne 3 .TS tab(|); l l. \fIname\fP|the name of a known character set \fB"\fP\fIx\fP|a normal character \fBC\-\fP\fIx\fP|a control character .TE .eI .eI .\"}}} Inside macros you can use \fBdefset\fP as Origami function: .\"{{{ defset inside macros .bI "\fBdefset\fP \fIdest source\fP" The value of set \fIdest\fP is overwritten by the set \fIsource\fP. \fIdest\fP has to be a user-defined set. the predefined sets are not allowed there! .eI .\"}}} .\"}}} .\"{{{ boolean expressions .NH 3 Boolean expressions .LP The boolean expressions \fIcondition\fP mentioned above can be: .\"{{{ boolean basicfunctions .\"{{{ last-message .bI "\fBlast-message\fP \fImessage-name\fP" Is true if the last message created by a string from file msg in the Origami source directory was \fImessage-name\fP. A successful test will set the last displayed message to a dummy value, so that \fBlast-message\fP \fIx\fP will be false until a new message is displayed. Using Origami-messages in prompts changes the last displayed message. The appendix contains the list of known messages. .eI .\"}}} .\"{{{ test-file-changed .bI "\fBtest-file-changed\fP" Is true if the current file has been changed. .eI .\"}}} .\"{{{ test-filed .bI "\fBtest-filed\fP" Is true if the current line is a file-folded-line. .eI .\"}}} .\"{{{ test-fold-line .bI "\fBtest-fold-line\fP" Is true if the current line is a closed-fold-line. .eI .\"}}} .\"{{{ test-begin-fold .bI "\fBtest-begin-fold\fP" Is true if the current line is the {\&{\&{ line of a open fold. .eI .\"}}} .\"{{{ test-end-fold .bI "\fBtest-end-fold\fP" Is true if the current line is the }\&}\&} line of a open fold. .eI .\"}}} .\"{{{ test-text .bI "\fBtest-text\fP" Is true if the current line is a normal text-line. .eI .\"}}} .\"{{{ test-top .bI "\fBtest-top\fP" Is true if the current line is the top of the entered fold. .eI .\"}}} .\"{{{ test-bottom .bI "\fBtest-bottom\fP" Is true if the current line is the bottom of the entered fold. .eI .\"}}} .\"{{{ test-char .bI "\fBtest-char "\fP\fIx\fP" Is true if the character under the cursor is equal to \fIx\fP. .eI .\"}}} .\"{{{ test-char-less .bI "\fBtest-char-less "\fP\fIx\fP" Is true if the character under the cursor is less then \fIx\fP. .eI .\"}}} .\"{{{ test-char-greater .bI "\fBtest-char-greater "\fP\fIx\fP" Is true if the character under the cursor is greater than \fIx\fP. .eI .\"}}} .\"{{{ test-char-counter .bI "\fBtest-char-counter\fP \fIterm\fP" Is true if the ASCII-value of the character under the cursor is equal to value of the expression. .eI .\"}}} .\"{{{ test-char-less-counter .bI "\fBtest-char-less-counter\fP \fIterm\fP" Is true if the ASCII-value of the character under the cursor is less than the value of the expression. .eI .\"}}} .\"{{{ test-char-greater-counter .bI "\fBtest-char-greater-counter\fP \fIterm\fP" Is true if the ASCII-value of the character under the cursor is greater than the value of the expression. .eI .\"}}} .\"{{{ test-char-set .bI "\fBtest-char-set\fP \fIname\fP" Is true if the character under the cursor is in the given character set \fIname\fP. .eI .\"}}} .\"{{{ test-language .bI "\fBtest-language "\fP\fIx\fP" Is true if \fIx\fP is the language used by \fBset-language\fP. .eI .\"}}} .\"{{{ counter-0 .bI "\fBcounter-0\fP \fIterm\fP" Is true if the expression evaluates to 0. .eI .\"}}} .\"{{{ counter>0 .bI "\fBcounter>0\fP \fIterm\fP" Is true if the expression evaluates to a value greater than 0. .eI .\"}}} .\"{{{ test-begin-line .bI "\fBtest-begin-line\fP" Is true if the cursor is placed on or before the first non-space-character of the current line. .eI .\"}}} .\"{{{ test-end-line .bI "\fBtest-end-line\fP" Is true if the cursor is placed behind the last non-space-character of the current line. .eI .\"}}} .\"{{{ test-behind-counter .bI "\fBtest-behind-counter\fP \fIterm\fP" Is true if the position in line greater than the value of the expression. .eI .\"}}} .\"{{{ in-prompt .bI "\fBin-prompt\fP" Is true if Origami isn't waiting for a normal edit-character (for example when prompting for a filename). .eI .\"}}} .\"{{{ test-overwrite .bI "\fBtest-overwrite\fP" Is true if Origami is in overwrite-mode. .eI .\"}}} .\"{{{ test-autosave .bI "\fBtest-autosave\fP" Is true if Origami is in autosave-mode. .eI .\"}}} .\"{{{ test-echo .bI "\fBtest-echo\fP" Is true if Origami is in echo-mode. .eI .\"}}} .\"{{{ test-view .bI "\fBtest-view\fP" Is true if Origami is in view-mode. .eI .\"}}} .\"{{{ term .bI "\fIterm\fP" Is true if the given expression evaluates to non-zero. .eI .\"}}} .\"}}} .\"{{{ boolean operators .\"{{{ pre .bI "\fBpre (\fP\fIstatement\fP ... \fB)\fP \fIcondition\fP" The sequence of \fIstatement\fP will be executed before the evaluation of \fIcondition\fP. .eI .\"}}} .\"{{{ not .bI "\fBnot(\fP\fIcondition\fP\fI)\fP" The value of \fIcondition\fP is logically negated. .eI .\"}}} .\"{{{ and .bI "\fBand(\fP\fIcondition\fP [ \fIcondition\fP ... ] \fB)\fP" Is true if all \fIcondition\fPs are true. .eI .\"}}} .\"{{{ or .bI "\fBor(\fP\fIcondition\fP [ \fIcondition\fP ... ] \fB)\fP" Is true if one of the \fIcondition\fPs is true. .eI .\"}}} .\"}}} .\"{{{ comments .nB OCL uses short-circuit evaluation for \fBand\fP and \fBor\fP. When Origami is prompting for information (for example, asking to overwrite an existing file during \fBtoggle-create-file-fold\fP), you can just use the part of OCL also allowed in begin-prompt- and end-prompt-macros. For historical reasons it is allowed to use delimiters \fB,\fP in the expression lists for \fBand\fP and \fBor\fP. .\"}}} .\"}}} .\"}}} .\"{{{ area .NH 3 The display area .LP Origami can use a part of the screen to continuously display a text in the same manner as the status line. This area cannot be edited with the normal editing commands. The text appears below the status line if it is enabled, with the last line highlighted. Otherwise the text appears below the editing area. Controlling this text display area is restricted to the following OCL statements: .\"{{{ set-area .bI "\fBset-area\fP \fIterm\fP" The OCL expression is used to set the size of the new area. If its value is 0, no text area will be displayed. Otherwise the value determines the number of lines in the new and empty text area. .eI .\"}}} .\"{{{ write-area .bI "\fBwrite-area\fB \fIvariable variable prompt\fP" Origami uses the variables as x- / y position where to write the string \fIprompt\fP. .eI .\"}}} .\"{{{ pipe-area .bI "\fBpipe-area\fP \fIprompt\fP" Origami starts \fIprompt\fP as a command and uses its output as new text for the text area. .sY \fBpipe-area\fP .eI .\"}}} .\"}}} .\"{{{ modes .NH 3 User defined modes .LP In addition to the predefined modes you can define up to 32 new pairs of strings which can be displayed as modes in the status line: .\"{{{ defmodestring .bI "\fB(defmodestring\fP \fIname longstring shortstring\fP\fB)\fP" \fIname\fP is a new mode. \fIlongstring\fP is displayed in the status line when the mode is active. If the status line becomes to long, \fIshortstring\fP is used. \fIlongstring\fP and \fIshortstring\fP are normal strings. \fIname\fP is a normal identifier. .eI .\"}}} .LP Usermodes are controlled by the following Origami commands. They can be used as normal Origami commands in every \fB(deffun \fP\&.\&.\&.\fB )\fP, \fB(initfun \fP\&.\&.\&.\fB )\fP and \fB(defmac \fP\&.\&.\&.\fB )\fP. .\"{{{ set-user-mode .bI "\fBset-user-mode\fP \fIname\fP" Usermode \fIname\fP is activated. At this point, \fIname\fP must be defined as usermode! .eI .\"}}} .\"{{{ reset-user-mode .bI "\fBreset-user-mode\fP \fIname\fP" Usermode \fIname\fP is reset. At this point, \fIname\fP must be defined as usermode! .eI .\"}}} .\"}}} .\"{{{ multiple keyboards .NH 3 Multiple keyboard modes .\"{{{ declaration .LP To create more complex keybindings (for example a \fBvi\fP emulation with modes), OCL offers the possibility to use up to eight different keyboard translation tables. To do this, you must declare the used key tables with: .\"{{{ defmodes .bI "\fB(defmodes\fP \fIname\fP ... \fB)\fP" where \fIname\fP is a normal string. This command has two effects: .nI Keybind initializes a key table for each \fIname\fP. .eI and .nI The macros \fIname\fP are defined and can be used within other macro definitions to switch to a certain keytab. They are not stored in fixed macro buffers, but you can use them for your one macro definitions. .eI .eI .\"}}} .\"}}} .\"{{{ bindings .LP The first defined mode is active when starting Origami. The definition of a declared keyboard can be done with: .\"{{{ mode .bI "\fB(mode\fP \fIname\fP \fB(keybind\fP ... \fB)\fP ... \fB)\fP" All given bindings are put into the keytable for . \fB(keybind abort ... )\fP must be declared outside any \fB(mode\fP ... \fB)\fP statement, which means you can only have one abort key for all modes. If using multiple keyboard modes, no other \fB(keybind\fP ... \fB)\fP statement is allowed outside \fB(mode\fP ... \fB)\fP statements. .LP Using this statement more than once for a specific keytable adds all given bindings to the given mode. .eI .\"}}} .\"}}} .\"}}} .\"{{{ terminal .NH 3 Terminals .LP You can configure Origami for different terminals in one rc file by using \fBterminal\fP. Terminal dependent aliases can be declared on toplevel via: .\"{{{ terminal alias .bI "\fB(terminal\fP [ \fB(\fP ] \fIname\fP [ ... \fB)\fP ] \fB(alias\fP ... \fB)\fP ... \fB)\fP" The corresponding alias definitions will be used for the different terminals. Terminal dependent aliases inside the \fB(alias\fP ... \fB)\fP statements are handled for each terminal. The given aliases are internally stored as \fItermname\fP\fB@\fP\fIaliasname\fP. Use \fBautoalias\fP to generate your alias declarations. .eI .\"}}} .LP Terminal dependent bindings can be used inside and outside of \fB(mode\fP \&.\&.\&. \fB)\fP statements. The declaration has to be made like: .\"{{{ terminal keybind .bI "\fB(terminal\fP [ \fB(\fP ] \fIname\fP [ ... \fB)\fP ] \fB(keybind\fP ... \fB)\fP ... \fB)\fP" The \fB(keybind\fP \&..\&.\&\fB )\fP commands inside this statement are only active if Origami is used on a terminal named \fIname\fP (value of environment variable \*(oT or \*(tE). Used aliases have to be declared globally or must be declared as terminal dependent for all named terminals. If a alias isn't declared for one of the given terminals, the bindings will not be done for this terminal and a errormessage will be printed. .eI .\"}}} .LP using \fBdefault\fP as terminalname in \fB(terminal\fP ..\&. \fB)\fP statements is allowed. The corresponding action will only be done for the default-table. .LP Some different terminals use the same character sequences for their different keys. To prevent multiple keytables for these terminals, you can use: .\"{{{ termalias .bI "\fB(termalias\fP \fItermname\fP \fB(\fP \fIaliastermname\fP ... \fB))\fP" If \fB$\*(tE\fP/\fB$\*(oT\fP is set to one of the \fIaliastermname\fPs, the keytable for \fItermname\fP is used. .eI .\"}}} .\"}}} .\"{{{ conditional compilation .NH 3 Conditional compilation .LP OCL offers the possibility to use the same OCL source for different keybindings by using the commands \fB@if-using\fP and \fB@use\fP to control the compilation of the OCL source. Some parts of the source will be handled like comments (like #if .. #endif in C). .\"{{{ use (..) .bI "\fB@use (\fP \fIname\fP ... \fB)\fP" From now on the identifiers \fIname\fP ... are known as set tags. .eI .\"}}} .\"{{{ use not(..) .bI "\fB@use not(\fP \fIname\fP ... \fB)\fP" From now on the identifiers \fIname\fP ... are not known as set tags. Deleting tags automatically created by \fBalias\fP has no influence on the alias definition. .eI .\"}}} .\"{{{ if-using (..) .bI "\fB@if-using (\fP \fItag\fP ... \fB)\fP \fIstatement\fP ... \fB@fi\fP" The list of statements will only be compiled if one of the tags is set. .eI .\"}}} .\"{{{ if-using not(..) .bI "\fB@if-using not(\fP \fItag\fP ... \fB)\fP \fIstatement\fP ... \fB@fi\fP" The list of statements will only be compiled if none of the tags is set. .eI .\"}}} .wA if a filed fold begins appears inside \fB@if-using (\fP\fInot-defined-tag\fP\fB)\fP, the fold will not be read to speed up compilation. Thus, its impossible to start a \fB@if-using\fP-block in one file and end it in another ! .LP All known aliases are known as set tags too. This can be used to write OCL sources which adapt to the terminal environment automatically. Alias-tags can be removed using \fB@use not(\fP\fI$aliasname\fP\fB)\fP without influencing the alias definition. .\"}}} .\"{{{ specials .NH 3 Special commands .LP .\"{{{ os-extension .bI "\fB(os-extension (\fP \fIstring\fP ... \fB))\fP" Keybind generates a rc-file entry, containing the given text. The standard UN*X Origami will ignore these entries, but special ports to non-UN*X operating-systems may use these entries for their own purposes. .eI .\"}}} .LP The following functions are special commands, for internal use. Only experienced OCL programmers should use these functions. They can be bound to keysequences or used in macros. .\"{{{ screen-off .bI "\fBscreen-off\fP" Turn off the screen display. If keyboard input is expected and the screen is switched off, the abort key is automatically invoked and the display turned on again. .eI .\"}}} .\"{{{ screen-on .bI "\fBscreen-on\fP" Turn on the screen display. You have to call \fBredraw-display\fP yourself. .eI .\"}}} .\"{{{ K_SHIFT .bI "\fBshift-next-token\fP" You can use it to control Origami from a pipe regardless of the key bindings except \fBshift-next-token\fP and \fBquote-character\fP. There are no other useful applications for it! .eI .\"}}} .\"}}} .\"{{{ references .NH 3 References .LP The following commands can be used to generate additional text files while compiling new bindings. .\"{{{ reference-begin/end .hI \fB@reference-begin\fP .br .br : .br \fB@reference-end\fP .tI If the command line option \fB\-r\fP\fIreferencefile\fP is active, all comments will be put into \fIreferencefile\fP. The text between the \fB@reference-begin\fP / \fB-end\fP marks will not be parsed as OCL code, so that the commands must appear at the beginning of a line and must be followed by a newline. If the command line option \fB\-R\fP is active, the data will copied to the rc file. Origami can display it with \fBhelp\fP, if no other helpfile is given. .eI .\"}}} .\"}}} .\"}}} .\"{{{ OCL examples .NH 2 OCL examples .LP This section includes some commented OCL examples for you to browse through before starting your own applications. It is assumed that you are familiar with Origami before you start programming in OCL. .\"{{{ simple keybindings .NH 3 Bindings keys .LP The following examples show how you can bind commands to (sequences of) keys and how aliases work. .\"{{{ first example with return .DS ; This is a simple keybind file (keybind newline-and-indent C-M) .DE The operation `newline-and-indent' is activated by pressing the key C-M. The line `newline-and-indent C-M' will be included in the keybinding help screens available to the user. .\"}}} .\"{{{ same example with alias You can achieve the same keybinding by using an alias: .DS ; This keybinding uses alias (alias enter C-M) (keybind newline-and-indent $enter) .DE The operation `newline-and-indent' is activated by C-M as before; the keybinding help will show `newline-and-indent enter'. If your terminal would send an unusual sequence of characters for the enter key instead of the C-M character (very rare), you would just define your own alias for $enter and leave the comprehensive keybind command unchanged. .\"}}} .\"}}} .\"{{{ byebye .NH 3 A small function .LP The first OCL example does not use any control structures. It defines a macro named byebye. You should play a little with such macros to get used to the compilation process and its (error) messages. .DS ; this is an example for a macro definition: (deffun byebye ( end-of-fold beginning-of-line newline-and-indent previous-line "end " "of " "text )) .sp (keybind byebye (M-"x "bye)) .DE byebye creates a new line containing \fBend of text\fP at the end of the entered fold. .\"}}} .\"{{{ shell version control .NH 3 Shell version control .LP Two more little macros deal with SVC. Note that the check out macro is only for personal use of SVC. If you are working in a group, someone else may have edited the file, which will not change your own read only copy. The advantage is that you can visit a file and decide if you want to change it. .DS (deffun check-out ( delete-mode-view shell-command "co " "-l " "$ORIFILE )) (deffun check-in ( save-file add-mode-view shell-command "ci " "-u " "$ORIFILE )) .DE .\"}}} .\"{{{ mtool-top .NH 3 MTool-version of top-of-fold .LP This a macro version of the command top-of-fold as it is used in the mtool system. The cursor moves to the begin of the currently opened fold. .DS ; example for a more complex macro (deffun mtool-top ( if test-end-fold (previous-line) fi while and(not(test-begin-fold),not(test-top)) ( if test-end-fold (mtool-top) fi previous-line ) )) .DE While the cursor is not being located on top of a fold (entered or opened) the cursor is moved up. If the macro finds the end of fold line from another opened fold, this fold is skipped by a recursive call of mtool-top. .\"}}} .\"{{{ fill-paragraph .NH 3 Fill paragraph .LP The next example macro is a bit more advanced. It is too lengthy to include it here, but it can be found in the file fill-paragraph. .LP fill-paragraph fills all lines from cursor position to the next line with a blank (or a dot in ``roff-mode'') in the first column. An end of a fold stops filling too. The first column of a line is here the first character in currently entered fold, not opened fold! Filling a line means to add words from the next line if it is too short or to put words to the next line if it is too long. The default right margin is set to column 72. If there are unfillable lines, fill-paragraph stops filling and complains. Fill-column counts from beginning of entered fold indentation. .LP The filling can be done in the following 3 ways: .bI "roff-mode (switched on when Origami starts)" All ``. '' are expanded to ``. ''. .eI .bI "block-mode" All `` '' are expanded to `` '', till the line reaches the fill margin. .eI .bI "shrink-mode" All `` '' are replaced by `` '' and the right margin remains unaligned or ragged. .eI .LP The macro inv-blank-handle switches between these modes. .LP The macro auto-wrap can be used instead of `` ''. If the cursor is at end of line, the currently typed word is automatically wrapped into a new line. .LP The macro set-fill-column allows to change the right margin. To do so, you can either use a numeric argument, point to the position of the new right margin with the cursor or make Origami prompt for the new column width by moving the cursor to the left margin. .\"}}} .\"{{{ goto-matching-fence .NH 3 Goto matching fence .LP If you are writing programs, you often want to know which parentheses match in a complicated expression. goto-matching-fence performs this function. It uses the character under the cursor to determine if you are looking for a round, square or curly bracket and if you want to jump to the opening or the closing one. If the cursor is not located on a bracket, nothing will happen. Otherwise the macro searches the matching fence. If it can't find it, it will move back to your old position. If necessary, this macro opens and closes folds. Do not worry if it does not seem to stop searching. If your text is very long and there is no fitting fence, you will be amazed how many folds you are using and how fast they can be opened and closed, but usually goto-matching-fence will exit gracefully at last. Remember the operation can also be interrupted by the abort character (often bound to C-C). .\"}}} .\"{{{ towers-of-hanoi .NH 3 The towers of hanoi .LP This is a funny macro to demonstrate the power of OCL. You should type a string of a few characters without blanks, then start this macro and have fun. .wA If you type more than about eight to ten characters, the game will require a long time. .\"}}} .\"{{{ conditional compilation .NH 3 Conditional compilation .\"{{{ simple example .LP A simple example for the usage of conditional compilation: .DS @if-using (foo) \&.\&.\&. block @fi .DE `\&.\&.\&. block' will only be compiled if the tag \fIfoo\fP is known as used. This can be done by an earlier \fB@use (\fP\fIfoo\fP\fB)\fP or by the commandline option \fB-U\fP\fIfoo\fP. .\"}}} .\"{{{ file-fold example .LP Another example shows the usage of conditional compilation to prevent multiple compilation of a file: .DS @if-using not(FILENAME) @use (FILENAME) \&.\&.\&. block @fi .DE .LP This technique is used in the library files in the bindings directory. .\"}}} .\"{{{ multiple configurations .LP The following example shows, how different keyboards, macro sets etc.\& can be handled properly with one OCL source. You need only one tag to choose the correct environment. This can be done either by an earlier \fB@use (\fP\fI??\fP\fB)\fP or by the command switch \fB\-U\fP\fI??\fP. .DS .\"{{{ set tags {\&{\&{ choose corect compilation tags @if-using (kbd_1_macros_1) @use ( kbd_1 mac_1 ) @fi @if-using (kbd_2_macros_1) @use ( kbd_2 mac_1 ) @fi ; you can write such statements as well: @if-using (kbd_1_macros_2) @use ( kbd_1 mac_2 ) @fi @if-using (kbd_2_macros_2) @use ( kbd_2 mac_2 ) @fi @if-using ( kbd_2_c ) @use (kbd_2 c_macs mac_1) @fi }\&}\&} .\"}}} .DE .DS .\"{{{ macros {\&{\&{ macros \&.\&.\&. simple macros @if-using (mac_2) .\&.\&.F special tex macros @fi @if-using (mac_1) .\&.\&.F text edit helps @fi @if-using (c_macs) .\&.\&.F c_macros @fi }\&}\&} .\"}}} .DE .DS .\"{{{ kbd \&{\&{\&{ keyboard mapping \&.\&.\&. terminal_keymap (esc,shift,ctrl ... ) @if-using (kbd_1) .\&.\&.F simple_keys (cursor- and functionkeys) @fi @if-using (kbd_2) .\&.\&.F more_complex_keys (cursor- and functionkeys) @fi }\&}\&} .\"}}} .DE The usage of more descriptive identifiers is left as an exercise for the reader. .\"}}} .\"}}} .\"{{{ terminals und modes .NH 3 Modes and terminals .\"{{{ simple example .LP A simple example for the usage of multiple keyboards is the following: .\"{{{ example .DS (defmodes edit shell) .DE .DS ( deffun shell-commands ( add-mode-view shell ) ) ( deffun editing ( delete-mode-view edit ) ) ( abort-macro editing ) .DE .DS (mode edit .\&.\&. bind all normal edit commands ( keybind shell-commands ( .. ) ) ) .DE .DS (mode shell .\&.\&. bind commands calling special shell scripts ( keybind editing ( .. ) ) ) .DE .DS \&.\&.\&. some other macros (mode shell ; mode is splitted in 2 definitions .\&.\&. bind commands calling special shell-scripts,part 2 ) .DE .\"}}} This enables you to use all normal characters for your shell commands or predefined system calls. .\"}}} .\"{{{ terminals .LP Another example shows the usage of terminal dependent bindings. .\"{{{ example .DS (defmodes keyboard) \&.\&.\&. aliases for SUN-keyboard \&.\&.\&. aliases for PC-keyboard (mode keyboard .\&.\&. all normal edit commands ( terminal SUN .\&.\&. all SUN keyboard function keys ) ( terminal PC .\&.\&. all PC keyboard function keys ) ) .DE .\"}}} .LP Origami loads only one of the given tables, depending on the value of $\*(oT or $\*(tE. The default keyboard uses none of the additional bindings. .LP The following is an example for using terminal dependencies for aliases too: .\"{{{ example .DS (defmodes keyboard) .DE .DS \&{\&{\&{ aliases for SUN keyboard - autoalias ; created with 'autoalias -tsun' ( terminal sun ( alias up ( ... ) ) \&.\&.. ) \&}\&}\&} \&.\&.\&. aliases for PC keyboard - hand coded .DE .DS (mode keyboard .\&.\&. all normal edit commands ( terminal ( sun PC ) ( keybind previous-line ( $up ) ) ; instead of $up, $sun@up and $PC@up ; will be used in the two tables \&.\&.. ) ) .DE .\"}}} .\"}}} .\"}}} .LP These examples should give an impression of what can be done using OCL. There are more macros stored in the bindings directory. I am sure that you will invent more useful OCL macros. If you wrote a really new and good one, please post it to the USENET newsgroup comp.editors. .\"}}} .\"}}} .\"{{{ Mouse extension .NH 1 Mouse extension .LP On some systems, Origami can be used with a mouse. The rc-file format is independent from mouse-support. If Origami isn't able to support the mouse, the corresponding information in the rc-file is ignored! .\"{{{ available mouse-supports .NH 2 Available implementations .LP Origami can be used with a mouse in the following window environments: .\"{{{ X .NH 3 X .LP Defining the symbol \fBXTERM\fP at compile time enables the mouse support for X. Running Origami inside a \fBxterm\fP will activate \fIsend mouse position on click\fP via sending '\\033[?9h' to the terminal and resetting afterwards. You can use up to 10 mouse buttons. They are named \fBButton1\fP .. \fBButton10\fP in the bindinglist. The mouse will only be activated, if the environment variable \fBTERM\fP is set to \fBxterm\fP. Pressing the mouse will activate the Origami actions. .LP \fBCut\fP/\fBPaste\fP function can be reached (on a standard xterm) via shift mouse button. See in your xterm- and X manuals for more details about mapping the mouse keys. Use \fBTERM\fP to control the loading of different keytables for different terminals! .LP If Origami is used in a xterm, you can use the command line option \fB\-T\fP \fItitle\fP to change the window title to the current filename. After exiting Origami, the title is set to \fItitle\fP. If \fItitle\fP is the empty string, \fBxterm\fP is used. .LP After reading the window size once from termcap/terminfo, Origami uses xterm escape sequences to get the windowsize. .\"}}} .\"{{{ MGR .NH 3 MGR .LP Defining the Symbol \fBMGR\fP at compiletime enables the mouse support for the Bellcore window manager MGR. Running Origami will activate \fIsend mouse position on click\fP with \fBm_setevent\fP and resetting afterwards. You can use 5 mouse buttons, pressing and releasing the button are distinguished. The buttons are named \fBButton1\fP..\fBButton5\fP, \fBButton1Down\fP..\fBButton5Down\fP in the bindinglist (\fBButton3\fP..\fBButton5\fP are not supported yet). The mouse will only be activated, if the environment variable \fB\*(tE\fP is set to \fBmgr\fP. See in your local mgr manuals for more information about mouse mapping. Use \fB\*(oT\fP to control the loading of different keytables for different terminals! .\"}}} .\"{{{ MGR + X .NH 3 X and MGR together .LP MGR and X support can be used together, because the MGR mouse support uses the escape sequence from the X mouse support to detect a mouse click. .LP Enable both supports by defining XTERM and MGR. .LP The commandline option \fB\-T\fP works only, if Origami is used in a xterm. .\"}}} .\"}}} .\"{{{ different supports .NH 2 Different Mouse supports .LP Different mouse-supports in Origami and keybind (rc-file) can be used together, if .nI both use the same `escape sequence' to mark a mouse-click .eI or .nI Origami scanns the mouse itself. .eI In these cases, the mapping of mouse buttons is defined by Origami. Otherwise the mouse won't work. .\"}}} .\"{{{ Using the mouse in OCL .NH 2 Using the mouse in OCL .LP All keytables, not named like a mouse-support use the default mouse-support (\fBxterm\fP). This can be changed with \fB\-M \fP\fIxxx\fP. If the mouse-support is not set to \fBno-mouse\fP, the OCL-tags \fBMOUSY\fP and \fIxxx\fP are set and the mouse-variables are defined. Otherwise, only the buttons are mapped to commands, but the mouse-variables are not used and no \fBMOUSY\fP is set! The mouse can be used with .LP \fB(mouse-buttons\fP \fICOMMAND-FOR-1 COMMAND-FOR-2\fP .. \fB)\fP .LP Pressing the mouse button \fIx\fP (number \fIx\fP in the above mentioned namelists) will activate \fICOMMAND-FOR-x\fP, which can be any Origami command or OCL macro. If one of the buttons should not be used, bind \fBno-operation\fP to it. Only the button numbers are stored in the rc-file. The names are generated by Origami at runtime, depending on Origami and its runtime environment. .LP If the choosen mouse-support is not \fBno-mouse\fP, the following OCL variables are defined automatically and set on mouse click before running the command: .nI .ne 12 .TS tab(|); l l s l l s l l s l l l l l s l l l l l s l l l l l l l l s l l l l l l. variable:|used for: \fB\*(mB\fP|number of pressed button \fB\*(mX\fP|column number the mouse pointed to ||useful for: \fBgoto-counter\fP \fB\*(mY\fP|line number of mouse position ||useful for: \fBgoto-line\fP \fB\*(mG\fP|number of steps down ||useful for: \fBnext-line\fP ||negative values: \fBprevious-line\fP \fB\*(mO\fP|clicked inside the text? ||\-1 if pressed outside the text ||0 otherwise .TE .eI .\"}}} .\"}}} .\"{{{ Miscellanous .NH 1 Miscellanous .LP If a document is to be loaded for the first time you should verify that it doesn't contain strings which could be misinterpreted as fold marks by Origami. The following simple shell script looks for such strings. .DS fgrep '{\&{\&{' fgrep '}\&}\&}' fgrep ':\&:\&:' .DE .\"}}} .\"{{{ Copyrights .NH 1 Copyright appointments .LP This chapter wasn't included in earlier versions, but a discussion on USENET convinced me to write it. Please read it carefully. .LP Each part of this software can and must be copied free. If you copy binaries, you must not prevent people from copying sources, too. You must not remove my name from this program. If you want to use parts of it for your own purposes, point out what is your code and what is mine. You use this software completely on your own risk. .LP No part of this software may be used for military purposes. I will make no exceptions for this point. .LP If someone wants to use software or parts of it from this package for commercial purposes, he needs a written non exclusive license. .LP There are no remarks in the other files of this package about copyright and these things, because program code and comments about it are two different things, but the above conditions are valid for the whole package! .\"}}} .\"{{{ Acknowledgements .NH 1 Acknowledgements .LP Most of this manual was written by me, but the original was written by someone else, who didn't leave his name in it. The concept of the folding editor was originally implemented as part of the Transputer development system at INMOS Ltd., Bristol, UK. The editor was a part of the TDS D700, and was written in Occam. It first ran on a 68000 based Sage/Stride development system, and later was Transputer resident on the PC development system. .LP Origami was rewritten from scratch in Turbo Pascal by Martin Green while at Ferranti Ltd, Cheadle Heath, Stockport, England, and used the same key mappings and editor functions as the TDS editor. .LP It was then converted from Turbo Pascal by p2c and ported by Charlie Lawrence, while at Eastman Kodak Co. He added lex/yacc based keyfiles, and did the considerable work needed to get it running in C. .LP I fixed some bugs in memory managment and otherwhere, ported it to MINIX, changed its user interface to look more Emacs-like and added new features. Wolfgang Stumvoll (stumvoll\*(ac) wrote the OCL code and the keybind compiler. He also made beta tests of all my new versions by using them for his daily work, which helped a lot to find existing and new bugs. Last but not least, he wrote the OCL fill-paragraph, goto-matching-fence and towers-of-hanoi macros. Both of us made a general code clean up, which was highly overdue. .LP Michael Schwingen (michaels\*(ac) ported Origami to Atari TOS and fixed a few minor bugs. .LP Robert Blum (blum\*(ac) ported Origami to MS/PC DOS. .LP Andrew Miller (windy\*(ac) spent much time proofreading the documentation and is still writing the vi Emulation. He tested most new versions on his MINIX machine as well. .LP There are too many people in different nets all around the world, who helped with small tips, bugreports etc.\& to improve Origami. Thanks to all of you. .LP I maintain the whole Origami source code, which means that I will answer or forward mail concerning Origami, decide if and how extensions should be made, give advices for people who are porting it, post new UN*X versions and update the documentation. I put new versions of Origami on the ftp archive ftp.thp.uni-koeln.de, path pub/minix/beta/origami. .\"}}} .\"{{{ Appendixes .bp .NH 1 Appendixes .\"{{{ messages .NH 2 Messages .\"{{{ what are the messages .LP The following is the list of all messages, Origami can display and which can be used in OCL-commands using the Origami messages. They are stored in the file \fB.origamimsg\fP and can be changed by editing this file. If you are doing this, don't change the length of the lines, the type and order of the used formats. .\"}}} .\"{{{ description of types .LP Different messages are used in different ways. The first character of the message-name indicates the usage: .\"{{{ known tags .nI .TS tab(|); l l. \fBD\fP|display-characters: |specifying some display-details \fBF\fP|format strings: |should only used with \fBlast-message\fP \fBI\fP|prompt strings: |first character is used for \fByes\fP,.. \fBM\fP|strings to be displayed .TE .eI .\"}}} .LP If \fBF_\fP\fIxxx\fP messages are used inside OCL-prompts, string arguments are replaced by empty strings, integer and character arguments are replaced by undefined numbers/characters. .\"}}} .LP The known messages are: .\"{{{ list of messages (automatically generated by make!) .ne 6 .TS tab(@); l l. \fBD_COMMA\fP@limiter for modes in statusline \fBD_EOLN\fP@marker for long lines \fBF_F_FAILED\fP@opening a filed fold failed \fBF_INFO_1\fP@first format for \fBdescribe-fold\fP \fBF_INFO_2\fP@second format for \fBdescribe-fold\fP \fBF_LOADING\fP@displayed while loading a file \fBF_NO_OPEN\fP@trying to open a non-text fold \fBF_SUBSTITUTIONS\fP@number of replaces by \fBreplace-string\fP \fBF_TCFF\fP@\fBtoggle-file-fold\fP overwrite a file? \fBF_TCG_F\fP@keyboard problems (tcgetattr) \fBF_TCS_F\fP@keyboard problems (tcsetattr) \fBF_TERMA\fP@keyboard problems (missing capability) \fBF_TERMB\fP@keyboard problems (not in termcap) \fBF_VM_FAIL\fP@virtual text handling crashed \fBF_WRITING\fP@displayed while writing a file \fBF_WRITTEN\fP@displayed after writing a file \fBI_AB\fP@abort key for \fBquery-replace-string\fP \fBI_DO_AB\fP@do-and-abort key for \fBquery-replace-string\fP \fBI_DO_REST\fP@do-rest key for \fBquery-replace-string\fP \fBI_NO\fP@no-key \fBI_YES\fP@yes-key \fBM_ABORTED\fP@displayed, if a macro was aborted \fBM_ACF_MSG\fP@read ASCII-file, }}} lines missing \fBM_ANY\fP@prompt for any key \fBM_ANY_Q\fP@prompt for any key or 'q' to quit \fBM_ARG\fP@arg: for \fBrepeat-argument-\fP\fIx\fP \fBM_AUTO_SAVED\fP@files has been \fBauto-save\fPd \fBM_BOTTOM\fP@no move behind of entered fold \fBM_BYE\fP@Bye \fBM_CANTOPEN\fP@complain about failed file-open \fBM_CANTWRITE\fP@complain about failed file-write \fBM_CHANGED_LEAVE\fP@prompt, if leave a changed file \fBM_CHANGED_SAVE\fP@prompt, if save a changed file \fBM_CLOSE_FAILED\fP@complain about a failed file-close \fBM_CO_END\fP@\fBset-language\fP asks for end-comment \fBM_CO_START\fP@\fBset-language\fP asks for start-comment \fBM_DIR_EDIT\fP@warning, editing directory! \fBM_DIRTY_FOLD\fP@ASCII reading crashed, handle as text \fBM_END\fP@End \fBM_ERR_MACROPLACE\fP@invalid number for \fBsave-keyboard-macro\fP \fBM_ERR_PO\fP@trying to edit at invalid place \fBM_EXE_EXE\fP@no \fBexecute-macro\fP while \fBdefine-macro\fP \fBM_EX_NFF\fP@\fBfilter-buffer\fP leaves entered folds \fBM_FAILED\fP@failed \fBM_FAILED_TERMINAL\fP@cannot open keyboard/terminal \fBM_FILENAME\fP@prompt for a filename \fBM_FIX_EXE\fP@no \fBsave-keyboard-macro\fP while \fBdefine-macro\fP \fBM_FI_FAILED\fP@find failed \fBM_FOLDERR\fP@cannot fold \fBM_FORKFAIL\fP@fork failed \fBM_GOTO\fP@prompt for a line-number \fBM_HF\fP@help-file \fBM_INDENT_CRASH\fP@reading ASCII changed indentation \fBM_INT_OCL\fP@internal OCL-crash \fBM_KBD_PIPE_FAILED\fP@more than one keyboard-pipe \fBM_KEY_BUFF_FULL\fP@keyboard macrobuffer is full \fBM_LEAVE_INMOS\fP@really leave language \fBInmos\fP? \fBM_LIST\fP@listing-mode for \fBwrite-file\fP? \fBM_LONG_LINE\fP@complain about long line \fBM_MAIL_1\fP@dump-mail, part 1 \fBM_MAIL_2\fP@dump-mail, part 2 \fBM_MAIL_3\fP@dump-mail, part 3 \fBM_MAIL_S\fP@dump-mail, subject \fBM_MARK_PATTERN\fP@replace at invalid position \fBM_NOFOLDKEY\fP@key disabled during create fold \fBM_NOT_BOUND\fP@key not bound \fBM_NOT_IF_TDS\fP@\fBInmos\fP: some commands not allowed \fBM_NO_AREA\fP@incorrect area-adress \fBM_NO_BACK_FOLDING\fP@complain: cannot fold backwards \fBM_NO_CHANGE\fP@\fBsave-file\fP not done, file unchanged! \fBM_NO_DEFINE\fP@\fBsave-keyboard-macro\fP and \fBdeffun\fP \fBM_NO_ENTER_LIST_FF\fP@cannot enter listing of filed fold \fBM_NO_FF_COPY\fP@no copy of filed folds \fBM_NO_JOB\fP@\fBOrigami\fP cannot handle job-control \fBM_NO_KTAB\fP@rc-file corrupted \fBM_NO_MARKS\fP@no marks for \fB-m\fP\fIxxx\fP option in rc-file \fBM_NO_OUTFILE\fP@\fBfilter-buffer\fP cannot open the pipe \fBM_NO_PICK\fP@nothing for \fBinsert-folded-kill-buffer\fP \fBM_NO_SAVE_CANCEL\fP@if cancel changes after failed save? \fBM_NO_SIMPLE_FOLD\fP@normal fold required \fBM_NO_TERM\fP@environment variable \fBTERM\fP not set \fBM_NO_TERMCAP\fP@cannot open terminal \fBM_NO_TEXT\fP@only text filed-folds can be entered \fBM_NO_TOP\fP@action needs to be on toplevel \fBM_NO_TOP_AUTO_SAVE\fP@cannot \fBauto-save\fP, entered a fold! \fBM_NO_UNDEL\fP@\fBundo-delete-line\fP has nothing to do \fBM_NULL_CRASH\fP@ASCII read: \\0 or no newline \fBM_Q_R_PROMPT\fP@prompt for \fBquery-replace-string\fP \fBM_READ\fP@Read \fBM_READING\fP@Reading... \fBM_REPLACE\fP@Prompt for replace-pattern \fBM_RF\fP@rc-file \fBM_SEARCH\fP@prompt for search-pattern \fBM_SHELL_CREATED\fP@sub-shell created \fBM_SH_COMMAND\fP@prompt for a shell-command \fBM_STACK_OVER\fP@complain about OCL-stack-crash \fBM_SUSPEND\fP@suspended \fBM_TABSIZE\fP@prompt for tab-size \fBM_TAB_CRASH\fP@complain: tab size set to 1 \fBM_TDS_CRASH\fP@reading corrupted \fBInmos\fP-file \fBM_TDS_LONG_LINE\fP@complain about lon \fBInmos\fP-line \fBM_TOP\fP@no move above entered fold \fBM_USE_EXIT\fP@trying to close a entered fold \fBM_VIEW\fP@view mode! \fBM_WHICH_FIX\fP@prompt for a macro-buffer \fBM_WIN_CHANGED\fP@window changed \fBM_WRITING\fP@Writing... \fBM_WRITTEN\fP@Written .TE .\"}}} .\"}}} .\"{{{ OCL-assembler-tokens .NH 2 OCL-assembler .LP The following list shows all available OCL-assembler commands. \fBviewrc\fP uses the following names to decode the rc-files. The names are used in the source-code too. There are commands with different kinds of arguments. The following command-types are known: .\"{{{ table of known types .nI .ne 8 .TS tab(|); l l. COM|without arguments COM_I|with variable/integer argument COM_C|with character argument COM_A|with adress argument COM_II|with 2 variable/integer arguments COM_P|with prompt argument COM_IP|with variable/integer and prompt arguments COM_IIP|with 2 variable/integer and prompt arguments .TE .eI .\"}}} .LP \fB\fPThe known commands are: .\"{{{ table of commands (automatically generated by make!) .TS tab(@); l r l. \fBO_NOP\fP@256@COM no operation .sp .3 \fBM_BEGIN_OF_LINE\fP@257@COM at beginning of line? .sp .3 \fBM_BEHIND_COUNTER_X_POS\fP@258@COM_I behind var[arg] x-pos? .sp .3 \fBM_BOT_OF_FOLD\fP@259@COM at bottom of entered fold? .sp .3 \fBM_CHANGE_FOLD\fP@260@COM_II change fold type .sp .3 \fBM_END_OF_LINE\fP@261@COM behind end of line? .sp .3 \fBM_EXIT\fP@262@COM_P end macro and show message .sp .3 \fBM_FINISH\fP@263@COM_IP exit \fBOrigami\fP return=var[arg] show prompt .sp .3 \fBM_GO_COUNTER_X_POS\fP@264@COM_I go to position var[arg] .sp .3 \fBM_PIPE_HELP\fP@265@COM_P get areatext from pipe .sp .3 \fBM_POS_TO_COUNTER\fP@266@COM_I var[arg]=x-position .sp .3 \fBM_SHOW_HELP\fP@267@COM_I show the help file .sp .3 \fBM_STORE_C\fP@268@COM var[arg]=current char .sp .3 \fBM_TEST_CC\fP@269@COM_I current char==var[arg]? .sp .3 \fBM_TEST_CHAR\fP@270@COM_C current char==arg? .sp .3 \fBM_TEST_CHAR_HIGH\fP@271@COM current char>arg? .sp .3 \fBM_TEST_CHAR_LOW\fP@272@COM current charvar[arg]? .sp .3 \fBM_TEST_L_CC\fP@275@COM_I current char0? .sp .3 \fBM_PROMPT\fP@381@COM_IP prompt for var[arg]-value .sp .3 \fBM_PROMPT_C\fP@382@COM_IP prompt for var[arg]-char .sp .3 \fBM_PUSH_INT\fP@383@COM_I push var[arg] on stack .sp .3 \fBM_READ_REPEAT\fP@384@COM_I reset repeat-mode .sp .3 \fBM_RESET_USER_MODE\fP@385@COM_I no user-mode arg .sp .3 \fBM_SCREEN_OFF\fP@386@COM don't write on screen .sp .3 \fBM_SCREEN_ON\fP@387@COM write on screen .sp .3 \fBM_SET_COPY\fP@388@COM_II copy set2 to set1 .sp .3 \fBM_SET_COUNTER\fP@389@COM_II var[arg1]=arg2 .sp .3 \fBM_SET_USER_MODE\fP@390@COM_I user-mode arg .sp .3 \fBM_SHOW_CURSOR\fP@391@COM_I show cursor var[arg]/10 sec .sp .3 \fBM_STORE_LINE_NO\fP@392@COM_I var[arg]=line-number .sp .3 \fBM_SUM_COUNTER\fP@393@COM_II var[arg1]+=var[arg2] .sp .3 \fBM_SW_KBD\fP@394@COM_I switch to keyboard arg .sp .3 \fBM_S_ENTERED\fP@395@COM_I var[arg]= #entered spaces .sp .3 \fBM_TEST_AUTO\fP@396@COM in auto-save-mode? .sp .3 \fBM_TEST_ECHO\fP@397@COM in echo-mode? .sp .3 \fBM_TEST_OVER\fP@398@COM in overwrite-mode? .sp .3 \fBM_TEST_VIEW\fP@399@COM in view-mode? .sp .3 \fBM_TEXTLINE\fP@400@COM normal textline? .sp .3 \fBO_APL_ON\fP@401@COM \fBapplication-keypad\fP .sp .3 \fBO_BELL\fP@402@COM \fBbell\fP .sp .3 \fBO_BELL_VISIBLE\fP@403@COM \fBvisible-bell\fP .sp .3 \fBO_DEF_FIX\fP@404@COM \fBsave-keyboard-macro\fP .sp .3 \fBO_DEF_MACRO\fP@405@COM \fBdefine-macro\fP .sp .3 \fBO_NUM_ON\fP@406@COM \fBnumeric-keypad\fP .sp .3 \fBO_REP_0\fP@407@COM \fBset-argument-0\fP .sp .3 \fBO_REP_1\fP@408@COM \fBset-argument-1\fP .sp .3 \fBO_REP_2\fP@409@COM \fBset-argument-2\fP .sp .3 \fBO_REP_3\fP@410@COM \fBset-argument-3\fP .sp .3 \fBO_REP_4\fP@411@COM \fBset-argument-4\fP .sp .3 \fBO_REP_5\fP@412@COM \fBset-argument-5\fP .sp .3 \fBO_REP_6\fP@413@COM \fBset-argument-6\fP .sp .3 \fBO_REP_7\fP@414@COM \fBset-argument-7\fP .sp .3 \fBO_REP_8\fP@415@COM \fBset-argument-8\fP .sp .3 \fBO_REP_9\fP@416@COM \fBset-argument-9\fP .sp .3 \fBO_UNCHANGE\fP@417@COM \fBset-file-unchanged\fP .sp .3 \fBO_CALL_FIX\fP@418@COM dummy, used during compilation .sp .3 \fBO_EXE_MACRO\fP@419@COM \fBexecute-macro\fP .sp .3 \fBO_CALL_FIX\fP (\fIx\fP-419) @\fIx\fP>419@COM call the OCL-macro .TE .LP Tokens lower than 256 represent the corresponding characters. .\"}}} .\"}}} .\"{{{ command line options .NH 2 Command line options .LP The following is part of the online help. Origamis usage is .DS \fBorigami\fP [\fIoption\fP ...] [\fIfile\fP ...] .DE where \fIoptions\fP can be: .\"{{{ list off known options .\"{{{ define iP: [.eI] .bI .nr iP 0 .de iP .ie \\n(iT .eI .el .nr iT 1 .bI "\\$1" .. .\"}}} .\"{{{F ../man/o-opt.MAN .\":::F ../man/o-opt.MAN .\"}}} .\" this is used for ms and me in different ways. So IP is replaced by XP .\" The calling files define this macro in the right way .\"{{{ -a .iP "\fB\-a\fP \fIdelay\fP, 2\(<=\fIdelay\fP\(<=60" \fBOrigami\fP will start in auto-save-mode with \fIdelay\fP minutes (\fB\-a 0\fP, no auto-save). Multiple usage of this option is allowed. The last given value is used. .\"}}} .\"{{{ -e .iP \fB\-e\fP \fBOrigami\fP does not echo the entered keys under the statusline. .\"}}} .\"{{{ -h .iP \fB\-h\fP \fBOrigami\fP prints its usage. .\"}}} .\"{{{ -i .iP "\fB\-i\fP" \fBOrigami\fP displayes control-characters with inverse ACII-characters instead of \fB^\fP followed by the ASCII-character. .\"}}} .\"{{{ -k .iP "\fB\-k\fP \fInamebase\fP" \fBOrigami\fP reads the keybinding and the bindinglist from file \fB\&.origamirc\fP, the help from \fB.origamihelp\fP. This option sets the files to \fInamebase\fP\fBrc\fP and \fInamebase\fP\fBhelp\fP. If \fBOrigami\fP cannot find the files in the current directory, \fBOrigami\fP tries to find the files in the directories \fB$\*(hO\fP or \fBORIGAMI_PATH\fP (set at compiletime). If this option is used more than once, the last given value is used. .\"}}} .\"{{{ -l .iP "\fB\-l\fP \fIline\fP" Goto \fIline\fP after setting up. Multiple usage of \fB\-l\fP .. is not allowed. .\"}}} .\"{{{ -m .iP "\fB\-m\fP \fImarkname\fP" \fBOrigami\fP searches in the rcfile for a set of foldmarks named \fImarkname\fP. If there is no such markset given, \fBOrigami\fP will stop. Otherwise the marks for folds are switched to the new ones. Multiple usage of \fB\-m\fP .. is not allowed. .\"}}} .\"{{{ -n .iP \fB\-n\fP All readings of files were done without searching for \fB{\&{\&{\fP, \fB}\&}\&}\fP or \fB:\&:\&:\fP. Folds can be used when editing, but there is no folding-structure in the read file. This allows to edit files which contain these strings without confusing \fBOrigami\fP. The Inmos format won't be decoded, if this option is active. This `non-folding' mode concerns only reading files. Furthermore creating new folds or writing files using language Inmos is possible. .\"}}} .\"{{{ -o .iP \fB\-o\fP \fBOrigami\fP starts in overwrite-mode. .\"}}} .\"{{{ -p .iP \fB\-p\fP Preprocessormode is on. Leading hashes are moved to first character in lines. Reading such files moves hashes to correct indentation in folds. .\"}}} .\"{{{ -s .iP "\fB\-s\fP \fIdepth\fP" Sets internal OCL stack to size \fIdepth\fP. Default is 64, which should be enough for usual macros. Multiple usage of this option is allowed. The last given value is used. .\"}}} .\"{{{ -t .iP "\fB\-t\fP \fIhard-tab-width\fP" specify the handling of tabs. Multiple usage of this option is allowed. The last given value is used. Available are: .iP "\fB\-t 0\fP" expand tabs to spaces and ask for tab-size. .iP "\fB\-t \-1\fP" handle tab characters like normal control characters. .iP "\fB\-t\fP \fIn\fP,\fIn\fP>0" reading files with tab-width \fIn\fP doesn't replace the tabs by spaces and handle tabs in the right way. .\"}}} .\"{{{ -v .iP \fB\-v\fP \fBOrigami\fP starts in view-mode. .\"}}} .\"{{{ -N .iP "\fB\-N\fP \fInumber\fP" If \fBOrigami\fP is compiled with support for storing lines outside memory, this options sets the number of buffered lines. .\"}}} .\"{{{ -O .iP "\fB\-O\fP \fIocl-value\fP" Initialise the OCL-variable \fB\*(oA\fP with \fIocl-value\fP. Multiple usage of this option is allowed. The last given value is used. .\"}}} .\"{{{ -P .iP "\fB\-P\fP" Don't open the controlling terminal, if called in a pipe. .\"}}} .\"{{{ -T .iP "\fB\-T\fP \fIdefault-name\fP" This option is only available, if \fBOrigami\fP is compiled to support xterms. In this case, this option enables \fBOrigami\fP to set the xterm window name to the name of the current file. After \fBOrigami\fP has finished, the window name is changed to \fIdefault-name\fP. Multiple usage of this option is allowed. The last given value is used. If the given value is the empty string, \fBxterm\fP is used. .\"}}} .\"{{{ -X .iP "\fB\-X\fP \fIos specific option\fP" Some speciell versions of \fBOrigami\fP use this option to handle additional features. See the os-specific documents for more information. .\"}}} .\"{{{ -V .iP \fB\-V\fP \fBOrigami\fP starts in verbose-mode. .\"}}} .\"{{{ -W window-name .iP "\fB\-W\fP \fIwindow name\fP" \fIwindow name\fP will be displayed in the statusline, in front of the filename. \fIwindow name\fP will also appear in the title of xterms, if \fB\-T\fP is used. .\"}}} .\"{{{ -Z .iP \fB\-Z\fP \fBOrigami\fP cannot be stopped via \fBsuspend-origami\fP. .\"}}} .eI .\"}}} .\"}}} .\"}}}