1. Macro / Shell Extensions
    1. Shell Commands/Filters
    2. Learn/Replay
      1. Repeating Actions and Learn/Replay Sequences
    3. Macro Language
      1. Macro Language - SYNTAX
      2. DATA TYPES
      3. VARIABLES
      4. FUNCTIONS and SUBROUTINES
      5. User Defined Functions
      6. OPERATORS AND EXPRESSIONS
      7. LOOPING AND CONDITIONALS
    4. Macro Subroutines
      1. Built in Variables
      2. Built-in Subroutines
    5. Actions Routines
      1. Actions Representing Menu Commands:
      2. Menu Action Routine Arguments:
      3. Keyboard-Only Actions

Macro / Shell Extensions

Shell Commands/Filters

The Shell menu (Unix versions only) allows you to execute Unix shell commands from within NEdit. You can add items to the menu to extend NEdit's command set or to incorporate custom automatic editing features using shell commands or editing languages like awk and sed. To add items to the menu, select Preferences -> Default Settings Customize Menus -> Shell Menu. NEdit comes pre-configured with a few useful Unix commands like spell and sort, but we encourage you to add your own custom extensions.

Filter Selection... prompts you for a Unix command to use to process the currently selected text. The output from this command replaces the contents of the selection.

Execute Command... prompts you for a Unix command and replaces the current selection with the output of the command. If there is no selection, it deposits the output at the current insertion point.

Execute Command Line uses the position of the cursor in the window to indicate a line to execute as a shell command line. The cursor may be positioned anywhere on the line. This command allows you to use an NEdit window as an editable command window for saving output and saving commands for re-execution.

The X resource called nedit.shell (See Customizing NEdit) determines which Unix shell is used to execute commands. The default value for this resource is /bin/csh.


Learn/Replay

Selecting Learn Keystrokes from the Macro menu puts NEdit in learn mode. In learn mode, keystrokes and menu commands are recorded, to be played back later, using the Replay Keystrokes command, or pasted into a macro in the Macro Commands dialog of the Default Settings menu in Preferences.

Note that only keyboard and menu commands are recorded, not mouse clicks or mouse movements since these have no absolute point of reference, such as cursor or selection position. When you do a mouse-based operation in learn mode, NEdit will beep (repeatedly) to remind you that the operation was not recorded.

Learn mode is also the quickest and easiest method for writing macros. The dialog for creating macro commands contains a button labeled "Paste Learn / Replay Macro", which will deposit the last sequence learned into the body of the macro.

Repeating Actions and Learn/Replay Sequences

You can repeat the last (keyboard-based) command, or learn/replay sequence with the Repeat... command in the Macro menu. To repeat an action, first do the action (i.e. insert a character, do a search, move the cursor), then select Repeat..., decide how or how many times you want it repeated, and click OK. For example, to move down 30 lines through a file, you could type: <Down Arrow> Ctrl+, 29 <Return>. To repeat a learn/replay sequence, first learn it, then select Repeat..., click on Learn/Replay and how you want it repeated, then click OK.

If the commands you are repeating advance the cursor through the file, you can also repeat them within a range of characters, or from the current cursor position to the end of the file. To iterate over a range of characters, use the primary selection (drag the left mouse button over the text) to mark the range you want to operate on, and select "In Selection" in the Repeat dialog.

When using In "Selection" or "To End" with a learned sequence, try to do cursor movement as the last step in the sequence, since testing of the cursor position is only done at the end of the sequence execution. If you do cursor movement first, for example searching for a particular word then doing a modification, the position of the cursor won't be checked until the sequence has potentially gone far beyond the end of your desired range.

It's easy for a repeated command to get out of hand, and you can easily generate an infinite loop by using range iteration on a command which doesn't progress. To cancel a repeating command in progress, type Ctrl+. (period), or select Cancel Macro from the Macro menu.


Macro Language

Macros can be called from Macro menu commands, window background menu commands, within the smart-indent framework, and from the .neditmacro file. Macro menu and window background menu commands are defined under Preferences -> Default Settings -> Customize Menus. Help on creating items in these menus can be found in the section, Help -> Customizing -> Preferences. The .neditmacro file is a file of macro commands and definitions which you can create in your home directory, and which NEdit will automatically load when it is first started.

