Short: Programmable Texteditor for PC + Amiga Author: Rick Stiles Uploader: aminet aminet net Type: text/edit Version: 4k2 Architecture: m68k-amigaos Its the free Version 4.2 Update (v4k2/1995) with the Version 4.0 (Shareware/1992) from Fish disks. Look in the archive directory. Source include. MfG anonymous This archive contains an UPDATE to Uedit release 4.0 -- the release that Rick Stiles placed into the public domain, and was distributed on Fish disks 768, 769, and 770 after his untimely death. THIS IS NOT A COMPLETE UEDIT PACKAGE; YOU MUST ALSO HAVE THE ORIGINAL UEDIT 4.0 DISTRIBUTION ON FISH DISK 768. You also need disk 769 if you want to use the spell checker or want the C source. It contains material to be combined with that distribution. It includes a new version of the Uedit executable itself, but this is of little use without the support files. It includes source code in the form of "context diffs" relative to the source on Fish disk 769. Like Uedit 4.0 itself, this update is in the public domain. This new version is called release "4K2". It is a further upgrade of a previous version called release "4K1". Version numbers containing a K instead of a decimal point denote Uedit versions created by Paul Kienitz. It contains very few new features: it is almost purely an attempt to create a more thoroughly debugged version of Uedit 4.0, which had several problems. The two significant new features are that it now detaches from the CLI so you no longer have to start it with a "Run" command, and it has a method, crude but adequate, for specifying an alternate video mode to use for the display. There are also several improved versions of keys in the standard config files. They are contained in several text files, each containing a related group of keys in a specific category. You can use any or all of them in your config, leaving most of it unchanged. There are two changes that cause significant compatibility trouble. Each of them requires, for most users, making some substantial adjustments to your Uedit setup. One has to do with the syntax of menus, the other with using "U:" instead of "S:" as the directory for Uedit's support files. Use of U: instead of S: ======================= Previously, using "U:" instead of "S:" was an option. If you wanted to keep all those files out of your crowded S: directory, you used a small patch program called "S-U" which patched the Uedit executable. Version 4K2 comes already patched; it expects the name U: to be assigned to some directory where it can find files such as "Data!", "NoName.info", the "Config!" files if it needs to compile them, and so on. If you have already used the S-U patch program, this change will not affect you. Or if you have these files in S: and simply want to get Uedit 4K2 up and running with a minimum of trouble, you can just add the line "Assign U: S:" to your S:User-Startup script. Otherwise you will need to move files around. Note: if you have version 4K1, no further changes need to be made for 4K2. It should accept a 4K1 config with no changes and no need to recompile. There are two steps to this procedure. One is to create a new directory for the files, add a line to S:User-Startup assigning U: to that directory, and move every Uedit support file, including "Help!" and "REXXCOMM" and "Directories" and "Key-Help", and those mentioned in the previous paragraph, and perhaps others depending on your setup, to the new directory. The other step is to go through your Config! files (including Config!A through Config!Z) and replace all references to S: with references to U: with a search and replace. Search for the string: "S: (that is, a quote character, the letter S, and a colon) And replace it with: "U: (a quote character, a U, and a colon). Then change the line that starts "", in the config defaults near the beginning of the file "Config!", to use U: instead of S:. Then, when the configuration is recompiled (which Uedit 4K2 will try to do as soon as you run it), the change will be complete. New (old) menu function syntax: =============================== The other change affecting compatibility, which needs to be made before you can compile the configuration, is in the specification of menus in the startup key, in the file "Config!". The syntax of the menu(), subMenu(), checkedMenu(), and checkedSubMenu() functions has been simplified slightly, and the width of the strings used by the menus has been increased from 17 characters to 22. One of the late changes Rick Stiles made in Uedit was the addition of a new second argument to the menu functions, specifying an alternate string which would show in the place of the menu item's usual text, when the mouse is highlighting that item. That is, when normally an item would reverse colors as the mouse passes over it, moving up or down the menu, it could instead momentarily display an alternate text. This feature is stupid, so I removed it. The syntax of the menu functions is now as it was in older Uedit versions: menu(D, N, C) subMenu(D, N, C) checkedMenu(D, N, C, F) checkedSubMenu(D, N, C, F) D: literal -- text that appears in the menu N: list 10 -- menu number, counting from the left C: list 10 -- command key corresponding to this item F: list 13 -- flag that determines whether checkmark is present When Uedit 3.0 was released, those with older versions had to go through their startup key definition in the file "Config!", and add a second argument consisting of an empty pair of quotes to every menu function. With Uedit 4K2, you have to take those useless second arguments back out again. The simplest way to do this is with another search and replace in "Config!". Search for the string: ","", (a quote character, a comma, two more quotes, and another comma) And replace it with: ", (a quote character and a comma). If there are any menu functions that actually use the second argument, so that there is a string between those two quotes instead of them just having nothing between them, then you will have to fix those cases manually. If you miss any, Uedit will flash the screen and leave the cursor at the error when compiling the startup key. You can then fix it and recompile. The default Config! file contains a few cases of the second argument being used. One is the "About" item in the "Files" menu (that's menu number 1), two others are the "Local modes" and "Global modes" items in the "Modes" menu (number 5). Simply erase the second string after the comma, along with its enclosing quotes and the extra comma that goes with it. Most people's configurations will probably not have any other instances. If you are using the vanilla Uedit configuration or something very close to it, you can simply replace the startup key definition entirely with the new version that is included with this distribution, in the file called "Startup-Key.UE". Simply erase the startup definition, containing all the menu functions and nameBuffer() functions, from your Config! file, and insert the file "Startup-Key.UE" in the same place. It contains the standard menu definitions with the extra string arguments removed, and also with the strings lengthened by five characters to fit the new widened menu size: 22 characters instead of 17. Also, all menu items with submenus have a colon character on the end of their name, just to make it more visibly recognizable. If you have a menu configuration that is not much different from the standard one, you can use the one provided in the file "Startup-Key.UE" and make changes where necessary. But if you have a substantially customized set of menus, then you'll have to modify the menu functions by hand. Each label string (the first argument of each menu function) should be lengthened by five characters. I recommend that two of the five added characters be spaces at each end, so as not to crowd the text against the edges of the menu rectangles. This process can be automated, to a large extent, with the following function: Pad all following menu item strings with five extra spaces Just compile the above with F6, place the cursor at the beginning of your startup key definition, and press the spacebar with the shift and alt keys held down. This will give each menu item a one character margin at each end, and a padding of three spaces in the middle. It will not remove the second string argument if it is still present -- that has to be done separately, as explained above. In most cases, the three spaces added for padding will be added just before the command key name, if any. You should then look through the list of menu definitions to spot anything that looks wrong. There may be occasional items where the three spaces in the middle get added in the wrong place, for example the "Bracket hilite" item in the standard config, which has no space before the key name, or the unused "Directory utility" item. At this time you may also wish to take advantage of the extra space to lengthen some of the abbreviations that were used in the shorter strings, to make the menu item descriptions clearer. You can use overstrike mode, and turn things like "Replace fwd" into "Replace forward", or "Load & Run" into "Load & Run learn", and so on. This whole process may seem rather tedious, but in the end you will have menus that are more readable and easier on the eye. If you do not lengthen the menu descriptions, the program will run okay; the menus will just look funny with a five character right margin. Screen mode specification: ========================== Uedit 4K2 has a method of specifying which video display mode its intuition screen should use. It does NOT support the ASL screenmode requester, however; it accepts screen mode specifications only in raw numeric form. How do you select an appropriate number? By using the small public domain program "ScreenModes" which is included with Uedit 4K2. When run from a CLI prompt, it lists all of the available display modes that Uedit can use. You can redirect its output to a file with "ScreenModes > t:foo" or a similar command, or load its output into a Uedit buffer by running the ScreenModes command with Uedit's ctl-Z AmigaDOS function. This list shows only display modes that are suitable for Workbench use, excluding exotic modes such as HAM, extra-halfbrite, dual playfield, and so forth. Only Workbench-compatible modes should be used with Uedit. The list shows the nominal resolution (not including overscan) of each mode along with its name, after the hexadecimal mode ID number. For instance, one line reads: 00029004: 640 × 512 PAL:High Res Laced This line tells us that if you want to run Uedit on a PAL screen, assuming this is not the default for your system, the mode ID to use would be the hexadecimal value 00029004. Another line, on ECS systems, reads: 00039024: 640 × 480 MULTISCAN:Productivity This tells us that the value 00039024 will create a productivity mode screen. Besides avoiding ID numbers not listed by this program, you should also avoid superhires modes. Uedit is still limited to a maximum screen width of 1064 pixels, and these modes have a minimum width of 1280 pixels. So if you use such a mode, you will have a big empty space at the right side of the screen. How do you tell Uedit about this number? There are two ways. One is with the command language. There is a new numeric variable (list 10) called "modeID". In a command language function, you can use functions such as "equateNum(modeID, 0x39024)". The "0x" is necessary so that Uedit knows the number is hexadecimal. When this is done, the new display type will be used the next time the screen is reopened; for instance, after you go to tiny window. To make Uedit use the system default screen type as it always has in the past, set modeID to zero. ** IMPORTANT! ** Note that changing the display ID *DOES NOT* change the width and height of the screen in pixels! These numbers are set in the config defaults and are used regardless of the display type. It is UP TO YOU to select width and height numbers that make sense when used with the desired mode ID. This also goes for the "lace" setting. The mode ID to use when Uedit starts up can also be set in the config defaults. Its position is where the "Cram display mode" flag used to be: right between "Columnar display mode" and "Show page-row-column". Cram mode no longer exists in Uedit 4K2; the flag variable "cram" is no longer recognized in the command language, and the 11th angle-bracketed value in the config defaults is now either zero or a mode ID. When entering a mode ID number in the config defaults, unfortunately, the value has to be in decimal. Just enter the number in hex, with "0x" in front, and then position the cursor after the left angle bracket and use the ctl-X key to translate the hex number into decimal. You should end up with something like this, assuming you entered "0x39024" into the brackets: <0> Columnar display mode <233508> Cram display mode <0> Show page-row-column Of course, you'd also want to edit out the words "Cram display mode" and put "Display mode ID (decimal)" or the like in their place. CLI detaching: ============== Uedit behaves the same as always when run from Workbench. When run with a CLI command, it now detaches itself automatically into the background, so you can now start it with a simple "UE" command where previously something like "Run nil: UE" was necessary. The side effect of this is that the running Uedit process is not a CLI task -- it behaves as if it was started from the Workbench. Some information of the CLI it was started from, such as local variables, are not inherited. It does inherit the CLI's current directory and command path, however. It also picks up the command path if started from Workbench. In release 4K1, commands run from inside Uedit with the execute() function had no command path. Replacement versions of config functions: ========================================= Besides the file "Startup-Key.UE", there are several other files included which contain improved versions of some of the key commands in the standard config. The files are: "Ctl-Click.UE" - an enhanced tool for click-loading files. "I-Search.UE" - an improved incremental search command. "Paging.UE" - new commands for paginating text. "Printing.UE" - new versions of some functions for using the printer. "ScrollGadget.UE" - an improved version of the horizontal fake scroll gadget. "Wildcards.UE" - an improved command for loading files with wildcards. Each of these replaces some key or keys in the standard config. Each file contains both documentation and CL functions. See each file for details. Other miscellaneous changes: ============================ The following is a hopefully complete list of differences between Uedit 4K1 and Uedit 4.0. Most of them are basically bugfixes, not new features: Default path for support files changed from S: to U: -- see above. Alternate description argument removed from syntax of menu(), submenu(), checkedMenu(), and checkedSubMenu() functions -- see above. Checkmarked menu items are no longer rendered in inverse colors. Each checkmark item's description should have three spaces at the beginning instead of one (or zero) to allow room for the check -- this is sufficient to tell checkmarked items apart from non-checkmarked ones. Menu label strings are now 22 characters wide instead of 17 -- see above. "cram" variable (list 13) replaced with "modeID" (list 10) for alternate screenmode support -- see above. It detaches from the CLI at startup, and remembers a command path when started from Workbench -- see above. The "custom screen" value in the config defaults is ignored. The screen is always custom. Creating a second WBENCHSCREEN is dangerous to the rest of the system. The maximum number of menus is now 8 instead of 7. The maximum number of items in each menu is now 24 instead of 20. The maximum number of subitems attached to one item is still 12. The decimal-to-hex translation function now inserts "0x" instead of "0X". WarpText is no longer used for rendering, nor are primitive scrolling functions that aren't aware of layers. Formerly, if you opened another window on Uedit's screen, Uedit's display updates would erase that window's visible image. Now Uedit's display stays "behind" other windows the way it should. And the display refreshing is actually faster this way! At least, that's the case on an A3000. The word wrapper, used for both text entry and paragraph reformatting, no longer breaks words at a hyphen if the word has only one letter before the dash, like "T-shirt" or "X-ray". (I made this change because I got sick of it breaking the name "Q-Blue" in the middle.) It also will not break after a hyphen when the following character is a greater-than sign. C programmers will no longer get names like "foo->bar" broken between the two punctuation characters. A major memory loss problem was fixed: in Uedit 4.0, if you free a buffer while it's in the middle of being saved to disk, its memory is never deallocated! If you do this regularly, your system can lose huge amounts of available memory space. Many Enforcer hits were fixed. Several obscure bugs, including some Enforcer hits, were fixed simply by going back to the original C versions of various functions instead of using the clumsy and unnecessary assembly substitutes. Uedit 4K1 should be Enforcer clean. The requestFile() function now uses the ASL file requester instead of the ARP requester. Consequently, arp.library is no longer used at all, and requestFile() does not work under DOS 1.x. If I work any further on Uedit, I will probably make the whole thing 2.x only. The mouseDown function now returns false if Uedit's backdrop window is inactive. This prevents situations where another screen pops to the front while you were scrolling with the mouse, or something of the sort, and Uedit never hears the button being released so it keeps scrolling forever. When the screen is closed and then reopened with a different lace setting and a nonzero top edge (from being slid down with the mouse), it formerly would use a top edge distance half or double what it should have used, depending on whether it was going from nonlace to lace or vice versa. Now it uses the correct distance. Formerly, the row of letters in the title bar that you can click on to change flags would not work right if you used a wide font such as topaz 9. You would click on a letter and the letter to the right of where you clicked would be the one changed. Now it handles all font widths. The title bar at the top of the screen has been somewhat cleaned up in appearence. The close gadget and the message line no longer overlap each other, and so on. When the screen is laced, there are two pixels of the screen title bar showing above the window title bar instead of one, to make it easier to grab it with the mouse. Now it requires care and delicacy; formerly it required blind luck. Anyway, you can always slide the screen by holding down the left Amiga key and clicking in the middle, depending on your Prefs/IControl settings. Small errors caused by fonts with differing baseline heights no longer occur. Formerly, lines would be rendered a few pixels too high or low, a mouse click at the bottom edge of a character might land the cursor on the next line, and it might not be able to make use of the last few pixels at the bottom of the screen, forcing you to specify extra ones to get full use of the display. Fixed the currentDir() function so it unlocks the previous current dir lock instead of leaving "dangling locks" behind. Changed the basic input loop to wait for port signals, and wake up once per second for idle operations, instead of checking for input every 60 milliseconds. Much less drain on the system while waiting for input. This also helps ARexx commands execute a little faster. The following is a list of further differences between Uedit 4K2 and Uedit 4K1, my previous bugfix release: Requesters such as "Blah present, want read-only copy?" now force the screen to the front if it's not active. When the screen is pushed to the front either by a requester or by the frontScreen() CL function, the window is activated. Fixed a rare but nasty bug which, if the timing was just right, could cause a buffer that had just been saved to be freed twice. This usually happened if some command waited for the save queue to be empty and then called freebuf(). It no longer changes the name of the buffer to match the existing filename on disk, if the name it finds differs in any way other than letter case. Formerly, if for instance you loaded an MS-DOS text file from a CrossDOS disk with a name like "Foo.txt]", with the "]" telling CrossDOS to convert newlines, then Uedit would change the buffer name to "FOO.TXT" and the file would be saved with newlines not converted back. And when dealing with file links it could get the wrong name entirely. The one drawback now is that it is unable to correct the letter case of accented or umlauted letters in names in international filesystems. The execute() CL function now uses the command path of the CLI Uedit was started from, or that known to the Workbench when it was started. Probably one or two other little fixes I forgot to record... Known problems as yet unsolved: =============================== The display refreshing routines need to be redesigned from the ground up. The present method fails to catch some display updates (until the full refresh is done after four seconds of idle time) and in other cases redraws the whole screen when only part of it is changed. This is, for instance, why the response is so sluggish when drag-selecting a hilite area. It still gets confused sometimes about where the cursor is when two splits are open on one buffer, and especially if three or more are open. The internal method used to handle this needs to be redesigned, storing cursor information in the split's data rather than in the buffer's. If a file is protected from writing and Uedit fails for that reason to save a buffer, it deletes the file. This is NOT good behavior. It really ought to check AvailMem and do memory packing before it is down to the last drop of available memory. Search-and-replace needs to be optimized to not split blocks when the new string is shorter than, or equal in length to, the old string. Loading files with Workbench shift-double-clicking only works if all shift- clicked args are in the same directory.