Hi,
the help section about action routines is messy. Since I don't know
how to fix this in one big blow, I took a step by step manner. The
first step is to separate the mouse-only actions from the other
actions, because these can't be used inside macros but are only to be
bound directly to mouse events. IMO, this step is a must, so the diff
file for this is mouseActions.diff.
(Please note that I also renamed move-destination() to
move_destination() and that I use this action regardless of whether or
not it is unusual, so you have my email sent for this hereby.
Moreover, there is a small fix for HTML generation, the Range_Sets_
reference must be Rangesets_.)
As next intermediate step, I changed the worst about the Menu Action
Routine Arguments part. In the longer run, one probably should write
a well-documented alphabetical list of all action routines (excluding
only the mouse actions, which have their separate entry now).
Since I don't know if you like the second change, I also post a
separate diff file for it, called mouseAndMenuActions.diff. This
*includes* the mouseActions.diff, so you need to apply only *one* diff
file, either the mouseActions.diff for only the mouse actions, or the
mouseAndMenuActions.diff for the mouse actions and the menu action
changes.
Cheers,
Jörg
Index: help.etx
===================================================================
--- help.etx (revision 31)
+++ help.etx (revision 33)
@@ -34,7 +34,7 @@
Cut_and_Paste_ Macro_Language_
Using_the_Mouse_ Macro_Subroutines_
Keyboard_Shortcuts_ Highlighting_Information_
- Shifting_and_Filling_ Range_Sets_
+ Shifting_and_Filling_ Rangesets_
Tabbed_Editing_ Action_Routines_
File_Format_
Customizing
@@ -3333,20 +3333,6 @@
**copy_primary()**
Copies the primary selection to the cursor.
-**copy_to()**
- If a secondary selection exists, copies the secondary selection to
- the cursor. If no secondary selection exists, copies the primary selection
- to the pointer location.
-
-**copy_to_or_end_drag()**
- Completes either a secondary selection operation, or a
- primary drag. If the user is dragging the mouse to adjust a secondary
- selection, the selection is copied and either inserted at the cursor
- location, or, if pending-delete is on and a primary selection exists in the
- window, replaces the primary selection. If the user is dragging a block of
- text (primary selection), completes the drag operation and leaves the text at
- it's current location.
-
**cut_clipboard()**
Deletes the text in the primary selection and places it in
the clipboard.
@@ -3401,22 +3387,6 @@
Moves the cursor to the end of the selection without
disturbing the selection.
-**exchange( ["nobell"] )**
- Exchange the primary and secondary selections.
-
-**extend_adjust()**
- Attached mouse-movement events to begin a selection between
- the cursor and the mouse, or extend the primary selection to the mouse
- position.
-
-**extend_end()**
- Completes a primary drag-selection operation.
-
-**extend_start()**
- Begins a selection between the cursor and the mouse. A
- drag-selection operation can be started with either extend_start or
- grab_focus.
-
**focus_pane( [relative-pane] | [positive-index] | [negative-index] )**
Move the focus to the requested pane.
Arguments can be specified in the form of a relative-pane
@@ -3439,12 +3409,6 @@
the end of the current word or the end of the next word, if the
cursor is between words.
-**grab_focus()**
- Moves the cursor to the mouse pointer location, and prepares for
- a possible drag-selection operation (bound to extend_adjust), or multi-click
- operation (a further grab_focus action). If a second invocation of grab
- focus follows immediately, it selects a whole word, or a third, a whole line.
-
**insert_string( "string" )**
If pending delete is on and the cursor is inside the
selection, replaces the selection with "string". Otherwise, inserts "string"
@@ -3456,29 +3420,6 @@
forward/backward-character("extend"), or process-up/down("extend"), for
compatibility with previous versions.
-**move-destination()**
- Moves the cursor to the pointer location without
- disturbing the selection. (This is an unusual way of working. We left it in
- for compatibility with previous versions, but if you actually use this
- capability, please send us some mail, otherwise it is likely to disappear in
- the future.
-
-**move_to()**
- If a secondary selection exists, deletes the contents of the
- secondary selection and inserts it at the cursor, or if pending-delete is on
- and there is a primary selection, replaces the primary selection. If no
- secondary selection exists, moves the primary selection to the pointer
- location, deleting it from its original position.
-
-**move_to_or_end_drag()**
- Completes either a secondary selection operation, or a
- primary drag. If the user is dragging the mouse to adjust a secondary
- selection, the selection is deleted and either inserted at the cursor
- location, or, if pending-delete is on and a primary selection exists in the
- window, replaces the primary selection. If the user is dragging a block of
- text (primary selection), completes the drag operation and deletes the text
- from it's current location.
-
**newline()**
Inserts a newline character. If Auto Indent is on, lines up the
indentation of the cursor with the current line.
@@ -3517,9 +3458,6 @@
The parameter "column" will maintain the preferred column while
moving the cursor.
-**process_bdrag()**
- Same as secondary_or_drag_start for compatibility with previous versions.
-
**process_cancel()**
Cancels the current extend_adjust, secondary_adjust, or
secondary_or_drag_adjust in progress.
@@ -3575,6 +3513,81 @@
Scroll to position line number lineNum at the top of
the pane. The first line of a file is line 1.
+**select_all()**
+ Select the entire file.
+
+**self_insert()**
+ To be attached to a key-press event, inserts the character
+ equivalent of the key pressed.
+
+3>Mouse-Only Actions
+
+ The following action routines cannot be used inside macros. (They aren't
+ recorded for the same reason, see Learn/Replay_.) They are intended
+ only for being attached directly as actions to mouse events.
+
+**copy_to()**
+ If a secondary selection exists, copies the secondary selection to
+ the cursor. If no secondary selection exists, copies the primary selection
+ to the pointer location.
+
+**copy_to_or_end_drag()**
+ Completes either a secondary selection operation, or a
+ primary drag. If the user is dragging the mouse to adjust a secondary
+ selection, the selection is copied and either inserted at the cursor
+ location, or, if pending-delete is on and a primary selection exists in the
+ window, replaces the primary selection. If the user is dragging a block of
+ text (primary selection), completes the drag operation and leaves the text at
+ it's current location.
+
+**exchange( ["nobell"] )**
+ Exchange the primary and secondary selections.
+
+**extend_adjust()**
+ Attached mouse-movement events to begin a selection between
+ the cursor and the mouse, or extend the primary selection to the mouse
+ position.
+
+**extend_end()**
+ Completes a primary drag-selection operation.
+
+**extend_start()**
+ Begins a selection between the cursor and the mouse. A
+ drag-selection operation can be started with either extend_start or
+ grab_focus.
+
+**grab_focus()**
+ Moves the cursor to the mouse pointer location, and prepares for
+ a possible drag-selection operation (bound to extend_adjust), or multi-click
+ operation (a further grab_focus action). If a second invocation of grab
+ focus follows immediately, it selects a whole word, or a third, a whole line.
+
+**mouse_pan()**
+ Turns the mouse pointer into a cross and scrolls the window according to the
+ mouse movements.
+
+**move_destination()**
+ Moves the cursor to the pointer location without disturbing the selection.
+
+**move_to()**
+ If a secondary selection exists, deletes the contents of the
+ secondary selection and inserts it at the cursor, or if pending-delete is on
+ and there is a primary selection, replaces the primary selection. If no
+ secondary selection exists, moves the primary selection to the pointer
+ location, deleting it from its original position.
+
+**move_to_or_end_drag()**
+ Completes either a secondary selection operation, or a
+ primary drag. If the user is dragging the mouse to adjust a secondary
+ selection, the selection is deleted and either inserted at the cursor
+ location, or, if pending-delete is on and a primary selection exists in the
+ window, replaces the primary selection. If the user is dragging a block of
+ text (primary selection), completes the drag operation and deletes the text
+ from it's current location.
+
+**process_bdrag()**
+ Same as secondary_or_drag_start() for compatibility with previous versions.
+
**secondary_adjust()**
Attached mouse-movement events to extend the secondary
selection to the mouse position.
@@ -3597,13 +3610,7 @@
To be attached to a mouse down event. Begin drag selecting
a secondary selection.
-**select_all()**
- Select the entire file.
-**self_insert()**
- To be attached to a key-press event, inserts the character
- equivalent of the key pressed.
-
----------------------------------------------------------------------
Customizing
Index: help.etx
===================================================================
--- help.etx (revision 31)
+++ help.etx (working copy)
@@ -34,7 +34,7 @@
Cut_and_Paste_ Macro_Language_
Using_the_Mouse_ Macro_Subroutines_
Keyboard_Shortcuts_ Highlighting_Information_
- Shifting_and_Filling_ Range_Sets_
+ Shifting_and_Filling_ Rangesets_
Tabbed_Editing_ Action_Routines_
File_Format_
Customizing
@@ -3111,103 +3111,87 @@
3>Menu Action Routine Arguments
Arguments are text strings enclosed in quotes. Below are the menu action
- routines which take arguments. Optional arguments are enclosed in [].
+ routines which take arguments. Optional arguments are enclosed in [ ].
- **new**( ["tab" | "window" | "prefs" | "opposite"] )
+**new**( ["tab" | "window" | "prefs" | "opposite"] )
+
+ "tab": Open a new tab
+ "window": Open a new window
+ "prefs": Follow the user's tab/window preference
+ "opposite": Opposite of user's tab/window preference
+
+ The default behaviour is "prefs".
- **close**( ["prompt" | "save" | "nosave"] )
+**close**( ["prompt" | "save" | "nosave"] )
- **execute_command**( shell-command )
- **filter_selection**( shell-command )
+ Note for ~filename~ that path names are relative to the directory from
+ which NEdit was started. Shell interpreted wildcards and `~' are not
+ expanded.
- **find**( search-string [, ~search-direction~] [, ~search-type~]
- [, ~search-wrap~] )
+**save_as**( ~filename~ )
- **find_again**( [~search-direction~] [, ~search-wrap~] )
+**open**( ~filename~ )
- **find_definition**( [tag-name] )
+**include_file**( ~filename~ )
- **find_dialog**( [~search-direction~] [, ~search-type~]
- [, ~keep-dialog~] )
+**load_macro_file**( ~filename~ )
- **find_selection**( [~search-direction~] [, ~search-wrap~]
- [, ~non-regex-search-type~] )
+**load_tags_file**( ~filename~ )
- **goto_line_number**( [~line-number~] [, ~column-number~] )
+**unload_tags_file**( ~filename~ )
- **goto_mark**( ~mark-letter~ )
- **include_file**( ~filename~ )
+ Note for the find and replace actions, ~non-regex-search-type~ is either
+ "literal", "case", "word", or "caseWord". ~search-direction~ is either
+ "forward" or "backward". ~search-type~ is either "literal", "case", "word",
+ "caseWord", "regex", or "regexNoCase". ~search-wrap~ is either "wrap" or
+ "nowrap", and ~keep-dialog~ is either "keep" or "nokeep".
- **load_tags_file**( ~filename~ )
- **macro_menu_command**( ~macro-menu-item-name~ )
+**find**( search-string [, ~search-direction~] [, ~search-type~] [,
~search-wrap~] )
- **mark**( ~mark-letter~ )
+**find_again**( [~search-direction~] [, ~search-wrap~] )
- **open**( ~filename~ )
+**find_definition**( [tag-name] )
- **replace**( search-string, replace-string,
- [, ~search-direction~] [, ~search-type~] [, ~search-wrap~] )
+**find_dialog**( [~search-direction~] [, ~search-type~] [, ~keep-dialog~] )
- **replace_again**( [~search-direction~] [, ~search-wrap~] )
+**find_selection**( [~search-direction~] [, ~search-wrap~] [,
~non-regex-search-type~] )
- **replace_all**( search-string, replace-string [, ~search-type~] )
+**replace**( search-string, replace-string, [, ~search-direction~] [,
~search-type~] [, ~search-wrap~] )
- **replace_dialog**( [~search-direction~] [, ~search-type~]
- [, ~keep-dialog~] )
+**replace_again**( [~search-direction~] [, ~search-wrap~] )
- **replace_in_selection**( search-string,
- replace-string [, ~search-type~] )
+**replace_all**( search-string, replace-string [, ~search-type~] )
- **save_as**( ~filename~ )
+**replace_dialog**( [~search-direction~] [, ~search-type~] [, ~keep-dialog~] )
- **shell_menu_command**( ~shell-menu-item-name~ )
+**replace_in_selection**( search-string, replace-string [, ~search-type~] )
- **unload_tags_file**( ~filename~ )
+**goto_line_number**( [~line-number~] [, ~column-number~] )
- **----------- Some notes on argument types above -----------**
+ The mark command limits users to single letters, i.e., ~mark-letter~
+ belongs to a-z. Inside of macros, single digits are allowed as marks.
+ These won't interfere with marks set by the user.
- ~Arguments to new()~
- "tab": Open a new tab
- "window": Open a new window
- "prefs": Follow the user's tab/window
- preference
- "opposite": Opposite of user's tab/window
- preference
- Default behaviour is "prefs".
+**goto_mark**( ~mark-letter~ )
- ~filename~ Path names are relative to the directory from
- which NEdit was started. Shell interpreted
- wildcards and `~' are not expanded.
+**mark**( ~mark-letter~ )
- ~keep-dialog~ Either "keep" or "nokeep".
+**macro_menu_command**( macro-menu-item-name )
+ macro-menu-item-name is the name of the command exactly as specified in
+ the Macro Menu dialogs.
- ~mark-letter~ The mark command limits users to single letters. Inside
- of macros, single digits are allowed as marks. These
- won't interfere with marks set by the user.
+**execute_command**( shell-command )
- ~macro-menu-item-name~
- Name of the command exactly as specified in
- the Macro Menu dialogs.
+**filter_selection**( shell-command )
- ~non-regex-search-type~
- Either "literal", "case", "word", or
- "caseWord".
+**shell_menu_command**( shell-menu-item-name )
+ shell-menu-item-name is the name of the command exactly as specified in
+ the Shell Menu dialogs.
- ~search-direction~
- Either "forward" or "backward".
- ~search-type~ Either "literal", "case", "word",
- "caseWord", "regex", or "regexNoCase".
-
- ~search-wrap~ Either "wrap" or "nowrap".
-
- ~shell-menu-item-name~
- Name of the command exactly as specified in
- the Shell Menu dialogs.
-
3>Window Preferences Actions
**set_auto_indent( "off" | "on" | "smart" )**
@@ -3333,20 +3317,6 @@
**copy_primary()**
Copies the primary selection to the cursor.
-**copy_to()**
- If a secondary selection exists, copies the secondary selection to
- the cursor. If no secondary selection exists, copies the primary selection
- to the pointer location.
-
-**copy_to_or_end_drag()**
- Completes either a secondary selection operation, or a
- primary drag. If the user is dragging the mouse to adjust a secondary
- selection, the selection is copied and either inserted at the cursor
- location, or, if pending-delete is on and a primary selection exists in the
- window, replaces the primary selection. If the user is dragging a block of
- text (primary selection), completes the drag operation and leaves the text at
- it's current location.
-
**cut_clipboard()**
Deletes the text in the primary selection and places it in
the clipboard.
@@ -3401,22 +3371,6 @@
Moves the cursor to the end of the selection without
disturbing the selection.
-**exchange( ["nobell"] )**
- Exchange the primary and secondary selections.
-
-**extend_adjust()**
- Attached mouse-movement events to begin a selection between
- the cursor and the mouse, or extend the primary selection to the mouse
- position.
-
-**extend_end()**
- Completes a primary drag-selection operation.
-
-**extend_start()**
- Begins a selection between the cursor and the mouse. A
- drag-selection operation can be started with either extend_start or
- grab_focus.
-
**focus_pane( [relative-pane] | [positive-index] | [negative-index] )**
Move the focus to the requested pane.
Arguments can be specified in the form of a relative-pane
@@ -3439,12 +3393,6 @@
the end of the current word or the end of the next word, if the
cursor is between words.
-**grab_focus()**
- Moves the cursor to the mouse pointer location, and prepares for
- a possible drag-selection operation (bound to extend_adjust), or multi-click
- operation (a further grab_focus action). If a second invocation of grab
- focus follows immediately, it selects a whole word, or a third, a whole line.
-
**insert_string( "string" )**
If pending delete is on and the cursor is inside the
selection, replaces the selection with "string". Otherwise, inserts "string"
@@ -3456,29 +3404,6 @@
forward/backward-character("extend"), or process-up/down("extend"), for
compatibility with previous versions.
-**move-destination()**
- Moves the cursor to the pointer location without
- disturbing the selection. (This is an unusual way of working. We left it in
- for compatibility with previous versions, but if you actually use this
- capability, please send us some mail, otherwise it is likely to disappear in
- the future.
-
-**move_to()**
- If a secondary selection exists, deletes the contents of the
- secondary selection and inserts it at the cursor, or if pending-delete is on
- and there is a primary selection, replaces the primary selection. If no
- secondary selection exists, moves the primary selection to the pointer
- location, deleting it from its original position.
-
-**move_to_or_end_drag()**
- Completes either a secondary selection operation, or a
- primary drag. If the user is dragging the mouse to adjust a secondary
- selection, the selection is deleted and either inserted at the cursor
- location, or, if pending-delete is on and a primary selection exists in the
- window, replaces the primary selection. If the user is dragging a block of
- text (primary selection), completes the drag operation and deletes the text
- from it's current location.
-
**newline()**
Inserts a newline character. If Auto Indent is on, lines up the
indentation of the cursor with the current line.
@@ -3505,10 +3430,10 @@
**page_right( ["scrollbar"] ["nobell"] )**
Move the cursor and scroll right one page.
-**paste_clipboard()**
+**paste_clipboard(["rect"])**
Insert the contents of the clipboard at the cursor, or if
pending delete is on, replace the primary selection with the contents of the
- clipboard.
+ clipboard. If "rect" is given, the clipboard is pasted as column.
**previous_page( ["stutter"] ["column"] ["scrollbar"] ["nobell"] )**
Moves the cursor and scroll backward one page.
@@ -3517,9 +3442,6 @@
The parameter "column" will maintain the preferred column while
moving the cursor.
-**process_bdrag()**
- Same as secondary_or_drag_start for compatibility with previous versions.
-
**process_cancel()**
Cancels the current extend_adjust, secondary_adjust, or
secondary_or_drag_adjust in progress.
@@ -3575,6 +3497,81 @@
Scroll to position line number lineNum at the top of
the pane. The first line of a file is line 1.
+**select_all()**
+ Select the entire file.
+
+**self_insert()**
+ To be attached to a key-press event, inserts the character
+ equivalent of the key pressed.
+
+3>Mouse-Only Actions
+
+ The following action routines cannot be used inside macros. (They aren't
+ recorded for the same reason, see Learn/Replay_.) They are intended
+ only for being attached directly as actions to mouse events.
+
+**copy_to()**
+ If a secondary selection exists, copies the secondary selection to
+ the cursor. If no secondary selection exists, copies the primary selection
+ to the pointer location.
+
+**copy_to_or_end_drag()**
+ Completes either a secondary selection operation, or a
+ primary drag. If the user is dragging the mouse to adjust a secondary
+ selection, the selection is copied and either inserted at the cursor
+ location, or, if pending-delete is on and a primary selection exists in the
+ window, replaces the primary selection. If the user is dragging a block of
+ text (primary selection), completes the drag operation and leaves the text at
+ it's current location.
+
+**exchange( ["nobell"] )**
+ Exchange the primary and secondary selections.
+
+**extend_adjust()**
+ Attached mouse-movement events to begin a selection between
+ the cursor and the mouse, or extend the primary selection to the mouse
+ position.
+
+**extend_end()**
+ Completes a primary drag-selection operation.
+
+**extend_start()**
+ Begins a selection between the cursor and the mouse. A
+ drag-selection operation can be started with either extend_start or
+ grab_focus.
+
+**grab_focus()**
+ Moves the cursor to the mouse pointer location, and prepares for
+ a possible drag-selection operation (bound to extend_adjust), or multi-click
+ operation (a further grab_focus action). If a second invocation of grab
+ focus follows immediately, it selects a whole word, or a third, a whole line.
+
+**mouse_pan()**
+ Turns the mouse pointer into a cross and scrolls the window according to the
+ mouse movements.
+
+**move_destination()**
+ Moves the cursor to the pointer location without disturbing the selection.
+
+**move_to()**
+ If a secondary selection exists, deletes the contents of the
+ secondary selection and inserts it at the cursor, or if pending-delete is on
+ and there is a primary selection, replaces the primary selection. If no
+ secondary selection exists, moves the primary selection to the pointer
+ location, deleting it from its original position.
+
+**move_to_or_end_drag()**
+ Completes either a secondary selection operation, or a
+ primary drag. If the user is dragging the mouse to adjust a secondary
+ selection, the selection is deleted and either inserted at the cursor
+ location, or, if pending-delete is on and a primary selection exists in the
+ window, replaces the primary selection. If the user is dragging a block of
+ text (primary selection), completes the drag operation and deletes the text
+ from it's current location.
+
+**process_bdrag()**
+ Same as secondary_or_drag_start() for compatibility with previous versions.
+
**secondary_adjust()**
Attached mouse-movement events to extend the secondary
selection to the mouse position.
@@ -3597,13 +3594,7 @@
To be attached to a mouse down event. Begin drag selecting
a secondary selection.
-**select_all()**
- Select the entire file.
-**self_insert()**
- To be attached to a key-press event, inserts the character
- equivalent of the key pressed.
-
----------------------------------------------------------------------
Customizing
--
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop