Correct and extend the raise_window action routine. Adds the following functionality to the raise_window() action routine: - if the first argument is "focus", raises the window which currently has the macro focus - if the first argument looks like the name of an open file, raises the relevant window diff -ur nedit_official/doc/help.etx nedit_mod/doc/help.etx --- nedit_official/doc/help.etx 2004-06-08 11:36:15.000000000 -0400 +++ nedit_mod/doc/help.etx 2004-06-09 13:54:36.777608000 -0400 @@ -3410,12 +3410,17 @@ Moves the cursor up one line. If "absolute" is given, always moves to the previous line in the text buffer, regardless of wrapping. -**raise_window([relative-window] | [positive-index] | [negative-index])** - Raise the current focused window to the front if no argument is supplied. - Arguments can be specified in the form of a relative-window - ("first", "last", "next", "previous"), a positive-index - (numbers greater than 0, 1 is the same as "last") or a - negative-index (numbers less than 0, -1 is the same as "first"). +**raise_window([instruction] | [index] | [file-name])** + If no argument is supplied, make the current focused document tab visible and + bring its window to the front. Otherwise, a single argument can be specified + to specify the document to raise. The argument can be in the form of a + document-specifying instruction ("first", "last", "next", "previous" which + provide access in relation to order of opening, or "focus" for the current + macro-focused document); the full name of an open document (its file path and + name); or a numeric index of the document in order of opening. If the index + is positive, it is treated as a count of "next" steps from "last" (with 1 for + "last" itself); if negative, these are "previous" steps (with -1 + for "first"). 0 is invalid. **scroll_down( nUnits, ["lines" | "pages"] )** Scroll the display down (towards the end of the file) by a given diff -ur nedit_official/doc/html/actions.html nedit_mod/doc/html/actions.html --- nedit_official/doc/html/actions.html 2004-06-09 05:01:53.000000000 -0400 +++ nedit_mod/doc/html/actions.html 2004-06-09 13:55:23.228119000 -0400 @@ -703,13 +703,18 @@ previous line in the text buffer, regardless of wrapping.

-raise_window([relative-window] | [positive-index] | [negative-index])
+raise_window([instruction] | [index] | [file-name])
 
-Raise the current focused window to the front if no argument is supplied. -Arguments can be specified in the form of a relative-window -("first", "last", "next", "previous"), a positive-index -(numbers greater than 0, 1 is the same as "last") or a -negative-index (numbers less than 0, -1 is the same as "first"). +If no argument is supplied, make the current focused document tab visible and +bring its window to the front. Otherwise, a single argument can be specified +to specify the document to raise. The argument can be in the form of a +document-specifying instruction ("first", "last", "next", "previous" which +provide access in relation to order of opening, or "focus" for the current +macro-focused document); the full name of an open document (its file path and +name); or a numeric index of the document in order of opening. If the index +is positive, it is treated as a count of "next" steps from "last" (with 1 for +"last" itself); if negative, these are "previous" steps (with -1 +for "first"). 0 is invalid.

 scroll_down( nUnits, ["lines" | "pages"] )
diff -ur nedit_official/doc/nedit.doc nedit_mod/doc/nedit.doc
--- nedit_official/doc/nedit.doc	2004-06-09 05:01:45.000000000 -0400
+++ nedit_mod/doc/nedit.doc	2004-06-09 13:55:17.518055000 -0400
@@ -3279,12 +3279,17 @@
   Moves the cursor up one line. If "absolute" is given, always moves to the 
   previous line in the text buffer, regardless of wrapping. 
 
-raise_window([relative-window] | [positive-index] | [negative-index])
-  Raise the current focused window to the front if no argument is supplied. 
-  Arguments can be specified in the form of a relative-window ("first", 
-  "last", "next", "previous"), a positive-index (numbers greater than 0, 1 is 
-  the same as "last") or a negative-index (numbers less than 0, -1 is the same 
-  as "first"). 
+raise_window([instruction] | [index] | [file-name])
+  If no argument is supplied, make the current focused document tab visible 
+  and bring its window to the front. Otherwise, a single argument can be 
+  specified to specify the document to raise. The argument can be in the form 
+  of a document-specifying instruction ("first", "last", "next", "previous" 
+  which provide access in relation to order of opening, or "focus" for the 
+  current macro-focused document); the full name of an open document (its file 
+  path and name); or a numeric index of the document in order of opening. If 
+  the index is positive, it is treated as a count of "next" steps from "last" 
+  (with 1 for "last" itself); if negative, these are "previous" steps (with -1 
+  for "first"). 0 is invalid. 
 
 scroll_down( nUnits, ["lines" | "pages"] )
   Scroll the display down (towards the end of the file) by a given number of 
diff -ur nedit_official/doc/nedit.html nedit_mod/doc/nedit.html
--- nedit_official/doc/nedit.html	2004-06-09 05:01:50.000000000 -0400
+++ nedit_mod/doc/nedit.html	2004-06-09 13:55:20.248085000 -0400
@@ -3917,13 +3917,18 @@
 previous line in the text buffer, regardless of wrapping.
 

-raise_window([relative-window] | [positive-index] | [negative-index])
+raise_window([instruction] | [index] | [file-name])
 
