2000-08-06 21:13:45 +00:00
|
|
|
/* $Id$ */
|
2000-06-06 05:53:49 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* global.c *
|
|
|
|
* *
|
2005-01-01 07:28:15 +00:00
|
|
|
* Copyright (C) 1999-2005 Chris Allegretta *
|
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
|
|
|
* *
|
|
|
|
**************************************************************************/
|
|
|
|
|
2004-11-17 23:17:05 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include <config.h>
|
|
|
|
#endif
|
2001-04-28 18:03:52 +00:00
|
|
|
|
2002-10-13 18:43:45 +00:00
|
|
|
#include <stdlib.h>
|
2002-04-23 10:56:06 +00:00
|
|
|
#include <assert.h>
|
2000-06-06 05:53:49 +00:00
|
|
|
#include "proto.h"
|
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
/* Global variables */
|
2002-02-22 04:30:50 +00:00
|
|
|
|
2003-10-03 20:26:25 +00:00
|
|
|
#ifndef DISABLE_WRAPJUSTIFY
|
2004-07-12 16:07:14 +00:00
|
|
|
/* wrap_at might be set in rcfile.c or nano.c. */
|
|
|
|
ssize_t wrap_at = -CHARS_FROM_EOL; /* Right justified fill value,
|
|
|
|
allows resize */
|
2003-10-03 20:26:25 +00:00
|
|
|
#endif
|
|
|
|
|
2002-07-19 01:08:59 +00:00
|
|
|
char *last_search = NULL; /* Last string we searched for */
|
|
|
|
char *last_replace = NULL; /* Last replacement string */
|
|
|
|
int search_last_line; /* Is this the last search line? */
|
|
|
|
|
2005-01-27 20:49:07 +00:00
|
|
|
unsigned long flags = 0; /* Our flag containing many options */
|
2005-01-17 05:06:55 +00:00
|
|
|
WINDOW *topwin; /* Top buffer */
|
2002-06-13 00:40:19 +00:00
|
|
|
WINDOW *edit; /* The file portion of the editor */
|
2000-06-06 05:53:49 +00:00
|
|
|
WINDOW *bottomwin; /* Bottom buffer */
|
2000-12-14 13:56:28 +00:00
|
|
|
char *filename = NULL; /* Name of the file */
|
2002-06-28 22:45:14 +00:00
|
|
|
|
|
|
|
#ifndef NANO_SMALL
|
|
|
|
struct stat originalfilestat; /* Stat for the file as we loaded it */
|
|
|
|
#endif
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
int editwinrows = 0; /* How many rows long is the edit
|
|
|
|
window? */
|
|
|
|
filestruct *current; /* Current buffer pointer */
|
2004-10-30 01:03:15 +00:00
|
|
|
size_t current_x = 0; /* Current x-coordinate in the edit
|
|
|
|
window */
|
|
|
|
int current_y = 0; /* Current y-coordinate in the edit
|
|
|
|
window */
|
2000-06-06 05:53:49 +00:00
|
|
|
filestruct *fileage = NULL; /* Our file buffer */
|
|
|
|
filestruct *edittop = NULL; /* Pointer to the top of the edit
|
|
|
|
buffer with respect to the
|
|
|
|
file struct */
|
|
|
|
filestruct *filebot = NULL; /* Last node in the file struct */
|
|
|
|
filestruct *cutbuffer = NULL; /* A place to store cut text */
|
2004-11-23 04:08:28 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
filestruct *jusbuffer = NULL; /* A place to store unjustified text */
|
|
|
|
#endif
|
2004-11-03 22:03:41 +00:00
|
|
|
partition *filepart = NULL; /* A place to store a portion of the
|
|
|
|
file struct */
|
|
|
|
|
2001-07-14 19:32:47 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2004-12-01 15:11:27 +00:00
|
|
|
openfilestruct *open_files = NULL; /* The list of open file
|
|
|
|
buffers */
|
2001-07-11 02:08:33 +00:00
|
|
|
#endif
|
|
|
|
|
2004-05-29 16:47:52 +00:00
|
|
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
|
|
|
char *whitespace = NULL; /* Characters used when displaying
|
|
|
|
the first characters of tabs and
|
|
|
|
spaces. */
|
2005-03-10 22:52:21 +00:00
|
|
|
int whitespace_len[2]; /* The length of the characters. */
|
2004-05-29 16:47:52 +00:00
|
|
|
#endif
|
|
|
|
|
2002-03-03 22:36:36 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2004-05-29 16:38:57 +00:00
|
|
|
char *punct = NULL; /* Closing punctuation that can end
|
|
|
|
sentences. */
|
|
|
|
char *brackets = NULL; /* Closing brackets that can follow
|
|
|
|
closing punctuation and can end
|
|
|
|
sentences. */
|
2003-01-13 01:35:15 +00:00
|
|
|
char *quotestr = NULL; /* Quote string. The default value is
|
|
|
|
set in main(). */
|
2004-07-30 03:54:34 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
regex_t quotereg; /* Compiled quotestr regular expression. */
|
|
|
|
int quoterc; /* Did it compile? */
|
|
|
|
char *quoteerr = NULL; /* The error message. */
|
|
|
|
#else
|
|
|
|
size_t quotelen; /* strlen(quotestr) */
|
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2002-03-03 22:36:36 +00:00
|
|
|
|
2004-02-28 16:24:31 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
char *backup_dir = NULL; /* Backup directory. */
|
|
|
|
#endif
|
|
|
|
|
2002-07-19 01:08:59 +00:00
|
|
|
char *answer = NULL; /* Answer str to many questions */
|
2000-06-06 05:53:49 +00:00
|
|
|
int totlines = 0; /* Total number of lines in the file */
|
2005-01-27 20:49:07 +00:00
|
|
|
size_t totsize = 0; /* Total number of characters in the
|
|
|
|
file */
|
2004-07-28 20:46:25 +00:00
|
|
|
size_t placewewant = 0; /* The column we'd like the cursor
|
2000-06-06 05:53:49 +00:00
|
|
|
to jump to when we go to the
|
|
|
|
next or previous line */
|
|
|
|
|
2004-07-12 16:07:14 +00:00
|
|
|
ssize_t tabsize = -1; /* Our internal tabsize variable. The
|
|
|
|
default value is set in main(). */
|
2000-08-03 22:51:21 +00:00
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
char *hblank = NULL; /* A horizontal blank line */
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2000-06-06 05:53:49 +00:00
|
|
|
char *help_text; /* The text in the help window */
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
|
|
|
/* More stuff for the marker select */
|
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef NANO_SMALL
|
2004-01-09 23:04:55 +00:00
|
|
|
filestruct *mark_beginbuf; /* The begin marker buffer */
|
2004-10-30 01:16:08 +00:00
|
|
|
size_t mark_beginx; /* X value in the string to start */
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2001-09-19 03:19:43 +00:00
|
|
|
#ifndef DISABLE_OPERATINGDIR
|
2002-02-27 04:14:16 +00:00
|
|
|
char *operating_dir = NULL; /* Operating directory, which we can't */
|
|
|
|
char *full_operating_dir = NULL;/* go higher than */
|
2001-09-19 03:19:43 +00:00
|
|
|
#endif
|
|
|
|
|
2001-04-18 04:28:54 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2002-05-05 23:03:54 +00:00
|
|
|
char *alt_speller = NULL; /* Alternative spell command */
|
2001-04-18 04:28:54 +00:00
|
|
|
#endif
|
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *main_list = NULL;
|
|
|
|
shortcut *whereis_list = NULL;
|
|
|
|
shortcut *replace_list = NULL;
|
2002-02-22 04:30:50 +00:00
|
|
|
shortcut *replace_list_2 = NULL; /* 2nd half of replace dialog */
|
2004-09-30 22:07:21 +00:00
|
|
|
shortcut *gotoline_list = NULL;
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *writefile_list = NULL;
|
|
|
|
shortcut *insertfile_list = NULL;
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *help_list = NULL;
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_SPELLER
|
2002-02-15 19:17:02 +00:00
|
|
|
shortcut *spell_list = NULL;
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2002-04-06 05:02:14 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-03-21 05:07:28 +00:00
|
|
|
shortcut *extcmd_list = NULL;
|
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;
|
2003-02-05 02:51:19 +00:00
|
|
|
shortcut *gotodir_list = NULL;
|
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
|
|
|
const colortype *colorstrings = NULL;
|
|
|
|
syntaxtype *syntaxes = NULL;
|
|
|
|
char *syntaxstr = NULL;
|
2001-04-30 11:28:46 +00:00
|
|
|
#endif
|
|
|
|
|
2002-07-19 01:08:59 +00:00
|
|
|
const shortcut *currshortcut; /* Current shortcut list we're using */
|
2001-04-12 03:01:53 +00:00
|
|
|
|
2001-01-20 22:18:18 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-02-15 19:17:02 +00:00
|
|
|
toggle *toggles = NULL;
|
2001-01-20 22:18:18 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-06-03 19:28:30 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-05-23 16:30:06 +00:00
|
|
|
filestruct *search_history = NULL;
|
|
|
|
filestruct *searchage = NULL;
|
|
|
|
filestruct *searchbot = NULL;
|
|
|
|
filestruct *replace_history = NULL;
|
|
|
|
filestruct *replaceage = NULL;
|
|
|
|
filestruct *replacebot = NULL;
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
|
|
|
|
2000-07-07 01:49:52 +00:00
|
|
|
/* Regular expressions */
|
2000-09-06 13:39:17 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2000-10-26 01:44:42 +00:00
|
|
|
regex_t search_regexp; /* Global to store compiled search regexp */
|
|
|
|
regmatch_t regmatches[10]; /* Match positions for parenthetical
|
|
|
|
subexpressions, max of 10 */
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2002-03-24 23:19:32 +00:00
|
|
|
|
2004-08-12 03:27:54 +00:00
|
|
|
bool curses_ended = FALSE; /* Indicates to statusbar() to simply
|
2003-02-03 03:32:08 +00:00
|
|
|
* write to stderr, since endwin() has
|
|
|
|
* ended curses mode. */
|
|
|
|
|
2004-08-17 05:23:38 +00:00
|
|
|
char *homedir = NULL; /* $HOME or from /etc/passwd. */
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
/* Initialize a struct *without* our lovely braces =( */
|
2004-03-19 21:46:34 +00:00
|
|
|
void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc,
|
2002-04-23 10:56:06 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2003-02-13 22:25:01 +00:00
|
|
|
const char *help,
|
2002-06-28 22:45:14 +00:00
|
|
|
#endif
|
2005-01-08 06:04:19 +00:00
|
|
|
int metaval, int funcval, int miscval, bool view, void
|
2004-03-19 21:46:34 +00:00
|
|
|
(*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;
|
2004-07-12 03:10:30 +00:00
|
|
|
s->desc = _(desc);
|
2002-04-23 10:56:06 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2004-07-12 03:10:30 +00:00
|
|
|
s->help = _(help);
|
2002-06-28 22:45:14 +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
|
|
|
}
|
|
|
|
|
2004-11-11 21:50:01 +00:00
|
|
|
void shortcut_init(bool unjustify)
|
2000-09-01 13:32:47 +00:00
|
|
|
{
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *get_help_msg = N_("Get Help");
|
|
|
|
const char *exit_msg = N_("Exit");
|
|
|
|
const char *prev_page_msg = N_("Prev Page");
|
|
|
|
const char *next_page_msg = N_("Next Page");
|
|
|
|
const char *replace_msg = N_("Replace");
|
|
|
|
const char *go_to_line_msg = N_("Go To Line");
|
|
|
|
const char *cancel_msg = N_("Cancel");
|
|
|
|
const char *first_line_msg = N_("First Line");
|
|
|
|
const char *last_line_msg = N_("Last Line");
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *refresh_msg = N_("Refresh");
|
2005-01-01 07:43:32 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
const char *cut_till_end_msg = N_("CutTillEnd");
|
|
|
|
#endif
|
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
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
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-06-03 20:51:39 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-05-03 20:57:13 +00:00
|
|
|
const char *history_msg = N_("History");
|
2004-09-28 22:21:46 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
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
|
|
|
|
const char *to_files_msg = N_("To Files");
|
2002-10-13 18:43:45 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
const char *nano_help_msg = N_("Invoke the help menu");
|
|
|
|
const char *nano_exit_msg =
|
2001-07-14 19:32:47 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2005-06-16 03:11:39 +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 =
|
|
|
|
N_("Search for text within the editor");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_prevpage_msg = N_("Move to the previous screen");
|
|
|
|
const char *nano_nextpage_msg = N_("Move to the next screen");
|
|
|
|
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 =
|
|
|
|
N_("Show the position of the cursor");
|
|
|
|
const char *nano_spell_msg =
|
|
|
|
N_("Invoke the spell checker, if available");
|
2005-05-17 21:49:19 +00:00
|
|
|
const char *nano_gotoline_msg =
|
|
|
|
N_("Go to a specific line number and column number");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_replace_msg = N_("Replace text within the editor");
|
2004-11-01 22:54:40 +00:00
|
|
|
#ifndef NANO_SMALL
|
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");
|
2004-11-01 22:54:40 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_prevline_msg = N_("Move to the previous line");
|
|
|
|
const char *nano_nextline_msg = N_("Move to the next line");
|
|
|
|
const char *nano_forward_msg = N_("Move forward one character");
|
|
|
|
const char *nano_back_msg = N_("Move back one character");
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *nano_home_msg =
|
|
|
|
N_("Move to the beginning of the current line");
|
|
|
|
const char *nano_end_msg =
|
|
|
|
N_("Move to the end of the current line");
|
|
|
|
const char *nano_refresh_msg =
|
|
|
|
N_("Refresh (redraw) the current screen");
|
|
|
|
const char *nano_delete_msg =
|
|
|
|
N_("Delete the character under the cursor");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_backspace_msg =
|
|
|
|
N_("Delete the character to the left of the cursor");
|
2004-10-23 14:53:07 +00:00
|
|
|
const char *nano_tab_msg =
|
|
|
|
N_("Insert a tab character at the cursor position");
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_enter_msg =
|
|
|
|
N_("Insert a carriage return at the cursor position");
|
2004-08-07 21:27:37 +00:00
|
|
|
#ifndef NANO_SMALL
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_nextword_msg = N_("Move forward one word");
|
|
|
|
const char *nano_prevword_msg = N_("Move backward one word");
|
2005-06-12 22:31:03 +00:00
|
|
|
const char *nano_wordcount_msg =
|
|
|
|
N_("Count the number of words in the file");
|
2004-08-07 21:27:37 +00:00
|
|
|
#endif
|
2004-09-11 21:41:13 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
const char *nano_parabegin_msg =
|
|
|
|
N_("Go to the beginning of the current paragraph");
|
|
|
|
const char *nano_paraend_msg =
|
|
|
|
N_("Go to the end of the current paragraph");
|
|
|
|
#endif
|
2003-11-28 19:47:42 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *nano_openprev_msg =
|
|
|
|
N_("Switch to the previous file buffer");
|
|
|
|
const char *nano_opennext_msg =
|
|
|
|
N_("Switch to the next file buffer");
|
2004-09-11 21:41:13 +00:00
|
|
|
#endif
|
|
|
|
const char *nano_verbatim_msg = N_("Insert character(s) verbatim");
|
2005-01-01 07:43:32 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
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
|
2004-11-01 22:40:02 +00:00
|
|
|
#if !defined(NANO_SMALL) && defined(HAVE_REGEX_H)
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_bracket_msg = N_("Find other bracket");
|
2004-08-07 21:27:37 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_cancel_msg = N_("Cancel the current function");
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *nano_firstline_msg =
|
|
|
|
N_("Go to the first line of the file");
|
|
|
|
const char *nano_lastline_msg =
|
|
|
|
N_("Go to the last line of the file");
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
const char *nano_case_msg =
|
|
|
|
N_("Make the current search/replace case (in)sensitive");
|
|
|
|
const char *nano_reverse_msg =
|
|
|
|
N_("Make the current search/replace go backwards");
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
const char *nano_regexp_msg = N_("Use regular expressions");
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
2005-06-03 20:51:39 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-05-03 20:57:13 +00:00
|
|
|
const char *nano_history_msg =
|
|
|
|
N_("Edit the previous search/replace strings");
|
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
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
const char *nano_dos_msg = N_("Write file out in DOS format");
|
|
|
|
const char *nano_mac_msg = N_("Write file out in Mac format");
|
2001-09-28 19:53:11 +00:00
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_append_msg = N_("Append to the current file");
|
|
|
|
const char *nano_prepend_msg = N_("Prepend to the current file");
|
|
|
|
#ifndef NANO_SMALL
|
2005-06-06 18:38:16 +00:00
|
|
|
const char *nano_backup_msg =
|
|
|
|
N_("Back up original file when saving");
|
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-02-22 23:22:37 +00:00
|
|
|
#if !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
|
2004-07-12 03:10:30 +00:00
|
|
|
const char *nano_multibuffer_msg = N_("Insert into new buffer");
|
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_BROWSER
|
2004-07-23 12:51:40 +00:00
|
|
|
const char *nano_exitbrowser_msg = N_("Exit from the file browser");
|
|
|
|
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
|
|
|
|
* point is that sc_init_one() takes 9 arguments, unless DISABLE_HELP is
|
|
|
|
* defined, when the 4th one should not be there. */
|
2004-03-02 22:52:57 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2005-03-22 04:50:11 +00:00
|
|
|
#define IFHELP(help, nextvar) help, nextvar
|
2004-03-02 22:52:57 +00:00
|
|
|
#else
|
2005-03-22 04:50:11 +00:00
|
|
|
#define IFHELP(help, 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);
|
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_HELP_KEY, get_help_msg,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-11-25 04:39:07 +00:00
|
|
|
sc_init_one(&main_list, NANO_EXIT_KEY,
|
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
open_files != NULL && open_files != open_files->next ?
|
|
|
|
N_("Close") :
|
2001-07-11 02:08:33 +00:00
|
|
|
#endif
|
2004-11-25 04:39:07 +00:00
|
|
|
exit_msg, IFHELP(nano_exit_msg, NANO_NO_KEY), NANO_EXIT_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_exit);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_WRITEOUT_KEY, N_("WriteOut"),
|
|
|
|
IFHELP(nano_writeout_msg, NANO_NO_KEY), NANO_WRITEOUT_FKEY,
|
|
|
|
NANO_NO_KEY, NOVIEW, do_writeout_void);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_JUSTIFY_KEY, N_("Justify"),
|
|
|
|
IFHELP(nano_justify_msg, NANO_NO_KEY),
|
|
|
|
NANO_JUSTIFY_FKEY, NANO_NO_KEY, NOVIEW,
|
2004-06-29 00:43:56 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2004-05-13 17:28:03 +00:00
|
|
|
do_justify_void
|
2004-04-30 04:49:02 +00:00
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
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
|
|
|
|
* 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. */
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_INSERTFILE_KEY, N_("Read File"),
|
|
|
|
IFHELP(nano_insert_msg, NANO_NO_KEY), NANO_INSERTFILE_FKEY,
|
|
|
|
NANO_NO_KEY,
|
2002-01-02 15:12:21 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2003-03-11 03:50:40 +00:00
|
|
|
VIEW
|
2002-01-02 15:12:21 +00:00
|
|
|
#else
|
2003-03-11 03:50:40 +00:00
|
|
|
NOVIEW
|
2002-01-02 15:12:21 +00:00
|
|
|
#endif
|
2004-11-12 00:48:18 +00:00
|
|
|
, !ISSET(RESTRICTED) ? do_insertfile_void :
|
|
|
|
nano_disabled_msg);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_WHEREIS_KEY, N_("Where Is"),
|
|
|
|
IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_WHEREIS_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_search);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_PREVPAGE_KEY, prev_page_msg,
|
|
|
|
IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_page_up);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_NEXTPAGE_KEY, next_page_msg,
|
|
|
|
IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_page_down);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_CUT_KEY, N_("Cut Text"),
|
|
|
|
IFHELP(nano_cut_msg, NANO_NO_KEY), NANO_CUT_FKEY,
|
|
|
|
NANO_NO_KEY, NOVIEW, do_cut_text);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2000-11-27 22:58:23 +00:00
|
|
|
if (unjustify)
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, N_("UnJustify"),
|
|
|
|
IFHELP(NULL, 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
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_UNCUT_KEY, N_("UnCut Txt"),
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_uncut_msg, NANO_NO_KEY), NANO_UNCUT_FKEY,
|
|
|
|
NANO_NO_KEY, NOVIEW, do_uncut_text);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_CURSORPOS_KEY, N_("Cur Pos"),
|
|
|
|
IFHELP(nano_cursorpos_msg, NANO_NO_KEY), 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. */
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_SPELL_KEY, N_("To Spell"),
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_spell_msg, NANO_NO_KEY), NANO_SPELL_FKEY,
|
2004-04-30 04:49:02 +00:00
|
|
|
NANO_NO_KEY, NOVIEW,
|
|
|
|
#ifndef DISABLE_SPELLER
|
|
|
|
!ISSET(RESTRICTED) ? do_spell :
|
|
|
|
#endif
|
|
|
|
nano_disabled_msg);
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg,
|
2004-11-01 22:54:40 +00:00
|
|
|
IFHELP(nano_gotoline_msg, NANO_GOTOLINE_ALTKEY),
|
2005-05-17 18:06:26 +00:00
|
|
|
NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW,
|
|
|
|
do_gotolinecolumn_void);
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg,
|
2004-11-01 22:54:40 +00:00
|
|
|
IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY),
|
|
|
|
NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, do_replace);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-11-01 22:54:40 +00:00
|
|
|
#ifndef NANO_SMALL
|
2004-11-01 22:40:02 +00:00
|
|
|
sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"),
|
|
|
|
IFHELP(nano_mark_msg, NANO_MARK_ALTKEY), NANO_MARK_FKEY,
|
2005-06-12 23:53:28 +00:00
|
|
|
NANO_NO_KEY, VIEW, do_mark);
|
2004-11-01 22:40:02 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Where Is Next"),
|
|
|
|
IFHELP(nano_whereis_next_msg, NANO_WHEREIS_NEXT_KEY),
|
2004-11-01 22:54:40 +00:00
|
|
|
NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, do_research);
|
2004-11-01 22:40:02 +00:00
|
|
|
#endif
|
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_PREVLINE_KEY, N_("Prev Line"),
|
|
|
|
IFHELP(nano_prevline_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_up);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_NEXTLINE_KEY, N_("Next Line"),
|
|
|
|
IFHELP(nano_nextline_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_down);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_FORWARD_KEY, N_("Forward"),
|
|
|
|
IFHELP(nano_forward_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_right_void);
|
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"),
|
|
|
|
IFHELP(nano_back_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_left_void);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_HOME_KEY, N_("Home"),
|
|
|
|
IFHELP(nano_home_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_home);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_END_KEY, N_("End"),
|
|
|
|
IFHELP(nano_end_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_end);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-06-06 18:38:16 +00:00
|
|
|
sc_init_one(&main_list, NANO_REFRESH_KEY, refresh_msg,
|
2004-07-12 03:10:30 +00:00
|
|
|
IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, total_refresh);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_DELETE_KEY, N_("Delete"),
|
|
|
|
IFHELP(nano_delete_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, NOVIEW, do_delete);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_BACKSPACE_KEY, N_("Backspace"),
|
|
|
|
IFHELP(nano_backspace_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, NOVIEW, do_backspace);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_TAB_KEY, N_("Tab"),
|
|
|
|
IFHELP(nano_tab_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, NOVIEW, do_tab);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_ENTER_KEY, N_("Enter"),
|
|
|
|
IFHELP(nano_enter_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, NOVIEW, do_enter);
|
2001-02-11 19:05:05 +00:00
|
|
|
|
2002-06-21 03:20:06 +00:00
|
|
|
#ifndef NANO_SMALL
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_NEXTWORD_KEY, N_("Next Word"),
|
|
|
|
IFHELP(nano_nextword_msg, 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"),
|
|
|
|
IFHELP(nano_prevword_msg, NANO_PREVWORD_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_prev_word);
|
2005-06-12 22:31:03 +00:00
|
|
|
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Word Count"),
|
|
|
|
IFHELP(nano_wordcount_msg, NANO_WORDCOUNT_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_word_count);
|
2001-09-22 22:14:25 +00:00
|
|
|
#endif
|
2003-08-23 21:11:06 +00:00
|
|
|
|
2004-09-11 21:41:13 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, beg_of_par_msg,
|
|
|
|
IFHELP(nano_parabegin_msg, NANO_PARABEGIN_ALTKEY1), NANO_NO_KEY,
|
2005-03-13 21:12:25 +00:00
|
|
|
NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void);
|
2004-09-11 21:41:13 +00:00
|
|
|
|
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, end_of_par_msg,
|
|
|
|
IFHELP(nano_paraend_msg, NANO_PARAEND_ALTKEY1), NANO_NO_KEY,
|
2005-03-13 21:12:25 +00:00
|
|
|
NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void);
|
2004-09-11 21:41:13 +00:00
|
|
|
#endif
|
2003-08-23 21:11:06 +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"),
|
|
|
|
IFHELP(nano_openprev_msg, NANO_OPENPREV_KEY), NANO_NO_KEY,
|
|
|
|
NANO_OPENPREV_ALTKEY, VIEW, open_prevfile_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"),
|
|
|
|
IFHELP(nano_opennext_msg, NANO_OPENNEXT_KEY), NANO_NO_KEY,
|
|
|
|
NANO_OPENNEXT_ALTKEY, VIEW, open_nextfile_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"),
|
|
|
|
IFHELP(nano_verbatim_msg, NANO_VERBATIM_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, NOVIEW, do_verbatim_input);
|
|
|
|
|
2005-01-01 07:43:32 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, cut_till_end_msg,
|
|
|
|
IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
|
|
|
|
#endif
|
|
|
|
|
2004-09-11 21:41:13 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, fulljstify_msg,
|
2004-11-01 22:54:40 +00:00
|
|
|
IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify);
|
2004-09-11 21:41:13 +00:00
|
|
|
#endif
|
|
|
|
|
2005-06-17 17:37:46 +00:00
|
|
|
#if !defined(NANO_SMALL) && defined(HAVE_REGEX_H)
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&main_list, NANO_NO_KEY, N_("Find Other Bracket"),
|
|
|
|
IFHELP(nano_bracket_msg, NANO_BRACKET_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_find_bracket);
|
2003-11-28 19:47:42 +00:00
|
|
|
#endif
|
|
|
|
|
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,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2003-09-04 20:25:29 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_CANCEL_KEY, cancel_msg,
|
|
|
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2003-09-04 20:25:29 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, first_line_msg,
|
|
|
|
IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_FIRSTLINE_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_first_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-09-04 20:25:29 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_LASTLINE_KEY, last_line_msg,
|
|
|
|
IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_LASTLINE_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_last_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-09-04 20:25:29 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_TOOTHERSEARCH_KEY, replace_msg,
|
2004-07-12 03:10:30 +00:00
|
|
|
IFHELP(nano_replace_msg, NANO_NO_KEY), NANO_REPLACE_FKEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2003-09-04 20:25:29 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_TOGOTOLINE_KEY, go_to_line_msg,
|
|
|
|
IFHELP(nano_gotoline_msg, NANO_NO_KEY), NANO_GOTOLINE_FKEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2000-06-29 01:30:04 +00:00
|
|
|
|
2003-09-04 20:25:29 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-09-11 21:41:13 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, beg_of_par_msg,
|
2004-09-30 22:07:21 +00:00
|
|
|
IFHELP(nano_parabegin_msg, NANO_PARABEGIN_ALTKEY1), NANO_NO_KEY,
|
2005-03-13 21:12:25 +00:00
|
|
|
NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void);
|
2003-09-04 20:25:29 +00:00
|
|
|
|
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-09-11 21:41:13 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_PARAEND_KEY, end_of_par_msg,
|
2004-09-30 22:07:21 +00:00
|
|
|
IFHELP(nano_paraend_msg, NANO_PARAEND_ALTKEY1), NANO_NO_KEY,
|
2005-03-13 21:12:25 +00:00
|
|
|
NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void);
|
2003-09-04 20:25:29 +00:00
|
|
|
#endif
|
|
|
|
|
2001-07-16 00:48:53 +00:00
|
|
|
#ifndef NANO_SMALL
|
2003-09-04 20:25:29 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_NO_KEY, case_sens_msg,
|
|
|
|
IFHELP(nano_case_msg, 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
|
|
|
|
2003-09-04 20:25:29 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2005-06-16 18:48:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_NO_KEY, backwards_msg,
|
2004-07-12 03:10:30 +00:00
|
|
|
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
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
|
2003-09-04 20:25:29 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_NO_KEY, regexp_msg,
|
2005-06-03 20:51:39 +00:00
|
|
|
IFHELP(nano_regexp_msg, 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-06-03 20:51:39 +00:00
|
|
|
#ifndef NANO_SMALL
|
2003-09-04 20:25:29 +00:00
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
2005-05-03 20:57:13 +00:00
|
|
|
sc_init_one(&whereis_list, NANO_PREVLINE_KEY, history_msg,
|
|
|
|
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2005-01-01 07:43:32 +00:00
|
|
|
|
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
|
|
|
sc_init_one(&whereis_list, NANO_CUTTILLEND_KEY, cut_till_end_msg,
|
|
|
|
IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY),
|
|
|
|
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2004-11-07 16:04:18 +00:00
|
|
|
|
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
/* Translators: try to keep this string under 10 characters long */
|
|
|
|
sc_init_one(&whereis_list, NANO_FULLJUSTIFY_KEY, fulljstify_msg,
|
|
|
|
IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY),
|
|
|
|
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,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
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,
|
|
|
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +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,
|
|
|
|
IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_FIRSTLINE_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW, 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,
|
|
|
|
IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_LASTLINE_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_last_line);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-05-03 20:57:13 +00:00
|
|
|
/* Translators: try to keep this string under 12 characters long */
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&replace_list, NANO_TOOTHERSEARCH_KEY, N_("No Replace"),
|
2004-07-12 03:10:30 +00:00
|
|
|
IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_REPLACE_FKEY,
|
2005-01-08 06:04:19 +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(&replace_list, NANO_TOGOTOLINE_KEY, go_to_line_msg,
|
|
|
|
IFHELP(nano_gotoline_msg, NANO_NO_KEY), NANO_GOTOLINE_FKEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2000-06-29 01:30:04 +00:00
|
|
|
|
2001-07-16 00:48:53 +00:00
|
|
|
#ifndef NANO_SMALL
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&replace_list, NANO_NO_KEY, case_sens_msg,
|
|
|
|
IFHELP(nano_case_msg, 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,
|
2004-07-12 03:10:30 +00:00
|
|
|
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
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,
|
2005-06-03 20:51:39 +00:00
|
|
|
IFHELP(nano_regexp_msg, 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-06-03 20:51:39 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-05-03 20:57:13 +00:00
|
|
|
sc_init_one(&replace_list, NANO_PREVLINE_KEY, history_msg,
|
|
|
|
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
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,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
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,
|
|
|
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +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,
|
|
|
|
IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, 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,
|
|
|
|
IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, do_last_line);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2005-06-03 19:28:30 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-05-03 20:57:13 +00:00
|
|
|
sc_init_one(&replace_list_2, NANO_PREVLINE_KEY, history_msg,
|
|
|
|
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
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,
|
2004-07-12 03:10:30 +00:00
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
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,
|
2004-07-12 03:10:30 +00:00
|
|
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +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,
|
2004-07-12 03:10:30 +00:00
|
|
|
IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, 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,
|
2004-07-12 03:10:30 +00:00
|
|
|
IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, 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,
|
|
|
|
N_("Go To Text"), IFHELP(nano_whereis_msg, NANO_NO_KEY),
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL);
|
2004-09-30 22:07:21 +00:00
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&help_list);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-06-06 18:38:16 +00:00
|
|
|
sc_init_one(&help_list, NANO_REFRESH_KEY, refresh_msg,
|
2005-04-25 21:48:22 +00:00
|
|
|
IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY,
|
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
|
|
|
|
|
|
|
sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg,
|
|
|
|
IFHELP(nano_exit_msg, NANO_NO_KEY), NANO_EXIT_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&help_list, NANO_PREVPAGE_KEY, prev_page_msg,
|
|
|
|
IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY,
|
2005-01-08 06:04:19 +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(&help_list, NANO_NEXTPAGE_KEY, next_page_msg,
|
|
|
|
IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2004-05-29 20:38:08 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&help_list, NANO_PREVLINE_KEY, N_("Prev Line"),
|
|
|
|
IFHELP(nano_prevline_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2004-05-29 20:38:08 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&help_list, NANO_NEXTLINE_KEY, N_("Next Line"),
|
|
|
|
IFHELP(nano_nextline_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +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,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
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,
|
|
|
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +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. */
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 16 characters long */
|
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,
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, NULL);
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-02-15 19:17:02 +00:00
|
|
|
#ifndef NANO_SMALL
|
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. */
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 16 characters long */
|
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_NO_KEY, N_("DOS Format"),
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_dos_msg, TOGGLE_DOS_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, NULL);
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 16 characters long */
|
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_NO_KEY, N_("Mac Format"),
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_mac_msg, TOGGLE_MAC_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, NULL);
|
2002-02-15 19:17:02 +00:00
|
|
|
#endif
|
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 16 characters long */
|
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_NO_KEY, N_("Append"),
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_append_msg, NANO_APPEND_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, NULL);
|
2001-05-29 04:21:44 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 16 characters long */
|
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_NO_KEY, N_("Prepend"),
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_prepend_msg, NANO_PREPEND_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, NULL);
|
2002-04-16 03:15:47 +00:00
|
|
|
|
2002-06-28 22:45:14 +00:00
|
|
|
#ifndef NANO_SMALL
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 16 characters long */
|
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_NO_KEY, N_("Backup File"),
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_backup_msg, TOGGLE_BACKUP_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
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,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
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,
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +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,
|
2003-12-24 03:33:09 +00:00
|
|
|
IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NOVIEW, NULL);
|
2001-05-29 04:21:44 +00:00
|
|
|
#endif
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2002-03-21 05:07:28 +00:00
|
|
|
#ifndef NANO_SMALL
|
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. */
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 22 characters long */
|
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,
|
|
|
|
N_("Execute Command"), IFHELP(nano_execute_msg,
|
2005-01-08 06:04:19 +00:00
|
|
|
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. */
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 22 characters long */
|
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,
|
2004-11-01 22:54:40 +00:00
|
|
|
IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY),
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, NANO_NO_KEY, 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
|
|
|
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2002-04-23 10:56:06 +00:00
|
|
|
free_shortcutage(&spell_list);
|
2002-04-06 05:02:14 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&spell_list, NANO_HELP_KEY, get_help_msg,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
2001-05-29 04:21:44 +00:00
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
sc_init_one(&spell_list, NANO_CANCEL_KEY, cancel_msg,
|
|
|
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2002-03-21 05:07:28 +00:00
|
|
|
#ifndef NANO_SMALL
|
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,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
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,
|
|
|
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +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"),
|
|
|
|
IFHELP(nano_insert_msg, 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,
|
2004-11-01 22:54:40 +00:00
|
|
|
IFHELP(nano_multibuffer_msg, 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
|
|
|
|
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,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
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,
|
2004-07-23 12:51:40 +00:00
|
|
|
IFHELP(nano_exitbrowser_msg, NANO_NO_KEY), NANO_EXIT_FKEY,
|
2005-01-08 06:04:19 +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(&browser_list, NANO_PREVPAGE_KEY, prev_page_msg,
|
|
|
|
IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
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,
|
|
|
|
IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY,
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_NO_KEY, VIEW, NULL);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2003-08-05 19:31:12 +00:00
|
|
|
/* Translators: try to keep this string under 22 characters long */
|
2004-09-30 22:07:21 +00:00
|
|
|
sc_init_one(&browser_list, NANO_GOTOLINE_KEY, N_("Go To Dir"),
|
2004-11-01 22:54:40 +00:00
|
|
|
IFHELP(nano_gotodir_msg, NANO_GOTOLINE_ALTKEY),
|
2005-01-08 06:04:19 +00:00
|
|
|
NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, NULL);
|
2001-04-14 06:50:24 +00:00
|
|
|
|
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,
|
|
|
|
IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY,
|
|
|
|
NANO_NO_KEY, VIEW,
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
do_help
|
|
|
|
#else
|
|
|
|
nano_disabled_msg
|
|
|
|
#endif
|
|
|
|
);
|
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,
|
|
|
|
IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY,
|
2005-01-08 06:04:19 +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
|
|
|
|
2002-02-27 04:14:16 +00:00
|
|
|
#ifndef NANO_SMALL
|
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
|
|
|
|
2004-07-12 03:10:30 +00:00
|
|
|
/* Deallocate the given shortcut. */
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef NANO_SMALL
|
|
|
|
/* Create one new toggle structure, at the end of the toggles linked
|
|
|
|
* list. */
|
|
|
|
void toggle_init_one(int val, const char *desc, long flag)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
u->desc = _(desc);
|
|
|
|
u->flag = flag;
|
|
|
|
u->next = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void toggle_init(void)
|
|
|
|
{
|
|
|
|
/* There is no need to reinitialize the toggles. They can't
|
|
|
|
* change. */
|
|
|
|
if (toggles != NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
toggle_init_one(TOGGLE_NOHELP_KEY, N_("Help mode"), NO_HELP);
|
2005-06-18 03:37:56 +00:00
|
|
|
toggle_init_one(TOGGLE_MORESPACE_KEY,
|
|
|
|
N_("Use of more space for editing"), MORE_SPACE);
|
2004-07-12 03:10:30 +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))
|
2005-01-17 05:06:55 +00:00
|
|
|
toggle_init_one(TOGGLE_MULTIBUFFER_KEY,
|
|
|
|
N_("Multiple file buffers"), MULTIBUFFER);
|
2004-07-12 03:10:30 +00:00
|
|
|
#endif
|
2005-06-18 03:37:56 +00:00
|
|
|
toggle_init_one(TOGGLE_CUTTOEND_KEY, N_("Cut to end"), CUT_TO_END);
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef DISABLE_WRAPPING
|
2005-06-18 03:03:32 +00:00
|
|
|
toggle_init_one(TOGGLE_WRAP_KEY, N_("Long line wrapping"),
|
|
|
|
NO_WRAP);
|
2004-07-12 03:10:30 +00:00
|
|
|
#endif
|
2005-06-18 03:37:56 +00:00
|
|
|
#ifndef DISABLE_MOUSE
|
|
|
|
toggle_init_one(TOGGLE_MOUSE_KEY, N_("Mouse support"), USE_MOUSE);
|
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
/* If we're using restricted mode, the suspend toggle is disabled.
|
|
|
|
* It's useless since suspending is disabled. */
|
|
|
|
if (!ISSET(RESTRICTED))
|
|
|
|
toggle_init_one(TOGGLE_SUSPEND_KEY, N_("Suspend"), SUSPEND);
|
2005-06-18 03:37:56 +00:00
|
|
|
toggle_init_one(TOGGLE_CONST_KEY,
|
|
|
|
N_("Constant cursor position display"), CONST_UPDATE);
|
|
|
|
toggle_init_one(TOGGLE_AUTOINDENT_KEY, N_("Auto indent"),
|
|
|
|
AUTOINDENT);
|
|
|
|
toggle_init_one(TOGGLE_TABSTOSPACES_KEY,
|
|
|
|
N_("Conversion of typed tabs to spaces"), TABS_TO_SPACES);
|
2004-12-04 17:41:52 +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))
|
2004-07-12 03:10:30 +00:00
|
|
|
toggle_init_one(TOGGLE_NOCONVERT_KEY,
|
|
|
|
N_("No conversion from DOS/Mac format"), NO_CONVERT);
|
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))
|
2005-01-17 05:06:55 +00:00
|
|
|
toggle_init_one(TOGGLE_BACKUP_KEY, N_("Backup files"),
|
|
|
|
BACKUP_FILE);
|
|
|
|
toggle_init_one(TOGGLE_SMOOTH_KEY, N_("Smooth scrolling"),
|
2005-06-16 02:13:10 +00:00
|
|
|
SMOOTH_SCROLL);
|
2005-01-17 05:06:55 +00:00
|
|
|
toggle_init_one(TOGGLE_SMARTHOME_KEY, N_("Smart home key"),
|
|
|
|
SMART_HOME);
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
|
|
|
toggle_init_one(TOGGLE_SYNTAX_KEY, N_("Color syntax highlighting"),
|
2005-03-10 20:55:11 +00:00
|
|
|
NO_COLOR_SYNTAX);
|
2004-07-12 03:10:30 +00:00
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_NANORC
|
|
|
|
toggle_init_one(TOGGLE_WHITESPACE_KEY, N_("Whitespace display"),
|
|
|
|
WHITESPACE_DISPLAY);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif /* !NANO_SMALL */
|
|
|
|
|
2002-05-12 19:52:15 +00:00
|
|
|
/* This function is called just before calling exit(). Practically, the
|
|
|
|
* 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. */
|
2002-05-12 19:52:15 +00:00
|
|
|
#ifdef DEBUG
|
2004-07-12 03:10:30 +00:00
|
|
|
/* Added by SPK for memory cleanup; gracefully return our malloc()s. */
|
2002-07-19 01:08:59 +00:00
|
|
|
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
|
2004-02-28 16:24:31 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
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);
|
|
|
|
if (hblank != NULL)
|
|
|
|
free(hblank);
|
|
|
|
#ifndef DISABLE_SPELLER
|
|
|
|
if (alt_speller != NULL)
|
|
|
|
free(alt_speller);
|
|
|
|
#endif
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-02-27 04:14:16 +00:00
|
|
|
if (help_text != NULL)
|
|
|
|
free(help_text);
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
2002-02-27 04:14:16 +00:00
|
|
|
if (filename != NULL)
|
|
|
|
free(filename);
|
|
|
|
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);
|
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-07-19 01:08:59 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
free_shortcutage(&extcmd_list);
|
|
|
|
#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
|
|
|
|
#ifndef NANO_SMALL
|
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
|
2002-02-27 04:14:16 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2005-05-26 05:53:29 +00:00
|
|
|
/* Free the memory associated with each open file buffer. */
|
2005-05-26 06:09:07 +00:00
|
|
|
if (open_files != NULL) {
|
|
|
|
/* Make sure open_files->fileage is up to date, in case we've
|
|
|
|
* cut the top line of the file. */
|
|
|
|
open_files->fileage = fileage;
|
|
|
|
|
2002-07-19 01:08:59 +00:00
|
|
|
free_openfilestruct(open_files);
|
2005-05-26 06:09:07 +00:00
|
|
|
}
|
2002-04-10 02:31:20 +00:00
|
|
|
#else
|
2005-05-26 05:17:13 +00:00
|
|
|
if (fileage != NULL)
|
|
|
|
free_filestruct(fileage);
|
2002-04-10 02:31:20 +00:00
|
|
|
#endif
|
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;
|
2003-01-13 01:35:15 +00:00
|
|
|
regfree(&bob->val);
|
2002-07-19 01:08:59 +00:00
|
|
|
free(bob);
|
|
|
|
}
|
|
|
|
while (syntaxes->color != NULL) {
|
|
|
|
colortype *bob = syntaxes->color;
|
|
|
|
|
|
|
|
syntaxes->color = bob->next;
|
2003-01-13 01:35:15 +00:00
|
|
|
regfree(&bob->start);
|
|
|
|
if (bob->end != NULL)
|
2003-02-03 02:56:44 +00:00
|
|
|
regfree(bob->end);
|
|
|
|
free(bob->end);
|
2002-07-19 01:08:59 +00:00
|
|
|
free(bob);
|
|
|
|
}
|
|
|
|
syntaxes = syntaxes->next;
|
|
|
|
free(bill);
|
|
|
|
}
|
|
|
|
#endif /* ENABLE_COLOR */
|
2003-01-05 20:41:21 +00:00
|
|
|
#ifndef NANO_SMALL
|
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 */
|