*** Kedit 5.0 D3 bugs... TTBOMK, some bugs may be features, or * I simply misunderstood the manual, as it was the case with * Eof() versus Focuseof(). *** Focuseof() is handy for macros like A-X. The default A-X * could use this "trick" before checking Dirfileid.1() = '': 'Locate' focustof() - focuseof() *** DIR and DIRAppend don't work for directories starting with * a dot (possible on HPFS). Workaround: add a backslash to * directory id.s in macros like A-X. *** A nice but undocumented (or rather unexpected) feature, IMM * calls REXX if its argument line starts with a REXX comment, * and so REXX arithmetic on Kedit's command line is possible: 'IMM /**/ parse source X ; say 2**15 / 500 "by" address() X' *** 'query column' and COLUMN.1() return ZONE.1() -1 for column * 1 .. ZONE.1() -1 and similar ZONE.2() +1 for all columns to * the right of ZONE.2(). If this is a feature then it should * be documented in the QUERY COLUMN topic. *** If command() + inprefix() < modifiable() then ... * to check if the cursor is in a line of the file area works, * but it looks clumsy, did I miss a better solution for this ? *** The following keys are supported by PREXX 3.0, 4DOS, and of * course all enhanced keyboards, but ignored by Kedit 5.0 D3: * C-PrtSc (114), C-Star (150), A-Star (55) (PRESS.EXE names). *** Patching a KEDIT.EXE 5.00D3 binary to support C- and A-Star * is possible: locate /7*/, a hex. string with the 24 bytes * 10372A????00 000000000000 000000000000 000000000000, where * ???? is the offset of the 'text *' macro. Replace this by * 10372A????00 007200000000 009600000000 003700000000, where * hex. 72 (114) supports C-PrtSc as S-Star, hex. 96 (150) is * C-Star, and hex. 37 (55) is A-Star. Then [Shift]+[Star] is * still recognized as Star, but [Ctrl]+[PrtSc] is reported as * S-Star. [also tested with Kedit 5.00D4] *** For Kedit 5.00P3 (where P stands for Protected Mode = OS/2) * there are 28 bytes in each key string (instead of 24 bytes) * 10372A?? ????0000000000 0000000000000000 0000000000000000 * precedes 104A2D??????00 000000000000008E 0000000000004A00. * Using this pattern (C-Minus 8E00 and A-Minus 4A00) replace * 10372A?? ????0000720000 0000009600000000 0000370000000000 * to get S-Star = "C-PrtSc", C-Star, and A-Star keys in OS/2. * [also tested with Kedit 5.00P4] *** Kedit's key detect logic could allow something like this: * SET KEY S-DEL 83 44 /* scan code 83, ascii 44 ',' */ * SET KEY S-STAR 114 0 /* scan code 114 = C-PrtSc 7200 */ * SET KEY C-STAR 150 0 /* scan code 150 = C-Star 9600 */ * SET KEY A-STAR 51 0 /* scan code 51 = A-Star 3700 */ *** Readv reports READV.3 = 224 for Slash, NumEnter, C-NumEnter, * and READV.3 = 0 for composed characters. Maybe this should * be documented, as it is a correct but not obvious behaviour. *** 'Pscreen 12 80 preset' does not work, although VGAs support * 12 lines (8x16 character box with 200 double scanned lines), * even MODE 80,12 in a DOS text window works. DOS KHELP with * 12 lines doesn't show its last 2 lines. OS/2 KHELP has no * problem with 12 lines. 'Pscreen 13 80 preset' is okay, but * less lines cannot be set. Other tools like QuickHelp (DOS) * accept 12 "preset" lines (e.g. QH -d KREF50.HLP). *** If KEDIT starts in a text window with less than 13 lines * QUERY PSCREEN states incorrectly PSCREEN 25 80 PRESET and * the command line is invisible. Workaround in PROFILE.KEX: if pscreen.1() = 25 & pscreen.3() = 'PRESET' then do 'pscreen 28' ; 'pscreen 25' /* force 25 if lines < 13 */ end /* confused KEDIT startup */ *** DIRFORMAT should accept 0 as 2nd argument (extension size), * causing the last dot in fileid.s to be treated as ordinary * character by DIR and DIRAPpend. This should be simple, as * further dots are already handled in this way. Macros like * TREE could be simplified if DIRFileid.5() is always empty: * IF RIGHT( DIRFileid.4(), 1 ) = '*' THEN /* truncated id. */ *** The manual doesn't state that FPath.1() returns a backslash * for root directories, so both FPath.1() || '\' || FName.2() * and Directory.1() || '\' || FName.2() would then be invalid. * There should be a Directory.2() or something similar, where * directory paths always end either with or without backslash. * It's a pain to trap the added backslash of root directories. *** Kedit's PATH option should work within a session too. This * would allow to locate files by other PATH-alike environment * variables like MACROPATH, TEMP, INCLUDE, KHELP, etc. *** The example SET KEDIT=MACROPATH KEXPATH in the manual could * be changed to SET KEDIT=MACROPATH KHELP, this allows to use * only 2 environment variables for KEDIT macros and KHELP.PRO * in 3 places (native DOS C:\AUTOEXEC.BAT, OS/2 ?:\CONFIG.SYS, * and MDOS ?:\AUTOEXEC.BAT, using different PATH settings and * different "home" directories for DOS resp. OS/2 KEDIT/KHELP) *** KHelp CI, KHELP COV, and KHELP CR locate CInsert, COVerlay, * and CReplace in KHELP.HLP as expected, but KHELP CA doesn't * work for CAppend. *** DEFine should only accept macro names which can be PURGEd: * On HPFS something like DEFine "A B.KEX" with embedded blanks * is possible, and then MACRO "A B" invokes this macro. It's * also listed by MACROS, MACROS ALL, or MACROS CHANGED. But * QUERY MACRO "A B", MACROS "A B", DEF "A B", and PURGE "A B" * won't work, Kedit can't get rid of this nonsense. Weirder * names like ".." resp. "...KEX" are fully supported on HPFS, * DEFine has only to prohibit embedded blanks. *** SYNONYM TEST to undefine TEST does not work. Something like * SYNONYM TEST TEST is an approximation, but TEST would still * be processed as synonym (wasting the limited synonym space). *** KEDIT .\- allows to edit file "-", but KEDIT "-" won't work: * KEDIT "-" does the same as KEDIT -. At least it's possible * to edit - somehow, but = is really difficult. On HPFS two * commands SAVE =X and DOS RENAME ?X ? create file =. On HPFS * + , ; = [ ] are legal file characters, and . (point) is also * legal except for the last character. KEDIT "-" should treat * - as a file name (only for a single AND delimited character * "-"), the same would work for FName, FPath, FType, or FExt. * A new "known bugs" manual chapter could mention "=" (HPFS). * BTW: DOS KEDIT = and DOS KEDIT "=" result in DOS KEDIT "+". *** DIR =:=\*.= used in an edited *.HTM file shows the 1st *.HTM * file in the same directory, DIR =:=\*.HTM shows all *.HTM in * this directory. *** 'Extract /UNKNOWN/' sets EXTRACT.0=1 and EXTRACT.1=UNKNOWN, * a nice but undocumented feature. A few other undocumented * features: keyboard option ENHFORCED, initialization options * MOUSESOFTRESET, NOREXX, REXXSAA, PREXX30, option DELAY of * DIALOG resp. ALERT (Kedit 5.0 only except from EXTRACT.1). * BTW, that's not meant to be nitpicking, but as the manuals * of Kedit are still the best I've seen in the last 25 years, * somebody at Mansfield might be interested in even the most * minor omissions. *** INIT-option MACROSPACE mentioned in k5sl3.doc / k5sl4.doc * should be documented. If it allows me to share macros in * different Kedit-sessions this could be fun. *** The limit 20 for both ISA and Nbfile.2() under DOS is much * too small. See _NFILE_ in \msc\doc\startup\_file.c and in * \msc\doc\startup\dos\crt0dat.asm to patch the MSC startup * for LOCKING ON. There should be no limit for LOCKING OFF: * If a file in the ring is not really opened (= locked) then * why not free the handle until it's needed ? *** SYMBOL() could test variable definitions without triggering * NOVALUE. It could also be used internally by Editv, which * at the moment allows to get, set, or put any illegal symbol * stems like :, +, X*X, and so on without reporting an error. *** Better idea than SYMBOL(): KEXX could offer VALUE(), which * also does not trigger NOVALUE. Furthermore VALUE() could * be used to access EDIT-variables with its third argument: * VAL = value( 'RC' ) <=> 'RC' if no RC value * VAR = value( VAR, , 'EDIT' ) <=> 'EDITV GET' VAR * call value VAR, VAR, 'FILE' <=> 'EDITV PUTF' VAR * call value VAR, NEW, 'FILE' <=> 'EDITV SETF' VAR NEW * OLD = value( VAR, NEW, 'EDIT' ) <=> yet 3 instructions: * 'EDITV GET' VAR ; OLD = VAR ; 'EDITV SET' VAR NEW *** Another possible VALUE() added function: * X = value( 'Z', ,'ENVIRONMENT' ) <=> X = dosenv( 'Z' ) * call value 'Y','X','ENVIRONMENT' <=> simplified "putenv" * At the moment "putenv" changing Kedit's environment works * only with REXX tricks: IMM /**/ address CMD 'SET Y=X' * One of my macros really uses this trick to SET RXTRACE=ON * and OFF before and after debugging macros written in REXX. * Modifying the PATH is another possible (ab)use of "putenv". *** Delimit() returns '~', '*' as delimiters, which don't work * with locate, and Delimit() returns '=', '?' as delimiters, * which cannot be used as delimiters for implicit locates: say delimit( '''()%$#"!/' ) /* *-delimit */ say delimit( '''()%$#"!/*<,' ) /* =-delimit */ say delimit( '''()%$#"!/*<,=>' ) /* ?-delimit */ say delimit( '''()%$#"!/*<,=>?[@\]_`{}' ) /* ~-delimit */ say delimit( '''()%$#"!/*<,=>?[@\]_`{}~' || d2c(127) ) *** All characters above DEL (127) and below blank (32) except * from NUL (0) are legal delimiters for locate, but Delimit() * does not consider these 159 additionally valid delimiters. * For the following proposal read char. H = "house" d2c(127), * C = ^C d2c(3), D = ^D d2c(4), E = ^E d2c(5), F = ^F d2c(6): * To patch Delimit() change /!"#$%'()*,<=>?@[\]_`{}~H in the * KEDIT.EXE binary twice in /!"#$%'()[,<{>]@_\`}HCDEF, where * CDEF are the new delimiters replacing *=?~ in KEDIT 5.00D3. * KEDIT 5.00P3 (OS/2) has only one delimiter string /!"# etc. * [also tested with Kedit 5.00D4 resp. 5.00P4] *** Maybe Delimit() should return no value instead of an empty * string, if no delimiter is applicable. This would trigger * error 122 (RC=98). I'm not sure about the best solution. *** In addition to 'range BLOCK' a 'range ALL' could be useful. * And maybe 'range PARAgraph' for the remaining group target. *** 'Query range' doesn't work like (almost) all other queries: * 'query range' followed by 'set' Lastmsg.1() or equivalent * 'range' Range.1() Range.2() modifies the range. To avoid * this special case a new target type *-N as offset from EOF * would allow 'query range' to report 'range :M *-N'. Then * the special adding of colons by 'modify range' is obsolete, * and a new offset-from-EOF-target '*-N' is generally useful. *** The manual could mention the last message method for 'attr': 'nomsg q attr' ; ATTR = lastmsg.1() ; /*...*/ ; 'set' ATTR *** At the moment Set Monitor changes neither the text mode nor * gray scale summing, it only notes Monitor COLOR (resp. MONO) * internally and then executes Set Color * Default, selecting * either COLOR or MONO default attributes. Set Monitor later * only affects the verbose results shown by Query Color resp. * Query Border. Adding MONITOR GRAY (for gray scale summing) * would be less confusing, and the new default attributes for * GRAY should be different from MONO. The difference between * 'Dos mode [co80|bw80|mono]' and 'Set monitor' should be made * clearer in the manual. *** If debugging.1() = 'ON' then interpret 'trace' debugging.3() * at the begin of a macro is a way to debug a recursive macro * which is not in memory, i.e. when 'Debug start' cannot help. * There should be a better solution, either with 'Trace value' * and 'Trace()' as in REXX, or with a KEXX-function 'Debug()', * returning 1 if the current macro was started by 'Debug'. *** 'Dos whatever' does not return whatever exit code in RC as * it should. At the moment it's difficult to get the return * code of external commands: * IMM /**/ address CMD 'whatever' ; exit rc *** The 'New file...' message is IMHO useless: This situation * is normally obvious (unless the TOFEOF-setting or -colours * are screwed up). The only way to suppress this message is * apparently the NOMSG-option, but then MSGMODE would be OFF. * At least the NEW-option and/or the NOSCREEN-option should * suppress any 'New file...' message. If KEDIT depends on a * first message internally then 'NOMSG MSG' should be enough. *** DIALOG /whatever/ YESNOCANCEL supports the keys Y, N, ESC * in addition to ENTER, TAB, S-TAB, CURR, CURL, SPACE, and * mouse button 1. Without mouse especially ESC resulting in * DIALOG.2 = 'CANCEL' is very handy but not documented. *** MORE and LESS return 2 if nothing found with DISPLAY 0 0, * but always 0 with DISPLAY 1 1. A consistent return code * (RC 4 ?) would simplify using MORE and LESS in macros. *** The manual should emphasize that MORE and LESS operate on * matching instead of ordinary targets: MORE TAG 1 tags all * lines instead of only one line. The effects of something * like LESS 1 followed by MORE 2 are quite interesting and * could be used as an example (how to hide odd linenumbers). *** MORE TAG and LESS TAG return 5 (error 3) 'too few operands', * but MORE TAGged resp. LESS TAGged are legal, and TAG is an * abbreviation for TAGged in e.g. LOCATE TAG. Workaround: * Use macros MORE and LESS replacing argument TAG by TAGged. *** After return from DOS resp. DOSN the status and/or command * lines can be invisible or at the wrong place, for example: * - start a TEXTWINDOW session of KEDIT * - change the number of screen lines by e.g. DOS MODE 80,34 * - inform KEDIT about the screen size by PSCREEN 34 80 PRESET * - execute another shell command, e.g. only COMMAND DOSN EXIT * - a new status line appears at screen line NN, the old status * line 34 is not updated, the command line 33 is still okay * - editing file lines between NN and 33 won't work as expected * - PSCREEN 34 corrects this situation until the next DOS shell *** workaround for TEXTWINDOW problems with DOS and DOSN using * address CMD - requires OS/2 CMD.EXE and REXX forced by /**/ if opmode.1() = 'TEXTWINDOW' then do TXT = "/**/ if arg( 1 ) > '' then address CMD '@CLS &'" TXT = TXT "arg( 1 ) ; else 'command dosn' ; return rc" 'define DOSN' TXT /* DOSQ is always ok */ 'syn DOSN macro DOSN' /* assume SYNONYM ON */ end *** Similar DOS workaround based on MACRO DOSN skipped, in my * PROFILE these are of course real macros and no one-liners. * At least I learned that one-liners have their own limit of * 250 characters instead of WIDTH.1(). With this limit it's * possible to enter a legal IMMediate REXX macro (using /**/) * on the command line and get an artificial KEXX error 69. *** GET without argument doesn't get .\KEDITPUT.TMP created by * another Kedit session (if PUT was not used before GET). * Either GET should get whatever .\KEDITPUT.TMP, or PUT and * GET could use temporary files in the TMP-directory (with * unique names maybe derived from the process number). TMP * can be determined like PATH and MACROPATH. This would be * generally useful, there are too many TMP = DOSENV('TMP'); * if TMP = '' then TMP = '.'; constructs in my KEXX-macros. *** MACRO .dotted (for any .dotted.KEX on HPFS) doesn't work, * MACRO .dotted.KEX (explicit extension) is okay. I don't * intend to use such names, but in theory they are legal. *************************************************************** *-- The following problems are already corrected in KeditW 1.0, *-- but I haven't tested anything above this line with KeditW: *** Something like 'mark ALL' would be very useful: It's often *-- necessary to move parts of a file (as block) into a buffer *-- file, do something with it, and then move the result (ALL, *-- again as block) back or to another file. 'Putd ALL' is not *-- really equivalent, as it writes physically to disk. There *-- are numerous '-* mark line reset' ; '* mark line' in one of *-- my scripts, where a new 'mark ALL' would be much clearer... *** The default A-F key macro asks for a fill character even if *-- no block is marked, 'fill' reports this later. Better A-F: *-- if block() & block.1() = 'BOX' then... ; 'fill' lastkey.2() *** 'Nomsg cancel' does not work, i.e. displays a quit message. *-- 'Quit' and 'cancel' quit changed files without warning, if *-- these files were originally added to the ring by MACROS or *-- DIR. Apparently an undocumented "quit anyway"-flag exists, *-- as files MACROS.KML or DIR.DIR added to the ring by command *-- KEDIT instead of MACROS or DIR don't have this problem. *** With a foreign keyboard layout, where S-Del on the numeric *-- keypad is comma ',' instead of point '.', Readv recognizes *-- READV.3 == 83, but reports READV.1 = ',' instead of S-Del. *-- With a new definition of , (comma) it's possible to revive *-- S-DEL for Kedit 5.0 and KEYB GR (german keyboard): *-- DEFINE , if lastkey.3() = 83 then 'macro S-Del' ; *-- else 'text' lastkey.2() *** 'Q focus' says 'focus', FOCUS.0() is 0, so the undocumented *-- query/extract focus is some kind of dead code. It could be *-- nice to have query/extract focus, because Focusword.1() is *-- only reliable if the focus character Focus.2() is no space. *** Datatype() supports the 'Whole' option, which is important *-- for the translation of REXX to KEXX and v.v. This should *-- be documented and recommended instead of Datatype( x, 'N'). *** 'File', 'Ffile', 'Save', or 'Ssave' in an empty file should *-- always truncate the file on disk, not only if it is LOCKed. *-- At the moment 'File' and 'FFile' behave like 'QQuit' in an *-- unLOCKed empty file, and 'Save' is a NOP, all setting RC=0.