move $args SH pattern to $[1-9]/$n_args
[nedit-bw.git] / nmvarNEDIT_HOME2.diff
bloba477ef511c1454aeb9b02f61c31bd75a6998f832
1 From: Thorsten Haude <yoo@vranx.de>
2 Subject: New NEdit Macro variables $NEDIT_HOME
4 Part of "patch collection", see
6 http://sourceforge.net/tracker/index.php?func=detail&aid=1058246&group_id=11005&atid=311005
7 [ 1058246 ] Patch Collection
9 2006-11-22
11 Updaed to track CVS Head,
13 ---
15 doc/help.etx | 6 ++++++
16 source/built-ins.h | 1 +
17 source/highlightData.c | 2 +-
18 source/macro.c | 22 ++++++++++++++++++++++
19 4 files changed, 30 insertions(+), 1 deletion(-)
21 diff --quilt old/source/macro.c new/source/macro.c
22 --- old/source/macro.c
23 +++ new/source/macro.c
24 @@ -4457,6 +4457,28 @@ static int versionMV(WindowInfo* window,
28 +** Returns the name of the directory where NEdit's run control files reside.
29 +** This is either the value of the environmental variable $NEDIT_HOME, the
30 +** default of ~/.nedit or $HOME. (See the online documentation for details
31 +** about the algorithm.)
32 +*/
33 +static int neditHomeMV(WindowInfo *window, DataValue *argList, int nArgs,
34 + DataValue *result, char **errMsg)
36 + const char *neditRCName = GetRCFileName(NEDIT_RC);
37 + char neditHome[MAXPATHLEN];
39 + if (0 != ParseFilename(neditRCName, NULL, neditHome)) {
40 + M_FAILURE("Unable to parse path of nedit.rc in %s");
41 + }
43 + result->tag = STRING_TAG;
44 + AllocNStringCpy(&result->val.str, neditHome);
46 + return True;
49 +/*
50 ** Built-in macro subroutine to create a new rangeset or rangesets.
51 ** If called with one argument: $1 is the number of rangesets required and
52 ** return value is an array indexed 0 to n, with the rangeset labels as values;
53 diff --quilt old/doc/help.etx new/doc/help.etx
54 --- old/doc/help.etx
55 +++ new/doc/help.etx
56 @@ -2538,6 +2538,12 @@ Macro Subroutines
57 **$VERSION**
58 Returns NEdit's version number ('5006' for NEdit 5.6).
60 +**$NEDIT_HOME**
61 + Returns the name of the directory where NEdit's run control files reside.
62 + This is either the value of the environmental variable $NEDIT_HOME, the
63 + default of ~/.nedit or $HOME. (See Preferences_ for details
64 + about the algorithm.)
66 **$n_display_lines**
67 The number of lines visible in the currently active pane.
69 diff --quilt old/source/highlightData.c new/source/highlightData.c
70 --- old/source/highlightData.c
71 +++ new/source/highlightData.c
72 @@ -548,7 +548,7 @@ static char *DefaultPatternSets[] = {
73 "NEdit Macro:2:0{\n\
74 README:\"NEdit Macro syntax highlighting patterns, version 2.6, maintainer Thorsten Haude, nedit at thorstenhau.de\":::Flag::D\n\
75 Comment:\"#\":\"$\"::Comment::\n\
76 - Built-in Misc Vars:\"(?<!\\Y)\\$(?:active_pane|calltip_ID|column|cursor|display_width|empty_array|file_name|file_path|language_mode|line|locked|max_font_width|min_font_width|modified|n_display_lines|n_panes|rangeset_list|read_only|selection_(?:start|end|left|right)|server_name|text_length|top_line|VERSION)>\":::Identifier::\n\
77 + Built-in Misc Vars:\"(?<!\\Y)\\$(?:active_pane|calltip_ID|column|cursor|display_width|empty_array|file_name|file_path|language_mode|line|locked|max_font_width|min_font_width|modified|n_display_lines|n_panes|rangeset_list|read_only|selection_(?:start|end|left|right)|server_name|text_length|top_line|VERSION|NEDIT_HOME)>\":::Identifier::\n\
78 Built-in Pref Vars:\"(?<!\\Y)\\$(?:auto_indent|em_tab_dist|file_format|font_name|font_name_bold|font_name_bold_italic|font_name_italic|highlight_syntax|incremental_backup|incremental_search_line|make_backup_copy|match_syntax_based|overtype_mode|show_line_numbers|show_matching|statistics_line|tab_dist|use_tabs|wrap_margin|wrap_text)>\":::Identifier2::\n\
79 Built-in Special Vars:\"(?<!\\Y)\\$(?:args|[1-9]|list_dialog_button|n_args|read_status|search_end|shell_cmd_status|string_dialog_button|sub_sep)>\":::String1::\n\
80 Built-in Subrs:\"<(?:args|append_file|beep|call|calltip|clipboard_to_string|dialog|filename_dialog|focus_window|get_character|get_pattern_(by_name|at_pos)|get_range|get_selection|get_style_(by_name|at_pos)|getenv|kill_calltip|length|list_dialog|max|min|n_args|rangeset_(?:add|create|destroy|get_by_name|includes|info|invert|range|set_color|set_mode|set_name|subtract)|read_file|replace_in_string|replace_range|replace_selection|replace_substring|search|search_string|select|select_rectangle|set_cursor_pos|shell_command|split|string_compare|string_dialog|string_to_clipboard|substring|t_print|tolower|toupper|valid_number|write_file)(?=\\s*\\()\":::Subroutine::\n\
81 diff --quilt old/source/built-ins.h new/source/built-ins.h
82 --- old/source/built-ins.h
83 +++ new/source/built-ins.h
84 @@ -112,3 +112,4 @@ MV($backlight_string, backlightString)
86 MV(rangeset_list, rangesetList)
87 MV(VERSION, version)
88 +MV(NEDIT_HOME, neditHome)