fix hex regex in SH
[nedit-bw.git] / enhanced-hooks-early-ReadMacroInitFile.patch
blob2dee3a9694da63caa00a4fa47d58c51596c20849
1 ---
3 source/nedit.c | 26 +++++++++-----------------
4 1 files changed, 9 insertions(+), 17 deletions(-)
6 diff --quilt old/source/nedit.c new/source/nedit.c
7 --- old/source/nedit.c
8 +++ new/source/nedit.c
9 @@ -392,17 +392,17 @@ static const char cmdLineHelp[] =
10 #endif /*VMS*/
12 int main(int argc, char **argv)
14 int i, lineNum, nRead, fileSpecified = FALSE, editFlags = CREATE;
15 - int gotoLine = False, macroFileRead = False, opts = True;
16 + int gotoLine = False, opts = True;
17 int iconic=False, tabbed = -1, group = 0, isTabbed;
18 char *toDoCommand = NULL, *geometry = NULL, *langMode = NULL;
19 char filename[MAXPATHLEN], pathname[MAXPATHLEN];
20 XtAppContext context;
21 XrmDatabase prefDB;
22 - WindowInfo *window = NULL, *lastFile = NULL;
23 + WindowInfo *window = NULL, *lastFile = NULL, *dummy_untitled;
24 static const char *protectedKeywords[] = {"-iconic", "-icon", "-geometry",
25 "-g", "-rv", "-reverse", "-bd", "-bordercolor", "-borderwidth",
26 "-bw", "-title", NULL};
27 unsigned char* invalidBindings = NULL;
29 @@ -571,10 +571,14 @@ int main(int argc, char **argv)
31 if (strcmp(GetPrefServerName(), "") != 0) {
32 IsServer = True;
35 + dummy_untitled = EditNewFile(NULL, geometry, iconic, langMode, NULL, False);
36 + ReadMacroInitFile(WindowList);
37 + CheckCloseDim();
39 /* Process any command line arguments (-tags, -do, -read, -create,
40 +<line_number>, -line, -server, and files to edit) not already
41 processed by RestoreNEditPrefs. */
42 fileSpecified = FALSE;
43 for (i=1; i<argc; i++) {
44 @@ -686,14 +690,10 @@ int main(int argc, char **argv)
45 if (lastFile && window->shell != lastFile->shell) {
46 CleanUpTabBarExposeQueue(lastFile);
47 RaiseDocument(lastFile);
50 - if (!macroFileRead) {
51 - ReadMacroInitFile(WindowList);
52 - macroFileRead = True;
53 - }
54 if (gotoLine)
55 SelectNumberedLine(window, lineNum);
56 if (toDoCommand != NULL) {
57 DoMacro(window, toDoCommand, "-do macro");
58 toDoCommand = NULL;
59 @@ -743,14 +743,10 @@ int main(int argc, char **argv)
60 if (lastFile && window->shell != lastFile->shell) {
61 CleanUpTabBarExposeQueue(lastFile);
62 RaiseDocument(lastFile);
65 - if (!macroFileRead) {
66 - ReadMacroInitFile(WindowList);
67 - macroFileRead = True;
68 - }
69 if (gotoLine)
70 SelectNumberedLine(window, lineNum);
71 if (toDoCommand != NULL) {
72 DoMacro(window, toDoCommand, "-do macro");
73 toDoCommand = NULL;
74 @@ -779,17 +775,13 @@ int main(int argc, char **argv)
75 CleanUpTabBarExposeQueue(lastFile);
76 RaiseDocument(lastFile);
78 CheckCloseDim();
80 - /* If no file to edit was specified, open a window to edit "Untitled" */
81 - if (!fileSpecified) {
82 - EditNewFile(NULL, geometry, iconic, langMode, NULL, False);
83 - ReadMacroInitFile(WindowList);
84 - CheckCloseDim();
85 - if (toDoCommand != NULL)
86 - DoMacro(WindowList, toDoCommand, "-do macro");
87 + /* If no file to edit was specified, do at least the -do macro */
88 + if (!fileSpecified && toDoCommand != NULL) {
89 + DoMacro(WindowList, toDoCommand, "-do macro");
92 /* Begin remembering last command invoked for "Repeat" menu item */
93 AddLastCommandActionHook(context);