2000-08-06 21:13:45 +00:00
|
|
|
/* $Id$ */
|
2000-06-06 05:53:49 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* global.c *
|
|
|
|
* *
|
2006-11-10 02:47:11 +00:00
|
|
|
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta *
|
2007-01-01 05:15:32 +00:00
|
|
|
* Copyright (C) 2005, 2006, 2007 David Lawrence Ramsey *
|
2000-06-06 05:53:49 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
2001-10-24 11:33:54 +00:00
|
|
|
* the Free Software Foundation; either version 2, or (at your option) *
|
2000-06-06 05:53:49 +00:00
|
|
|
* any later version. *
|
|
|
|
* *
|
2005-05-15 19:57:17 +00:00
|
|
|
* This program is distributed in the hope that it will be useful, but *
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
|
|
* General Public License for more details. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the Free Software *
|
2005-05-15 19:57:17 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
|
|
|
* 02110-1301, USA. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#include "proto.h"
|
|
|
|
|
2006-05-10 13:41:53 +00:00
|
|
|
/* Global variables. */
|
|
|
|
#ifndef NANO_TINY
|
2006-05-10 15:15:06 +00:00
|
|
|
sigjmp_buf jump_buf;
|
2006-11-27 07:28:52 +00:00
|
|
|
/* Used to return to either main() or the unjustify routine in
|
2006-05-10 13:41:53 +00:00
|
|
|
* do_justify() after a SIGWINCH. */
|
2006-05-10 15:15:06 +00:00
|
|
|
bool jump_buf_main = FALSE;
|
|
|
|
/* Have we set jump_buf so that we return to main() after a
|
|
|
|
* SIGWINCH? */
|
2006-05-10 13:41:53 +00:00
|
|
|
#endif
|
|
|
|
|
2003-10-03 20:26:25 +00:00
|
|
|
#ifndef DISABLE_WRAPJUSTIFY
|
2005-12-08 07:09:08 +00:00
|
|
|
ssize_t fill = 0;
|
|
|
|
/* The column where we will wrap lines. */
|
2005-07-24 19:57:51 +00:00
|
|
|
ssize_t wrap_at = -CHARS_FROM_EOL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The position where we will wrap lines. fill is equal to this
|
|
|
|
* if it's greater than zero, and equal to (COLS + this) if it
|
|
|
|
* isn't. */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
char *last_search = NULL;
|
|
|
|
/* The last string we searched for. */
|
|
|
|
char *last_replace = NULL;
|
|
|
|
/* The last replacement string we searched for. */
|
|
|
|
|
|
|
|
long flags = 0;
|
|
|
|
/* Our flag containing the states of all global options. */
|
|
|
|
WINDOW *topwin;
|
|
|
|
/* The top portion of the window, where we display the version
|
|
|
|
* number of nano, the name of the current file, and whether the
|
|
|
|
* current file has been modified. */
|
|
|
|
WINDOW *edit;
|
2006-07-28 17:06:27 +00:00
|
|
|
/* The middle portion of the window, i.e. the edit window, where
|
2005-12-08 07:09:08 +00:00
|
|
|
* we display the current file we're editing. */
|
|
|
|
WINDOW *bottomwin;
|
|
|
|
/* The bottom portion of the window, where we display statusbar
|
|
|
|
* messages, the statusbar prompt, and a list of shortcuts. */
|
|
|
|
int editwinrows = 0;
|
|
|
|
/* How many rows does the edit window take up? */
|
|
|
|
|
|
|
|
filestruct *cutbuffer = NULL;
|
|
|
|
/* The buffer where we store cut text. */
|
2004-11-23 04:08:28 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2005-12-08 07:09:08 +00:00
|
|
|
filestruct *jusbuffer = NULL;
|
|
|
|
/* The buffer where we store unjustified text. */
|
2004-11-23 04:08:28 +00:00
|
|
|
#endif
|
2005-12-08 07:09:08 +00:00
|
|
|
partition *filepart = NULL;
|
|
|
|
/* The partition where we store a portion of the current
|
|
|
|
* file. */
|
2005-07-08 19:57:25 +00:00
|
|
|
openfilestruct *openfile = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The list of all open file buffers. */
|
2001-07-11 02:08:33 +00:00
|
|
|
|
2006-01-06 21:51:10 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
char *matchbrackets = NULL;
|
|
|
|
/* The opening and closing brackets that can be found by bracket
|
|
|
|
* searches. */
|
|
|
|
#endif
|
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
|
2005-12-08 07:09:08 +00:00
|
|
|
char *whitespace = NULL;
|
|
|
|
/* The characters used when displaying the first characters of
|
|
|
|
* tabs and spaces. */
|
|
|
|
int whitespace_len[2];
|
|
|
|
/* The length of these characters. */
|
2004-05-29 16:47:52 +00:00
|
|
|
#endif
|
|
|
|
|
2002-03-03 22:36:36 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2005-12-08 07:09:08 +00:00
|
|
|
char *punct = NULL;
|
|
|
|
/* The closing punctuation that can end sentences. */
|
|
|
|
char *brackets = NULL;
|
|
|
|
/* The closing brackets that can follow closing punctuation and
|
|
|
|
* can end sentences. */
|
|
|
|
char *quotestr = NULL;
|
|
|
|
/* The quoting string. The default value is set in main(). */
|
2004-07-30 03:54:34 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2005-12-08 07:09:08 +00:00
|
|
|
regex_t quotereg;
|
|
|
|
/* The compiled regular expression from the quoting string. */
|
|
|
|
int quoterc;
|
2006-05-22 18:30:09 +00:00
|
|
|
/* Whether it was compiled successfully. */
|
2005-12-08 07:09:08 +00:00
|
|
|
char *quoteerr = NULL;
|
|
|
|
/* The error message, if it didn't. */
|
2004-07-30 03:54:34 +00:00
|
|
|
#else
|
2005-12-08 07:09:08 +00:00
|
|
|
size_t quotelen;
|
|
|
|
/* The length of the quoting string in bytes. */
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2004-02-28 16:24:31 +00:00
|
|
|
#endif
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
char *answer = NULL;
|
2007-01-01 05:15:32 +00:00
|
|
|
/* The answer string used by the statusbar prompt. */
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
ssize_t tabsize = -1;
|
|
|
|
/* The width of a tab in spaces. The default value is set in
|
|
|
|
* main(). */
|
2000-08-03 22:51:21 +00:00
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
char *backup_dir = NULL;
|
|
|
|
/* The directory where we store backup files. */
|
|
|
|
#endif
|
2001-09-19 03:19:43 +00:00
|
|
|
#ifndef DISABLE_OPERATINGDIR
|
2005-12-08 07:09:08 +00:00
|
|
|
char *operating_dir = NULL;
|
|
|
|
/* The relative path to the operating directory, which we can't
|
|
|
|
* move outside of. */
|
|
|
|
char *full_operating_dir = NULL;
|
|
|
|
/* The full path to it. */
|
2001-09-19 03:19:43 +00:00
|
|
|
#endif
|
|
|
|
|
2001-04-18 04:28:54 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2005-12-08 07:09:08 +00:00
|
|
|
char *alt_speller = NULL;
|
|
|
|
/* The command to use for the alternate spell checker. */
|
2001-04-18 04:28:54 +00:00
|
|
|
#endif
|
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *main_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The main shortcut list. */
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *whereis_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The "Search" shortcut list. */
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *replace_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The "Search (to replace)" shortcut list. */
|
|
|
|
shortcut *replace_list_2 = NULL;
|
|
|
|
/* The "Replace with" shortcut list. */
|
2004-09-30 22:07:21 +00:00
|
|
|
shortcut *gotoline_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The "Enter line number, column number" shortcut list. */
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *writefile_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The "File Name to Write" shortcut list. */
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *insertfile_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The "File to insert" shortcut list. */
|
|
|
|
#ifndef NANO_TINY
|
|
|
|
shortcut *extcmd_list = NULL;
|
|
|
|
/* The "Command to execute" shortcut list. */
|
|
|
|
#endif
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *help_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The help text shortcut list. */
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_SPELLER
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *spell_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The internal spell checker shortcut list. */
|
2002-04-06 05:02:14 +00:00
|
|
|
#endif
|
2001-01-12 07:51:05 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *browser_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The file browser shortcut list. */
|
2006-03-30 07:03:04 +00:00
|
|
|
shortcut *whereis_file_list = NULL;
|
|
|
|
/* The file browser "Search" shortcut list. */
|
2003-02-05 02:51:19 +00:00
|
|
|
shortcut *gotodir_list = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The "Go To Directory" shortcut list. */
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
2003-02-05 02:51:19 +00:00
|
|
|
|
2001-04-30 11:28:46 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2002-12-22 16:30:00 +00:00
|
|
|
syntaxtype *syntaxes = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The global list of color syntaxes. */
|
2002-12-22 16:30:00 +00:00
|
|
|
char *syntaxstr = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The color syntax name specified on the command line. */
|
2001-04-30 11:28:46 +00:00
|
|
|
#endif
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
const shortcut *currshortcut;
|
|
|
|
/* The current shortcut list we're using. */
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle *toggles = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The global toggle list. */
|
2001-01-20 22:18:18 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-05-23 16:30:06 +00:00
|
|
|
filestruct *search_history = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The search string history list. */
|
2005-05-23 16:30:06 +00:00
|
|
|
filestruct *searchage = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The top of the search string history list. */
|
2005-05-23 16:30:06 +00:00
|
|
|
filestruct *searchbot = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The bottom of the search string history list. */
|
2005-05-23 16:30:06 +00:00
|
|
|
filestruct *replace_history = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The replace string history list. */
|
2005-05-23 16:30:06 +00:00
|
|
|
filestruct *replaceage = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The top of the replace string history list. */
|
2005-05-23 16:30:06 +00:00
|
|
|
filestruct *replacebot = NULL;
|
2005-12-08 07:09:08 +00:00
|
|
|
/* The bottom of the replace string history list. */
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
|
|
|
|
2006-05-10 13:41:53 +00:00
|
|
|
/* Regular expressions. */
|
2000-09-06 13:39:17 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2005-12-08 07:09:08 +00:00
|
|
|
regex_t search_regexp;
|
|
|
|
/* The compiled regular expression to use in searches. */
|
|
|
|
regmatch_t regmatches[10];
|
|
|
|
/* The match positions for parenthetical subexpressions, 10
|
|
|
|
* maximum, used in regular expression searches. */
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2002-03-24 23:19:32 +00:00
|
|
|
|
2006-04-12 15:27:40 +00:00
|
|
|
int reverse_attr = A_REVERSE;
|
|
|
|
/* The curses attribute we use for reverse video. */
|
2003-02-03 03:32:08 +00:00
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
char *homedir = NULL;
|
2006-05-14 18:22:01 +00:00
|
|
|
/* The user's home directory, from $HOME or /etc/passwd. */
|
2004-08-17 05:23:38 +00:00
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
/* Return the number of entries in the shortcut list s. */
|
2004-07-01 18:59:52 +00:00
|
|
|
size_t length_of_list(const shortcut *s)
|
2002-02-15 19:17:02 +00:00
|
|
|
{
|
2004-07-01 18:59:52 +00:00
|
|
|
size_t i = 0;
|
2002-09-13 18:14:04 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
for (; s != NULL; s = s->next)
|
2002-02-15 19:17:02 +00:00
|
|
|
i++;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2006-04-19 13:36:56 +00:00
|
|
|
/* Add a new shortcut to the end of the shortcut list. */
|
2006-07-25 21:13:30 +00:00
|
|
|
void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc
|
2002-04-23 10:56:06 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-07-25 21:13:30 +00:00
|
|
|
, const char *help, bool blank_after
|
2002-06-28 22:45:14 +00:00
|
|
|
#endif
|
2006-07-25 21:13:30 +00:00
|
|
|
, int metaval, int funcval, int miscval, bool view,
|
|
|
|
void (*func)(void))
|
2000-06-06 05:53:49 +00:00
|
|
|
{
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *s;
|
|
|
|
|
|
|
|
if (*shortcutage == NULL) {
|
2003-06-14 20:41:34 +00:00
|
|
|
*shortcutage = (shortcut *)nmalloc(sizeof(shortcut));
|
2002-02-15 19:17:02 +00:00
|
|
|
s = *shortcutage;
|
|
|
|
} else {
|
|
|
|
for (s = *shortcutage; s->next != NULL; s = s->next)
|
|
|
|
;
|
2003-06-14 20:41:34 +00:00
|
|
|
s->next = (shortcut *)nmalloc(sizeof(shortcut));
|
2002-02-15 19:17:02 +00:00
|
|
|
s = s->next;
|
|
|
|
}
|
|
|
|
|
2004-03-19 21:46:34 +00:00
|
|
|
s->ctrlval = ctrlval;
|
2006-04-19 14:09:01 +00:00
|
|
|
s->desc = (desc == NULL) ? "" : _(desc);
|
2002-04-23 10:56:06 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-04-19 14:09:01 +00:00
|
|
|
s->help = (help == NULL) ? "" : _(help);
|
2006-04-22 19:45:26 +00:00
|
|
|
s->blank_after = blank_after;
|
2006-07-25 21:13:30 +00:00
|
|
|
#endif
|
2004-03-19 21:46:34 +00:00
|
|
|
s->metaval = metaval;
|
|
|
|
s->funcval = funcval;
|
|
|
|
s->miscval = miscval;
|
2000-06-06 05:53:49 +00:00
|
|
|
s->viewok = view;
|
|
|
|
s->func = func;
|
2002-02-15 19:17:02 +00:00
|
|
|
s->next = NULL;
|
2000-06-06 05:53:49 +00:00
|
|
|
}
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
/* Initialize all shortcut lists. If unjustify is TRUE, replace the
|
|
|
|
* Uncut shortcut in the main shortcut list with UnJustify. */
|
2004-11-11 21:50:01 +00:00
|
|
|
void shortcut_init(bool unjustify)
|
2000-09-01 13:32:47 +00:00
|
|
|
{
|
2006-07-03 18:40:53 +00:00
|
|
|
/* TRANSLATORS: Try to keep this and following strings at most 10
|
|
|
|
* characters. */
|
2006-03-25 15:56:40 +00:00
|
|
|
const char *cancel_msg = N_("Cancel");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *get_help_msg = N_("Get Help");
|
|
|
|
const char *exit_msg = N_("Exit");
|
2006-03-30 07:03:04 +00:00
|
|
|
const char *whereis_msg = N_("Where Is");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *prev_page_msg = N_("Prev Page");
|
|
|
|
const char *next_page_msg = N_("Next Page");
|
|
|
|
const char *go_to_line_msg = N_("Go To Line");
|
2006-07-03 18:40:53 +00:00
|
|
|
/* TRANSLATORS: Try to keep this and previous strings at most 10
|
|
|
|
* characters. */
|
2006-03-25 15:56:40 +00:00
|
|
|
const char *replace_msg = N_("Replace");
|
2006-03-30 07:03:04 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-05-06 15:07:26 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 12 characters. */
|
|
|
|
const char *whereis_next_msg = N_("WhereIs Next");
|
2006-03-30 07:03:04 +00:00
|
|
|
#endif
|
2006-07-03 18:40:53 +00:00
|
|
|
/* TRANSLATORS: Try to keep this and following strings at most 10
|
|
|
|
* characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *first_line_msg = N_("First Line");
|
|
|
|
const char *last_line_msg = N_("Last Line");
|
2004-09-11 21:41:13 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
const char *beg_of_par_msg = N_("Beg of Par");
|
|
|
|
const char *end_of_par_msg = N_("End of Par");
|
|
|
|
const char *fulljstify_msg = N_("FullJstify");
|
|
|
|
#endif
|
2006-04-24 20:53:43 +00:00
|
|
|
const char *refresh_msg = N_("Refresh");
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *case_sens_msg = N_("Case Sens");
|
2005-06-16 18:48:30 +00:00
|
|
|
const char *backwards_msg = N_("Backwards");
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
const char *regexp_msg = N_("Regexp");
|
2002-02-15 19:17:02 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-05-24 19:48:03 +00:00
|
|
|
const char *prev_history_msg = N_("PrevHstory");
|
2006-07-03 18:40:53 +00:00
|
|
|
/* TRANSLATORS: Try to keep this and previous strings at most 10
|
|
|
|
* characters. */
|
2006-05-24 19:48:03 +00:00
|
|
|
const char *next_history_msg = N_("NextHstory");
|
2004-09-28 22:21:46 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2006-04-12 12:54:23 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 16 characters. */
|
2004-09-28 22:14:58 +00:00
|
|
|
const char *new_buffer_msg = N_("New Buffer");
|
2004-09-28 22:21:46 +00:00
|
|
|
#endif
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2006-05-06 15:31:32 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 16 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *to_files_msg = N_("To Files");
|
2006-05-21 21:37:21 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 12 characters. */
|
2006-03-30 07:03:04 +00:00
|
|
|
const char *first_file_msg = N_("First File");
|
2006-05-21 21:37:21 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 12 characters. */
|
2006-03-30 07:03:04 +00:00
|
|
|
const char *last_file_msg = N_("Last File");
|
2002-10-13 18:43:45 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-29 19:43:32 +00:00
|
|
|
const char *nano_cancel_msg = N_("Cancel the current function");
|
2006-04-14 20:21:45 +00:00
|
|
|
const char *nano_help_msg = N_("Display this help text");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_exit_msg =
|
2001-07-14 19:32:47 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2006-05-21 21:37:21 +00:00
|
|
|
N_("Close the current file buffer / Exit from nano")
|
2004-07-12 03:10:30 +00:00
|
|
|
#else
|
|
|
|
N_("Exit from nano")
|
|
|
|
#endif
|
|
|
|
;
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *nano_writeout_msg =
|
|
|
|
N_("Write the current file to disk");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_justify_msg = N_("Justify the current paragraph");
|
|
|
|
const char *nano_insert_msg =
|
|
|
|
N_("Insert another file into the current one");
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *nano_whereis_msg =
|
2006-05-21 21:37:21 +00:00
|
|
|
N_("Search for a string or a regular expression");
|
2007-02-01 13:40:59 +00:00
|
|
|
const char *nano_prevpage_msg = N_("Go to previous screen");
|
|
|
|
const char *nano_nextpage_msg = N_("Go to next screen");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_cut_msg =
|
|
|
|
N_("Cut the current line and store it in the cutbuffer");
|
|
|
|
const char *nano_uncut_msg =
|
|
|
|
N_("Uncut from the cutbuffer into the current line");
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *nano_cursorpos_msg =
|
2006-04-14 20:15:44 +00:00
|
|
|
N_("Display the position of the cursor");
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *nano_spell_msg =
|
|
|
|
N_("Invoke the spell checker, if available");
|
2005-07-11 20:50:43 +00:00
|
|
|
const char *nano_gotoline_msg = N_("Go to line and column number");
|
2006-05-21 21:37:21 +00:00
|
|
|
const char *nano_replace_msg =
|
|
|
|
N_("Replace a string or a regular expression");
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-11-01 22:40:02 +00:00
|
|
|
const char *nano_mark_msg = N_("Mark text at the cursor position");
|
|
|
|
const char *nano_whereis_next_msg = N_("Repeat last search");
|
2006-04-27 23:39:49 +00:00
|
|
|
const char *nano_copy_msg =
|
|
|
|
N_("Copy the current line and store it in the cutbuffer");
|
2006-07-05 18:42:22 +00:00
|
|
|
const char *nano_indent_msg = N_("Indent the current line");
|
|
|
|
const char *nano_unindent_msg = N_("Unindent the current line");
|
2004-11-01 22:54:40 +00:00
|
|
|
#endif
|
2007-02-01 13:40:59 +00:00
|
|
|
const char *nano_forward_msg = N_("Go forward one character");
|
|
|
|
const char *nano_back_msg = N_("Go back one character");
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2007-02-01 13:40:59 +00:00
|
|
|
const char *nano_nextword_msg = N_("Go forward one word");
|
|
|
|
const char *nano_prevword_msg = N_("Go back one word");
|
2004-08-07 21:27:37 +00:00
|
|
|
#endif
|
2007-02-01 13:40:59 +00:00
|
|
|
const char *nano_prevline_msg = N_("Go to previous line");
|
|
|
|
const char *nano_nextline_msg = N_("Go to next line");
|
|
|
|
const char *nano_home_msg = N_("Go to beginning of current line");
|
|
|
|
const char *nano_end_msg = N_("Go to end of current line");
|
2004-09-11 21:41:13 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
const char *nano_parabegin_msg =
|
2007-02-01 13:40:59 +00:00
|
|
|
N_("Go to beginning of paragraph; then of previous paragraph");
|
2004-09-11 21:41:13 +00:00
|
|
|
const char *nano_paraend_msg =
|
2007-02-01 13:40:59 +00:00
|
|
|
N_("Go just beyond end of paragraph; then of next paragraph");
|
2006-04-24 21:14:55 +00:00
|
|
|
#endif
|
|
|
|
const char *nano_firstline_msg =
|
2007-02-01 13:40:59 +00:00
|
|
|
N_("Go to the first line of the file");
|
2006-04-24 21:14:55 +00:00
|
|
|
const char *nano_lastline_msg =
|
2007-02-01 13:40:59 +00:00
|
|
|
N_("Go to the last line of the file");
|
2006-04-24 21:14:55 +00:00
|
|
|
#ifndef NANO_TINY
|
2007-02-01 13:40:59 +00:00
|
|
|
const char *nano_bracket_msg = N_("Go to the matching bracket");
|
2006-04-24 21:14:55 +00:00
|
|
|
const char *nano_scrollup_msg =
|
|
|
|
N_("Scroll up one line without scrolling the cursor");
|
|
|
|
const char *nano_scrolldown_msg =
|
|
|
|
N_("Scroll down one line without scrolling the cursor");
|
2004-09-11 21:41:13 +00:00
|
|
|
#endif
|
2003-11-28 19:47:42 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2005-07-08 20:09:16 +00:00
|
|
|
const char *nano_prevfile_msg =
|
2005-06-06 18:38:16 +00:00
|
|
|
N_("Switch to the previous file buffer");
|
2005-07-08 20:09:16 +00:00
|
|
|
const char *nano_nextfile_msg =
|
2005-06-06 18:38:16 +00:00
|
|
|
N_("Switch to the next file buffer");
|
2004-09-11 21:41:13 +00:00
|
|
|
#endif
|
2006-04-23 19:21:12 +00:00
|
|
|
const char *nano_verbatim_msg =
|
2006-04-24 21:00:17 +00:00
|
|
|
N_("Insert the next keystroke verbatim");
|
2006-04-24 21:14:55 +00:00
|
|
|
const char *nano_tab_msg =
|
2006-04-29 13:59:04 +00:00
|
|
|
N_("Insert a tab at the cursor position");
|
2006-04-24 21:14:55 +00:00
|
|
|
const char *nano_enter_msg =
|
2006-04-27 23:39:49 +00:00
|
|
|
N_("Insert a newline at the cursor position");
|
2006-04-24 21:14:55 +00:00
|
|
|
const char *nano_delete_msg =
|
|
|
|
N_("Delete the character under the cursor");
|
|
|
|
const char *nano_backspace_msg =
|
|
|
|
N_("Delete the character to the left of the cursor");
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-01-01 07:43:32 +00:00
|
|
|
const char *nano_cut_till_end_msg =
|
|
|
|
N_("Cut from the cursor position to the end of the file");
|
|
|
|
#endif
|
2004-09-11 21:41:13 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
const char *nano_fulljustify_msg = N_("Justify the entire file");
|
2004-07-12 03:10:30 +00:00
|
|
|
#endif
|
2005-11-15 23:45:29 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-04-24 21:14:55 +00:00
|
|
|
const char *nano_wordcount_msg =
|
|
|
|
N_("Count the number of words, lines, and characters");
|
2004-08-07 21:27:37 +00:00
|
|
|
#endif
|
2006-04-24 21:14:55 +00:00
|
|
|
const char *nano_refresh_msg =
|
|
|
|
N_("Refresh (redraw) the current screen");
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_case_msg =
|
2006-06-08 02:37:45 +00:00
|
|
|
N_("Toggle the case sensitivity of the search");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_reverse_msg =
|
2006-06-08 02:37:45 +00:00
|
|
|
N_("Reverse the direction of the search");
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2006-06-08 02:37:45 +00:00
|
|
|
const char *nano_regexp_msg =
|
|
|
|
N_("Toggle the use of regular expressions");
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-05-24 19:48:03 +00:00
|
|
|
const char *nano_prev_history_msg =
|
2006-07-31 01:30:31 +00:00
|
|
|
N_("Recall the previous search/replace string");
|
2006-05-24 19:48:03 +00:00
|
|
|
const char *nano_next_history_msg =
|
2006-07-31 01:30:31 +00:00
|
|
|
N_("Recall the next search/replace string");
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
|
|
|
const char *nano_tofiles_msg = N_("Go to file browser");
|
2002-04-06 05:02:14 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-06-08 02:37:45 +00:00
|
|
|
const char *nano_dos_msg = N_("Toggle the use of DOS format");
|
|
|
|
const char *nano_mac_msg = N_("Toggle the use of Mac format");
|
2001-09-28 19:53:11 +00:00
|
|
|
#endif
|
2006-06-08 02:37:45 +00:00
|
|
|
const char *nano_append_msg = N_("Toggle appending");
|
|
|
|
const char *nano_prepend_msg = N_("Toggle prepending");
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *nano_backup_msg =
|
2006-06-08 02:37:45 +00:00
|
|
|
N_("Toggle backing up of the original file");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_execute_msg = N_("Execute external command");
|
2001-09-28 19:53:11 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#if !defined(NANO_TINY) && defined(ENABLE_MULTIBUFFER)
|
2006-06-08 02:37:45 +00:00
|
|
|
const char *nano_multibuffer_msg =
|
|
|
|
N_("Toggle the use of a new buffer");
|
2004-07-12 03:10:30 +00:00
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_BROWSER
|
2004-07-23 12:51:40 +00:00
|
|
|
const char *nano_exitbrowser_msg = N_("Exit from the file browser");
|
2006-03-30 07:03:04 +00:00
|
|
|
const char *nano_firstfile_msg =
|
|
|
|
N_("Go to the first file in the list");
|
|
|
|
const char *nano_lastfile_msg =
|
|
|
|
N_("Go to the last file in the list");
|
2004-07-23 12:51:40 +00:00
|
|
|
const char *nano_gotodir_msg = N_("Go to directory");
|
2000-06-06 05:53:49 +00:00
|
|
|
#endif
|
2002-04-23 10:56:06 +00:00
|
|
|
#endif /* !DISABLE_HELP */
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-05-20 03:29:33 +00:00
|
|
|
/* The following macro is to be used in calling sc_init_one(). The
|
2006-04-22 19:45:26 +00:00
|
|
|
* point is that sc_init_one() takes 10 arguments, unless DISABLE_HELP
|
2006-07-25 21:13:30 +00:00
|
|
|
* is defined, when the 4th and 5th ones should not be there. */
|
2004-03-02 22:52:57 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-07-25 21:13:30 +00:00
|
|
|
#define IFSCHELP(help, blank, nextvar) help, blank, nextvar
|
2004-03-02 22:52:57 +00:00
|
|
|
#else
|
2006-07-25 21:13:30 +00:00
|
|
|
#define IFSCHELP(help, blank, nextvar) nextvar
|
2002-04-23 10:56:06 +00:00
|
|
|
#endif
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
free_shortcutage(&main_list);
|
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-30 07:03:04 +00:00
|
|
|
do_help_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-11-25 04:39:07 +00:00
|
|
|
sc_init_one(&main_list, NANO_EXIT_KEY,
|
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2006-03-24 05:28:03 +00:00
|
|
|
openfile != NULL && openfile != openfile->next ? N_("Close") :
|
2001-07-11 02:08:33 +00:00
|
|
|
#endif
|
2006-07-25 21:13:30 +00:00
|
|
|
exit_msg, IFSCHELP(nano_exit_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, do_exit);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_WRITEOUT_KEY, N_("WriteOut"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_writeout_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_WRITEOUT_FKEY, NANO_NO_KEY, NOVIEW, do_writeout_void);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_JUSTIFY_KEY, N_("Justify"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_justify_msg, TRUE, NANO_NO_KEY),
|
|
|
|
NANO_JUSTIFY_FKEY, NANO_NO_KEY, NOVIEW,
|
2004-06-29 00:43:56 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2006-03-24 05:28:03 +00:00
|
|
|
do_justify_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2001-02-11 19:05:05 +00:00
|
|
|
|
2004-05-29 01:20:17 +00:00
|
|
|
/* We allow inserting files in view mode if multibuffers are
|
2005-12-08 07:09:08 +00:00
|
|
|
* available, so that we can view multiple files. If we're using
|
|
|
|
* restricted mode, inserting files is disabled, since it allows
|
|
|
|
* reading from or writing to files not specified on the command
|
|
|
|
* line. */
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_INSERTFILE_KEY, N_("Read File"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_insert_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_INSERTFILE_FKEY, NANO_NO_KEY,
|
2002-01-02 15:12:21 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2006-03-24 05:28:03 +00:00
|
|
|
VIEW
|
2002-01-02 15:12:21 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
NOVIEW
|
2002-01-02 15:12:21 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
, !ISSET(RESTRICTED) ? do_insertfile_void : nano_disabled_msg);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-03-30 07:03:04 +00:00
|
|
|
sc_init_one(&main_list, NANO_WHEREIS_KEY, whereis_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_whereis_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_WHEREIS_FKEY, NANO_NO_KEY, VIEW, do_search);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_PREVPAGE_KEY, prev_page_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prevpage_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, do_page_up);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_NEXTPAGE_KEY, next_page_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_nextpage_msg, TRUE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, do_page_down);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_CUT_KEY, N_("Cut Text"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cut_msg, FALSE, NANO_NO_KEY), NANO_CUT_FKEY,
|
2006-04-25 02:23:28 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, do_cut_text_void);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2000-11-27 22:58:23 +00:00
|
|
|
if (unjustify)
|
2006-07-03 18:40:53 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, N_("UnJustify"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(NULL, FALSE, NANO_NO_KEY), NANO_UNJUSTIFY_FKEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, NULL);
|
2000-11-27 22:58:23 +00:00
|
|
|
else
|
2006-07-03 18:40:53 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2006-05-06 15:07:26 +00:00
|
|
|
sc_init_one(&main_list, NANO_UNCUT_KEY, N_("UnCut Text"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_uncut_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_UNCUT_FKEY, NANO_NO_KEY, NOVIEW, do_uncut_text);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_CURSORPOS_KEY, N_("Cur Pos"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cursorpos_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_CURSORPOS_FKEY, NANO_NO_KEY, VIEW, do_cursorpos_void);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-05-29 01:20:17 +00:00
|
|
|
/* If we're using restricted mode, spell checking is disabled
|
|
|
|
* because it allows reading from or writing to files not specified
|
|
|
|
* on the command line. */
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_SPELL_KEY, N_("To Spell"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_spell_msg, TRUE, NANO_NO_KEY), NANO_SPELL_FKEY,
|
2006-03-24 05:28:03 +00:00
|
|
|
NANO_NO_KEY, NOVIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2006-03-24 05:28:03 +00:00
|
|
|
!ISSET(RESTRICTED) ? do_spell :
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg);
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2006-04-23 19:15:15 +00:00
|
|
|
sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_gotoline_msg, FALSE, NANO_GOTOLINE_METAKEY),
|
2006-04-23 19:15:15 +00:00
|
|
|
NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW,
|
|
|
|
do_gotolinecolumn_void);
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2006-05-22 18:28:20 +00:00
|
|
|
sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg
|
|
|
|
#ifndef NANO_TINY
|
2006-11-21 04:20:53 +00:00
|
|
|
, IFSCHELP(nano_replace_msg, FALSE, NANO_REPLACE_METAKEY)
|
2006-05-22 18:28:20 +00:00
|
|
|
#else
|
2006-11-21 04:20:53 +00:00
|
|
|
, IFSCHELP(nano_replace_msg, TRUE, NANO_REPLACE_METAKEY)
|
2006-05-22 18:28:20 +00:00
|
|
|
#endif
|
2006-07-25 21:13:30 +00:00
|
|
|
, NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, do_replace);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-11-01 22:40:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"),
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_mark_msg, FALSE, NANO_MARK_METAKEY),
|
2006-07-25 21:13:30 +00:00
|
|
|
NANO_MARK_FKEY, NANO_NO_KEY, VIEW, do_mark);
|
2004-11-01 22:40:02 +00:00
|
|
|
|
2006-04-23 19:15:15 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, whereis_next_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_whereis_next_msg, TRUE, NANO_WHEREIS_NEXT_KEY),
|
2006-04-23 19:15:15 +00:00
|
|
|
NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, do_research);
|
2006-04-27 23:39:49 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Copy Text"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_copy_msg, FALSE, NANO_COPY_KEY), NANO_NO_KEY,
|
2006-11-21 04:20:53 +00:00
|
|
|
NANO_COPY_METAKEY, NOVIEW, do_copy_text);
|
2006-04-28 13:19:56 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Indent Text"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_indent_msg, FALSE, NANO_INDENT_KEY), NANO_NO_KEY,
|
2006-07-05 18:42:22 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, do_indent_void);
|
2006-04-28 13:19:56 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Unindent Text"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_unindent_msg, TRUE, NANO_UNINDENT_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_unindent);
|
2006-04-19 14:09:01 +00:00
|
|
|
#endif
|
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_FORWARD_KEY, N_("Forward"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_forward_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, do_right);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_BACK_KEY, N_("Back"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_back_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, do_left);
|
2006-04-19 14:09:01 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_NEXTWORD_KEY, N_("Next Word"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_nextword_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2005-06-12 22:31:03 +00:00
|
|
|
NANO_NO_KEY, VIEW, do_next_word_void);
|
2002-06-21 03:20:06 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Prev Word"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prevword_msg, FALSE, NANO_PREVWORD_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, do_prev_word_void);
|
|
|
|
#endif
|
2005-06-12 22:31:03 +00:00
|
|
|
|
2006-04-22 19:45:26 +00:00
|
|
|
sc_init_one(&main_list, NANO_PREVLINE_KEY, N_("Prev Line"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prevline_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-07-06 22:17:47 +00:00
|
|
|
NANO_NO_KEY, VIEW, do_up_void);
|
2005-10-24 02:12:09 +00:00
|
|
|
|
2006-04-22 19:45:26 +00:00
|
|
|
sc_init_one(&main_list, NANO_NEXTLINE_KEY, N_("Next Line"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_nextline_msg, TRUE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-07-06 22:17:47 +00:00
|
|
|
NANO_NO_KEY, VIEW, do_down_void);
|
2005-10-24 02:12:09 +00:00
|
|
|
|
2006-04-22 19:45:26 +00:00
|
|
|
sc_init_one(&main_list, NANO_HOME_KEY, N_("Home"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_home_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, do_home);
|
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_END_KEY, N_("End"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_end_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, do_end);
|
2003-08-23 21:11:06 +00:00
|
|
|
|
2004-09-11 21:41:13 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, beg_of_par_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_parabegin_msg, FALSE, NANO_PARABEGIN_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_PARABEGIN_METAKEY2, VIEW, do_para_begin_void);
|
2004-09-11 21:41:13 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, end_of_par_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_paraend_msg, FALSE, NANO_PARAEND_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_PARAEND_METAKEY2, VIEW, do_para_end_void);
|
2004-09-11 21:41:13 +00:00
|
|
|
#endif
|
2003-08-23 21:11:06 +00:00
|
|
|
|
2006-04-21 02:05:09 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, first_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_FIRSTLINE_METAKEY2, VIEW, do_first_line);
|
2006-04-21 02:05:09 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, last_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_lastline_msg, TRUE, NANO_LASTLINE_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
|
|
|
#ifndef NANO_TINY
|
2006-05-12 12:37:53 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Find Other Bracket"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_bracket_msg, FALSE, NANO_BRACKET_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, do_find_bracket);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Up"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_scrollup_msg, FALSE, NANO_SCROLLUP_KEY),
|
2006-11-21 04:20:53 +00:00
|
|
|
NANO_NO_KEY, NANO_SCROLLUP_METAKEY, VIEW, do_scroll_up);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Down"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_scrolldown_msg, TRUE, NANO_SCROLLDOWN_KEY),
|
2006-11-21 04:20:53 +00:00
|
|
|
NANO_NO_KEY, NANO_SCROLLDOWN_METAKEY, VIEW, do_scroll_down);
|
2006-04-22 19:45:26 +00:00
|
|
|
#endif
|
2006-04-21 02:05:09 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Previous File"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prevfile_msg, FALSE, NANO_PREVFILE_KEY),
|
2006-11-21 04:20:53 +00:00
|
|
|
NANO_NO_KEY, NANO_PREVFILE_METAKEY, VIEW,
|
2006-04-22 19:45:26 +00:00
|
|
|
switch_to_prev_buffer_void);
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Next File"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_nextfile_msg, TRUE, NANO_NEXTFILE_KEY),
|
2006-11-21 04:20:53 +00:00
|
|
|
NANO_NO_KEY, NANO_NEXTFILE_METAKEY, VIEW,
|
2006-07-25 21:13:30 +00:00
|
|
|
switch_to_next_buffer_void);
|
2002-02-15 19:17:02 +00:00
|
|
|
#endif
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2004-09-11 21:41:13 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Verbatim Input"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_verbatim_msg, FALSE, NANO_VERBATIM_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_verbatim_input);
|
2004-09-11 21:41:13 +00:00
|
|
|
|
2006-04-22 19:45:26 +00:00
|
|
|
sc_init_one(&main_list, NANO_TAB_KEY, N_("Tab"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_tab_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, do_tab);
|
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_ENTER_KEY, N_("Enter"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_enter_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, do_enter);
|
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_DELETE_KEY, N_("Delete"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_delete_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, do_delete);
|
|
|
|
|
2006-04-24 20:50:52 +00:00
|
|
|
sc_init_one(&main_list, NANO_BACKSPACE_KEY, N_("Backspace")
|
|
|
|
#ifndef NANO_TINY
|
2006-07-25 21:13:30 +00:00
|
|
|
, IFSCHELP(nano_backspace_msg, FALSE, NANO_NO_KEY)
|
2006-04-24 20:50:52 +00:00
|
|
|
#else
|
2006-07-25 21:13:30 +00:00
|
|
|
, IFSCHELP(nano_backspace_msg, TRUE, NANO_NO_KEY)
|
2006-04-24 20:50:52 +00:00
|
|
|
#endif
|
2006-07-25 21:13:30 +00:00
|
|
|
, NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_backspace);
|
2005-01-01 07:43:32 +00:00
|
|
|
|
2006-04-23 19:15:15 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-08-22 18:48:13 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("CutTillEnd"),
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_cut_till_end_msg, TRUE, NANO_CUTTILLEND_METAKEY),
|
2006-04-23 19:15:15 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
|
|
|
|
#endif
|
|
|
|
|
2004-09-11 21:41:13 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, fulljstify_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_fulljustify_msg, FALSE, NANO_FULLJUSTIFY_METAKEY),
|
2004-11-01 22:54:40 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify);
|
2004-09-11 21:41:13 +00:00
|
|
|
#endif
|
|
|
|
|
2005-11-15 23:45:29 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-04-22 19:45:26 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Word Count"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_wordcount_msg, FALSE, NANO_WORDCOUNT_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, do_wordlinechar_count);
|
2003-11-28 19:47:42 +00:00
|
|
|
#endif
|
|
|
|
|
2006-04-22 20:03:05 +00:00
|
|
|
sc_init_one(&main_list, NANO_REFRESH_KEY, refresh_msg
|
2006-04-22 20:00:23 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-07-25 21:13:30 +00:00
|
|
|
, IFSCHELP(nano_refresh_msg, TRUE, NANO_NO_KEY)
|
2006-04-22 20:00:23 +00:00
|
|
|
#else
|
2006-07-25 21:13:30 +00:00
|
|
|
, IFSCHELP(nano_refresh_msg, FALSE, NANO_NO_KEY)
|
2006-04-22 20:00:23 +00:00
|
|
|
#endif
|
2006-07-25 21:13:30 +00:00
|
|
|
, NANO_NO_KEY, NANO_NO_KEY, VIEW, total_refresh);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&whereis_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-30 07:03:04 +00:00
|
|
|
do_help_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, first_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY),
|
|
|
|
NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_METAKEY2, VIEW,
|
2006-04-21 02:24:34 +00:00
|
|
|
do_first_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_LASTLINE_KEY, last_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_METAKEY),
|
|
|
|
NANO_LASTLINE_FKEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_TOOTHERSEARCH_KEY, replace_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_replace_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_REPLACE_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_TOGOTOLINE_KEY, go_to_line_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_gotoline_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2000-06-29 01:30:04 +00:00
|
|
|
|
2003-09-04 20:25:29 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2004-09-11 21:41:13 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, beg_of_par_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_parabegin_msg, FALSE, NANO_PARABEGIN_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_PARABEGIN_METAKEY2, VIEW, do_para_begin_void);
|
2003-09-04 20:25:29 +00:00
|
|
|
|
2004-09-11 21:41:13 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_PARAEND_KEY, end_of_par_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_paraend_msg, FALSE, NANO_PARAEND_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_PARAEND_METAKEY2, VIEW, do_para_end_void);
|
2003-09-04 20:25:29 +00:00
|
|
|
#endif
|
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_NO_KEY, case_sens_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_case_msg, FALSE, TOGGLE_CASE_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2001-06-14 02:54:22 +00:00
|
|
|
|
2005-06-16 18:48:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_NO_KEY, backwards_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_reverse_msg, FALSE, TOGGLE_BACKWARDS_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2001-06-14 02:54:22 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_NO_KEY, regexp_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_regexp_msg, FALSE, NANO_REGEXP_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2001-06-14 02:54:22 +00:00
|
|
|
#endif
|
2003-01-05 20:41:21 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-05-24 19:48:03 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_PREVLINE_KEY, prev_history_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2006-05-24 19:48:03 +00:00
|
|
|
|
|
|
|
sc_init_one(&whereis_list, NANO_NEXTLINE_KEY, next_history_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2004-11-07 16:04:18 +00:00
|
|
|
|
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
sc_init_one(&whereis_list, NANO_FULLJUSTIFY_KEY, fulljstify_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_fulljustify_msg, FALSE, NANO_FULLJUSTIFY_METAKEY),
|
2004-11-07 16:04:18 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify);
|
|
|
|
#endif
|
2001-07-16 00:48:53 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&replace_list);
|
2001-07-16 00:48:53 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-30 07:03:04 +00:00
|
|
|
do_help_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list, NANO_FIRSTLINE_KEY, first_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY),
|
|
|
|
NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_METAKEY2, VIEW,
|
2006-04-21 02:24:34 +00:00
|
|
|
do_first_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list, NANO_LASTLINE_KEY, last_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_METAKEY),
|
|
|
|
NANO_LASTLINE_FKEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-05-25 04:02:50 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 12 characters. */
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&replace_list, NANO_TOOTHERSEARCH_KEY, N_("No Replace"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_whereis_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_REPLACE_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list, NANO_NO_KEY, case_sens_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_case_msg, FALSE, TOGGLE_CASE_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2001-06-14 02:54:22 +00:00
|
|
|
|
2005-06-16 18:48:30 +00:00
|
|
|
sc_init_one(&replace_list, NANO_NO_KEY, backwards_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_reverse_msg, FALSE, TOGGLE_BACKWARDS_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2001-06-14 02:54:22 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list, NANO_NO_KEY, regexp_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_regexp_msg, FALSE, NANO_REGEXP_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2001-06-14 02:54:22 +00:00
|
|
|
#endif
|
2003-01-05 20:41:21 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-05-24 19:48:03 +00:00
|
|
|
sc_init_one(&replace_list, NANO_PREVLINE_KEY, prev_history_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2006-05-24 19:48:03 +00:00
|
|
|
|
|
|
|
sc_init_one(&replace_list, NANO_NEXTLINE_KEY, next_history_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2001-07-16 00:48:53 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&replace_list_2);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-30 07:03:04 +00:00
|
|
|
do_help_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_FIRSTLINE_KEY, first_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY),
|
|
|
|
NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_METAKEY2, VIEW,
|
2006-04-21 02:24:34 +00:00
|
|
|
do_first_line);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_LASTLINE_KEY, last_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_METAKEY),
|
|
|
|
NANO_LASTLINE_FKEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-05-24 19:48:03 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_PREVLINE_KEY, prev_history_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2006-05-24 19:48:03 +00:00
|
|
|
|
|
|
|
sc_init_one(&replace_list_2, NANO_NEXTLINE_KEY, next_history_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
|
|
|
|
2004-09-30 22:07:21 +00:00
|
|
|
free_shortcutage(&gotoline_list);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&gotoline_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-30 07:03:04 +00:00
|
|
|
do_help_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&gotoline_list, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&gotoline_list, NANO_FIRSTLINE_KEY, first_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY),
|
|
|
|
NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_METAKEY2, VIEW,
|
2006-04-21 02:24:34 +00:00
|
|
|
do_first_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&gotoline_list, NANO_LASTLINE_KEY, last_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_METAKEY),
|
|
|
|
NANO_LASTLINE_FKEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-11-01 22:54:40 +00:00
|
|
|
sc_init_one(&gotoline_list, NANO_TOOTHERWHEREIS_KEY,
|
2006-07-25 21:13:30 +00:00
|
|
|
N_("Go To Text"), IFSCHELP(nano_whereis_msg, FALSE,
|
|
|
|
NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2004-09-30 22:07:21 +00:00
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&writefile_list);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-30 07:03:04 +00:00
|
|
|
do_help_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2004-07-12 03:10:30 +00:00
|
|
|
|
2001-01-12 07:51:05 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2004-05-29 01:20:17 +00:00
|
|
|
/* If we're using restricted mode, the file browser is disabled.
|
|
|
|
* It's useless since inserting files is disabled. */
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_TOFILES_KEY, to_files_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_tofiles_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-05-29 01:20:17 +00:00
|
|
|
/* If we're using restricted mode, the DOS format, Mac format,
|
|
|
|
* append, prepend, and backup toggles are disabled. The first and
|
|
|
|
* second are useless since inserting files is disabled, the third
|
|
|
|
* and fourth are disabled because they allow writing to files not
|
|
|
|
* specified on the command line, and the fifth is useless since
|
|
|
|
* backups are disabled. */
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 16 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_NO_KEY, N_("DOS Format"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_dos_msg, FALSE, TOGGLE_DOS_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 16 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_NO_KEY, N_("Mac Format"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_mac_msg, FALSE, TOGGLE_MAC_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
|
2002-02-15 19:17:02 +00:00
|
|
|
#endif
|
|
|
|
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 16 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_NO_KEY, N_("Append"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_append_msg, FALSE, NANO_APPEND_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
|
2001-05-29 04:21:44 +00:00
|
|
|
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 16 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_NO_KEY, N_("Prepend"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prepend_msg, FALSE, NANO_PREPEND_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
|
2002-04-16 03:15:47 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 16 characters. */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&writefile_list, NANO_NO_KEY, N_("Backup File"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_backup_msg, FALSE, TOGGLE_BACKUP_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
|
2002-06-28 22:45:14 +00:00
|
|
|
#endif
|
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&insertfile_list);
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&insertfile_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-30 07:03:04 +00:00
|
|
|
do_help_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&insertfile_list, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2001-05-29 04:21:44 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2004-05-29 01:20:17 +00:00
|
|
|
/* If we're using restricted mode, the file browser is disabled.
|
|
|
|
* It's useless since inserting files is disabled. */
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&insertfile_list, NANO_TOFILES_KEY, to_files_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_tofiles_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
|
2001-05-29 04:21:44 +00:00
|
|
|
#endif
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-05-29 01:20:17 +00:00
|
|
|
/* If we're using restricted mode, command execution is disabled.
|
|
|
|
* It's useless since inserting files is disabled. */
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2004-11-01 22:54:40 +00:00
|
|
|
sc_init_one(&insertfile_list, NANO_TOOTHERINSERT_KEY,
|
2006-07-03 18:40:53 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 22
|
|
|
|
* characters. */
|
2006-07-25 21:13:30 +00:00
|
|
|
N_("Execute Command"), IFSCHELP(nano_execute_msg, FALSE,
|
|
|
|
NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2002-09-03 22:58:40 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2004-05-29 01:20:17 +00:00
|
|
|
/* If we're using restricted mode, the multibuffer toggle is
|
|
|
|
* disabled. It's useless since inserting files is disabled. */
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2004-09-28 22:14:58 +00:00
|
|
|
sc_init_one(&insertfile_list, NANO_NO_KEY, new_buffer_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_multibuffer_msg, FALSE,
|
|
|
|
TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY, NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NOVIEW, NULL);
|
2002-09-13 18:14:04 +00:00
|
|
|
#endif
|
2002-09-03 22:58:40 +00:00
|
|
|
#endif
|
2001-05-29 04:21:44 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&extcmd_list);
|
2002-04-06 05:02:14 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&extcmd_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-30 07:03:04 +00:00
|
|
|
do_help_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2002-03-21 05:07:28 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&extcmd_list, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2004-09-28 22:14:58 +00:00
|
|
|
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&extcmd_list, NANO_TOOTHERINSERT_KEY, N_("Insert File"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_insert_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2004-09-30 22:07:21 +00:00
|
|
|
|
2004-09-28 22:21:46 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2004-09-28 22:14:58 +00:00
|
|
|
sc_init_one(&extcmd_list, NANO_NO_KEY, new_buffer_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_multibuffer_msg, FALSE, TOGGLE_MULTIBUFFER_KEY),
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL);
|
2002-03-21 05:07:28 +00:00
|
|
|
#endif
|
2004-09-28 22:21:46 +00:00
|
|
|
#endif
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
free_shortcutage(&help_list);
|
|
|
|
|
|
|
|
sc_init_one(&help_list, NANO_REFRESH_KEY, refresh_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_refresh_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2005-12-08 07:09:08 +00:00
|
|
|
|
|
|
|
sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_exit_msg, FALSE, NANO_NO_KEY), NANO_EXIT_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2005-12-08 07:09:08 +00:00
|
|
|
|
|
|
|
sc_init_one(&help_list, NANO_PREVPAGE_KEY, prev_page_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prevpage_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2005-12-08 07:09:08 +00:00
|
|
|
|
|
|
|
sc_init_one(&help_list, NANO_NEXTPAGE_KEY, next_page_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_nextpage_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2005-12-08 07:09:08 +00:00
|
|
|
|
|
|
|
sc_init_one(&help_list, NANO_PREVLINE_KEY, N_("Prev Line"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prevline_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2005-12-08 07:09:08 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
|
|
|
|
|
|
|
sc_init_one(&help_list, NANO_NEXTLINE_KEY, N_("Next Line"),
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_nextline_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2005-12-08 07:09:08 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2006-05-06 02:26:18 +00:00
|
|
|
|
|
|
|
sc_init_one(&help_list, NANO_NO_KEY, first_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_FIRSTLINE_METAKEY2, VIEW, NULL);
|
2006-05-06 02:26:18 +00:00
|
|
|
|
|
|
|
sc_init_one(&help_list, NANO_NO_KEY, last_line_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_lastline_msg, TRUE, NANO_LASTLINE_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_LASTLINE_METAKEY2, VIEW, NULL);
|
2005-12-08 07:09:08 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef DISABLE_SPELLER
|
|
|
|
free_shortcutage(&spell_list);
|
|
|
|
|
|
|
|
sc_init_one(&spell_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2005-12-08 07:09:08 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-03-30 07:03:04 +00:00
|
|
|
do_help_void
|
2005-12-08 07:09:08 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2005-12-08 07:09:08 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2005-12-08 07:09:08 +00:00
|
|
|
|
|
|
|
sc_init_one(&spell_list, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2005-12-08 07:09:08 +00:00
|
|
|
#endif
|
|
|
|
|
2001-01-12 07:51:05 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&browser_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&browser_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2004-07-23 12:30:40 +00:00
|
|
|
sc_init_one(&browser_list, NANO_EXIT_KEY, exit_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_exitbrowser_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2006-05-06 15:07:26 +00:00
|
|
|
sc_init_one(&browser_list, NANO_WHEREIS_KEY, whereis_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_whereis_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-05-06 15:07:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
|
|
|
|
|
|
|
sc_init_one(&browser_list, NANO_NO_KEY, whereis_next_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_whereis_next_msg, FALSE, NANO_WHEREIS_NEXT_KEY),
|
2006-05-06 15:07:26 +00:00
|
|
|
NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, NULL);
|
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&browser_list, NANO_PREVPAGE_KEY, prev_page_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prevpage_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&browser_list, NANO_NEXTPAGE_KEY, next_page_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_nextpage_msg, FALSE, NANO_NO_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2006-05-06 15:07:26 +00:00
|
|
|
sc_init_one(&browser_list, NANO_NO_KEY, first_file_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_firstfile_msg, FALSE, NANO_FIRSTFILE_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_FIRSTFILE_METAKEY2, VIEW, NULL);
|
2006-03-30 07:03:04 +00:00
|
|
|
|
2006-05-06 15:07:26 +00:00
|
|
|
sc_init_one(&browser_list, NANO_NO_KEY, last_file_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_lastfile_msg, FALSE, NANO_LASTFILE_METAKEY),
|
|
|
|
NANO_NO_KEY, NANO_LASTFILE_METAKEY2, VIEW, NULL);
|
2006-03-30 07:03:04 +00:00
|
|
|
|
2006-05-06 15:31:32 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 12 characters. */
|
2006-05-06 15:07:26 +00:00
|
|
|
sc_init_one(&browser_list, NANO_GOTODIR_KEY, N_("Go To Dir"),
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_gotodir_msg, FALSE, NANO_GOTODIR_METAKEY),
|
2006-05-06 15:07:26 +00:00
|
|
|
NANO_GOTODIR_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2001-04-14 06:50:24 +00:00
|
|
|
|
2006-03-30 07:03:04 +00:00
|
|
|
free_shortcutage(&whereis_file_list);
|
|
|
|
|
|
|
|
sc_init_one(&whereis_file_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2006-03-30 07:03:04 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_browser_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
|
|
|
|
|
|
|
sc_init_one(&whereis_file_list, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2006-03-30 07:03:04 +00:00
|
|
|
|
|
|
|
sc_init_one(&whereis_file_list, NANO_FIRSTFILE_KEY, first_file_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_firstfile_msg, FALSE, NANO_FIRSTFILE_METAKEY),
|
|
|
|
NANO_FIRSTFILE_FKEY, NANO_FIRSTFILE_METAKEY2, VIEW,
|
2006-04-21 02:24:34 +00:00
|
|
|
do_first_file);
|
2006-03-30 07:03:04 +00:00
|
|
|
|
|
|
|
sc_init_one(&whereis_file_list, NANO_LASTFILE_KEY, last_file_msg,
|
2006-11-21 04:20:53 +00:00
|
|
|
IFSCHELP(nano_lastfile_msg, FALSE, NANO_LASTFILE_METAKEY),
|
|
|
|
NANO_LASTFILE_FKEY, NANO_LASTFILE_METAKEY2, VIEW, do_last_file);
|
2006-03-30 07:03:04 +00:00
|
|
|
|
|
|
|
#ifndef NANO_SMALL
|
|
|
|
sc_init_one(&whereis_file_list, NANO_NO_KEY, case_sens_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_case_msg, FALSE, TOGGLE_CASE_KEY), NANO_NO_KEY,
|
2006-03-30 07:03:04 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
|
|
|
|
|
|
|
sc_init_one(&whereis_file_list, NANO_NO_KEY, backwards_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_reverse_msg, FALSE, TOGGLE_BACKWARDS_KEY),
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2006-03-30 07:03:04 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
sc_init_one(&whereis_file_list, NANO_NO_KEY, regexp_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_regexp_msg, FALSE, NANO_REGEXP_KEY), NANO_NO_KEY,
|
2006-03-30 07:03:04 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef NANO_SMALL
|
2006-05-24 19:48:03 +00:00
|
|
|
sc_init_one(&whereis_file_list, NANO_PREVLINE_KEY, prev_history_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2006-05-24 19:48:03 +00:00
|
|
|
|
|
|
|
sc_init_one(&whereis_file_list, NANO_NEXTLINE_KEY, next_history_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2006-03-30 07:03:04 +00:00
|
|
|
#endif
|
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&gotodir_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&gotodir_list, NANO_HELP_KEY, get_help_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-08-25 19:26:48 +00:00
|
|
|
do_browser_help
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
2006-03-24 05:28:03 +00:00
|
|
|
nano_disabled_msg
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2006-03-24 05:28:03 +00:00
|
|
|
);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&gotodir_list, NANO_CANCEL_KEY, cancel_msg,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY,
|
2006-04-22 19:45:26 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
currshortcut = main_list;
|
2005-01-08 06:04:19 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2002-04-23 10:56:06 +00:00
|
|
|
toggle_init();
|
2002-02-27 04:14:16 +00:00
|
|
|
#endif
|
2002-04-23 10:56:06 +00:00
|
|
|
}
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2006-04-19 13:36:56 +00:00
|
|
|
/* Free the given shortcut. */
|
2004-07-12 03:10:30 +00:00
|
|
|
void free_shortcutage(shortcut **shortcutage)
|
|
|
|
{
|
|
|
|
assert(shortcutage != NULL);
|
2005-06-06 18:41:17 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
while (*shortcutage != NULL) {
|
|
|
|
shortcut *ps = *shortcutage;
|
|
|
|
*shortcutage = (*shortcutage)->next;
|
|
|
|
free(ps);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-04-19 13:36:56 +00:00
|
|
|
/* Add a new toggle to the end of the global toggle list. */
|
2006-07-25 21:13:30 +00:00
|
|
|
void toggle_init_one(int val
|
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
, const char *desc, bool blank_after
|
|
|
|
#endif
|
|
|
|
, long flag)
|
2004-07-12 03:10:30 +00:00
|
|
|
{
|
|
|
|
toggle *u;
|
|
|
|
|
|
|
|
if (toggles == NULL) {
|
2004-07-20 12:57:34 +00:00
|
|
|
toggles = (toggle *)nmalloc(sizeof(toggle));
|
2004-07-12 03:10:30 +00:00
|
|
|
u = toggles;
|
|
|
|
} else {
|
|
|
|
for (u = toggles; u->next != NULL; u = u->next)
|
|
|
|
;
|
2004-07-20 12:57:34 +00:00
|
|
|
u->next = (toggle *)nmalloc(sizeof(toggle));
|
2004-07-12 03:10:30 +00:00
|
|
|
u = u->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
u->val = val;
|
2006-07-25 21:13:30 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2006-04-20 22:29:02 +00:00
|
|
|
u->desc = (desc == NULL) ? "" : _(desc);
|
2006-04-22 19:45:26 +00:00
|
|
|
u->blank_after = blank_after;
|
2006-07-25 21:13:30 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
u->flag = flag;
|
|
|
|
u->next = NULL;
|
|
|
|
}
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
/* Initialize the global toggle list. */
|
2004-07-12 03:10:30 +00:00
|
|
|
void toggle_init(void)
|
|
|
|
{
|
|
|
|
/* There is no need to reinitialize the toggles. They can't
|
|
|
|
* change. */
|
|
|
|
if (toggles != NULL)
|
|
|
|
return;
|
|
|
|
|
2006-07-25 21:13:30 +00:00
|
|
|
/* The following macro is to be used in calling toggle_init_one(). The
|
|
|
|
* point is that toggle_init_one() takes 4 arguments, unless
|
|
|
|
* DISABLE_HELP is defined, when the 2nd and 3rd ones should not be
|
|
|
|
* there. */
|
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
#define IFTHELP(help, blank, nextvar) help, blank, nextvar
|
|
|
|
#else
|
|
|
|
#define IFTHELP(help, blank, nextvar) nextvar
|
|
|
|
#endif
|
|
|
|
|
|
|
|
toggle_init_one(TOGGLE_NOHELP_KEY, IFTHELP(N_("Help mode"), FALSE,
|
|
|
|
NO_HELP));
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2006-04-19 23:13:44 +00:00
|
|
|
toggle_init_one(TOGGLE_CONST_KEY,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFTHELP(N_("Constant cursor position display"), FALSE,
|
|
|
|
CONST_UPDATE));
|
2006-04-20 22:29:02 +00:00
|
|
|
|
|
|
|
toggle_init_one(TOGGLE_MORESPACE_KEY,
|
2006-07-31 01:30:31 +00:00
|
|
|
IFTHELP(N_("Use of one more line for editing"), FALSE,
|
2006-07-25 21:13:30 +00:00
|
|
|
MORE_SPACE));
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_SMOOTH_KEY,
|
2006-04-23 19:15:15 +00:00
|
|
|
#ifdef ENABLE_NANORC
|
2006-07-25 21:13:30 +00:00
|
|
|
IFTHELP(N_("Smooth scrolling"), FALSE, SMOOTH_SCROLL)
|
2006-04-23 19:15:15 +00:00
|
|
|
#else
|
2006-07-25 21:13:30 +00:00
|
|
|
IFTHELP(N_("Smooth scrolling"), TRUE, SMOOTH_SCROLL)
|
2006-04-23 19:15:15 +00:00
|
|
|
#endif
|
2006-07-25 21:13:30 +00:00
|
|
|
);
|
2006-04-20 22:29:02 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_NANORC
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_WHITESPACE_KEY,
|
2006-04-23 19:15:15 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2006-07-25 21:13:30 +00:00
|
|
|
IFTHELP(N_("Whitespace display"), FALSE, WHITESPACE_DISPLAY)
|
2006-04-23 19:15:15 +00:00
|
|
|
#else
|
2006-07-25 21:13:30 +00:00
|
|
|
IFTHELP(N_("Whitespace display"), TRUE, WHITESPACE_DISPLAY)
|
2006-04-23 19:15:15 +00:00
|
|
|
#endif
|
2006-07-25 21:13:30 +00:00
|
|
|
);
|
2004-07-12 03:10:30 +00:00
|
|
|
#endif
|
2006-04-20 22:29:02 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_COLOR
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_SYNTAX_KEY,
|
|
|
|
IFTHELP(N_("Color syntax highlighting"), TRUE, NO_COLOR_SYNTAX));
|
2006-04-22 18:20:14 +00:00
|
|
|
#endif
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_SMARTHOME_KEY, IFTHELP(N_("Smart home key"),
|
|
|
|
FALSE, SMART_HOME));
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_AUTOINDENT_KEY, IFTHELP(N_("Auto indent"),
|
|
|
|
FALSE, AUTOINDENT));
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_CUTTOEND_KEY, IFTHELP(N_("Cut to end"),
|
|
|
|
FALSE, CUT_TO_END));
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef DISABLE_WRAPPING
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_WRAP_KEY, IFTHELP(N_("Long line wrapping"),
|
|
|
|
FALSE, NO_WRAP));
|
2004-07-12 03:10:30 +00:00
|
|
|
#endif
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2005-06-18 03:37:56 +00:00
|
|
|
toggle_init_one(TOGGLE_TABSTOSPACES_KEY,
|
2006-07-25 22:24:48 +00:00
|
|
|
#ifndef DISABLE_MOUSE
|
|
|
|
IFTHELP(N_("Conversion of typed tabs to spaces"), TRUE,
|
|
|
|
TABS_TO_SPACES)
|
|
|
|
#else
|
2006-07-25 21:13:30 +00:00
|
|
|
IFTHELP(N_("Conversion of typed tabs to spaces"),
|
|
|
|
!ISSET(RESTRICTED) ? TRUE : FALSE, TABS_TO_SPACES)
|
2006-04-23 19:15:15 +00:00
|
|
|
#endif
|
2006-07-25 21:13:30 +00:00
|
|
|
);
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2004-12-04 17:41:52 +00:00
|
|
|
/* If we're using restricted mode, the backup toggle is disabled.
|
|
|
|
* It's useless since backups are disabled. */
|
|
|
|
if (!ISSET(RESTRICTED))
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_BACKUP_KEY, IFTHELP(N_("Backup files"),
|
|
|
|
FALSE, BACKUP_FILE));
|
2006-04-20 22:29:02 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
/* If we're using restricted mode, the multibuffer toggle is
|
|
|
|
* disabled. It's useless since inserting files is disabled. */
|
|
|
|
if (!ISSET(RESTRICTED))
|
|
|
|
toggle_init_one(TOGGLE_MULTIBUFFER_KEY,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFTHELP(N_("Multiple file buffers"), FALSE,
|
|
|
|
MULTIBUFFER));
|
2004-07-12 03:10:30 +00:00
|
|
|
#endif
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2006-04-20 22:36:10 +00:00
|
|
|
#ifndef DISABLE_MOUSE
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_MOUSE_KEY, IFTHELP(N_("Mouse support"),
|
|
|
|
FALSE, USE_MOUSE));
|
2006-04-20 22:36:10 +00:00
|
|
|
#endif
|
|
|
|
|
2006-04-20 22:29:02 +00:00
|
|
|
/* If we're using restricted mode, the DOS/Mac conversion toggle is
|
|
|
|
* disabled. It's useless since inserting files is disabled. */
|
|
|
|
if (!ISSET(RESTRICTED))
|
|
|
|
toggle_init_one(TOGGLE_NOCONVERT_KEY,
|
2006-07-25 21:13:30 +00:00
|
|
|
IFTHELP(N_("No conversion from DOS/Mac format"), FALSE,
|
|
|
|
NO_CONVERT));
|
2006-04-20 22:29:02 +00:00
|
|
|
|
|
|
|
/* If we're using restricted mode, the suspend toggle is disabled.
|
|
|
|
* It's useless since suspending is disabled. */
|
|
|
|
if (!ISSET(RESTRICTED))
|
2006-07-25 21:13:30 +00:00
|
|
|
toggle_init_one(TOGGLE_SUSPEND_KEY, IFTHELP(N_("Suspension"),
|
|
|
|
FALSE, SUSPEND));
|
2004-07-12 03:10:30 +00:00
|
|
|
}
|
2005-11-15 03:17:35 +00:00
|
|
|
#endif /* !NANO_TINY */
|
2004-07-12 03:10:30 +00:00
|
|
|
|
2006-04-19 13:36:56 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
/* This function is used to gracefully return all the memory we've used.
|
|
|
|
* It should be called just before calling exit(). Practically, the
|
2002-05-12 19:52:15 +00:00
|
|
|
* only effect is to cause a segmentation fault if the various data
|
|
|
|
* structures got bolloxed earlier. Thus, we don't bother having this
|
2002-07-19 01:08:59 +00:00
|
|
|
* function unless debugging is turned on. */
|
|
|
|
void thanks_for_all_the_fish(void)
|
2002-02-27 04:14:16 +00:00
|
|
|
{
|
2004-07-12 03:10:30 +00:00
|
|
|
delwin(topwin);
|
|
|
|
delwin(edit);
|
|
|
|
delwin(bottomwin);
|
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
if (quotestr != NULL)
|
|
|
|
free(quotestr);
|
2004-07-30 03:54:34 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
regfree("ereg);
|
2005-05-26 05:17:13 +00:00
|
|
|
if (quoteerr != NULL)
|
|
|
|
free(quoteerr);
|
2004-07-30 03:54:34 +00:00
|
|
|
#endif
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-02-28 16:24:31 +00:00
|
|
|
if (backup_dir != NULL)
|
|
|
|
free(backup_dir);
|
|
|
|
#endif
|
2002-03-28 01:59:34 +00:00
|
|
|
#ifndef DISABLE_OPERATINGDIR
|
2002-02-27 04:14:16 +00:00
|
|
|
if (operating_dir != NULL)
|
|
|
|
free(operating_dir);
|
|
|
|
if (full_operating_dir != NULL)
|
|
|
|
free(full_operating_dir);
|
|
|
|
#endif
|
|
|
|
if (last_search != NULL)
|
|
|
|
free(last_search);
|
|
|
|
if (last_replace != NULL)
|
|
|
|
free(last_replace);
|
|
|
|
#ifndef DISABLE_SPELLER
|
|
|
|
if (alt_speller != NULL)
|
|
|
|
free(alt_speller);
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
2002-02-27 04:14:16 +00:00
|
|
|
if (answer != NULL)
|
|
|
|
free(answer);
|
|
|
|
if (cutbuffer != NULL)
|
2003-01-13 01:35:15 +00:00
|
|
|
free_filestruct(cutbuffer);
|
2004-11-23 04:08:28 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
if (jusbuffer != NULL)
|
|
|
|
free_filestruct(jusbuffer);
|
|
|
|
#endif
|
2002-02-27 04:14:16 +00:00
|
|
|
free_shortcutage(&main_list);
|
|
|
|
free_shortcutage(&whereis_list);
|
|
|
|
free_shortcutage(&replace_list);
|
|
|
|
free_shortcutage(&replace_list_2);
|
2004-09-30 22:07:21 +00:00
|
|
|
free_shortcutage(&gotoline_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
free_shortcutage(&writefile_list);
|
|
|
|
free_shortcutage(&insertfile_list);
|
2005-12-08 07:09:08 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
free_shortcutage(&extcmd_list);
|
|
|
|
#endif
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-07-19 01:08:59 +00:00
|
|
|
free_shortcutage(&help_list);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_SPELLER
|
2002-02-27 04:14:16 +00:00
|
|
|
free_shortcutage(&spell_list);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2002-02-27 04:14:16 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
|
|
|
free_shortcutage(&browser_list);
|
2003-01-13 01:35:15 +00:00
|
|
|
free_shortcutage(&gotodir_list);
|
2002-02-27 04:14:16 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-05-26 06:09:07 +00:00
|
|
|
/* Free the memory associated with each toggle. */
|
2005-05-26 05:17:13 +00:00
|
|
|
while (toggles != NULL) {
|
|
|
|
toggle *t = toggles;
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2005-05-26 05:17:13 +00:00
|
|
|
toggles = toggles->next;
|
|
|
|
free(t);
|
|
|
|
}
|
|
|
|
#endif
|
2005-05-26 05:53:29 +00:00
|
|
|
/* Free the memory associated with each open file buffer. */
|
2005-07-08 20:09:16 +00:00
|
|
|
if (openfile != NULL)
|
2005-07-08 19:57:25 +00:00
|
|
|
free_openfilestruct(openfile);
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2005-05-26 05:17:13 +00:00
|
|
|
if (syntaxstr != NULL)
|
|
|
|
free(syntaxstr);
|
2002-07-19 01:08:59 +00:00
|
|
|
while (syntaxes != NULL) {
|
|
|
|
syntaxtype *bill = syntaxes;
|
|
|
|
|
|
|
|
free(syntaxes->desc);
|
|
|
|
while (syntaxes->extensions != NULL) {
|
|
|
|
exttype *bob = syntaxes->extensions;
|
|
|
|
|
|
|
|
syntaxes->extensions = bob->next;
|
2005-07-29 21:42:08 +00:00
|
|
|
free(bob->ext_regex);
|
2005-08-29 18:52:06 +00:00
|
|
|
if (bob->ext != NULL) {
|
|
|
|
regfree(bob->ext);
|
|
|
|
free(bob->ext);
|
|
|
|
}
|
2002-07-19 01:08:59 +00:00
|
|
|
free(bob);
|
|
|
|
}
|
|
|
|
while (syntaxes->color != NULL) {
|
|
|
|
colortype *bob = syntaxes->color;
|
|
|
|
|
|
|
|
syntaxes->color = bob->next;
|
2005-07-29 21:42:08 +00:00
|
|
|
free(bob->start_regex);
|
2005-07-13 20:18:46 +00:00
|
|
|
if (bob->start != NULL) {
|
|
|
|
regfree(bob->start);
|
|
|
|
free(bob->start);
|
|
|
|
}
|
2005-07-14 18:33:51 +00:00
|
|
|
if (bob->end_regex != NULL)
|
|
|
|
free(bob->end_regex);
|
2005-07-13 20:18:46 +00:00
|
|
|
if (bob->end != NULL) {
|
2003-02-03 02:56:44 +00:00
|
|
|
regfree(bob->end);
|
2005-07-13 20:18:46 +00:00
|
|
|
free(bob->end);
|
|
|
|
}
|
2002-07-19 01:08:59 +00:00
|
|
|
free(bob);
|
|
|
|
}
|
|
|
|
syntaxes = syntaxes->next;
|
|
|
|
free(bill);
|
|
|
|
}
|
|
|
|
#endif /* ENABLE_COLOR */
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-05-26 06:09:07 +00:00
|
|
|
/* Free the search and replace history lists. */
|
2005-05-26 05:17:13 +00:00
|
|
|
if (searchage != NULL)
|
|
|
|
free_filestruct(searchage);
|
|
|
|
if (replaceage != NULL)
|
|
|
|
free_filestruct(replaceage);
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
2004-08-17 05:23:38 +00:00
|
|
|
#ifdef ENABLE_NANORC
|
2005-05-26 05:17:13 +00:00
|
|
|
if (homedir != NULL)
|
|
|
|
free(homedir);
|
2004-08-17 05:23:38 +00:00
|
|
|
#endif
|
2002-02-27 04:14:16 +00:00
|
|
|
}
|
2002-05-12 19:52:15 +00:00
|
|
|
#endif /* DEBUG */
|