diff -u -r nano/src/files.c nano-boo/src/files.c --- nano/src/files.c 2004-08-06 15:27:57.000000000 -0400 +++ nano-boo/src/files.c 2004-08-06 16:09:33.000000000 -0400 @@ -338,8 +338,9 @@ return; } -/* Open the file (and decide if it exists). */ -int open_file(const char *filename, int insert, int quiet) +/* Open the file (and decide if it exists). Return TRUE on success, + * FALSE on failure. */ +bool open_file(const char *filename, int insert, int quiet) { int fd; FILE *f; @@ -348,7 +349,7 @@ if (filename[0] == '\0' || stat(filename, &fileinfo) == -1) { if (insert && !quiet) { statusbar(_("\"%s\" not found"), filename); - return -1; + return FALSE; } else { /* We have a new file */ statusbar(_("New File")); @@ -361,7 +362,7 @@ _("File \"%s\" is a device file"), filename); if (!insert) new_file(); - return -1; + return FALSE; } else if ((fd = open(filename, O_RDONLY)) == -1) { /* If we're in multibuffer mode, don't be quiet when an error occurs while opening a file */ @@ -373,7 +374,7 @@ statusbar("%s: %s", strerror(errno), filename); if (!insert) new_file(); - return -1; + return FALSE; } else { /* File is A-OK */ if (!quiet) statusbar(_("Reading File")); @@ -381,7 +382,7 @@ if (f == NULL) { nperror("fdopen"); close(fd); - return -1; + return FALSE; } read_file(f, filename, quiet); #ifndef NANO_SMALL @@ -389,7 +390,7 @@ #endif } - return 1; + return TRUE; } /* This function will return the name of the first available extension @@ -426,6 +427,8 @@ void do_insertfile(int loading_file) { int i, old_current_x = current_x; + bool opened; + /* True if the file opened successfully. */ char *realname = NULL; static char *inspath = NULL; @@ -550,14 +553,13 @@ #ifndef NANO_SMALL if (i == NANO_EXTCMD_KEY) { realname = mallocstrcpy(realname, ""); - i = open_pipe(answer); - } else { + opened = open_pipe(answer); + } else #endif + { realname = real_dir_from_tilde(answer); - i = open_file(realname, TRUE, loading_file); -#ifndef NANO_SMALL + opened = open_file(realname, TRUE, loading_file); } -#endif #ifdef ENABLE_MULTIBUFFER if (loading_file) { @@ -566,7 +568,7 @@ created to hold the file), reload the buffer we had open before, and skip the insertion; otherwise, save realname in filename and continue the insertion */ - if (i == -1) { + if (!opened) { free(realname); free(fileage); load_open_file(); @@ -597,20 +599,11 @@ /* And re-init the shortcut list */ shortcut_init(FALSE); - } -#endif - -#ifdef ENABLE_MULTIBUFFER - if (!loading_file) { + } else #endif - /* Restore the old x-coordinate position */ current_x = old_current_x; -#ifdef ENABLE_MULTIBUFFER - } -#endif - /* If we've gone off the bottom, recenter; otherwise, just redraw */ edit_refresh(); @@ -2675,8 +2668,12 @@ case NANO_HELP_KEY: case NANO_HELP_FKEY: case '?': /* Pico compatibility */ +#ifndef DISABLE_HELP do_help(); curs_set(0); +#else + nano_disabled_msg(); +#endif break; case NANO_ENTER_KEY: case 'S': /* Pico compatibility */ diff -u -r nano/src/global.c nano-boo/src/global.c --- nano/src/global.c 2004-08-02 17:31:13.000000000 -0400 +++ nano-boo/src/global.c 2004-08-06 16:12:54.000000000 -0400 @@ -282,25 +282,31 @@ const char *nano_tab_msg = N_("Insert a tab character"); const char *nano_enter_msg = N_("Insert a carriage return at the cursor position"); +#ifndef NANO_SMALL const char *nano_nextword_msg = N_("Move forward one word"); const char *nano_prevword_msg = N_("Move backward one word"); +#endif const char *nano_verbatim_msg = N_("Insert character(s) verbatim"); #ifdef ENABLE_MULTIBUFFER const char *nano_openprev_msg = N_("Switch to previous file buffer"); const char *nano_opennext_msg = N_("Switch to next file buffer"); #endif -#if !defined(NANO_SMALL) && defined(HAVE_REGEX_H) +#ifndef NANO_SMALL +#ifdef HAVE_REGEX_H const char *nano_bracket_msg = N_("Find other bracket"); #endif const char *nano_whereis_next_msg = N_("Repeat last search"); +#endif const char *nano_cancel_msg = N_("Cancel the current function"); const char *nano_firstline_msg = N_("Go to the first line of the file"); const char *nano_lastline_msg = N_("Go to the last line of the file"); +#ifndef DISABLE_JUSTIFY const char *nano_parabegin_msg = N_("Go to the beginning of the current paragraph"); const char *nano_paraend_msg = N_("Go to the end of the current paragraph"); const char *nano_fulljustify_msg = N_("Justify the entire file"); +#endif #ifndef NANO_SMALL const char *nano_case_msg = N_("Make the current search/replace case (in)sensitive"); diff -u -r nano/src/nano.c nano-boo/src/nano.c --- nano/src/nano.c 2004-08-06 15:27:59.000000000 -0400 +++ nano-boo/src/nano.c 2004-08-06 16:00:47.000000000 -0400 @@ -861,7 +861,7 @@ f = fdopen(fd[0], "rb"); if (f == NULL) nperror("fdopen"); - + read_file(f, "stdin", FALSE); /* If multibuffer mode is on, we could be here in view mode. If so, * don't set the modification flag. */ @@ -912,6 +912,7 @@ xcur = actual_x(current->data, get_page_start(xplustabs()) + mouse_x); +#ifndef NANO_SMALL /* Selecting where the cursor is toggles the mark, as does selecting beyond the line length with the cursor at the end of the line. */ @@ -922,6 +923,7 @@ } do_mark(); } +#endif current_x = xcur; placewewant = xplustabs(); @@ -1078,7 +1080,9 @@ delete_node(foo); renumber(current); totlines--; +#ifndef DISABLE_WRAPPING wrap_reset(); +#endif } else return; @@ -1799,16 +1803,15 @@ /* In case the line got shorter, assign mark_beginx. */ mark_beginx = current_x; SET(MARK_ISSET); - } else { + } else #endif + { /* Only reload the temp file if it isn't a marked selection. */ free_filestruct(fileage); terminal_init(); global_init(TRUE); open_file(tempfile_name, FALSE, TRUE); -#ifndef NANO_SMALL } -#endif /* Go back to the old position, mark the file as modified, and make * sure that the titlebar is refreshed. */ @@ -1967,7 +1970,7 @@ regmatch_t matches; int rc = regexec("ereg, line, 1, &matches, 0); - if (rc == REG_NOMATCH || matches.rm_so == (regoff_t)-1) + if (rc == REG_NOMATCH || matches.rm_so == (regoff_t) -1) return 0; /* matches.rm_so should be 0, since the quote string should start * with the caret ^. */ diff -u -r nano/src/proto.h nano-boo/src/proto.h --- nano/src/proto.h 2004-08-06 15:19:47.000000000 -0400 +++ nano-boo/src/proto.h 2004-08-06 15:54:27.000000000 -0400 @@ -165,7 +165,7 @@ filestruct *read_line(char *buf, filestruct *prev, int *line1ins, size_t len); void read_file(FILE *f, const char *filename, int quiet); -int open_file(const char *filename, int insert, int quiet); +bool open_file(const char *filename, int insert, int quiet); char *get_next_filename(const char *name); void do_insertfile(int loading_file); void do_insertfile_void(void); @@ -352,9 +352,7 @@ #ifndef NANO_SMALL void do_toggle(const toggle *which); #endif -#if !defined(NANO_SMALL) || defined(USE_SLANG) void disable_signals(void); -#endif #ifndef NANO_SMALL void enable_signals(void); #endif