From cc028f2bb998cf1ef5c50f6977c7cafc1a118554 Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Sun, 7 Dec 2008 14:21:42 +0100 Subject: [PATCH] saveSearchHistory_v2 + fixes B.W. --- drag-move-fixes.patch | 45 +++++++ saveSearchHistory-fixes.patch | 278 ++++++++++++++++++++++++++++++++++++++++++ saveSearchHistory.patch | 156 ++++++++++++++---------- series | 2 + 4 files changed, 417 insertions(+), 64 deletions(-) create mode 100644 drag-move-fixes.patch create mode 100644 saveSearchHistory-fixes.patch diff --git a/drag-move-fixes.patch b/drag-move-fixes.patch new file mode 100644 index 0000000..a714296 --- /dev/null +++ b/drag-move-fixes.patch @@ -0,0 +1,45 @@ +--- + + source/tabDragDrop.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --quilt old/source/tabDragDrop.c new/source/tabDragDrop.c +--- old/source/tabDragDrop.c ++++ new/source/tabDragDrop.c +@@ -25,7 +25,9 @@ + * * + *******************************************************************************/ + ++#include + #include "tabDragDrop.h" ++#include "preferences.h" + #include "window.h" + + #include +@@ -198,7 +200,7 @@ static void createTabDragCursor(Widget t + { + /* create drag icon widget */ + Widget topLevelWidget = NULL, x = tabWidget; +- while (x = XtParent(x)) ++ while ((x = XtParent(x))) + topLevelWidget = x; + diInfo.dragIcon = XmCreateDragIcon(topLevelWidget, "tabDragIcon", dropIconArgs, n); + } +@@ -457,7 +459,7 @@ static void tabDragProc(Widget widget, X + + /* calculate position and dimensions for the insertion site */ + int spacing = 0; +- XtVaGetValues(tabBar, XmNspacing, &spacing, 0); ++ XtVaGetValues(tabBar, XmNspacing, &spacing, NULL); + + XWindowAttributes attrs; + XGetWindowAttributes(TheDisplay, XtWindow(tab), &attrs); +@@ -490,7 +492,7 @@ static void tabDragProc(Widget widget, X + lastTabBar = tabBar; + + /* copy inverted image of the insertion site*/ +- XGCValues gcVals = {}; ++ XGCValues gcVals; + GC gc1 = XCreateGC(TheDisplay, XtWindow(tabBar), 0, &gcVals); + gcVals.function = GXnor; + XChangeGC(TheDisplay, gc1, GCFunction, &gcVals); diff --git a/saveSearchHistory-fixes.patch b/saveSearchHistory-fixes.patch new file mode 100644 index 0000000..960fac8 --- /dev/null +++ b/saveSearchHistory-fixes.patch @@ -0,0 +1,278 @@ +--- + + source/Makefile.dependencies | 4 +- + source/menu.c | 5 ++- + source/nedit.h | 2 - + source/preferences.c | 10 +++--- + source/preferences.h | 2 + + source/search.c | 62 ++++++++++++++++++++++++------------------- + 6 files changed, 49 insertions(+), 36 deletions(-) + +diff --quilt old/source/Makefile.dependencies new/source/Makefile.dependencies +--- old/source/Makefile.dependencies ++++ new/source/Makefile.dependencies +@@ -32,7 +32,7 @@ nc.o: nc.c server_common.h ../util/fileU + ../util/prefFile.h ../util/system.h ../util/clearcase.h + nedit.o: nedit.c nedit.h textBuf.h file.h preferences.h regularExp.h \ + selection.h tags.h menu.h macro.h server.h window.h interpret.h ops.h \ +- rbTree.h parse.h help.h help_topic.h ../util/misc.h \ ++ search.h rbTree.h parse.h help.h help_topic.h ../util/misc.h \ + ../util/printUtils.h ../util/fileUtils.h ../util/getfiles.h + preferences.o: preferences.c preferences.h nedit.h textBuf.h text.h \ + search.h window.h userCmds.h highlight.h highlightData.h help.h \ +@@ -46,7 +46,7 @@ regexConvert.o: regexConvert.c regexConv + regularExp.o: regularExp.c regularExp.h + search.o: search.c search.h nedit.h textBuf.h regularExp.h text.h \ + server.h window.h preferences.h file.h highlight.h ../util/DialogF.h \ +- ../util/misc.h ++ ../util/misc.h ../util/utils.h + selection.o: selection.c selection.h nedit.h textBuf.h text.h file.h \ + window.h menu.h server.h ../util/DialogF.h ../util/fileUtils.h macro.h + server.o: server.c server.h window.h nedit.h textBuf.h file.h selection.h \ +diff --quilt old/source/menu.c new/source/menu.c +--- old/source/menu.c ++++ new/source/menu.c +@@ -2308,9 +2308,10 @@ static void saveSearchHistoryDefCB(Widge + + /* Set the preference and make the other windows' menus agree */ + SetPrefSaveSearchHistory(state); +- for (win=WindowList; win!=NULL; win=win->next) { +- if (IsTopDocument(win)) ++ for (win = WindowList; win != NULL; win = win->next) { ++ if (IsTopDocument(win)) { + XmToggleButtonSetState(win->saveSearchHistoryDefItem, state, False); ++ } + } + } + +diff --quilt old/source/preferences.c new/source/preferences.c +--- old/source/preferences.c ++++ new/source/preferences.c +@@ -276,7 +276,7 @@ static struct prefData { + int autoIndent; /* style for auto-indent */ + int autoSave; /* whether automatic backup feature is on */ + int saveOldVersion; /* whether to preserve a copy of last version */ +- int saveSearchHistory; /* whether to store search/replace history */ ++ int saveSearchHistory; /* whether to store search/replace history */ + int searchDlogs; /* whether to show explanatory search dialogs */ + int searchWrapBeep; /* 1=beep when search restarts at begin/end */ + int keepSearchDlogs; /* whether to retain find and replace dialogs */ +@@ -1800,14 +1800,14 @@ int GetPrefSaveOldVersion(void) + return PrefData.saveOldVersion; + } + +-void SetPrefSaveSearchHistory(int state) ++void SetPrefSaveSearchHistory(Boolean state) + { +- setIntPref(&PrefData.saveSearchHistory, state); ++ setIntPref(&PrefData.saveSearchHistory, !!state); + } + +-int GetPrefSaveSearchHistory(void) ++Boolean GetPrefSaveSearchHistory(void) + { +- return PrefData.saveSearchHistory; ++ return (Boolean)!!PrefData.saveSearchHistory; + } + + void SetPrefSearchDlogs(int state) +diff --quilt old/source/preferences.h new/source/preferences.h +--- old/source/preferences.h ++++ new/source/preferences.h +@@ -105,6 +105,8 @@ void SetPrefAutoSave(int state); + int GetPrefAutoSave(void); + void SetPrefSaveOldVersion(int state); + int GetPrefSaveOldVersion(void); ++void SetPrefSaveSearchHistory(Boolean state); ++Boolean GetPrefSaveSearchHistory(void); + void SetPrefRows(int nRows); + int GetPrefRows(void); + void SetPrefCols(int nCols); +diff --quilt old/source/search.c new/source/search.c +--- old/source/search.c ++++ new/source/search.c +@@ -4706,9 +4706,10 @@ static void enableFindAgainCmds(void) + { + WindowInfo *w; + +- for (w=WindowList; w!=NULL; w=w->next) { +- if (!IsTopDocument(w)) ++ for (w = WindowList; w != NULL; w = w->next) { ++ if (!IsTopDocument(w)) { + continue; ++ } + XtSetSensitive(w->findAgainItem, True); + XtSetSensitive(w->replaceFindAgainItem, True); + XtSetSensitive(w->replaceAgainItem, True); +@@ -4737,8 +4738,9 @@ void WriteSearchHistory(void) + int i; + + /* If the Save Search-History option is disabled, just return */ +- if (!GetPrefSaveSearchHistory()) ++ if (!GetPrefSaveSearchHistory()) { + return; ++ } + + /* open the file */ + if ((fp = fopen(fullName, "w")) == NULL) { +@@ -4750,8 +4752,9 @@ void WriteSearchHistory(void) + beginning of file. + By calling ftruncate(), we discard the old contents and avoid + trailing garbage in the file if the new contents is shorter. */ +- if ((fp = fopen(fullName, "r+")) == NULL) ++ if ((fp = fopen(fullName, "r+")) == NULL) { + return; ++ } + if (ftruncate(fileno(fp), 0) != 0) { + fclose(fp); + return; +@@ -4765,10 +4768,11 @@ void WriteSearchHistory(void) + for (i = NHist; i >= 1; i--) { + searchStr = SearchHistory[historyIndex(i)]; + replaceStr = ReplaceHistory[historyIndex(i)]; +- fprintf(fp, "%d:%d:%d\n%s%s\n", +- SearchTypeHistory[historyIndex(i)], +- strlen(searchStr), strlen(replaceStr), +- searchStr, replaceStr); ++ fprintf(fp, "%d:%u:%u\n%s%s\n", ++ SearchTypeHistory[historyIndex(i)], ++ (unsigned)strlen(searchStr), ++ (unsigned)strlen(replaceStr), ++ searchStr, replaceStr); + } + fclose(fp); + +@@ -4790,13 +4794,14 @@ void ReadSearchHistory(void) + const char *fullName = GetRCFileName(SEARCH_HISTORY); + struct stat attribute; + char line[SEARCHMAX + 1]; +- size_t lineLen, searchLen, replaceLen; ++ unsigned lineLen, searchLen, replaceLen; + int type; + FILE *fp; + + /* If the save search history option is disabled, just return */ +- if (!GetPrefSaveSearchHistory()) ++ if (!GetPrefSaveSearchHistory()) { + return; ++ } + + /* Stat history file to see whether someone touched it after this + session last changed it. */ +@@ -4810,15 +4815,17 @@ void ReadSearchHistory(void) + } + } else { + /* stat() failed, probably for non-exiting history database. */ +- if (ENOENT != errno) ++ if (ENOENT != errno) { + fprintf(stderr, "NEdit: Error reading file %s (%s)\n", +- fullName, strerror(errno)); ++ fullName, strerror(errno)); ++ } + return; + } + + /* open the file */ +- if ((fp = fopen(fullName, "r")) == NULL) ++ if ((fp = fopen(fullName, "r")) == NULL) { + return; ++ } + + /* Clear previous list */ + while (0 != NHist) { +@@ -4842,15 +4849,14 @@ void ReadSearchHistory(void) + } + line[--lineLen] = '\0'; + +- if (sscanf(line, "%d:%d:%d", &type, &searchLen, &replaceLen) != 3) { ++ if (sscanf(line, "%d:%u:%u", &type, &searchLen, &replaceLen) != 3) { + fprintf(stderr, "NEdit: Invalid line in file %s\n", fullName); + break; + } + +- SearchTypeHistory[HistStart]=type; +- if (type < 0 || type >= N_SEARCH_TYPES +- || searchLen < 0 || searchLen > SEARCHMAX +- || replaceLen < 0 || replaceLen > SEARCHMAX) { ++ SearchTypeHistory[HistStart] = type; ++ if (type < 0 || type >= N_SEARCH_TYPES || ++ searchLen > SEARCHMAX || replaceLen > SEARCHMAX) { + fprintf(stderr, "NEdit: Invalid values in file %s\n", fullName); + break; + } +@@ -4860,42 +4866,45 @@ void ReadSearchHistory(void) + if (NHist == MAX_SEARCH_HISTORY) { + XtFree(SearchHistory[HistStart]); + XtFree(ReplaceHistory[HistStart]); +- } else ++ } else { + NHist++; ++ } + + /* read and store search-string */ + if (fread(line, 1, searchLen, fp) != searchLen) { + fprintf(stderr, "NEdit: Error reading file %s (%s)\n", +- fullName, strerror(errno)); ++ fullName, strerror(errno)); + NHist--; + break; + } +- line[searchLen]='\0'; ++ line[searchLen] = '\0'; + SearchHistory[HistStart] = XtMalloc(searchLen + 1); + strcpy(SearchHistory[HistStart], line); + + /* read and store replace-string */ + if (fread(line, 1, replaceLen, fp) != replaceLen) { + fprintf(stderr, "NEdit: Error reading file %s (%s)\n", +- fullName, strerror(errno)); ++ fullName, strerror(errno)); + NHist--; + break; + } +- line[replaceLen]='\0'; ++ line[replaceLen] = '\0'; + ReplaceHistory[HistStart] = XtMalloc(replaceLen + 1); + strcpy(ReplaceHistory[HistStart], line); + + /* There will be another '\n' left, but this is read and + ignored by the next loop as empty line. */ + +- if (++HistStart >= MAX_SEARCH_HISTORY) ++ if (++HistStart >= MAX_SEARCH_HISTORY) { + HistStart = 0; ++ } + } + fclose(fp); + + /* If there are history items, enable Find/Replace Again commands */ +- if (NHist) ++ if (NHist) { + enableFindAgainCmds(); ++ } + } + + /* +@@ -4947,8 +4956,9 @@ static void saveSearchHistory(const char + currentItemIsIncremental = isIncremental; + + /* Enable Find/Replace Again commands on first call */ +- if (NHist == 0) ++ if (NHist == 0) { + enableFindAgainCmds(); ++ } + + /* Refresh search/replace history where two sessions overwrite each + other's changes in the history file. */ +diff --quilt old/source/nedit.h new/source/nedit.h +--- old/source/nedit.h ++++ new/source/nedit.h +@@ -406,7 +406,7 @@ typedef struct _WindowInfo { + Widget searchDlogsDefItem; + Widget beepOnSearchWrapDefItem; + Widget keepSearchDlogsDefItem; +- Widget saveSearchHistoryDefItem; ++ Widget saveSearchHistoryDefItem; + Widget searchWrapsDefItem; + Widget showCursorlineItem; + Widget appendLFItem; diff --git a/saveSearchHistory.patch b/saveSearchHistory.patch index ada4bd5..bb979e5 100644 --- a/saveSearchHistory.patch +++ b/saveSearchHistory.patch @@ -1,26 +1,26 @@ --- - source/menu.c | 17 ++++ + source/menu.c | 17 +++ source/nedit.c | 5 + source/nedit.h | 1 - source/preferences.c | 13 +++ - source/search.c | 211 ++++++++++++++++++++++++++++++++++++++++++++++++--- + source/preferences.c | 13 ++ + source/search.c | 238 ++++++++++++++++++++++++++++++++++++++++++++++++--- source/search.h | 2 util/utils.c | 8 - - util/utils.h | 2 - 8 files changed, 243 insertions(+), 16 deletions(-) + util/utils.h | 3 + 8 files changed, 271 insertions(+), 16 deletions(-) diff --quilt old/source/menu.c new/source/menu.c --- old/source/menu.c +++ new/source/menu.c -@@ -189,6 +189,7 @@ static void beepOnSearchWrapDefCB(Widget +@@ -188,6 +188,7 @@ static void searchDlogsDefCB(Widget w, W + static void beepOnSearchWrapDefCB(Widget w, WindowInfo *window, caddr_t callData); static void keepSearchDlogsDefCB(Widget w, WindowInfo *window, caddr_t callData); - static void searchWrapsDefCB(Widget w, WindowInfo *window, caddr_t callData); +static void saveSearchHistoryDefCB(Widget w, WindowInfo *window, caddr_t callData); + static void searchWrapsDefCB(Widget w, WindowInfo *window, caddr_t callData); static void showCursorlineCB(Widget widget, WindowInfo *window, caddr_t callData); - static void appendLFCB(Widget w, WindowInfo* window, caddr_t callData); @@ -941,6 +942,9 @@ Widget CreateMenuBar(Widget parent, Wind window->keepSearchDlogsDefItem = createMenuToggle(subSubPane, "keepDialogsUp", "Keep Dialogs Up", 'K', @@ -80,7 +80,7 @@ diff --quilt old/source/nedit.h new/source/nedit.h Widget searchDlogsDefItem; Widget beepOnSearchWrapDefItem; Widget keepSearchDlogsDefItem; -+ Widget saveSearchHistoryDefItem; ++ Widget saveSearchHistoryDefItem; Widget searchWrapsDefItem; Widget showCursorlineItem; Widget appendLFItem; @@ -91,7 +91,7 @@ diff --quilt old/source/preferences.c new/source/preferences.c int autoIndent; /* style for auto-indent */ int autoSave; /* whether automatic backup feature is on */ int saveOldVersion; /* whether to preserve a copy of last version */ -+ int saveSearchHistory; /* whether to store search/replace history */ ++ int saveSearchHistory; /* whether to store search/replace history */ int searchDlogs; /* whether to show explanatory search dialogs */ int searchWrapBeep; /* 1=beep when search restarts at begin/end */ int keepSearchDlogs; /* whether to retain find and replace dialogs */ @@ -178,7 +178,7 @@ diff --quilt old/source/search.c new/source/search.c /* start the search history mechanism at the current history item */ window->fHistIndex = 0; -@@ -4686,6 +4700,179 @@ static Boolean replaceUsingRE(const char +@@ -4686,6 +4700,205 @@ static Boolean replaceUsingRE(const char } /* @@ -199,10 +199,21 @@ diff --quilt old/source/search.c new/source/search.c + +/* +** Write dynamic database of search/replace history. ++** ++** Format: ++** type:search-len:replace-len\nsearch-stringreplace-string\n ++** ++** type ............ search flags (int as string) ++** search-len ...... length of search-string (int as string) ++** replace-len ..... length of replace-string (int as string) ++** search-string ... binary data of search string ++** replace-string .. binary data of replace string ++** +*/ +void WriteSearchHistory(void) +{ -+ const char* fullName = GetRCFileName(SEARCH_HISTORY); ++ const char *fullName = GetRCFileName(SEARCH_HISTORY); ++ const char *searchStr, *replaceStr; + struct stat attribute; + FILE *fp; + int i; @@ -221,9 +232,8 @@ diff --quilt old/source/search.c new/source/search.c + beginning of file. + By calling ftruncate(), we discard the old contents and avoid + trailing garbage in the file if the new contents is shorter. */ -+ if ((fp = fopen(fullName, "r+")) == NULL) { ++ if ((fp = fopen(fullName, "r+")) == NULL) + return; -+ } + if (ftruncate(fileno(fp), 0) != 0) { + fclose(fp); + return; @@ -233,12 +243,15 @@ diff --quilt old/source/search.c new/source/search.c +#endif + } + -+ /* Write the list of search-/replace-strings and types */ -+ for (i = NHist; i >= 1; i--) -+ fprintf(fp, "%s\t%s\t%d\n", -+ SearchHistory[historyIndex(i)], -+ ReplaceHistory[historyIndex(i)], -+ SearchTypeHistory[historyIndex(i)]); ++ /* Write list of search-/replace-strings and types to the file */ ++ for (i = NHist; i >= 1; i--) { ++ searchStr = SearchHistory[historyIndex(i)]; ++ replaceStr = ReplaceHistory[historyIndex(i)]; ++ fprintf(fp, "%d:%d:%d\n%s%s\n", ++ SearchTypeHistory[historyIndex(i)], ++ strlen(searchStr), strlen(replaceStr), ++ searchStr, replaceStr); ++ } + fclose(fp); + + /* Stat history file to store our own write time. */ @@ -249,17 +262,19 @@ diff --quilt old/source/search.c new/source/search.c +} + +/* -+** Read database of search/replace history. ++** Read database of search/replace history. ++** ++** For more information see WriteSearchHistory(). ++** +*/ +void ReadSearchHistory(void) +{ + const char *fullName = GetRCFileName(SEARCH_HISTORY); + struct stat attribute; ++ char line[SEARCHMAX + 1]; ++ size_t lineLen, searchLen, replaceLen; ++ int type; + FILE *fp; -+ char line[2*SEARCHMAX + 5]; /* search-, reapeat-string, type + 2 tabs */ -+ char *pos[3]; -+ size_t lineLen; -+ int i; + + /* If the save search history option is disabled, just return */ + if (!GetPrefSaveSearchHistory()) @@ -278,7 +293,8 @@ diff --quilt old/source/search.c new/source/search.c + } else { + /* stat() failed, probably for non-exiting history database. */ + if (ENOENT != errno) -+ perror("nedit: Error reading search/replace history database"); ++ fprintf(stderr, "NEdit: Error reading file %s (%s)\n", ++ fullName, strerror(errno)); + return; + } + @@ -295,59 +311,69 @@ diff --quilt old/source/search.c new/source/search.c + HistStart = 0; + + /* read lines of the file */ -+ while (True) { -+ if (fgets(line, sizeof(line), fp) == NULL) { -+ /* end of file */ -+ fclose(fp); -+ break; -+ } ++ while (fgets(line, sizeof(line), fp) != NULL) { + lineLen = strlen(line); -+ if (lineLen == 0) { -+ /* blank line */ ++ if (lineLen == 0 || line[0] == '\n' || line[0] == '#') { ++ /* blank line or comment */ + continue; + } + if (line[lineLen - 1] != '\n') { + /* no newline, probably truncated */ -+ fprintf(stderr, "nedit: Line too long in history file\n"); -+ while (fgets(line, sizeof(line), fp) != NULL) { -+ lineLen = strlen(line); -+ if (lineLen > 0 && line[lineLen - 1] == '\n') -+ break; -+ } -+ continue; ++ fprintf(stderr, "NEdit: Line too long in file %s\n", fullName); ++ break; + } + line[--lineLen] = '\0'; + -+ /* split line (Is there any function for this in the project?) */ -+ pos[0] = line; -+ for (i = 1; i < 3; i++) { -+ pos[i] = strchr(pos[i-1], '\t'); -+ if (pos[i]) { -+ pos[i][0]='\0'; -+ pos[i]++; -+ } else { -+ /* invalid line */ -+ continue; -+ } ++ if (sscanf(line, "%d:%d:%d", &type, &searchLen, &replaceLen) != 3) { ++ fprintf(stderr, "NEdit: Invalid line in file %s\n", fullName); ++ break; ++ } ++ ++ SearchTypeHistory[HistStart]=type; ++ if (type < 0 || type >= N_SEARCH_TYPES ++ || searchLen < 0 || searchLen > SEARCHMAX ++ || replaceLen < 0 || replaceLen > SEARCHMAX) { ++ fprintf(stderr, "NEdit: Invalid values in file %s\n", fullName); ++ break; + } + + /* If there are more than MAX_SEARCH_HISTORY strings saved, recycle -+ some space, free the entry that's about to be overwritten */ ++ some space, free the entry that's about to be overwritten */ + if (NHist == MAX_SEARCH_HISTORY) { + XtFree(SearchHistory[HistStart]); + XtFree(ReplaceHistory[HistStart]); + } else + NHist++; + -+ /* store search-/replace-string and type */ -+ SearchHistory[HistStart] = XtMalloc(strlen(pos[0]) + 1); -+ ReplaceHistory[HistStart] = XtMalloc(strlen(pos[1]) + 1); -+ strcpy(SearchHistory[HistStart], pos[0]); -+ strcpy(ReplaceHistory[HistStart], pos[1]); -+ SearchTypeHistory[HistStart] = atoi(pos[2]); ++ /* read and store search-string */ ++ if (fread(line, 1, searchLen, fp) != searchLen) { ++ fprintf(stderr, "NEdit: Error reading file %s (%s)\n", ++ fullName, strerror(errno)); ++ NHist--; ++ break; ++ } ++ line[searchLen]='\0'; ++ SearchHistory[HistStart] = XtMalloc(searchLen + 1); ++ strcpy(SearchHistory[HistStart], line); ++ ++ /* read and store replace-string */ ++ if (fread(line, 1, replaceLen, fp) != replaceLen) { ++ fprintf(stderr, "NEdit: Error reading file %s (%s)\n", ++ fullName, strerror(errno)); ++ NHist--; ++ break; ++ } ++ line[replaceLen]='\0'; ++ ReplaceHistory[HistStart] = XtMalloc(replaceLen + 1); ++ strcpy(ReplaceHistory[HistStart], line); ++ ++ /* There will be another '\n' left, but this is read and ++ ignored by the next loop as empty line. */ ++ + if (++HistStart >= MAX_SEARCH_HISTORY) + HistStart = 0; + } ++ fclose(fp); + + /* If there are history items, enable Find/Replace Again commands */ + if (NHist) @@ -358,7 +384,7 @@ diff --quilt old/source/search.c new/source/search.c ** Store the search and replace strings, and search type for later recall. ** If replaceString is NULL, duplicate the last replaceString used. ** Contiguous incremental searches share the same history entry (each new -@@ -4698,7 +4885,6 @@ static void saveSearchHistory(const char +@@ -4698,7 +4911,6 @@ static void saveSearchHistory(const char { char *sStr, *rStr; static int currentItemIsIncremental = FALSE; @@ -366,10 +392,11 @@ diff --quilt old/source/search.c new/source/search.c /* Cancel accumulation of contiguous incremental searches (even if the information is not worthy of saving) if search is not incremental */ -@@ -4727,19 +4913,19 @@ static void saveSearchHistory(const char +@@ -4727,19 +4939,20 @@ static void saveSearchHistory(const char XtFree(SearchHistory[historyIndex(1)]); SearchHistory[historyIndex(1)] = XtNewString(searchString); SearchTypeHistory[historyIndex(1)] = searchType; ++ + /* Save history to file */ + WriteSearchHistory(); return; @@ -396,7 +423,7 @@ diff --quilt old/source/search.c new/source/search.c /* If there are more than MAX_SEARCH_HISTORY strings saved, recycle some space, free the entry that's about to be overwritten */ -@@ -4761,6 +4947,9 @@ static void saveSearchHistory(const char +@@ -4761,6 +4974,9 @@ static void saveSearchHistory(const char HistStart++; if (HistStart >= MAX_SEARCH_HISTORY) HistStart = 0; @@ -440,12 +467,13 @@ diff --quilt old/util/utils.c new/util/utils.c diff --quilt old/util/utils.h new/util/utils.h --- old/util/utils.h +++ new/util/utils.h -@@ -72,7 +72,7 @@ void Push(Stack* stack, const void* valu +@@ -72,7 +72,8 @@ void Push(Stack* stack, const void* valu void* Pop(Stack* stack); /* N_FILE_TYPES must be the last entry!! This saves us from counting. */ -enum {NEDIT_RC, AUTOLOAD_NM, NEDIT_HISTORY, NEDIT_DICT, N_FILE_TYPES}; -+enum {NEDIT_RC, AUTOLOAD_NM, NEDIT_HISTORY, NEDIT_DICT, SEARCH_HISTORY, N_FILE_TYPES}; ++enum {NEDIT_RC, AUTOLOAD_NM, NEDIT_HISTORY, NEDIT_DICT, SEARCH_HISTORY, ++ N_FILE_TYPES}; /* If anyone knows where to get this from system include files (in a machine independent way), please change this (L_cuserid is apparently not ANSI) */ diff --git a/series b/series index b5e9341..91c58fd 100644 --- a/series +++ b/series @@ -145,5 +145,7 @@ FP-redux.patch last-op.patch DISASM_RT-in-ContinueMacro.patch drag-move.patch +drag-move-fixes.patch ewmh-raise.diff saveSearchHistory.patch +saveSearchHistory-fixes.patch -- 2.11.4.GIT