10/24/97 I took the time to apply all of my 4.0.3-color patches to the 5.0-beta source. It can be downloaded from: ftp://ftp.rational.com/exchange/max/nedit/5.0-beta I added all of the features from the 4.0.3-color version. Most of you are familiar with these already. 4.0.3-color Features: Selection Stuff: * Updated the selection mechanism to be able to do extension by words or lines based on how the selection was initially done. * Added word selection by groups of like characters. Like characters are newline, space or tab, non-delimiter characters and the delimiter characters minus the newline, space and tab. * Added 'nedit*text.dragStartsOnCharacter' resource to control if the the character under the mouse is selected when dragging to the right even though the I-bar is to the left of the character. It is disabled by default. * Added 'nedit*text.enableQuadrupleClick' resource to control if quadruple click is enabled to select all of the text. It is enabled by default. * Added the ability for the Cut, Copy, and Paste keys to control the secondary selection as they do in textedit. See 'Help|Using the Mouse' for the translation table example. * Added an example to the help file of the translation table to enable the use of the Shift key to control the secondary selection. See 'Help|Using the Mouse' for the details. * Added the ability to drag the primary selection with the left mouse button. See 'Help|Using the Mouse' for the translation table example. * Replaced the move-secondary-or-cut-clipboard, copy-secondary-or-paste-clipboard, exchange-or-copy-clipboard actions with the generic action secondary-or-clipboard that takes as its first argument the secondary action to perform when there is a secondary selection and as its second argument the clipboard action to perform if there is no secondary selection. The valid first arguments are 'copy', 'move', and 'exchange'. The valid second arguments are 'copy', 'cut' and 'paste'. The following are equivalent. move-secondary-or-cut-clipboard() = secondary-or-clipboard(move, cut) copy-secondary-or-paste-clipboard() = secondary-or-clipboard(copy, paste) exchange-or-copy-clipboard() = secondary-or-clipboard(exchange, copy) * Removed the default right mouse button bindings. If you want the right mouse button to extend the selection you will have to modify NEdits translation table in your .Xdefaults file. See 'Help|Using the Mouse' for the translation table examples. * Re-enabled the use of the textNselectForeground and textNhighlightForeground resources in syntax highlight mode. If you do not like this behavior then recompile with IGNORE_SELECT_FOREGROUND_COLOR or IGNORE_HIGHLIGHT_FOREGROUND_COLOR defined. Editing Stuff: * Added the ability to have multiple windows that edit the same file. Try 'Windows|Clone Window'. * Changed the forward word action to move the cursor to the end of the word instead of the beginning. This is how textedit and emacs does it. * Added arguments to the beginning-of-line/end-of-line actions to control the toggling between the beginning/end of the line and the first/last non-whitespace character. It works as follows. beginning-of-line() always goes to the beginning of the line. beginning-of-line(non-space) always goes to the first non-whitespace character. beginning-of-line(toggle) first goes to the beginning of the line and then toggles between the first non-whitespace character and the beginning of the line. beginning-of-line(toggle, non-space) first goes to the first non-whitespace character and then toggles between the beginning of the line and the first non-whitespace character. end-of-line() always goes to the end of the line. end-of-line(non-space) always goes to the last non-whitespace character. end-of-line(toggle) first goes to the end of the line and then toggles between the last non-whitespace character and the end of the line. end-of-line(toggle, non-space) first goes to the last non-whitespace character and then toggles between the end of the line and the last non-whitespace character. Here is an example of a .Xdefaults entry with the toggle argument added. nedit*text.Translations: #override \ Alt Shift osfBeginLine: beginning-of-line(toggle, extend, rect)\n\ Meta Shift osfBeginLine: beginning-of-line(toggle, extend, rect)\n\ Shift osfBeginLine: beginning-of-line(toggle, extend)\n\ osfBeginLine: beginning-of-line(toggle)\n\ Alt Shift osfEndLine: end-of-line(toggle, extend, rect)\n\ Meta Shift osfEndLine: end-of-line(toggle, extend, rect)\n\ Shift osfEndLine: end-of-line(toggle, extend)\n\ osfEndLine: end-of-line(toggle)\n Search Stuff: * Removed the find dialog. Added a find button to the replace dialog instead. Also made it the default button. * Added a replace and find action that replaces the current selection and then finds the next occurance. Action names: replace-find and replace-find-same. Added a Replace & Find button to the replace dialog. Also added a menu item for it. * Incremental search text field just below the menu bar with an ignore case and regular expression toggle button. Note that the 'Search:' label is a hidden push button that can be used to hide the search bar. * Backward incremental search with Shift+Find Incremental. * Shift+Return or Ctrl+Return in Search text field toggles the search direction. * Added separate Find and Replace menu items. The Find menu item will popup the Find/Replace dialog and will make the Find button the default button. The Replace menu item will also popup the Find/Replace dialog but it will make the Replace & Find button the default instead. * Updated the following menu accelerators. Menu item Before Now -----------------------------|----------|------- Search|Find Incremental | Ctrl+F | Ctrl+T Search|Find/Replace... | Ctrl+R | not used Search|Find... | not used | Ctrl+F Search|Replace... | not used | Ctrl+R Search|Replace Same | Alt+T | Alt+T Search|Find And Replace Same | Ctrl+T | Alt+R The resource to set these are: nedit*searchMenu.find.accelerator: Ctrlf nedit*searchMenu.find.acceleratorText: [Shift]Ctrl+F nedit*searchMenu.findShift.accelerator: Shift Ctrlf nedit*searchMenu.replace.accelerator: Ctrlr nedit*searchMenu.replace.acceleratorText: [Shift]Ctrl+R nedit*searchMenu.replaceShift.accelerator: Shift Ctrlr nedit*searchMenu.findIncremental.accelerator: Ctrlt nedit*searchMenu.findIncremental.acceleratorText: [Shift]Ctrl+T nedit*searchMenu.findIncrementalShift.accelerator: Shift Ctrlt nedit*searchMenu.findSelection.accelerator: Ctrlh nedit*searchMenu.findSelection.acceleratorText: [Shift]Ctrl+H nedit*searchMenu.findSelectionShift.accelerator: Shift Ctrlh nedit*searchMenu.findSame.accelerator: Ctrlg nedit*searchMenu.findSame.acceleratorText: [Shift]Ctrl+G nedit*searchMenu.findSameShift.accelerator: Shift Ctrlg nedit*searchMenu.replaceSame.accelerator: Altt nedit*searchMenu.replaceSame.acceleratorText: [Shift]Alt+T nedit*searchMenu.replaceSameShift.accelerator: Shift Altt nedit*searchMenu.replaceFindSame.accelerator: Altr nedit*searchMenu.replaceFindSame.acceleratorText: [Shift]Alt+R nedit*searchMenu.replaceFindSameShift.accelerator: Shift AltR * Changed the default for Keep Search Dialogs Up to True. * Added copying of the primary selection into the 'String to Find:' field when the 'Find...' or 'Replace...' menu item are activated. This is controlled by the 'nedit.findReplaceUsesSelection' resource. * Added ringing of the bell when the search wraps around the beginning/end of the file when verbose search is off. * Improved the flash matching feature to allow you to place the cursor on the left side of the ending character. * Added a goto matching character feature that moves the cursor to the complimentary character matching the character next to the cursor. * Changed the accelerator for 'Select Matching' from Ctrl+M to Shift+Ctrl+M and made Ctrl+M the accelerator for 'Goto Matching'. Use the following resources to redefine these: nedit*searchMenu.match.accelerator: Shift Ctrlm nedit*searchMenu.match.acceleratorText: Shift+Ctrl+M nedit*searchMenu.gotoMatching.accelerator: Ctrlm nedit*searchMenu.gotoMatching.acceleratorText: Ctrl+M * Integrated alberto@gaps.ssr.upm.es changes for a "Goto Line Number"/"Goto Selected" warning dialog. > 7. "Goto Line Number"/"Goto Selected" display a warning dialog if > line number is greater than number of lines in file, instead of > going to the end. Preferences: * Added preference to control if the Search text field is displayed. See 'Preferences|Incremental Search Line'. * Removed the hardcoded selection threshold and vertical scroll delay. They are now normal resources, 'nedit*text.selectThreshold' in pixels and 'nedit*text.verticalScrollDelay' in milliseconds. * Added a preference to enable the on exit confirmation dialog that informs you that you have more than one file open before exiting. See 'Preferences|Default Settings|On Exit Open Files Warning'. * Added a preference to control if the text area is editable eventhough the file is read only. See 'Preferences|Default Settings|Allow Read Only Edits'. * Added 'nedit.findReplaceUsesSelection' resource to control if the find and replace dialog is automatically loaded with the contents of the primary selection. * Added 'nedit.backupSuffix' resource to control the suffix used to generate the name of the backup file that holds the version of the file before the last save operation. File, Directory and Shell Command Stuff: * Added checking if the file being edited was changed by an external source. If so the user is prompted to reread it or to turn off checking altogether. This is checked every time the focus changes for the text area. * Added automatic update of the read only status. This is checked every time the focus changes for the text area. * Added a tail -f file checking mode. See Preferences|Checking Mode. * Improved the Open Selected feature to treat relatives paths as if they were relative to the directory of the file in the current edit window. Added the ability to open multiple files by parsing the selection into lines. It then checks to see if the line matches the output of grep or the error output of some of the popular compilers. If it matches it open the file and selects the line. If it doesn't match it is assumed to be the output of ls -F. Meaning that the '*@/' are ignored. Also if the first item on a line does not exist the rest of the line is ignored. * The current directory for a New window is inherited from the parent window. * The current directory for shell commands is now set to the directory of the window where they were executed from. * Added dialog to confirm re-load of file after command execution if the buffer has been modified. * Switched from using the Motif text widget in the command output dialogs to using the NEdit text widget. * Made the text in the command output dialogs writable. * Added disabling of the modified status when the command output is into a new window so the window can be closed without being prompted to save. * Added moving of the insertion cursor to the beginning of the command output in a new window. This is to force it to scroll back to the top. * Added the ability to backslash escape the % in shell command so they don't get converted to the path of the file. * Updated the title of the command output windows to have "NEdit - " prepended to them to identify them as belonging to NEdit. * Added modification of the mode bits to allow unconditional writes to the backup file. * Added expansion of '%' into the path of the current file in shell commands executed by the 'Execute Command ...' menu item. * Integrated alberto@gaps.ssr.upm.es changes to populate the Save As dialog with the current file name. > 1. "Save As" dialog gives, as default, the current filename (not only > its directory), like many editors and word processors do. This is > quite easy to implement: we have only to use "fullname" in > "PromptForNewFile" function as Input/Output argument (not only > Output). * Integrated alberto@gaps.ssr.upm.es changes to expand %t in shell commands to the current tab spacing value. > 3. In shell commands, "%t" expands to inner value of tab spacing > (tabDist). This can be useful for expand/unexpand commands: > > [un]expand -t %t > > expand/unexpand uses the value of the tab spacing (preferences) > in the window > > ("-t" is for HP-UX, see your system) > > NOTE: In Max's V4.0.3-color Patch 6, this also WORKS for Shell menu > commands "Execute Command...", "Execute Selection or Line with Cursor" > and "Filter selection". > > CHANGES IN SOURCES: > (see bellow in point 4, function "substitutePercent" in "source/shell.c") * Integrated alberto@gaps.ssr.upm.es changes for shell and macro commands to ASK for some argument(s)/option(s). > 4. Added the possibility for shell and macro commands to ASK for > some argument(s)/option(s). I've made some modifications to allow > commands to understand the following sintax: > > %:message:default_value% > > where: "%:" indicates the beginning of the sintax. Its special > meaning could be escaped with backslash: ("\%: in > shell commmands and "\\%:" in macro commands): > > message: is the asking message thet appears in the dialog > box (plus a ':' character added at the end). Inside > message, only ':' is a special character. If you want > to include it in the message, use "\:" ("\\:" in macros) > > ":" separator > > default_value: default value for argument/option in dialog > box. Could be an empty string (i.e.: %:message:%). > Inside default_value, only '%' is a special character. > If you want to include it in the message, use "\%" > ("\\%" in macros) > > "%" sintax end > > EXAMPLES: > > - Macro command: > > replace-in-selection("^", "%:First Character(s):\\%%", "regex") > > This command asks for the first character(s) that it will insert > at the beginning of line. This could be useful to comment out > selected lines. The default value is "%" (escaped with "\\"), > which is comment for MATLAB scripts/functions. > In dialog box, you can delete "%" and type "#" (shell scripts), > "!" (X resource files), "//" (C++), ... > > - Shell command: > On HP-UX, the command "adjust" is a simple but useful text > formatter. With option "-j", it justifies both margins, and > "-mXX" set the right margin value to XX (left margin remains > as is). So, we can create the shell command: > > Command Input: selection > Command Output: same window > Shell command to Execute: > adjust -j -m%:Right Margin:70% > > (or: adjust %:Adjust options:-j -m70% if you want the > capability of changing full options) Tags Stuff: * Added a warning dialog that the tags file has not been loaded when searching for a definition. * Added the search string used to find the definition to the search history. * Integrated alberto@gaps.ssr.upm.es changes to remove the backslash from the ctags expression. > 8. In tags files generated with "ctags", at least on HP-UX 9.XX, > special characters are "escaped" with backslash. For example: > definition of macro in "source/nedit.h": > > #define SET_ONE_RSRC(widget, name, newValue) \ > ... > > If I execute "ctags nedit.h", in "tags" file appears: > > SET_ONE_RSRC nedit.h /^#define SET_ONE_RSRC(widget, name, newValue) \\$/ > > Backslash is duplicated (escaping itself), so "Find Definition" command > will not work well, because in "nedit.h" does not exist the string > between '^' and '$' (i.e. with duplicated backslash). NEdit Server Stuff: * Clearcase awareness. * nc knows to connect only to the nedit server that was started in the same view that the current nc was invoked from. * Replace the internals of -srvname with my server name code. Each server is identified by its name from the -srvname option, the user name of the user, and the clearcase view tag if $CLEARCASE_ROOT is set. * Added -sn option to nc as shorthand for -srvname. * Added -wait option to nc that causes nc to wait for the file or files listed to be closed. * Added -openwait option to nc that causes nc to wait for the file or files listed to be opened. * nc now also waits for the server to start before exiting. * Added code to nedit to put itself into the background when running in server mode. * Added the ability to allow files opened by nedit and nc to be iconic if nedit was started with the -iconic argument but for files opened from the File menu to always be opened on top of the other windows. * Added propagation of the display value from nc to the nedit server at server startup. Miscellaneous: * Added support for the GNU auto configure utility. * Clearcase awareness. * Added display of the current view in the title bar. * Added display of the directory in the Windows menu. * Added the directory of the current file to the window's title bar. * Updated the title bar to display the name of the nedit server. * Added --enable-static-x configure argument that forces static linking of the Motif and X libraries. Fixes: * Fixed the server so that you will be prompted to create a file that doesn't exist. nc -create will bypass the prompt. * Changed fopen(..."r+") to access(...W_OK) to test if the file is writable because I was told that fopen(..."r+") modifies the ctime of a file in a clearcase vob. * Fixed Open Selected in an Untitled window. It wasn't using the correct current directory. * Fixed compressPathname() to not compress dir/.. when dir is a symbolic link. It is not valid to compress ../ in this case because ../ is not relative to dir but is instead relative to directory where dir points. * Fixed the display of the secondary selection to underline the area beyond the end of the line when the selection includes the newline. This is the change summary for the NEdit 5.0-beta MV patch 1. Features: * Added use of fopen() instead of access() to detemine if the file is writable. This needs to be tested with clearcase to verify that it doesn't update the mtime value. * Moved the Highlight Syntax button up after the Language Mode button. * Added sorting of the Untitled windows before the normal windows. * Removed setting of the status line background and the help dialog colors and font from the fallback resources. Made the NEdit text edit resources more generic so they will be used by the help dialog and so it will be easier for the user to override them in his .Xdefaults file. * Changed the Class name of the NEdit text widget from 'Text' to 'NEditText'. * Added the ability to escape the submenu character(>) with a backslash. * Made the status line an XmTextField widget instead of an XmText widget. Fixes: * Added fix so that EditExistingFile() would not try to use an Untitled window that has a shell command running into it. * Fixed problem with noticing that the writability of a file has changed in a clearcase view due to a check in or check out. * Fixed flashing of the locked status in tail -f mode. * Fixed bug in handleUnparsedRegionCB() that caused a core dump when using the Makefile syntax highlighting. * Fixed renaming of styles in the Highlight Styles Dialog. * Fixed core dump when using the 'Cancel Shell Command' menu item. * Added disable of the checking mode while the command output is being displayed to the user if the shell command was configure to reload the file afterwards. This fixes the bug where you would get the file changed dialog while the command output dialog was also displayed. * Fixed the missing shell, macro, and background menus on cloned windows. * Fixed array bounds write in AddToHistoryList. Missing parens. This would occur when using the history recall in the shell command dialog. --------- new1.root: New files in the root directory --------- BUILDING Makefile.in README.hp README.ibm README.linux README.sgi README.sun acconfig.h aclocal.m4 config.guess config.h.in config.sub configure configure.in install-sh mkinstalldirs --------- new1.source: New files in the source directory --------- Makefile.in clearcase.c clearcase.h highlightData.c server_common.c server_common.h strerror.c textBufTest.c version.h --------- new1.util: New files in the util directory --------- Makefile.in --------- patch1.source: Changes in the source directory --------- Makefile.in * Added config.h to the dependancy lists. * Updated the dependancy lists. * Added more information to version.c. clearcase.c * Made GetClearCaseViewTag() faster. Removed multiple calls to getenv(). file.c * Removed the SCCSID. * Removed the 'No changes made to...' prompt when trying to reload the file with the 'Revert to Saved' menu item. * Added fix so that EditExistingFile() would not try to use an Untitled window that has a shell command running into it. * Fixed problem with noticing that the writability of a file has changed in a clearcase view due to a check in or check out. * Fixed flashing of the locked status in tail -f mode. * Added turn off/on of the syntax highlighting when reloading the file. This is to get around the out of sync display that occurs while reloading because of the UpdateDisplay() that was added to the highlighting code. * Added use of fopen() instead of access() to detemine if the file is writable. This needs to be tested with clearcase to verify that it doesn't update the mtime value. * Added update of the readonly status when saving the file. help.c.in * Removed the text about the obsolete Syntax Highlighting Resources. * Added when configure was run to the Version information. * Updated the translation table examples. highlight.c * Finished applying the patches. * Made languageMode a per window data item. * Added call to UpdateDisplay in parseString() to refresh the display while we are computing the syntax highlighting. * Fixed bug in handleUnparsedRegionCB() that caused a core dump when using the Makefile syntax highlighting. * Added the watch cursor to the SyntaxHighlightModifyCB if more that 10000 characters were added. This way the user is given some indication that NEdit is not hung. highlightData.c * Added configure support. * Added conditional include of limits.h based on a configure define. * Made languageMode a per window data item. * Added conditional include of labels with the XmFRAME_TITLE_CHILD resource based on the Motif version. This needs workaround for if it is not supported. * Fixed renaming of styles in the Highlight Styles Dialog. * Added Sh/Ksh/Bash syntax highlighting. * Updated the default Perl syntax highlighting patterns. interprec.c * Added configure support. * Added conditional include of limits.h based on a configure define. macro.c * Made languageMode a per window data item. * Added conditional include of fcntl.h based on a configure define. menu.c * Moved the Highlight Syntax button up after the Language Mode button. * Finished applying the patches. * Moved the update of the menu toggle buttons into the function that sets the preference. * Added sorting of the Untitled windows before the normal windows. * Fixed core dump when using the 'Cancel Shell Command' menu item. nedit.c * Added support to configure to check for X11/Xlocale.h and for the XSupportsLocale call. * Removed setting of the status line background and the help dialog colors and font from the fallback resources. Made the NEdit text edit resources more generic so they will be used by the help dialog and so it will be easier for the user to override them in his .Xdefaults file. * Updated the fallback resources with the class name change of the NEdit text widget. nedit.h * Made languageMode a per window data item. * Switched from using the ctime to the mode of the file to detect if the mode has changed. parse.y * Added include of config.h. preferences.c * Made languageMode a per window data item. * Moved the update of the menu toggle buttons into the function that sets the preference. * Added Sh/Ksh/Bash syntax highlighting. selection.c * Added support for configure to check for glob.h. * Added Mark's expansion of tildes in open selected. server_common.c * Updated getUserName so that it doesn't overflow the static buffer. shell.c * Removed some unused code and an unused variable. * Added disable of the checking mode while the command output is being displayed to the user if the shell command was configure to reload the file afterwards. This fixes the bug where you would get the file changed dialog while the command output dialog was also displayed. shift.c * Removed SCCSID. smartIndent.c * Made languageMode a per window data item. tags.c * Removed SCCSID. text.c * Added support for configure to check for XmImRegister. * Changed the Class name of the NEdit text widget from 'Text' to 'NEditText'. textBuf.c * Added a rectReturn argument to BufReplaceRect to return the BufRectangle info instead of relying on structure copy of return values. * Added typecasting to get rid of the compiler messages about the mismatch between char and unsigned char. textBuf.h * Changed how the rectangle was returned from BufReplaceRect(). textDisp.c * Finished applying the patches. userCmds.c * Added the ability to escape the submenu character(>) with a backslash. * Updated writeMenuItemString() to escape the backslashes in the menu label. window.c * Added SetAutoSave(), SetSaveOldVersion(), SetShowMatching(). * Made the status line an XmTextField widget instead of an XmText widget. * Fixed the missing shell, macro, and background menus on cloned windows. * Added UpdateDisplay() which is a copy of XmUpdateDisplay() with the display value hardcoded and the XSync() commented out. window.h * Added SetAutoSave(), SetSaveOldVersion(), SetShowMatching(). * Added UpdateDisplay(). --------- patch1.util: Changes in the util directory --------- Makefile.in * Added config.h to the dependancy lists. managedList.c * Added configure support. misc.c * Fixed array bounds write in AddToHistoryList. Missing parens. vmsUtils.c * Added configure support. ---------------------------------------------------------------------- Max Vohlken Rational Software max.vohlken@rational.com ---------------------------------------------------------------------- Rational Software nor the company formerly known as Pure Atria make no warranty, expressed or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of this code.