* doc/syntax/po.nanorc: New file, syntax colouring for PO files.
* configure.ac: Stop --with-slang from duplicating --enable-tiny.
* configure.ac: Sort all the disabling options alphabetically.
+ * src/{proto.h,files.c,global.c,nano.c,rcfile.c}, configure.ac:
+ Convert #ifdef ENABLE_MULTIBUFFER to #ifndef DISABLE_MULTIBUFFER.
2014-04-02 Benno Schulenberg <bensberg@justemail.net>
* configure.ac, doc/Makefile.am: Try to build the info documentation
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.])
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
+ AC_DEFINE(DISABLE_MULTIBUFFER, 1, [Define this to disable multiple file buffers.])
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.])
AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab completion functions for files and search strings.])
AC_ARG_ENABLE(multibuffer,
AS_HELP_STRING([--disable-multibuffer], [Disable multiple file buffers]))
-if test "x$enable_multibuffer" != xno; then
- AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.])
+if test "x$enable_multibuffer" = xno; then
+ AC_DEFINE(DISABLE_MULTIBUFFER, 1, [Define this to disable multiple file buffers.])
fi
AC_ARG_ENABLE(nanorc,
void open_buffer(const char *filename, bool undoable)
{
bool new_buffer = (openfile == NULL
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
|| ISSET(MULTIBUFFER)
#endif
);
edit_refresh();
}
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
/* Switch to the next file buffer if next_buf is TRUE. Otherwise,
* switch to the previous file buffer. */
void switch_to_prevnext_buffer(bool next_buf)
return TRUE;
}
-#endif /* ENABLE_MULTIBUFFER */
+#endif /* !DISABLE_MULTIBUFFER */
/* A bit of a copy and paste from open_file(), is_file_writable()
* just checks whether the file is appendable as a quick
#ifndef NANO_TINY
if (execute) {
msg =
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
ISSET(MULTIBUFFER) ?
_("Command to execute in new buffer [from %s] ") :
#endif
} else {
#endif
msg =
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
ISSET(MULTIBUFFER) ?
_("File to insert into new buffer [from %s] ") :
#endif
* filename or command begins with a newline (i.e. an encoded
* null), treat it as though it's blank. */
if (i == -1 || ((i == -2 || *answer == '\n')
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
&& !ISSET(MULTIBUFFER)
#endif
)) {
s = get_shortcut(currmenu, &i, &meta_key, &func_key);
#ifndef NANO_TINY
-#ifdef ENABLE_MULTIBUFFER
-
+#ifndef DISABLE_MULTIBUFFER
if (s && s->scfunc == new_buffer_void) {
/* Don't allow toggling if we're in view mode. */
if (!ISSET(VIEW_MODE))
/* If we don't have a file yet, go back to the statusbar
* prompt. */
if (i != 0
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
&& (i != -2 || !ISSET(MULTIBUFFER))
#endif
)
}
#endif
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
if (!ISSET(MULTIBUFFER)) {
#endif
/* If we're not inserting into a new buffer, partition
openfile->current_x);
edittop_inside =
(openfile->edittop == openfile->fileage);
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
}
#endif
#ifndef NANO_TINY
if (execute) {
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
if (ISSET(MULTIBUFFER))
/* Open a blank buffer. */
open_buffer("", FALSE);
/* Save the command's output in the current buffer. */
execute_command(answer);
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
if (ISSET(MULTIBUFFER)) {
/* Move back to the beginning of the first line of
* the buffer. */
}
#endif
-#if defined(ENABLE_MULTIBUFFER) && defined(ENABLE_NANORC)
+#if !defined(DISABLE_MULTIBUFFER) && defined(ENABLE_NANORC)
if (ISSET(MULTIBUFFER)) {
/* Update the screen to account for the current
* buffer. */
return;
}
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
if (ISSET(VIEW_MODE) && !ISSET(MULTIBUFFER))
statusbar(_("Key invalid in non-multibuffer mode"));
else
const char *prepend_msg = N_("Prepend");
const char *backup_file_msg = N_("Backup File");
const char *ext_cmd_msg = N_("Execute Command");
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
const char *new_buffer_msg = N_("New Buffer");
#endif
const char *goto_dir_msg = N_("Go To Dir");
const char *nano_cancel_msg = N_("Cancel the current function");
const char *nano_help_msg = N_("Display this help text");
const char *nano_exit_msg =
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
N_("Close the current file buffer / Exit from nano")
#else
N_("Exit from nano")
const char *nano_scrolldown_msg =
N_("Scroll down one line without scrolling the cursor");
#endif
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
const char *nano_prevfile_msg =
N_("Switch to the previous file buffer");
const char *nano_nextfile_msg =
N_("Toggle backing up of the original file");
const char *nano_execute_msg = N_("Execute external command");
#endif
-#if !defined(NANO_TINY) && defined(ENABLE_MULTIBUFFER)
+#ifndef DISABLE_MULTIBUFFER
const char *nano_multibuffer_msg =
N_("Toggle the use of a new buffer");
#endif
cancel_msg, IFSCHELP(nano_cancel_msg), FALSE, VIEW);
add_to_funcs(do_exit, MMAIN,
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
/* TRANSLATORS: Try to keep this at most 10 characters. */
openfile != NULL && openfile != openfile->next ? N_("Close") :
#endif
add_to_funcs(do_insertfile_void,
/* TRANSLATORS: Try to keep this at most 10 characters. */
MMAIN, N_("Read File"), IFSCHELP(nano_insert_msg), FALSE,
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
VIEW);
#else
NOVIEW);
IFSCHELP(nano_scrolldown_msg), FALSE, VIEW);
#endif
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
add_to_funcs(switch_to_prev_buffer_void, MMAIN, N_("Previous File"),
IFSCHELP(nano_prevfile_msg), FALSE, VIEW);
add_to_funcs(switch_to_next_buffer_void, MMAIN, N_("Next File"),
add_to_funcs(ext_cmd_void, MINSERTFILE,
ext_cmd_msg, IFSCHELP(nano_execute_msg), FALSE, NOVIEW);
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
add_to_funcs(new_buffer_void, MINSERTFILE|MEXTCMD,
new_buffer_msg, IFSCHELP(nano_multibuffer_msg), FALSE, NOVIEW);
#endif
add_to_sclist(MMAIN, "M-=", do_scroll_down, 0, TRUE);
#endif
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
add_to_sclist(MMAIN, "M-<", switch_to_prev_buffer_void, 0, TRUE);
add_to_sclist(MMAIN, "M-,", switch_to_prev_buffer_void, 0, TRUE);
add_to_sclist(MMAIN, "M->", switch_to_next_buffer_void, 0, TRUE);
s->scfunc = do_home;
else if (!strcasecmp(input, "end"))
s->scfunc = do_end;
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
else if (!strcasecmp(input, "prevbuf"))
s->scfunc = switch_to_prev_buffer_void;
else if (!strcasecmp(input, "nextbuf"))
} else if (!strcasecmp(input, "backup")) {
s->scfunc = backup_file_void;
s->execute = FALSE;
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
} else if (!strcasecmp(input, "newbuffer")) {
s->scfunc = new_buffer_void;
s->execute = FALSE;
);
}
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
/* Save all of the other modified file buffers, if any. */
if (openfile != NULL) {
openfilestruct *tmp = openfile;
print_opt("-E", "--tabstospaces",
N_("Convert typed tabs to spaces"));
#endif
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
print_opt("-F", "--multibuffer", N_("Enable multiple file buffers"));
#endif
#ifdef ENABLE_NANORC
#ifdef DISABLE_MOUSE
printf(" --disable-mouse");
#endif
+#ifdef DISABLE_MULTIBUFFER
+ printf(" --disable-multibuffer");
+#endif
#ifndef ENABLE_NLS
printf(" --disable-nls");
#endif
#ifdef NANO_EXTRA
printf(" --enable-extra");
#endif
-#ifdef ENABLE_MULTIBUFFER
- printf(" --enable-multibuffer");
-#endif
#ifdef ENABLE_NANORC
printf(" --enable-nanorc");
#endif
delete_lockfile(openfile->lock_filename);
#endif
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
/* Exit only if there are no more open file buffers. */
if (!close_buffer())
#endif
bool fill_used = FALSE;
/* Was the fill option used? */
#endif
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
bool old_multibuffer;
/* The old value of the multibuffer option, restored after we
* load all files on the command line. */
const struct option long_options[] = {
{"help", 0, NULL, 'h'},
{"boldtext", 0, NULL, 'D'},
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
{"multibuffer", 0, NULL, 'F'},
#endif
#ifdef ENABLE_NANORC
SET(TABS_TO_SPACES);
break;
#endif
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
case 'F':
SET(MULTIBUFFER);
break;
optind++;
}
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
old_multibuffer = ISSET(MULTIBUFFER);
SET(MULTIBUFFER);
UNSET(VIEW_MODE);
}
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
if (!old_multibuffer)
UNSET(MULTIBUFFER);
#endif
void replace_buffer(const char *filename);
#endif
void display_buffer(void);
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
void switch_to_prevnext_buffer(bool next);
void switch_to_prev_buffer_void(void);
void switch_to_next_buffer_void(void);
#ifndef DISABLE_MOUSE
{"mouse", USE_MOUSE},
#endif
-#ifdef ENABLE_MULTIBUFFER
+#ifndef DISABLE_MULTIBUFFER
{"multibuffer", MULTIBUFFER},
#endif
{"morespace", MORE_SPACE},