-Raise the current focused window to the front if no argument is supplied. -Arguments can be specified in the form of a relative-window -("first", "last", "next", "previous"), a positive-index -(numbers greater than 0, 1 is the same as "last") or a -negative-index (numbers less than 0, -1 is the same as "first"). +If no argument is supplied, make the current focused document tab visible and +bring its window to the front. Otherwise, a single argument can be specified +to specify the document to raise. The argument can be in the form of a +document-specifying instruction ("first", "last", "next", "previous" which +provide access in relation to order of opening, or "focus" for the current +macro-focused document); the full name of an open document (its file path and +name); or a numeric index of the document in order of opening. If the index +is positive, it is treated as a count of "next" steps from "last" (with 1 for +"last" itself); if negative, these are "previous" steps (with -1 +for "first"). 0 is invalid.

 scroll_down( nUnits, ["lines" | "pages"] )
diff -ur nedit_official/source/help_data.h nedit_mod/source/help_data.h
--- nedit_official/source/help_data.h	2004-06-09 05:01:42.000000000 -0400
+++ nedit_mod/source/help_data.h	2004-06-09 13:55:14.858024000 -0400
@@ -3213,12 +3213,17 @@
 "\01IMoves the cursor up one line.  If \"absolute\" is given, always moves to the ",
 "previous line in the text buffer, regardless of wrapping. ",
 "\n\n",
-"\01A\01Braise_window([relative-window] | [positive-index] | [negative-index])\01A\n",
-"\01IRaise the current focused window to the front if no argument is supplied. ",
-"Arguments can be specified in the form of a relative-window ",
-"(\"first\", \"last\", \"next\", \"previous\"), a positive-index ",
-"(numbers greater than 0, 1 is the same as \"last\") or a ",
-"negative-index (numbers less than 0, -1 is the same as \"first\"). ",
+"\01A\01Braise_window([instruction] | [index] | [file-name])\01A\n",
+"\01IIf no argument is supplied, make the current focused document tab visible and ",
+"bring its window to the front. Otherwise, a single argument can be specified ",
+"to specify the document to raise. The argument can be in the form of a ",
+"document-specifying instruction (\"first\", \"last\", \"next\", \"previous\" which ",
+"provide access in relation to order of opening, or \"focus\" for the current ",
+"macro-focused document); the full name of an open document (its file path and ",
+"name); or a numeric index of the document in order of opening. If the index ",
+"is positive, it is treated as a count of \"next\" steps from \"last\" (with 1 for ",
+"\"last\" itself); if negative, these are \"previous\" steps (with -1 ",
+"for \"first\"). 0 is invalid. ",
 "\n\n",
 "\01A\01Bscroll_down( nUnits, [\"lines\" | \"pages\"] )\01A\n",
 "\01IScroll the display down (towards the end of the file) by a given ",
diff -ur nedit_official/source/menu.c nedit_mod/source/menu.c
--- nedit_official/source/menu.c	2004-05-06 04:39:56.000000000 -0400
+++ nedit_mod/source/menu.c	2004-06-09 13:58:52.980422000 -0400
@@ -3730,9 +3730,13 @@
     WindowInfo *nextWindow;
     WindowInfo *tmpWindow;
     int windowIndex;
+    char dummy[2];
 
     if (*nArgs > 0) {
-        if (strcmp(args[0], "last") == 0) {
+        if (strcmp(args[0], "focus") == 0 && MacroFocusWindow() != NULL) {
+            window = MacroFocusWindow();
+        }
+        else if (strcmp(args[0], "last") == 0) {
             window = WindowList;
         }
         else if (strcmp(args[0], "first") == 0) {
@@ -3767,27 +3771,22 @@
                 }
             }
         }
-        else {
-            if (sscanf(args[0], "%d", &windowIndex) == 1) {
-                if (windowIndex > 0) {
-                    for (window = WindowList; window != NULL && windowIndex > 1;
-                        --windowIndex) {
-                        window = window->next;
-                    }
+        else if (sscanf(args[0], "%d%1s", &windowIndex, dummy) == 1) {
+            if (windowIndex > 0) {
+                for (window = WindowList; window != NULL && windowIndex > 1;
+                    --windowIndex) {
+                    window = window->next;
                 }
-                else if (windowIndex < 0) {
-                    for (window = WindowList; window != NULL;
-                        window = window->next) {
-                        ++windowIndex;
-                    }
-                    if (windowIndex >= 0) {
-                        for (window = WindowList; window != NULL &&
-                            windowIndex > 0; window = window->next) {
-                            --windowIndex;
-                        }
-                    }
-                    else {
-                        window = NULL;
+            }
+            else if (windowIndex < 0) {
+                for (window = WindowList; window != NULL;
+                    window = window->next) {
+                    ++windowIndex;
+                }
+                if (windowIndex >= 0) {
+                    for (window = WindowList; window != NULL &&
+                        windowIndex > 0; window = window->next) {
+                        --windowIndex;
                     }
                 }
                 else {
@@ -3798,6 +3797,19 @@
                 window = NULL;
             }
         }
+        else {
+            /* we assume args[0] is a file_path/file_name string */
+            char fullname[MAXPATHLEN];
+            for (window = WindowList; window != NULL; window = window->next) {
+                sprintf(fullname, "%s%s", window->path, window->filename);
+                if (strcmp(args[0], fullname) == 0) {
+                    break;
+                }
+            }
+        }
+    }
+    else if (*nArgs == 0 && MacroFocusWindow() != NULL) {
+        window = MacroFocusWindow();
     }
     if (window != NULL) {
 	RaiseDocumentWindow(window);

=== DONE: diff -ur nedit_official  nedit_mod ===