NEdit's macro language is a simple interpreter with integer arithmetic, dynamic strings, and C-style looping constructs (very similar to the procedural portion of the Unix awk program). From the macro language, you can call the same action routines which are bound to keyboard keys and menu items, as well additional subroutines for accessing and manipulating editor data, which are specific to the macro language (these are listed in the sections titled Macro Subroutines, and Actions).

Macro Language - SYNTAX

An NEdit macro language program consists of a list of statements, each terminated by a newline. Groups of statements which are executed together conditionally, such as the body of a loop, are surrounded by curly braces "{}".

Blank lines and comments are also allowed. Comments begin with a "#" and end with a newline, and can appear either on a line by themselves, or at the end of a statement.

Statements which are too long to fit on a single line may be split across several lines, by placing a backslash "\" character at the end of each line to be continued.

DATA TYPES

The NEdit macro language recognizes only two data types, dynamic character strings, and integer values. In general strings and integers can be used interchangeably. If a string represents an integer value, it can be used as an integer. Integers can be compared and concatenated with strings.


Integer Constants

Integers are non-fractional numbers in the range of -2147483647 to 2147483647. Integer constants must be in decimal. For example:

a = -1
b = 1000

Character String Constants

Character string constants are enclosed in double quotes. For example:

a = "a string"
dialog("Hi there!", "Dismiss")

Strings may also include C-language style escape sequences:

   \\ Backslash      \t Tab		  \f Form feed
   \" Double quote   \b Backspace	  \a Alert
   \n Newline	     \r Carriage return   \v Vertical tab

For example, to send output to the terminal from which nedit was started, a newline character is neccessary because, like printf, t_print requires explicit newlines, and also buffers its output on a per-line basis:

t_print("a = " a "\n")

VARIABLES

