$ show default $ check_sum = 475410916 $ write sys$output "Creating AAAREADME.TXT" $ create AAAREADME.TXT $ DECK/DOLLARS="$*$*EOD*$*$" Eve_EDT Version 2.0 requires VMS 5.0 or greater. In order to build Eve_EDT from the following files, first execute the command file BUILD.COM. This creates EVE_EDT.TPU$SECTION and EVE_EDT.HLB. Move these two files to a directory where all users of Eve_EDT can read them. Modify Eve_EDT.COM so that directory specifications are correct on your system. Execute Eve_EDT.COM (this has to be done every time that users of Eve_EDT log in) and you're all set! Note that the help library no longer has to live in SYS$Help:! However the logical name EVE$HELP must be defined for the Eve_EDT help file to be used instead of SYS$Help:Eve$Help. The build procedure must be used every time that a new version of VMS is installed. If the topic COMMANDS in SYS$Help:Eve$Help.HLB ever changes then some editing should be done to Eve_Utility.HLP to reflect these. The only caveat to add is that if you have DECspell installed on your system, you'll want to remove the routine EVE_SPELL in the Eve_Utility module and you'll also want to remove the help entry for SPELL in Eve_Utility.HLP. The routines for accessing DECspell are already included in Eve. $*$*EOD*$*$ $ checksum AAAREADME.TXT $ if checksum$checksum .ne. check_sum then - $ write sys$output "Checksum failed, file probably corrupted" $ check_sum = 410536671 $ write sys$output "Creating BUILD.COM" $ create BUILD.COM $ DECK/DOLLARS="$*$*EOD*$*$" $ build == "EDIT/TPU/NODISPLAY/SECTION=EVE$SECTION" +- "/COMMAND=SYS$EXAMPLES:EVE$BUILD/NOINITIALIZATION" $ build eve_edt/output=eve_edt.tpu$section $ copy sys$help:eve$help.hlb eve_edt.hlb/log $ library/help/replace eve_edt eve_utility/log $ exit $*$*EOD*$*$ $ checksum BUILD.COM $ if checksum$checksum .ne. check_sum then - $ write sys$output "Checksum failed, file probably corrupted" $ check_sum = 893481656 $ write sys$output "Creating EVE_EDT.COM" $ create EVE_EDT.COM $ DECK/DOLLARS="$*$*EOD*$*$" $ define/job tpu$section user:[chris.work.eve_edt]eve_edt $ define/job mail$edit "Callable_TPU" $ define/job eve$help user:[chris.work.eve_edt]eve_edt.hlb $ tpu == "edit/tpu" $ ed*t == "edit/tpu" $ exit $*$*EOD*$*$ $ checksum EVE_EDT.COM $ if checksum$checksum .ne. check_sum then - $ write sys$output "Checksum failed, file probably corrupted" $ check_sum = 638552085 $ write sys$output "Creating EVE_EDT_CORE.TPU" $ create EVE_EDT_CORE.TPU $ DECK/DOLLARS="$*$*EOD*$*$" ! EVE_EDT_CORE.TPU ! ! Written by: Chris Yoder ! for: Harvey Mudd College ! Mathematics Department ! on: September 9, 1988 ! ! Eve_EDT is my own special version of EVE and EDT. It's mostly ! just an EDT keypad on top of Eve. With VMS 5.0, this version is ! *almost* unnecessary, but I'm used to my version by now... Besides ! that, Eve_EDT contains a number of subtle differences from the basic ! EDT keypad in Eve as well as some additional functionality. ! !++ ! Table of Contents ! ! EVE_EDT_CORE.TPU ! ! Procedure name Page Description ! -------------- ---- ------------ ! ! eve_edt_module_ident 2 Ident ! eve_edt_module_init 3 Initialization ! eve_edt_declare_synonym 4 Synonyms ! ! Page 2 ! procedure eve_edt_module_ident ! Ident module (required) return "V02-000"; ! Version 2, edit level 000 endprocedure; ! eve_edt_module_ident ! Page 3 ! procedure eve_edt_module_init ! eve_edt initializations (required) ! First we get ourselves into EDT mode and make certain that the ! cursor stays where it's supposed to... eve$set_edt_keypad; eve$bound_cursor; ! Now for a couple of nice little features... eve_set_find_whitespace; eve_set_scroll_margins ("10%","10%"); ! Now we set up a bunch of key definitions and subtle differences ! that I'm used to. ! Word separators: space, horizontal tab, form feed, carriage return, vertical ! tab, and line feed (+ "programmer's" word separators) eve$replace_word_separators (" " + ascii(9) + ascii(10) + ascii(11) + ascii(12) + ascii(13) + "._$-+[]{}()%*/\&@,!?;:"); define_key (eve$$kt_return + "copy_text('0')", key_name ("0", SHIFT_KEY), "", eve$x_edt_keys); define_key (eve$$kt_return + "eve_one_window", key_name ("1", SHIFT_KEY), "one_window", eve$x_edt_keys); define_key (eve$$kt_return + "copy_text('2')", key_name ("2", SHIFT_KEY), "", eve$x_edt_keys); define_key (eve$$kt_return + "copy_text('3')", key_name ("3", SHIFT_KEY), "", eve$x_edt_keys); define_key (eve$$kt_return + "copy_text('4')", key_name ("4", SHIFT_KEY), "", eve$x_edt_keys); define_key (eve$$kt_return + "copy_text('5')", key_name ("5", SHIFT_KEY), "", eve$x_edt_keys); define_key (eve$$kt_return + "copy_text('6')", key_name ("6", SHIFT_KEY), "", eve$x_edt_keys); define_key (eve$$kt_return + "copy_text('7')", key_name ("7", SHIFT_KEY), "", eve$x_edt_keys); define_key (eve$$kt_return + "copy_text('8')", key_name ("8", SHIFT_KEY), "", eve$x_edt_keys); define_key (eve$$kt_return + "copy_text('9')", key_name ("9", SHIFT_KEY), "", eve$x_edt_keys); define_key (eve$$kt_return + "eve_split_window", key_name ("=", SHIFT_KEY), "split_window", eve$x_edt_keys); define_key (eve$$kt_return + "eve_shrink_window('1')", key_name ("-", SHIFT_KEY), "shrink_window", eve$x_edt_keys); define_key (eve$$kt_return + "eve_enlarge_window('1')", key_name ("+", SHIFT_KEY), "enlarge_window", eve$x_edt_keys); define_key (eve$$kt_return + "eve_delete_window", key_name (DEL_KEY, SHIFT_KEY), "delete_window", eve$x_edt_keys); define_key (eve$$kt_return + "eve_previous_window", key_name (UP, SHIFT_KEY), "previous_window", eve$x_edt_keys); define_key (eve$$kt_return + "eve_next_window", key_name (DOWN, SHIFT_KEY), "next_window", eve$x_edt_keys); define_key (eve$$kt_return + "eve_shift_right('8')", key_name (RIGHT, SHIFT_KEY), "shift_right", eve$x_edt_keys); define_key (eve$$kt_return + "eve_shift_left('8')", key_name (LEFT, SHIFT_KEY), "shift_left", eve$x_edt_keys); define_key (eve$$kt_return + "eve_quote", key_name (KP3, SHIFT_KEY), "quote", eve$x_edt_keys); define_key (eve$$kt_return + "eve_replace('','')", key_name (KP9, SHIFT_KEY), "replace", eve$x_edt_keys); define_key (eve$$kt_return + "eve_learn", key_name (ENTER, SHIFT_KEY), "learn", eve$x_edt_keys); define_key (eve$$kt_return + "eve_attach('')", key_name ("a", SHIFT_KEY), "attach", eve$x_edt_keys); define_key (eve$$kt_return + "eve_buffer('')", key_name ("b", SHIFT_KEY), "buffer", eve$x_edt_keys); define_key (eve$$kt_return + "eve_show_buffers", key_name ("s", SHIFT_KEY), "show_buffers", eve$x_edt_keys); define_key (eve$$kt_return + "eve_repeat('')", key_name (PF2, SHIFT_KEY), "repeat", eve$x_edt_keys); define_key (eve$$kt_return + "eve_start_of_line", key_name (ASCII(8)), "start_of_line", eve$x_edt_keys); define_key (eve$$kt_return + "eve_do('')", key_name (ASCII(26)), "do", eve$x_edt_keys); define_key (eve$$kt_return + "eve_start_of_line", key_name(f12), "start_of_line", eve$x_edt_keys); define_key (eve$$kt_return + "eve_attach('')", key_name(f17), "attach", eve$x_edt_keys); define_key (eve$$kt_return + "eve_write_modified", key_name(f19), "write_modified", eve$x_edt_keys); define_key (eve$$kt_return + "eve_write_file('')", key_name(f20), "write_file", eve$x_edt_keys); ! These key definitions are specific to the Rectangular cut and paste ! routines. define_key (eve$$kt_return + "eve_mark_corner", key_name (".", SHIFT_KEY), "mark_corner", eve$x_edt_keys); define_key (eve$$kt_return + "eve_extract_rectangle", key_name ("<",SHIFT_KEY), "extract_rectangle", eve$x_edt_keys); define_key (eve$$kt_return + "eve_insert_rectangle", key_name (">", SHIFT_KEY), "insert_rectangle", eve$x_edt_keys); define_key (eve$$kt_return + "eve_copy_rectangle", key_name ("(", SHIFT_KEY), "copy_rectangle", eve$x_edt_keys); define_key (eve$$kt_return + "eve_overlay_rectangle", key_name (")", SHIFT_KEY), "overlay_rectangle", eve$x_edt_keys); endprocedure; ! eve_edt_module_init ! Page 4 ! procedure eve_edt_declare_synonym ! declare synonyms for people so they ! don't get lost eve$build_synonym ("what_line","current_line",1); eve$build_synonym ("write_file","write",1); eve$build_synonym ("exit","ex",1); eve$build_synonym ("show_buffers","list_buffers",1); endprocedure; ! eve_edt_declare_synonym $*$*EOD*$*$ $ checksum EVE_EDT_CORE.TPU $ if checksum$checksum .ne. check_sum then - $ write sys$output "Checksum failed, file probably corrupted" $ check_sum = 236206173 $ write sys$output "Creating EVE_EDT_MASTER.FILE" $ create EVE_EDT_MASTER.FILE $ DECK/DOLLARS="$*$*EOD*$*$" ! Master file to rebuild EVE_EDT ! ! List the files needed to rebuild EVE_EDT from scratch. ! eve_edt_core eve_utility $*$*EOD*$*$ $ checksum EVE_EDT_MASTER.FILE $ if checksum$checksum .ne. check_sum then - $ write sys$output "Checksum failed, file probably corrupted" $ check_sum = 808333910 $ write sys$output "Creating EVE_EDT_VERSION.DAT" $ create EVE_EDT_VERSION.DAT $ DECK/DOLLARS="$*$*EOD*$*$" V2.0 $*$*EOD*$*$ $ checksum EVE_EDT_VERSION.DAT $ if checksum$checksum .ne. check_sum then - $ write sys$output "Checksum failed, file probably corrupted" $ check_sum = 476843075 $ write sys$output "Creating EVE_UTILITY.HLP" $ create EVE_UTILITY.HLP $ DECK/DOLLARS="$*$*EOD*$*$" 1 Eve_Utility Eve_Utility Eve_Utility is a library of Eve routines that was built up in the days of Eve Version 1.0. These routines come from Eve_EDT Version 1.0, and have been separated to their own library with the advent of the Eve Build procedures. The primary purpose of this library is to support the Eve_EDT package. Unfortunately the Eve HELP routines aren't perfected yet... so you have to type HELP Eve_Utility before getting help on any of the routines in Eve_Utility. Type COMMANDS and press RETURN for a list of commands. 1 Eve_EDT Eve_EDT Eve_EDT is an interactive text editor built using the VAX Text Processing Utility. Eve_EDT is more or less Eve with an EDT keypad added to it. It is not intended to emulate EDT completely, where it made sence to do things the Eve way instead of the EDT way, the Eve was was chosen. 1 Author Author Both Eve_EDT and Eve_Utility come from Eve_EDT (Chris Yoder and R. Kevin Oberman), both modules were adapted from this original source by Chris Yoder (chris@ymir.bitnet). 1 Commands List of Topics For help on EVE topics, type the name of a topic and press RETURN. ~I~ o To exit from help and resume editing, press RETURN. TEXT-EDITING COMMANDS Capitalize Word Erase Word Quote Restore Sentence Change Mode Find Remove Restore Word Delete Insert Here Replace Select Erase Character Insert Mode Restore Store Text Erase Line Lowercase Word Restore Charac Uppercase Word Erase Prev Word Overstrike Mode Restore Line Wildcard Find Erase Start of Line CURSOR MOVEMENT AND SCROLLING Bottom Line Move Down Previous Screen Change Direction Mark Move Left Reverse End of Line Move by Line Move Right Start of Line Forward Move by Page Move Up Top Go To Move by Word Next Screen What Line GENERAL-PURPOSE COMMANDS @ Exit Quit Refresh Reset Show Do Help Recall Repeat Return Show Wildcards FILE, BUFFER, AND WINDOW COMMANDS Buffer Include File Set Width Show System Buffers Delete Buffer Next Window Shift Left Split Window Delete Window One Window Shift Right Two Windows Enlarge Window Other Window Shrink Window Write File Get File Previous Window Show Buffers TEXT-FORMATTING COMMANDS Center Line Insert Page Break Set Right Margin Fill Set Left Margin Set Tabs Fill Paragraph Set Nowrap Set Wrap Fill Range Tab KEY-DEFINITION COMMANDS Define Key Set Keypad NoEDT Set Keypad WPS Learn Set Keypad NoWPS Set Nogold Key Remember Set Keypad Numeric Show Key Set Gold Key Set Keypad VT100 Undefine Key Set Keypad EDT CUSTOMIZING AND ADVANCED FEATURES Attach Set Cursor Bound Set Wildcard VMS DCL Set Cursor Free Show Defaults Buffer Extend All Set Find Nowhitespace Show Summary Extend EVE Set Find Whitespace Spawn Extend This Set Scroll Margins Spell Save Extended EVE Set Wildcard Ultrix TPU INFORMATIONAL TOPICS Abbreviating Initialization Files New Features Canceling Commands Journal Files Position Cursor Command Files Keypad (diagram) Prompts and Responses Control Keys Keys (list) Ruler Keys Defaults List of Topics Section Files EDT Conversion Message Buffer Typing Keys EDT Differences Mouse Windows Gold Keys Names for Keys WPS Differences Note that the following commands are defined only in the Eve_Utility package. They are used in Eve_EDT. File and Buffer Commands Current Line List Buffers Read File Write Modified Write Selected Set Read Only Set Write Advanced Commands Background Comment Text Pad Buffer Pad Line Pad Selected Ruler Sort Spell Trim Buffer Trim Line Rectangle Manipulation Routines Overlay Rectangle Mark Corner Insert Rectangle Extract Rectangle Copy Rectangle 1 BACKGROUND BACKGROUND This command is the equivalent of the DCL command, with the exception that the BACKGROUND does not map the DCL buffer into a window on the screen if the DCL buffer is not already being displayed. The BACKGROUND and DCL commands share the same output buffer and subprocess and behave identically in all other ways. 1 COMMENT_TEXT COMMENT TEXT COMMENT TEXT inserts a comment string either at the beginning of each line that is selected or if nothing is selected at the beginning of each line in the entire buffer. This comment string can be any length or combination of characters that the user specifies within the limitations of the Eve parse routines. If the user does not specify a comment string either on the command line, or after being prompted for it, the comment string used will be the value of the variable Eve$x_comment_string. The default comment string will be shown within a pair of square brackets (e.g. [>] ) when the user is prompted for a comment string. In the version of Eve_EDT distributed by Chris Yoder, Eve$x_comment_string is set to a single greater than symbol. If the user changes the value of Eve$x_comment_string in their own tpu$local_init procedure, COMMENT TEXT will display this new default within the square brackets. 1 COPY_RECTANGLE COPY RECTANGLE COPY RECTANGLE will copy the text enclosed in the rectangle delimited by the MARK CORNER routine and the current cursor position into the EXTRACT buffer. In order for COPY RECTANGLE to be used, the user must have used the MARK CORNER routine to specify the corner of the rectangle diagonally across the rectangle from the current cursor position. COPY RECTANGLE will not remove or change any text in the current buffer. If the user wishes to remove the selected rectangle from the current buffer, then the routine EXTRACT RECTANGLE must be used. Whenever COPY RECTANGLE or EXTRACT RECTANGLE are used, whatEver is currently in the EXTRACT buffer will be wiped away and replaced by the selected text. A rectangle cannot be selected if a tab spans either edge. The COPY RECTANGLE key (SHIFT_() invokes this command. 1 CURRENT_LINE CURRENT LINE CURRENT LINE will display the current line of the buffer that the user is on as well as the total number of lines in the current buffer. It is a synonym for the command WHAT LINE. 1 EXTRACT_RECTANGLE EXTRACT RECTANGLE EXTRACT RECTANGLE will extract the text enclosed in the rectangle delimited by the MARK CORNER routine and the current cursor position into the EXTRACT buffer. In order for EXTRACT RECTANGLE to be used, the user must have used the MARK CORNER routine to specify the corner of the rectangle diagonally across the rectangle from the current cursor position. EXTRACT RECTANGLE will remove any text in the current buffer that falls within the selected rectangle. If the user wishes to keep the selected rectangle in the current buffer, then the routine COPY RECTANGLE must be used. WhenEver EXTRACT RECTANGLE or COPY RECTANGLE are used, whatEver is currently in the EXTRACT buffer will be wiped away and replaced by the selected text. A rectangle cannot be selected if a tab spans either edge. The EXTRACT RECTANGLE key (SHIFT_<) invokes this command. 1 INSERT_RECTANGLE INSERT RECTANGLE INSERT RECTANGLE will insert the text currently in the EXTRACT buffer into the current buffer. The current cursor position will be used as the upper left hand corner of the inserted rectangle. Regardless of the current buffer mode of insert or overstrike, the INSERT RECTANGLE routine will not overwrite any text in the current buffer, but will move text in the way out of the way and will pad any short lines to meet the left edge of the newly inserted rectangle. If the user would like to overwrite the text that the new rectangle would cover instead of move it, then the routine OVERLAY RECTANGLE must be used. Both INSERT RECTANGLE and OVERLAY RECTANGLE do not affect the contents of the EXTRACT buffer. Either or both routines may be used multiple times and in any order and will output the rectangle that is in the EXTRACT buffer. The INSERT RECTANGLE key (SHIFT_>) invokes this command. 1 LIST_BUFFERS LIST BUFFERS LIST BUFFERS is a synonym for the command SHOW BUFFERS. It is defined for compatability with Eve_EDT Version 1.0. 1 MARK_CORNER MARK CORNER The MARK CORNER routine is used before using either COPY RECTANGLE or EXTRACT RECTANGLE. It marks the corner diagonally across the rectangle from the corner that the cursor is on when the rectangle is COPYed or EXTRACTed. The MARK CORNER key (SHIFT_.) invokes this command. 1 OVERLAY_RECTANGLE OVERLAY RECTANGLE OVERLAY RECTANGLE will overlay the text currently in the EXTRACT buffer over the text in the current buffer. The current cursor position will be used as the upper left hand corner of the overlayed rectangle. Regardless of the current buffer mode of insert or overstrike, the OVERLAY RECTANGLE routine will not preserve any of the text that lies in the area where the rectangle to be overlayed rectangle, howEver short lines will be padded to meet it's left edge. If the user would like to preserve the text that the new rectangle would cover instead of overwrite it, then the routine INSERT RECTANGLE must be used. Both OVERLAY RECTANGLE and INSERT RECTANGLE do not affect the contents of the EXTRACT buffer. Either or both routines may be used multiple times and in any order and will output the rectangle that is in the EXTRACT buffer. The OVERLAY RECTANGLE key (SHIFT_)) invokes this command. 1 PAD_BUFFER PAD BUFFER The PAD BUFFER command will pad the current buffer out to the column that is passed to it. If no right column parameter is passed to the routine, then the buffer is padded out to the length of the longest line in the buffer. Note: Tabs are treated as one character by Eve. If the right column parameter is specified, and there are lines longer than that amount, the longer lines will not be modified and all of the shorter lines will be padded out to that amount. 1 PAD_LINE PAD LINE The PAD LINE command will pad the current line to the length requested by the user. If the line is already longer than the the length that the user requested, then the line is left alone. 1 PAD_SELECTED PAD SELECTED The PAD SELECTED command will pad the current selected region out to the column that is passed to it. If no right column parameter is passed to the routine, then the selected region is padded out to the length of the longest line in the region. Please note that tabs are treated as one character by Eve. If the right column parameter is specified, and there are lines longer than that amount, the longer lines will not be modified and all of the shorter lines will be padded out to that amount. 1 READ_FILE READ FILE READ FILE performs the same functions as GET FILE, with the exception that READ FILE automatically sets the file into read_only mode. 1 RULER RULER This command will tell you how many characters you've selected. The select region is not affected by using the RULER function. This is useful for figuring out how long a particular string or paragraph is. Please note that a tab only Ever takes up one character, and this command does not take into account how many screen characters the expanded tab takes up. 1 SET_READ_ONLY SET READ ONLY Set the current buffer to be a read only buffer. If the buffer is modified during a session, Eve_EDT will not attempt to save the buffer upon exit from the editor. The user may still use the WRITE FILE command on the buffer to explicitly force Eve_EDT to save the current buffer. 1 SET_WRITE SET WRITE Set the current buffer to be write buffer. If the buffer is modified during a session, Eve_EDT will attempt to save the buffer upon exit from the editor. The user may still use the WRITE FILE command on the buffer to explicitly force Eve_EDT to save the current buffer. 1 SORT SORT SORT will sort either the currently selected text or if nothing is selected the text of entire buffer is used. SORT writes out the text into a temporary file, spawns off a VMS SORT command, and then reads the sorted file back in. All temporary files are created in sys$scratch and are deleted after SORT is done with them. 1 SPELL SPELL SPELL will run a spell checking utility either on the currently selected text or if nothing is selected the text of the entire buffer is used. In order for the SPELL to work, the user must be able to use the command SPELL from a DCL prompt. It assumes that whatever spell checking utility you have will write the results into a file that is a higher version number than the input file. There have been several good spelling checkers on several of the DECUS VAX SIG tapes. The SPELL command will write out the selected text to a temporary file, then it will SPAWN the command SPELL , and finally it will read the temporary file back in. All temporary files are created in sys$scratch and are deleted after SPELL is done with them. 1 TRIM_BUFFER TRIM BUFFER The TRIM BUFFER command trims all of the spaces off of the end of each line in the current buffer. 1 TRIM_LINE TRIM LINE The TRIM LINE command trims all of the spaces off of the end of the current line. 1 WRITE_MODIFIED WRITE MODIFIED The WRITE MODIFIED command finds all modified Read/Write buffers and attempts to write out each one. This is useful if you spawn off an editing process. The editing session will not end until you use either the EXIT or QUIT commands. You may also suspend the current editing session and return to your main process with the ATTACH command. The WRITE MODIFIED key (F19) invokes this command. 1 WRITE_SELECTED WRITE SELECTED The WRITE SELECTED command writes out the region currently selected out to a file. It takes a filename as a parameter. The current buffer will not be affected in any way. $*$*EOD*$*$ $ checksum EVE_UTILITY.HLP $ if checksum$checksum .ne. check_sum then - $ write sys$output "Checksum failed, file probably corrupted" $ check_sum = 1987378476 $ write sys$output "Creating EVE_UTILITY.TPU" $ create EVE_UTILITY.TPU $ DECK/DOLLARS="$*$*EOD*$*$" ! EVE_UTILITY.TPU ! ! Written by: Chris Yoder ! for: Harvey Mudd College ! Mathematics Department ! on: September 20, 1988 ! ! This module provides rectangular cut and paste for EVE_EDT. It can ! be incorporated into any other EVE based TPU editor built with the ! BUILD facility found in EVE 2.0 (However, I would appreciate it if this ! header stayed in this file). ! ! The ideas were shamelessly stolen from EDTPlus, but the routines ! were completely rewritten for clarity, speed, and so that they would ! actually work in the EVE environment. - rcy 3/13/87 - 4/7/87 ! !++ ! Table of Contents ! ! EVE_UTILITY.TPU ! ! Procedure name Page Description ! -------------- ---- ------------ ! ! eve_utility_module_ident 2 Ident ! eve_utility_module_init 3 Initialization ! eve_utility_declare_synonym 4 Synonyms ! eve_mark_corner 5 Mark the corner of the rectangle ! rect$get_error 6 Error routine ! eve$get_rectangle 7 Grab the rectangle ! eve_extract_rectangle 8 Call EVE$Get_Rectangle (NOKEEP) ! eve_copy_rectangle 9 Call EVE$Get_Rectangle (KEEP) ! eve$put_rectangle 10 Write out the rectangle ! eve_insert_rectangle 11 Call EVE$Put_Rectangle (Insert) ! eve_overlay_rectangle 12 Call EVE$Put_Rectangle (Overstr) ! eve$goto_column 13 Goto a specific column in a line ! eve$pad_string 14 Pad a string with spaces ! eve_pad_buffer 15 Pad the entire buffer ! eve_pad_selected 16 Pad the selected region ! eve_pad_line 17 Pad the current line ! eve$current_line 18 Return the current line number ! eve_spell 19 SPELL buffer | sel. region ! eve_sort 20 SORT buffer | sel. region ! eve_background 21 execute a DCL command quietly ! eve_set_read_only 22 Don't write this buffer ! eve_set_write 23 Write this buffer ! eve_edt_read_file 24 Get a file (readonly) ! eve_edt_write_modified 25 Write modified buffers ! eve_trim_line 26 Trim curr line of white-space ! eve_trim_buffer 27 Trim curr buffer of white-space ! eve_write_selected 28 Write selected region to a file ! eve_ruler 29 How many characters are selected ! eve_comment_text 30 Comment the buffer or selected ! eve$comment_buffer 30 Comment the whole buffer ! ! Page 2 ! procedure eve_utility_module_ident ! Ident module (required) return "V02-000"; ! Version 2, edit level 000 -- Separated from Eve_EDT endprocedure; ! eve_utility_module_ident ! Page 3 ! procedure eve_utility_module_init ! utility initializations (required) ! These are the key definitions that I use in EVE_EDT. They are ! commented out here, but are available for inspection. ! !define_key (eve$$kt_return + "eve_mark_corner", key_name (".", SHIFT_KEY), ! "mark_corner", eve$x_edt_keys); !define_key (eve$$kt_return + "eve_extract_rectangle", key_name ("<",SHIFT_KEY), ! "extract_rectangle", eve$x_edt_keys); !define_key (eve$$kt_return + "eve_insert_rectangle", key_name (">", SHIFT_KEY), ! "insert_rectangle", eve$x_edt_keys); !define_key (eve$$kt_return + "eve_copy_rectangle", key_name ("(", SHIFT_KEY), ! "copy_rectangle", eve$x_edt_keys); !define_key (eve$$kt_return + "eve_overlay_rectangle", key_name (")", SHIFT_KEY), ! "overlay_rectangle", eve$x_edt_keys); ! Define a few status messages. rect$_nomessage := 0; rect$_success := 1; rect$_invparam := 2; rect$_colnotreached := 4; rect$_tabatcol := 6; rect$_linenotreached := 8; ! Default string for comment buffer. eve$kt_comment_string := ">"; ! Setup a couple of buffers to put our extracted rectangles in and for ! some scratch work... extract_buffer := eve$init_buffer ("Extract", "[End of Extract buffer]"); scratch_buffer := eve$init_buffer ("Scratch", "[End of Scratch buffer]"); endprocedure; ! eve_utility_module_init ! Page 4 ! procedure eve_utility_declare_synonym ! declare synonyms for people so they ! don't get lost endprocedure; ! eve_utility_declare_synonym ! Page 5 ! ! This routine will mark the corner of a rectangle. Use ! eve_extract_rectangle to cut it. ! Procedure eve_mark_corner corner_mark_1 := mark(reverse); corner_col_1 := current_column; corner_line_1 := eve$current_line; endprocedure; ! mark_corner ! Page 6 ! ! This procedure will print out the appropriate error message when one ! occurs while we are selecting a rectangle. It will also attempt to ! replace what we've taken out then it will clear the extract buffer. ! ! Parameters: ! error_status ---- The error that occurred ! keep_status ----- Keep_status of calling routine. ! top_edge -------- Top edge of the rectangle where the error occurred ! left_edge ------- Left edge of the rectangle where the error occurred ! Procedure rect$get_error (error_status,keep_status,top_edge,left_edge) if error_status = rect$_tabatcol then message ("A tab is interfering with selecting the rectangle."); else message ("An error has occurred selecting the rectangle."); endif; if not keep_status then eve_line (top_edge,''); eve$goto_column (left_edge); eve$put_rectangle (1); endif; erase (extract_buffer); position (corner_mark_2); delete(corner_mark_1); delete(corner_mark_2); endprocedure; ! Page 7 ! ! This routine will get a rectangle iff the user marked the ! opposite corner already. ! ! Parameters: ! ! keep_rectangle True if we want to keep the selected rectangle where ! it is as well as extract it. ! Procedure eve$get_rectangle (keep_rectangle) LOCAL ret_status, ! Hold the return status from a routine corner_col_2, ! The second corner column corner_line_2, ! The second corner line top_edge, ! The line number of the top edge bottom_edge, ! The line number of the bottom edge left_edge, ! The column number of the left edge right_edge, ! The column number of the right edge curr_line, ! The line that we are currently working on left_line_mark, ! Left edge of the range to put into the Extract buffer right_line_mark,! Right edge of the range to put into the Extract buffer this_position, ! The current position this_buffer, ! The current buffer buffer_length, ! The length of the current buffer ext_range; ! range to put into extract buffer on_error message ("Error in Get Rectangle routine."); return; endon_error if corner_mark_1 = 0 then if keep_rectangle then message("Please Mark the opposite Corner before Copying a Rectangle."); else message("Please Mark the opposite Corner before Extracting a Rectangle."); endif; return FALSE; endif; if get_info (corner_mark_1, "buffer") <> current_buffer then message ("Corner marked not in current buffer."); return (FALSE); endif; this_buffer := current_buffer; this_position := mark(NONE); corner_mark_2 := mark(none); corner_col_2 := current_column; corner_line_2 := eve$current_line; if (corner_mark_1<>corner_mark_2) then ! find the upper right corner ! figure out the right, left, top and bottom edges of the rectangle if corner_col_1 < corner_col_2 then left_edge := corner_col_1; right_edge := corner_col_2; else left_edge := corner_col_2; right_edge := corner_col_1; endif; if corner_line_1 < corner_line_2 then top_edge := corner_line_1; bottom_edge := corner_line_2; else top_edge := corner_line_2; bottom_edge := corner_line_1; endif; ! Start at the top left corner of the rectangle and work down to the ! bottom. erase(extract_buffer); curr_line := top_edge; ! Find out the length of the current buffer so that we know if any ! lines disappear from it. buffer_length := get_info (this_buffer, "record_count"); loop ! Through the lines in the rectangle exitif curr_line > bottom_edge; eve_line (curr_line,''); ! Check to see if the line is too short... if so, pad the damn thing! if (LENGTH(current_line) <= right_edge) then eve_pad_line (STR(right_edge)); update (current_window); endif; ret_status := eve$goto_column (left_edge); if (ret_status <> rect$_success) then ! Check for a short line. if ret_status = rect$_colnotreached then ! Pad out the line to grab it eve_line (curr_line,''); update (current_window); eve_pad_line (STR(right_edge)); ret_status := eve$goto_column (left_edge); else ! die gracefully rect$get_error(ret_status,keep_rectangle,top_edge,left_edge); position (this_buffer); position (this_position); return (FALSE); ! We died... endif; endif; left_line_mark := mark (FREE_CURSOR); ret_status := eve$goto_column (right_edge); if (ret_status <> rect$_success) then if (ret_status <> rect$_colnotreached) then ! die gracefully rect$get_error(ret_status,keep_rectangle,top_edge,left_edge); return (FALSE); ! We died... else eve_line (curr_line,''); update (current_window); eve_pad_line (STR(right_edge)); ret_status := eve$goto_column (right_edge); endif; endif; right_line_mark := mark (FREE_CURSOR); ext_range := create_range(left_line_mark,right_line_mark,NONE); position(end_of(extract_buffer)); if keep_rectangle then copy_text (ext_range); else move_text (ext_range); if get_info (this_buffer, "record_count") < buffer_length then ! The move text took a line out of the buffer, compensate for ! the fact by "moving" the bottom edge and current line up and ! reseting buffer_length. buffer_length := get_info (this_buffer, "record_count"); bottom_edge := bottom_edge - 1; curr_line := curr_line - 1; endif; endif; position(corner_mark_2); ! go back to the buffer that we started in. curr_line := curr_line + 1; ! go to the next line endloop; !end looping through the lines in the rectangle position(beginning_of(extract_buffer)); eve_pad_buffer(right_edge-left_edge); ! pad the rectangle out else ! One character rectangle, just copy or move it to the extract buffer. if (current_character = '') then !Woops, we're out on the edge here... erase(extract_buffer); position(beginning_of(extract_buffer)); copy_text(' '); else ext_range := create_range (corner_mark_1,corner_mark_2,NONE); erase(extract_buffer); position(beginning_of(extract_buffer)); if keep_rectangle then copy_text (ext_range); else move_text (ext_range); endif; endif; endif; ! if corner_mark_1<>corner_mark_2 position(corner_mark_2); ! go back to where we started cutting from... ! do some house-keeping. delete(corner_mark_1); delete(corner_mark_2); endProcedure; ! eve$get_rectangle ! Page 8 ! ! This procedure will extract a rectangle and place it in the EXTRACT ! buffer. ! ! Procedure eve_extract_rectangle eve$get_rectangle (0); endprocedure; ! eve_extract_rectangle ! Page 9 ! ! This procedure will make a copy of the extracted rectangle and ! place it in the EXTRACT buffer. The old rectangle will be left alone. ! Procedure eve_copy_rectangle eve$get_rectangle (1); endprocedure; ! eve_copy_rectangle ! Page 10 ! ! After hacking the EDTPlus version of extract_rectangle and ! copy_rectangle into clean code, I decided that eve_insert_rectangle ! was worthy of the same treatment (and like extract_rectangle, it takes ! a flag to toggle insert/overstrike mode so that the code doesn't have ! to be duplicated for overlay_rectangle. ! ! Parameters: ! ! insert_rect True if we want to insert this rectangle, False ! if we want to overlay this rectangle. ! Procedure eve$put_rectangle (insert_rect) LOCAL ret_status, ! Status of a call. top_edge, ! The line number of the top edge inserted_lines, ! The number of lines that we've inserted so far line_on, ! The line that we're working on num_lines, ! The number of lines in the extract buffer pad_line, ! Hold a line while we pad it out left_edge, ! The column number of the left edge start_mark, ! A mark to mark the start of a range copy_range, ! The range that we are transferring into this buffer this_buffer, ! The current buffer this_mode, ! The current buffer mode this_position; ! Hold the current position on_error message ("Error in Put Rectangle routine."); return; endon_error; ! Sanity check: find out if we have a rectangle to put... num_lines:=get_info(extract_buffer,"record_count"); if (num_lines=0) then message("EXTRACT buffer empty"); return; endif; ! initialize a bunch of stuff. this_position := mark(NONE); this_buffer := current_buffer; top_edge := eve$current_line; left_edge := current_column; inserted_lines := 0; ! OK, now we set the current buffer into Insert or Overstrike mode as ! requested, but save the current state so that we can reset later on. this_mode := get_info (this_buffer, "mode"); if insert_rect then set (insert, this_buffer); else set (overstrike, this_buffer); endif; loop ! until inserted_lines >= num_lines exitif inserted_lines >= num_lines; pad_line := ''; line_on := top_edge + inserted_lines; ! Sanity check: find out if we're trying to put this rectangle past the end ! of the buffer. if line_on > get_info (current_buffer,"record_count") then position (end_of (current_buffer)); split_line; endif; ! Now we go grab the current line of the rectangle and put it here. position (beginning_of(extract_buffer)); move_vertical (inserted_lines); start_mark := mark (NONE); position (search (line_end, forward)); move_horizontal (-1); copy_range := create_range (start_mark,mark(NONE),NONE); position (this_position); eve_line (line_on,''); ret_status := eve$goto_column (left_edge); if ret_status = rect$_success then copy_text (copy_range); else if ret_status = rect$_colnotreached then if left_edge > 0 then position (LINE_END); eve$pad_string (pad_line,left_edge-current_offset-1); copy_text (pad_line); ! hang off of the edge of the line position (LINE_END); endif; copy_text (copy_range); else if ret_status = rect$_tabatcol then message ("Error writing rectangle, tab in the way."); else message (fao("Error was !SL.",ret_status)); message ("Internal error in eve$put_rectangle. Contact Chris Yoder."); endif; endif; endif; inserted_lines := inserted_lines + 1; endloop; ! until inserted_lines >= num_lines position (this_position); set (this_mode, this_buffer); endProcedure; ! eve$put_rectangle ! Page 11 ! ! This procedure will insert the rectangle in the Extract buffer ! into the current buffer using the current position as the upper left ! hand corner of the inserted rectangle. ! Procedure eve_insert_rectangle eve$put_rectangle (1); endprocedure; ! eve_insert_rectangle ! Page 12 ! ! This procedure will overlay the rectangle in the Extract buffer ! into the current buffer using the current position as the upper left ! hand corner of the inserted rectangle. ! Procedure eve_overlay_rectangle eve$put_rectangle (0); endprocedure; ! eve_overlay_rectangle ! Page 13 ! ! This procedure will set the current position to the column passed in. ! It will return one of the following status messages: ! ! 0 = rect$_nomessage ------- No message, random error status. The current ! position is where we started. ! 1 = rect$_success --------- The success message. ! 2 = rect$_invparam -------- An invalid parameter was specified. ! 4 = rect$_colnotreached --- The column could not be reached because the line ! was too short. The current position is at the ! end of the line specified. ! 6 = rect$_tabatcol -------- The column specified ended up in the middle of ! a tab. The current position is at the end of ! the tab. ! ! Parameters: ! target_col The column that we want to end up on. ! ! procedure eve$goto_column (target_col) local this_position, ! Marker for current position last_col, ! The last column that we were at has_tabs, ! The line has tabs in it next_tab_col, ! The column where the next tab ends what_tab_stops, ! What tab stops are there cur_col, ! The current column we are working on. place, ! Hold a place in a string hold_len, ! Hold a string length start_line, ! A mark to hold the starting edge of the line line_range, ! A range to hold the line in ret_range, ! A range to hold the result of a search line_length, ! The length of the line cursor_is_free, ! Boolean answering this question i; ! looping variable on_error [TPU$_STRNOTFOUND] : position (this_position); [OTHERWISE] : message (fao ("Cannot move to column !SL.", target_col)); position (this_position); return rect$_nomessage; endon_error; ! Do some initializing and a reasonableness test on Target_Col this_position := mark (NONE); cursor_is_free := not (get_info (current_buffer, "bound")); if target_col < 0 then message (fao ("Cannot move to column !SL", target_col)); position (this_position); return rect$_invparam; endif; ! now see if target_col is beyond EOL, check for tabs and detab if necessary ! While we're here, might as well correct for 0 length lines. line_length := length (current_line); if (line_length = 0) then position (LINE_END); return rect$_colnotreached; endif; position (LINE_BEGIN); ! position at beginning of line start_line := mark(NONE); position (LINE_END); ! goto the end of the line line_range := create_range (start_line, mark (NONE), NONE); ret_range := search(ASCII(9),FORWARD,NO_EXACT,line_range); if (ret_range = 0) then has_tabs := False; else has_tabs := True; endif; position (LINE_BEGIN); if has_tabs then ! we move to the specified column, checking for tabs what_tab_stops := get_info (current_buffer, "tab_stops"); cur_col := 1; ! initialize next_tab_col if get_info (what_tab_stops,"type") = integer then ! easy case next_tab_col := what_tab_stops; else place := index (what_tab_stops,' '); if place = 0 then next_tab_col := int(what_tab_stops) - 1; what_tab_stops := ''; else hold_len := place - 1; next_tab_col := int(substr(what_tab_stops,1,hold_len)) - 1; what_tab_stops := substr(what_tab_stops,place+1, length(what_tab_stops)-place); endif; ! if place = 0 then else endif; ! if get_info (what_tab_stops,"type") = "integer" then else loop ! until we get to or past the column that we're looking for or to EOL exitif cur_col >= target_col; exitif current_offset = line_length; if current_character = ascii (9) then ! we have to worry about the tab cur_col := next_tab_col + 1; ! move to the end of the current tab. ! find out where the end of the next tab is. if get_info (what_tab_stops,"type") = integer then ! easy case next_tab_col := next_tab_col + what_tab_stops; else if length(what_tab_stops) > 0 then ! we don't have an empty string place := index (what_tab_stops,' '); if place = 0 then next_tab_col := int(what_tab_stops) - 1; what_tab_stops := ''; else hold_len := place - 1; next_tab_col := int(substr(what_tab_stops,1,hold_len)) - 1; what_tab_stops := substr(what_tab_stops,place+1, length(what_tab_stops)-place); endif; ! if place = 0 then else else next_tab_col := next_tab_col + 1; endif; ! if length(what_tab_stops) > 0 then else endif; ! if get_info (what_tab_stops,"type") = "integer" then else else ! no tab, easy case cur_col := cur_col + 1; endif; ! if current_character is a tab move_horizontal (1); endloop; ! return a status to the user if cur_col = target_col then ! we're fine, say so return rect$_success; else ! return an error if cur_col > target_col then ! we're over... return rect$_tabatcol; else ! short line return rect$_colnotreached; endif; endif; else ! we don't have tabs, this one's easy! if (line_length >= target_col) then move_horizontal (target_col - 1); return rect$_success; else position (LINE_END); ! go to the end of the line anyway. return rect$_colnotreached; endif; endif; ! if has_tabs else endprocedure; ! Page 14 ! ! Pad a string out to a specified length. If the string is longer than ! the length specified by pad_length, then just pass it back. 3/6/87 -rcy ! ! Parameters: ! ! this_string String to be modified - input/output ! pad_length Length to pad string out to. procedure eve$pad_string (this_string,pad_length) local temp_fao_string; ! A temp string to hold the result of FAO call if length(this_string) < pad_length then ! Heh, heh, what we do here is be a bit tricky. Just call FAO *twice*! ! The first call creates the proper FAO string to pad a string out to ! pad_length, the second does the actual padding. temp_fao_string := FAO ("!!!SLAS",pad_length); this_string := FAO (temp_fao_string,this_string); endif; ! if string_length < pad_length endprocedure; ! eve$pad_string ! Page 15 ! ! Procedure to pad a buffer out to a specific column. If a 0 or less is ! passed then we pad the buffer out to match the longest line in the buffer. ! procedure eve_pad_buffer (right_column_parameter) local this_direction, ! Save our current direction this_position, ! Save our current position i, ! Looping variable num_lines, ! Number of lines in the buffer temp_pattern, ! Hold a temporary pattern to find EOL hold_range, ! The range of the current line hold_line, ! The current line max_line_length, ! Local copy of right_column_parameter hold_line_length; ! Find out the current line length. this_position := mark (none); num_lines := get_info(current_buffer,'record_count'); this_direction := current_direction; set (forward, current_buffer); if right_column_parameter <= 0 then max_line_length := 0; position (beginning_of(current_buffer)); temp_pattern := (anchor & remain);; loop ! all the way through the buffer exitif mark(none) = end_of(current_buffer); hold_range := search (temp_pattern, forward); hold_line_length := length (hold_range); if max_line_length < hold_line_length then max_line_length := hold_line_length; endif; eve$edt_line; endloop; ! loop to figure out the length of the longest line. else max_line_length := right_column_parameter; endif; ! right_column_parameter <= 0 i.e. figure out how far to pad. ! Loop through the whole buffer, deleting a line, calling EVE$PAD_STRING ! and reinserting the line. i := 0; position (beginning_of(current_buffer)); loop ! all the way through the buffer exitif i >= num_lines; hold_line := erase_line; eve$pad_string (hold_line,max_line_length); copy_text (hold_line); split_line; i := i + 1; endloop; ! loop to do the actual padding hold_line := erase_line; ! blow away the extra split_line set (this_direction,current_buffer); position(this_position); endprocedure; ! eve_pad_buffer ! Page 16 ! ! Procedure to pad the selected area (calls eve_pad_buffer). ! Procedure eve_pad_selected (right_column_parameter) local pad_range, ! Range to pad this_position; ! Save our current position if eve$x_select_position = 0 then message ("You have not selected a region to pad."); return; endif; if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Select marker not in current buffer."); return; endif; ! setup this_position := mark (NONE); ! move the selected text to the scratch buffer pad_range := select_range; erase (scratch_buffer); position (beginning_of(scratch_buffer)); move_text (pad_range); ! pass the buck to do the work eve_pad_buffer (right_column_parameter); ! bring it back pad_range := create_range (beginning_of(scratch_buffer), end_of(scratch_buffer), NONE); position (this_position); move_text (pad_range); ! cleanup eve$x_select_position := 0; pad_range := 0; endprocedure; ! eve_pad_selected ! Page 17 ! ! Procedure to pad a line out to a specific column. ! procedure eve_pad_line (right_column_parameter) local this_offset, ! Save our current position hold_line, ! The current line pad_length, ! Integer version of max_line_length max_line_length; ! Local copy of right_column_parameter if not (eve$prompt_string (right_column_parameter, max_line_length, "Length to pad line to: ", "Line not padded.")) then return; endif; this_offset := current_offset; hold_line := erase_line; pad_length := INT (max_line_length); eve$pad_string (hold_line,pad_length); copy_text (hold_line); split_line; ! and now we go back to where we were move_vertical (-1); position(search(line_begin,reverse)); move_horizontal (this_offset); endprocedure; ! eve_pad_line ! Page 18 ! ! Displays a message with the current line number, ! total number of lines in the file, and the percentage. ! (Code shamelessly stolen from the EVE V2.0 source routine eve_what_line) ! (This is the quiet version of eve_what_line.) procedure eve$current_line ! What line am I on? local saved_mark, ! marker - current position text_mark, ! marker - after snapping to text this_line_position, ! marker - position at start of this_line total_lines, ! integer - total lines in buffer high_line, ! integer - high line limit for binary search low_line, ! integer - low line limit for binary search low_position, ! marker - beginning of low line this_line, ! integer - line number of current guess eob_flag; ! boolean - true if at eob on_error [TPU$_CONTROLC]: eve$$restore_position (saved_mark); ! restore free cursor position eve$learn_abort; abort; [OTHERWISE]: eve$$restore_position (saved_mark); endon_error; ! Initialization saved_mark := mark (FREE_CURSOR); position (search (ANCHOR, FORWARD)); ! snap the cursor (move_vertical pads) text_mark := mark (NONE); total_lines := get_info (current_buffer, "record_count"); high_line := total_lines + 1; if text_mark = end_of (current_buffer) then if text_mark = beginning_of (current_buffer) then return 0; else eob_flag := TRUE; low_line := total_lines; low_position := end_of (current_buffer); endif; else low_line := 1; low_position := beginning_of (current_buffer); endif; ! Binary search loop exitif high_line - low_line <= 1; this_line := (high_line + low_line) / 2; position (low_position); move_vertical (this_line - low_line); if mark (FREE_CURSOR) > saved_mark then high_line := this_line; else low_line := this_line; low_position := mark (FREE_CURSOR); if mark (FREE_CURSOR) = saved_mark then high_line := this_line; endif; endif; endloop; ! Display message and return to original position position (saved_mark); if eob_flag then return total_lines + 1; else return low_line; endif; endprocedure; ! Page 19 ! ! Run spell on the current buffer. Useful for making certain that MAIL ! is sent out w/o spelling errors... NOTE: This assumes that the ! command SPELL will run your spelling checker on the input ! filename. -rcy ! ! After playing with the sort routines, I decided that spell might ! also want to have the capability to use a select range as well! Now ! it's all hacked in. -rcy 2/24/87 ! procedure eve_spell local this_position, ! Marker for current cursor position spell_range, ! Range being spelled File_Name, ! Name of the file that we are spelling String_Start, ! Starting position of the string (temp) String_Length; ! Length of string while we play with it if eve$x_select_position <> 0 then if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Select marker not in current buffer"); return; endif; this_position := mark (none); spell_range := select_range; else this_position := mark (none); spell_range := create_range (beginning_of (current_buffer), end_of (current_buffer), none); endif; File_Name := GET_INFO (current_buffer,'output_file'); String_Start := INDEX (File_Name,']') + 1; String_Length := INDEX (File_Name,';') - String_Start; File_Name := SUBSTR (File_Name,String_Start,String_Length); String_Start := INDEX (File_Name,'.') + 1; String_Length := LENGTH (File_Name); File_Name := 'SYS$SCRATCH:EVE_SPELL_TMP.' + SUBSTR (File_Name,String_Start,String_Length); write_file (spell_range,File_Name); spawn ('spell ' + File_Name); erase (spell_range); eve_include_file (File_Name); eve_background ('delete ' + File_Name + ';*'); eve$x_select_position := 0; position (this_position); update (current_window); return (TRUE); endprocedure; ! eve_spell ! Page 20 ! ! Sort whatever is selected, or if nothing is selected, the entire ! current buffer, this is useful for all sorts of things that I haven't ! thought up yet, as well as the obvious. Basically we check to see if ! anything is selected, if nothing then select the entire buffer, write ! the select range out to a file, run sort on it, and then read it back ! in. - rcy ! procedure eve_sort local this_position, ! Marker for current cursor position sort_range; ! Range being sorted if eve$x_select_position <> 0 then if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Select marker not in current buffer"); return (FALSE); endif; this_position := mark (none); sort_range := select_range; else this_position := mark (none); sort_range := create_range (beginning_of (current_buffer), end_of (current_buffer), none); endif; write_file (sort_range,'sys$scratch:eve_sort.tmp'); eve_background ('sort sys$scratch:eve_sort.tmp sys$scratch:eve_sort.tmp'); erase (sort_range); eve_include_file ('sys$scratch:eve_sort.tmp'); eve_background ('delete sys$scratch:eve_sort.tmp;*'); eve$x_select_position := 0; position (this_position); update (current_window); return (TRUE); endprocedure; ! Page 21 ! ! This code was shamelessly stolen from the EVE$ADVANCED.TPU routine ! eve_dcl. Basically it exists to perform a DCL command without popping ! up a window. It uses the same process as the eve_dcl routine uses. ! ! Parameters: ! ! dcl_parameter String containing DCL command - input procedure eve_background (dcl_parameter) ! Run DCL command local dcl_string, ! Local copy of dcl_parameter dcl_window, ! Window to map dcl_buffer this_position, ! Current position + window this_window, ! Current window this_buffer; ! Current buffer on_error [TPU$_CREATEFAIL]: eve$message (EVE$_CANTCREADCL); eve$learn_abort; return (FALSE); [OTHERWISE]: endon_error; if not (eve$prompt_string (dcl_parameter, dcl_string, message_text (EVE$_DCLPROMT, 1), message_text (EVE$_NODCLCMD, 0))) then eve$learn_abort; return (FALSE); endif; if (get_info (eve$dcl_buffer, "type") <> BUFFER) then eve$dcl_buffer := eve$init_buffer ("DCL", ""); endif; if (get_info (eve$x_dcl_process, "type") = UNSPECIFIED) or (eve$x_dcl_process = 0) then eve$message (EVE$_CREATEDCL); eve$x_dcl_process := create_process (eve$dcl_buffer, "$ set noon"); endif; this_position := mark(none); position (end_of (eve$dcl_buffer)); ! Process the DCL string - need to include the $ split_line; copy_text (dcl_string); send (dcl_string, eve$x_dcl_process); position (end_of (eve$dcl_buffer)); position (this_position); update (current_window); return (TRUE); endprocedure; ! Page 22 ! Set the current buffer to be read only ! procedure eve_set_read_only set (NO_WRITE, current_buffer, ON); eve$update_status_lines; endprocedure; ! eve_set_read_only ! Page 23 ! Set the current buffer to be read/write ! procedure eve_set_write set (NO_WRITE, current_buffer, OFF); eve$update_status_lines; endprocedure; ! eve_set_write ! Page 24 ! ! Get a file in read-only mode. ! procedure eve_read_file (read_file_parameter) ! Get a file (Read-Only) eve_get_file (read_file_parameter); eve_set_read_only; endprocedure; ! read_file ! Page 25 ! ! Write out all of the Read/Write buffers that have been modified. ! procedure eve_write_modified local modified_buffer, ! Current buffer being checked for writing modified_buffer_name, ! String with name of modified_buffer original_reply, ! String returned by read_line after prompt write_reply; ! Lowercase version of original_reply on_error ! Lots of different errors possible from write_file, doesn't matter here set (success, on); message (fao ("Could not write buffer !AS",modified_buffer_name)); return; endon_error; message (eve$x_null); modified_buffer_name := eve$x_null; modified_buffer := get_info (buffers, "first"); loop exitif modified_buffer = 0; if (get_info (modified_buffer, "modified")) and (not (get_info (modified_buffer, "no_write"))) then modified_buffer_name := substr (get_info (modified_buffer, "name"), 1, eve$x_max_buffer_name_length); if eve$x_trimming then eve$trim_buffer (modified_buffer); endif; write_file (modified_buffer); endif; modified_buffer := get_info (buffers, "next"); endloop; return (TRUE); endprocedure; ! write_modified ! Page 26 ! ! Trim this line of extra spaces at end. (We just make eve$trim_line ! available to the user...) ! procedure eve_trim_line eve$trim_line; endprocedure; ! ! Page 26 ! ! Trim each line in the current buffer. This procedure just makes ! eve$trim_buffer available to the user. ! procedure eve_trim_buffer eve$trim_buffer (current_buffer); endprocedure; ! ! Page 27 ! Write the selected region to a specified file. If no file specified, ! ask. ! ! Parameters: ! ! write_file_name ! String containing file name - input procedure eve_write_selected (write_file_name) local this_position, ! save current position write_file_name_copy, ! local copy of write_file_name write_range; ! range to write out write_file_name_copy := write_file_name; if eve$x_trimming then eve$trim_buffer (current_buffer); endif; if eve$x_select_position <> 0 then if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Select marker not in current buffer"); return; endif; this_position := mark (none); write_range := select_range; else message ('No range selected!'); return (0); endif; if (length (write_file_name_copy) <= 0) then write_file_name_copy := read_line ('File name for selected region: '); if (length (write_file_name_copy) <= 0) then message ('No file name provided.'); return; endif; endif; write_file (write_range,write_file_name_copy); eve$x_select_position := 0; position (this_position); endprocedure; ! Page 28 ! ! This procedure will tell you how many characters you've selected. ! This is useful for figuring out how long a particular string is. ! ! Please note that a tab only ever takes up one character, and this ! procedure will only give it a value of one character, and not how many ! spaces it takes up. ! Procedure eve_ruler local range_ruler; ! Hold the length of the select range. if eve$x_select_position = 0 then message ("You have not selected a region to rule."); return; endif; if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Select marker not in current buffer."); return; endif; range_ruler := length (select_range); message (fao("You have selected !SL character!%S.",range_ruler)); endprocedure; ! eve_ruler ! Page 30 ! ! Procedure to insert a string (default = '>') at the beginning of ! every line in the selected area or in the current buffer. This is only ! the default interface routine. The actual work is done in ! EVE$COMMENT_BUFFER. ! ! Parameters: ! ! comment_string_parameter ! procedure eve_comment_text (comment_string_parameter) local comment_string, ! Local copy of comment_string_parameter comment_range, ! Range of text that we are commenting prompt_string, ! String that we prompt with for the comment ! character this_position; ! Current position prompt_string := "String to comment with: [" + eve$kt_comment_string + "] "; if not (eve$prompt_string (comment_string_parameter, comment_string, prompt_string, "Using Default")) then comment_string := eve$kt_comment_string; endif; ! select the appropriate text if eve$x_select_position <> 0 then if get_info (eve$x_select_position, "buffer") <> current_buffer then message ("Select marker not in current buffer"); return; endif; this_position := mark (none); comment_range := select_range; else this_position := mark (none); comment_range := create_range (beginning_of (current_buffer), end_of (current_buffer), none); endif; ! move the selected text to the scratch buffer erase (scratch_buffer); position (beginning_of(scratch_buffer)); move_text (comment_range); ! pass the buck to do the work eve$comment_buffer (scratch_buffer,comment_string); ! bring the modified text back comment_range := create_range (beginning_of(scratch_buffer), end_of(scratch_buffer), NONE); position (this_position); move_text (comment_range); ! cleanup position (this_position); eve$x_select_position := 0; comment_range := 0; endprocedure; ! eve_comment_text ! Page 31 ! ! This procedure moves to the buffer specified and inserts the string ! specified at the beginning of each and every line in the buffer. ! ! Parameters: ! buffer_to_comment The buffer that we are commenting ! comment_string The string to comment with ! procedure eve$comment_buffer (buffer_to_comment,comment_string) local this_position, ! The current position this_direction, ! The current direction for the buffer this_buffer, ! The current buffer this_mode; ! The current buffer mode ! save info so that we don't screw up the user. this_position := mark (NONE); this_direction := current_direction; this_buffer := current_buffer; this_mode := get_info (this_buffer, "mode"); ! start at the beginning of the buffer... position (beginning_of(buffer_to_comment)); set (insert, current_buffer); set (forward, current_buffer); ! and loop through the entire buffer 'till we get to the end of it. loop copy_text (comment_string); eve$edt_line; exitif mark (NONE) = end_of(current_buffer); endloop; ! set everything back to where and how it used to be. position (this_position); set (this_mode, this_buffer); set (this_direction, this_buffer); endprocedure; $*$*EOD*$*$ $ checksum EVE_UTILITY.TPU $ if checksum$checksum .ne. check_sum then - $ write sys$output "Checksum failed, file probably corrupted" $ check_sum = 774053366 $ write sys$output "Creating INSTALL.COM" $ create INSTALL.COM $ DECK/DOLLARS="$*$*EOD*$*$" $ copy eve_edt.tpu$section pub$root:[editors]*/log $ pur pub$root:[editors]eve_edt.tpu$section $ copy eve_edt.hlb pub$root:[editors]*/log $ pur pub$root:[editors]eve_edt.hlb $ exit $*$*EOD*$*$ $ checksum INSTALL.COM $ if checksum$checksum .ne. check_sum then - $ write sys$output "Checksum failed, file probably corrupted" $ exit