and newlines, condense three statements into one, place an #endif
better, melt two #ifndefs into one, and add a comment.
* src/winio.c (edit_scroll) - Remove the old softwrap scrolling code.
+ * src/{nano.h,proto.h,color.c,cut.c,files.c,global.c,help.c,nano.c,
+ search.c,text.c,utils.c} - Add, fix, and remove some #endif comments,
+ remove an obsolete comment, and remove some superfluous #ifndefs.
2014-03-16 Benno Schulenberg <bensberg@justemail.net>
* src/nano.h - Display more help items when the terminal is wider.
#ifdef DEBUG
fprintf(stderr, "No match using extension, trying libmagic...\n");
-#endif /* DEBUG */
+#endif
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
tmpsyntax = tmpsyntax->next) {
}
#ifdef DEBUG
fprintf(stderr,"Matching regex \"%s\" against \"%s\"\n",e->ext_regex, magicstring);
-#endif /* DEBUG */
+#endif
if (magicstring && regexec(e->ext, magicstring, 0, NULL, 0) == 0) {
openfile->syntax = tmpsyntax;
keep_cutbuffer = TRUE;
#ifndef NANO_TINY
-
if (cut_till_end) {
/* If cut_till_end is TRUE, move all text up to the end of the
* file into the cutbuffer. */
/* Leave the text in the cutbuffer, and mark the file as
* modified. */
-#ifndef NANO_TINY
if (!copy_text) {
-#endif
set_modified();
-#ifndef NANO_TINY
}
-#endif
-#endif
+#endif /* !NANO_TINY */
/* Update the screen. */
edit_refresh_needed = TRUE;
/* Cut from the current cursor position to the end of the file. */
void do_cut_till_end(void)
{
-#ifndef NANO_TINY
add_undo(CUT);
-#endif
do_cut_text(FALSE, TRUE, FALSE);
}
#endif /* !NANO_TINY */
#ifdef DEBUG
fprintf(stderr, "In write_lockfile(), write successful (wrote %d bytes)\n", wroteamt);
-#endif /* DEBUG */
+#endif
if (fclose(filestream) == EOF) {
statusbar(_("Error writing lock file %s: %s"),
locking_prefix, lockbase, locking_suffix);
#ifdef DEBUG
fprintf(stderr, "lock file name is %s\n", lockfilename);
-#endif /* DEBUG */
+#endif
if (stat(lockfilename, &fileinfo) != -1) {
ssize_t readtot = 0;
ssize_t readamt = 0;
lockprog);
fprintf(stderr, "user which created this lock file should be %s\n",
lockuser);
-#endif /* DEBUG */
+#endif
sprintf(promptstr, "File being edited (by %s, PID %d, user %s), continue?",
lockprog, lockpid, lockuser);
ans = do_yesno_prompt(FALSE, promptstr);
return write_lockfile(lockfilename, filename, FALSE);
}
-#endif /* NANO_TINY */
+#endif /* !NANO_TINY */
/* If it's not "", filename is a file to open. We make a new buffer, if
backup_dir = full_backup_dir;
}
}
-#endif
+#endif /* !NANO_TINY */
/* Read from inn, write to out. We assume inn is opened for reading,
* and out for writing. We return 0 on success, -1 on read error, or -2
#ifndef NANO_TINY
add_to_funcs(do_research, MBROWSER, whereis_next_msg,
IFSCHELP(nano_whereis_next_msg), TRUE, VIEW);
-#endif /* NANO_TINY */
+#endif
#ifndef DISABLE_JUSTIFY
/* TRANSLATORS: Try to keep this at most 10 characters. */
add_to_funcs(do_redo, MMAIN, N_("Redo"),
IFSCHELP(nano_redo_msg), TRUE, NOVIEW);
}
-#endif
+#endif /* !NANO_TINY */
add_to_funcs(do_right, MMAIN, N_("Forward"), IFSCHELP(nano_forward_msg),
FALSE, VIEW);
add_to_funcs(new_buffer_void, MEXTCMD,
new_buffer_msg, IFSCHELP(nano_multibuffer_msg), FALSE, NOVIEW);
#endif
-#endif /* NANO_TINY */
+#endif /* !NANO_TINY */
#ifndef DISABLE_HELP
add_to_funcs(edit_refresh, MHELP,
add_to_sclist(MMAIN, "M-N", do_toggle_void, NO_CONVERT, TRUE);
add_to_sclist(MMAIN, "M-Z", do_toggle_void, SUSPEND, TRUE);
add_to_sclist(MMAIN, "M-$", do_toggle_void, SOFTWRAP, TRUE);
-#endif /* NANO_TINY */
+#endif /* !NANO_TINY */
add_to_sclist(MHELP|MBROWSER, "^C", do_exit, 0, TRUE);
add_to_sclist(MHELP, "^G", do_exit, 0, TRUE);
return "?????";
}
}
-#endif /* NANO_TINY */
+#endif /* !NANO_TINY */
/* Interpret the string given by the rc file and return a
* shortcut struct, complete with proper value for execute. */
s->execute = FALSE;
s->toggle = SUSPEND;
}
-#endif /* NANO_TINY */
+#endif /* !NANO_TINY */
else if (!strcasecmp(input, "right") ||
!strcasecmp(input, "forward"))
s->scfunc = do_right;
ptr += sprintf(ptr, "(%s)\t\t\t%s %s\n",
s->keystr, _(flagtostr(s->toggle)), _("enable/disable"));
-
#ifdef ENABLE_NANORC
if (old_whitespace)
SET(WHITESPACE_DISPLAY);
#ifndef NANO_TINY
if (ISSET(LOCKING) && openfile->lock_filename)
delete_lockfile(openfile->lock_filename);
-#endif /* NANO_TINY */
+#endif
#ifdef ENABLE_MULTIBUFFER
/* Exit only if there are no more open file buffers. */
load_poshistory();
}
#endif /* ENABLE_NANORC */
-#endif /* NANO_TINY */
+#endif /* !NANO_TINY */
#ifndef NANO_TINY
/* Set up the backup directory (unless we're using restricted mode,
struct poshiststruct *next;
} poshiststruct;
-#endif /* NANO_TINY */
+#endif /* !NANO_TINY */
typedef struct openfilestruct {
#define UNdel_backspace (1<<1)
#define UNsplit_madenew (1<<2)
-/* Since in ISO C you can't pass around function pointers anymore,
- let's make some integer macros for function names, and then I
- can go cut my wrists after writing the big switch statement
- that will necessitate. */
-
#endif /* !NANO_TINY */
#define VIEW TRUE
#ifndef NANO_TINY
void do_copy_text(void);
void do_cut_till_end(void);
-
#endif
void do_uncut_text(void);
#ifndef NANO_TINY
RETSIGTYPE handle_sigwinch(int signal);
void allow_pending_sigwinch(bool allow);
-#endif
-#ifndef NANO_TINY
void do_toggle(int flag);
void do_toggle_void(void);
#endif
openfile->current_x && !didfind)
statusbar(_("This is the only occurrence"));
} else {
-#endif
+#endif /* HAVE_REGEX_H */
statusbar(_("This is the only occurrence"));
#ifdef HAVE_REGEX_H
}
edit_redraw(fileptr, pww_save);
search_replace_abort();
}
-#endif
+#endif /* !NANO_TINY */
#ifdef HAVE_REGEX_H
int replace_regexp(char *string, bool create)
return new_line_size;
}
-#endif
+#endif /* HAVE_REGEX_H */
char *replace_line(const char *needle)
{
#endif
edit_refresh();
}
-#endif
+#endif /* !NANO_TINY */
if (canceled != NULL)
*canceled = FALSE;
openfile = tmpof;
}
}
-#endif /* NANO_TINY */
+#endif /* !NANO_TINY */
do_gotolinecolumn(curlint->lineno, tmpcol, FALSE, FALSE, FALSE, FALSE);
titlebar(NULL);
edit_refresh();
*right_side_up = FALSE;
}
}
-#endif
+#endif /* !NANO_TINY */
/* Calculate the number of characters between begin and end, and return
* it. */