Variable names must begin either with a letter (local variables), or a $ (global variables). Beyond the first character, variables may also contain numbers and underscores `_'. Variables are called in to existence just by setting them (no explicit declarations are necessary).

Local variables are limited in scope to the subroutine (or menu item definition) in which they appear. Global variables are accessible from all routines, and their values persist beyond the call which created them, until reset.


Built-in Variables

NEdit has a number of permanently defined variables, which are used to access global editor information and information about the the window in which the macro is executing. These are listed along with the built in functions in the section titled Macro Subroutines.

FUNCTIONS and SUBROUTINES

The syntax of a function or subroutine call is:

function_name(arg1, arg2, ...)

where arg1, arg2, etc. represent up to 9 argument values which are passed to the routine being called. A function or subroutine call can be on a line by itself, as above, or if it returns a value, can be invoked within a character or numeric expression:

a = fn1(b, c) + fn2(d)
dialog("fn3 says: " fn3())

Arguments are passed by value. This means that you can not return values via the argument list, only through the function value or indirectly through agreed-upon global variables.


Built-in Functions

NEdit has a wide range of built in functions which can be called from the macro language. These routines are divided into two classes, macro-language functions, and editor action routines. Editor action routines are more flexible, in that they may be called either from the macro language, or bound directly to keys via translation tables. They are also limited, however, in that they can not return values. Macro language routines can return values, but can not be bound to keys in translation tables.

Nearly all of the built-in subroutines operate on an implied window, which is initially the window from which the macro was started. To manipulate the contents of other windows, use the focus_window subroutine to change the focus to the ones you wish to modify. focus_window can also be used to iterate over all of the currently open windows, using the special keyword names, "last" and "next".

For backwards compatibility, hyphenated action routine names are allowed, and most of the existing action routines names which contain underscores have an equivalent version containing hyphens ('-') instead of underscores. Use of these names is discouraged. The macro parser resolves the ambiguity between '-' as the subtraction/negation operator, and - as part of an action routine name by assuming subtraction unless the symbol specifically matches an action routine name.

User Defined Functions

Users can define their own macro subroutines, using the define keyword:

   define subroutine_name {
      < body of subroutine >
   }

Macro definitions can not appear within other definitions, or within macro menu item definitions (usually they are found in the .neditmacro file).

The arguments with which a user-defined subroutine or function was invoked, are presented as $1, $2, ... , $9. The number of arguments can be read from $n_args.

OPERATORS AND EXPRESSIONS

Operators have the same meaning and precedence that they do in C, except for ^, which raises a number to a power (y^x means y to the x power), rather than bitwise exclusive OR. The table below lists operators in decreasing order of precedence.

   Operators		    Associativity
   ()
   ^			    right to left
   - ! ++ --		    (unary)
   * / %		    left to right
   + -  		    left to right
   > >= < <= == !=	    left to right
   &			    left to right
   |			    left to right
   &&			    left to right
   ||			    left to right
   (concatenation)	    left to right
   = += -= *= /= %=, &= |=  right to left

The order in which operands are evaluated in an expression is undefined, except for && and ||, which like C, evaluate operands left to right, but stop when further evaluation would no longer change the result.


Numerical Operators

The numeric operators supported by the NEdit macro language are listed below:

   + addition
   - subtraction or negation
   * multiplication
   / division
   % modulo
   ^ power
   & bitwise and
   | bitwise or

Increment (++) and decrement (--) operators can also be appended or prepended to variables within an expression. Prepended increment/decrement operators act before the variable is evaulated. Appended increment/decrement operators act after the variable is evaluated.


Logical and Comparison Operators

Logical operations produce a result of 0 (for false) or 1 (for true). In a logical operation, any non-zero value is recognized to mean true. The logical and comparison operators allowed in the NEdit macro language are listed below:

   && logical and
   || logical or
   !  not
   >  greater
   <  less
   >= greater or equal
   <= less or equal
   == equal (integers and/or strings)
   != not equal (integers and/or strings)

Character String Operators

The "operator" for concatenating two strings is the absence of an operator. Adjoining character strings with no operator in between means concatenation:

d = a b "string" c
t_print("the value of a is: " a)

Comparison between character strings is done with the == and != operators, (as with integers). There are a number of useful built-in routines for working with character strings, which are listed in the section called Macro Subroutines.

LOOPING AND CONDITIONALS

NEdit supports looping constructs: for and while, and conditional statements: if and else, with essentially the same syntax as C:

for (<init>, ...; <condition>; <increment>, ...) <body>

while (<condition>) <body>

if (<condition>) <body>

if (<condition>) <body> else <body>

<body>, as in C, can be a single statement, or a list of statements enclosed in curly braces ({}). <condition> is an expression which must evaluate to true for the statements in <body> to be executed. for loops may also contain initialization statements, <init>, executed once at the beginning of the loop, and increment/decrement statements (or any arbitrary statement), which are executed at the end of the loop, before the condition is evaluated again.


Examples:

  for (i=0; i<100; i++)
     j = i * 2

  for (i=0, j=20; i<20; i++, j--) {
     k = i * j
     t_print(i, j, k)
  }

  while (k > 0)
  {
     k = k - 1
     t_print(k)
  }

  for (;;) {
     if (i-- < 1)
         break
  }

Loops may contain break and continue statements. A break statement causes an exit from the innermost loop, a continue statement transfers control to the end of the loop.


Macro Subroutines

Built in Variables

$cursor
Position of the cursor in the current window
$em_tab_dist
If tab emulation is turned on in the Tabs... dialog of the Preferences menu, value is the distance between emulated tab stops. If tab emulation is turned off, value is -1
$file_name
Name of the file being edited in the current window, stripped of directory component.
$file_path
Directory component of file being edited in the current window.
$language_mode
Name of language mode set in the current window.
$selection_start,$selection_end
Beginning and ending positions of the primary selection in the current window, or -1 if there is no text selected in the current window.
$selection_left, $selection_right
Left and right character offsets of the rectangular (primary) selection in the current window, or -1 if there is no selection or it is not rectangular.
$tab_dist
The distance between tab stops for a hardware tab character, as set in the Tabs... dialog of the Preferences menu.
$text_length
The length of the text in the current window.
$use_tabs
Whether the user is allowing the NEdit to insert tab characters to maintain spacing in tab emulation and rectangular dragging operations. (The setting of the "Use tab characters in padding and emulated tabs" button in the Tabs... dialog of the Preferences menu.)
$wrap_margin
The right margin in the current window for text wrapping and filling.

Built-in Subroutines

append_file(string, filename)
Appends a string to a named file. Returns 1 on successful write, or 0 if unsuccessful.
beep()
Ring the bell
clipboard_to_string()
Returns the contents of the clipboard as a macro string. Returns empty string on error.
dialog(message, btn_1_label, btn_2_label, ...)
Pop up a dialog for querying and presenting information to the user. First argument is a string to show in the message area of the dialog. Up to nine additional optional arguments represent labels for buttons to appear along the bottom of the dialog. Returns the number of the button pressed (the first button is number 1), or 0 if the user closed the dialog via the window close box.
focus_window(window_name)
Sets the window on which subsequent macro commands operate. window_name can be either a fully qualified file name, or one of "last" for the last window created, or "next" for the next window in the chain from the currently focused window (the first window being the one returned from calling focus_window("last"). Returns the name of the newly-focused window, or an empty string if the requested window was not found.
get_character(position)
Returns the single character at the position indicated by the first argument to the routine from the current window.
get_range(start, end)
Returns the text between a starting and ending position from the current window.
get_selection()
Returns a string containing the text currently selected by the primary selection either from the current window (no keyword), or from anywhere on the screen (keyword "any").
length(string)
Returns the length of a string
max(n1, n2, ...)
Returns the maximum value of all of its arguments
min(n1, n2, ...)
Returns the minimum value of all of its arguments
read_file(filename)
Reads the contents of a text file into a string. On success, returns 1 in $read_status, and the contents of the file as a string in the subroutine return value. On failure, returns the empty string "" and an 0 $read_status.
replace_in_string(string, search_for, replace_with, [type])
Replaces all occurrences of a search string in a string with a replacement string. Arguments are 1: string to search in, 2: string to search for, 3: replacement string. Argument 4 is an optional search type, one of "literal", "case" or "regex". The default search type is "literal". Returns a new string with all of the replacements done, or an empty string ("") if no occurrences were found.
replace_range(start, end, string)
Replaces all of the text in the current window between two positions
replace_selection(string)
Replaces the primary-selection selected text in the current window.
replace_substring(string, start, end, replace_with)
Replacing a substring between two positions in a string within another string.
search(search_for, start, [search_type, wrap, direction])
Searches silently in a window without dialogs, beeps, or changes to the selection. Arguments are: 1: string to search for, 2: starting position. Optional arguments may include the strings: "wrap" to make the search wrap around the beginning or end of the string, "backward" or "forward" to change the search direction ("forward" is the default), "literal", "case" or "regex" to change the search type (default is "literal"). Returns the starting position of the match, or -1 if nothing matched. also returns the ending position of the match in search_end
search_string(string, search_for, start, [search_type, direction])
Built-in macro subroutine for searching a string. Arguments are 1: string to search in, 2: string to search for, 3: starting position. Optional arguments may include the strings: "wrap" to make the search wrap around the beginning or end of the string, "backward" or "forward" to change the search direction ("forward" is the default), "literal", "case" or "regex" to change the search type (default is "literal"). Returns the starting position of the match, or -1 if nothing matched. Also returns the ending position of the match in $search_end
select(start, end)
Selects (with the primary selection) text in the current buffer between a starting and ending position.
select_rectangle(start, end, left, right)
Selects a rectangular area of text between a starting and ending position, and confined horizontally to characters displayed between positions "left", and "right".
set_cursor_pos(pos)
Set the cursor position for the current window.
shell_command(command, input_string)
executes a shell command, feeding it input from input_string. On completion, output from the command is returned as the function value, and the command's exit status is returned in the global variable $shell_cmd_status.
string_dialog(message, btn_1_label, btn_2_label, ...)
Pop up a dialog for prompting the user to enter information. The first argument is a string to show in the message area of the dialog. Up to nine additional optional arguments represent labels for buttons to appear along the bottom of the dialog. Returns the string entered by the user as the function value, and number of the button pressed (the first button is number 1), in $string_dialog_button. If the user closes the dialog via the window close box, the function returns the empty string, and $string_dialog_button returns 0.
string_to_clipboard(string)
Copy the contents of a macro string to the clipboard.
substring(string, start, end)
Returns the portion of a string between a starting and ending position.
t_print(string1, string2, ...)
Writes strings to the terminal (stdout) from which NEdit was started.
tolower(string)
Return an all lower-case version of string.
toupper(string)
Return an all upper-case version of string.
write_file(string, filename)
Writes a string (parameter 1) to a file named in parameter 2. Returns 1 on successful write, or 0 if unsuccessful.

Actions Routines

All of the editing capabilities of NEdit are represented as a special type of subroutine, called an action routine, which can be invoked from both macros and translation table entries (see "Binding Keys to Actions" in the X Resources section of the Help menu).

Actions Representing Menu Commands:

    File Menu		      Search Menu
    ---------------------     -----------------------
    new()		      find()
    open()		      find_dialog()
    open_dialog()	      find_again()
    open_selected()	      find_selection()
    close()		      replace()
    save()		      replace_dialog()
    save_as()		      replace_all()
    save_as_dialog()	      replace_in_selection()
    revert_to_saved()	      replace_again()
    include_file()	      goto_line_number()
    include_file_dialog ()    goto_line_number_dialog()
    load_tags_file()	      goto_selected()
    load_tags_file_dialog()   mark()
    load_macro_file()         mark_dialog()
    load_macro_file_dialog()  goto_mark()
    print()		      goto_mark_dialog()
    print_selection()	      match()
    exit()	     	      find_definition()
    			      split_window()
    			      close_pane()
    Edit Menu		      
    ---------------------     Shell Menu
    undo()		      -----------------------
    redo()		      filter_selection_dialog()
    delete()		      filter_selection()
    select_all()	      execute_command()
    shift_left()	      execute_command_dialog()
    shift_left_by_tab()       execute_command_line()
    shift_right()	      shell_menu_command()
    shift_right_by_tab()      
    uppercase() 	      Macro Menu
    lowercase() 	      -----------------------
    fill_paragraph()	      macro_menu_command()
    control_code_dialog()     repeat_macro()
    			      repeat_dialog()

The actions representing menu commands are named the same as the menu item with punctuation removed, all lower case, and underscores replacing spaces. Without the _dialog suffix, commands which normally prompt the user for information, instead take the information from the routine's arguments (see below). To present a dialog and ask the user for input, rather than supplying it in via arguments, use the actions with the _dialog suffix.

Menu Action Routine Arguments:

Arguments are text strings enclosed in quotes. Below are the menu action routines which take arguments. Optional arguments are inclosed in [].

open(filename)

save_as(filename)

include(filename)

load_tags_file(filename)

find_dialog([search_direction])

find(search_string [, search-direction], [search-type])

find_again([search-direction])

find_selection([search-direction])

replace_dialog([search-direction])

replace(search-string, replace-string, [, search-direction] [, search-type])

replace_in_selection(search-string, replace-string [, search-type])

replace_again([search-direction])

goto_line_number([line-number])

mark(mark-letter)

goto_mark(mark-letter)

filter_selection(shell-command)

execute_command(shell-command)

shell_menu_command(shell-menu-item-name)

macro_menu_command(macro-menu-item-name)

Some notes on argument types above:

filename
Path names are interpreted relative to the directory from which NEdit was started, wildcards and ~ are not expanded.
search-direction
Either "forward" or "backward"
search-type
Either "literal", "case", or "regex"
mark-letter
The mark command limits users to single letters. Inside of macros, numeric marks are allowed, which won't interfere with marks set by the user.
(macro or shell)-menu-item-name
Name of the command exactly as specified in the Shell Menu or Macro Menu dialogs

Keyboard-Only Actions

backward_character()
Moves the cursor one character to the left.
backward_paragraph()
Moves the cursor to the beginning of the paragraph, or if the cursor is already at the beginning of a paragraph, moves the cursor to the beginning of the previous paragraph. Paragraphs are defined as regions of text delimited by one or more blank lines.
backward_word()
Moves the cursor to the beginning of a word, or, if the cursor is already at the beginning of a word, moves the cursor to the beginning of the previous word. Word delimiters are user-settable, and defined by the X resource wordDelimiters.
beginning_of_file()
Moves the cursor to the beginning of the file.
beginning_of_line()
Moves the cursor to the beginning of the line.
beginning_of_selection()
Moves the cursor to the beginning of the selection without disturbing the selection.
copy_clipboard()
Copies the current selection to the clipboard.
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.
cut_primary()
Copies the primary selection to the cursor and deletes it at its original location.
delete_selection()
Deletes the contents of the primary selection.
delete_next_character()
If a primary selection exists, deletes its contents. Otherwise, deletes the character following the cursor.
delete_previous_character()
If a primary selection exists, deletes its contents. Otherwise, deletes the character before the cursor.
delete_next_word()
If a primary selection exists, deletes its contents. Otherwise, deletes the word following the cursor.
delete_previous_word()
If a primary selection exists, deletes its contents. Otherwise, deletes the word before the cursor.
delete_to_start_of_line()
If a primary selection exists, deletes its contents. Otherwise, deletes the characters between the cursor and the start of the line.
delete_to_end_of_line()
If a primary selection exists, deletes its contents. Otherwise, deletes the characters between the cursor and the end of the line.
deselect_all()
De-selects the primary selection.
end_of_file()
Moves the cursor to the end of the file.
end_of_line()
Moves the cursor to the end of the line.
end_of_selection()
Moves the cursor to the end of the selection without disturbing the selection.
exchange()
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.
forward_character()
Moves the cursor one character to the right.
forward_paragraph()
Moves the cursor to the beginning of the next paragraph. Paragraphs are defined as regions of text delimited by one or more blank lines.
forward_word()
Moves the cursor to the beginning of the next word. Word delimiters are user-settable, and defined by the X resource wordDelimiters.
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" at the cursor location.
key_select("direction")
Moves the cursor one character in "direction" ("left", "right", "up", or "down") and extends the selection. Same as 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.
newline_and_indent()
Inserts a newline character and lines up the indentation of the cursor with the current line, regardless of the setting of Auto Indent.
newline_no_indent()
Inserts a newline character, without automatic indentation, regardless of the setting of Auto Indent.
next_page()
Moves the cursor and scroll forward one page.
page_left()
Move the cursor and scroll left one page.
page_right()
Move the cursor and scroll right one page.
paste_clipboard()
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.
previous_page()
Moves the cursor and scroll backward one page.
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.
process_down()
Moves the cursor down one line.
process_return()
Same as newline for compatibility with previous versions.
process_shift_down()
Same as process_down("extend") for compatibility with previous versions.
process_shift_up()
Same as process_up("extend") for compatibility with previous versions.
process_tab()
If tab emulation is turned on, inserts an emulated tab, otherwise inserts a tab character.
process_up()
Moves the cursor up one line.
scroll_down(nLines)
Scroll the display down (towards the end of the file) by nLines.
scroll_up(nLines)
Scroll the display up (towards the beginning of the file) by nLines.
scroll_to_line(lineNum)
Scroll to position line number lineNum at the top of the pane. The first line of a file is line 1.
secondary_adjust()
Attached mouse-movement events to extend the secondary selection to the mouse position.
secondary_or_drag_adjust()
Attached mouse-movement events to extend the secondary selection, or reposition the primary text being dragged. Takes two optional arguments, "copy", and "overlay". "copy" leaves a copy of the dragged text at the site at which the drag began. "overlay" does the drag in overlay mode, meaning the dragged text is laid on top of the existing text, obscuring and ultimately deleting it when the drag is complete.
secondary_or_drag_start()
To be attached to a mouse down event. Begins drag selecting a secondary selection, or dragging the contents of the primary selection, depending on whether the mouse is pressed inside of an existing primary selection.
secondary_start()
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.


Arguments to Keyboard Action Routines

In addition to the arguments listed in the call descriptions, any routine involving cursor movement can take the argument "extend", meaning, adjust the primary selection to the new cursor position. Routines which take the "extend" argument as well as mouse dragging operations for both primary and secondary selections can take the optional keyword "rect", meaning, make the selection rectangular.


Send questions and comments to: nedit_support@fnal.gov.