2008-07-10 20:13:04 +00:00
|
|
|
/* $Id$ */
|
2000-06-06 05:53:49 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* global.c *
|
|
|
|
* *
|
2007-10-11 05:01:32 +00:00
|
|
|
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
|
|
|
|
* Free Software Foundation, Inc. *
|
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 *
|
2007-08-11 05:17:36 +00:00
|
|
|
* the Free Software Foundation; either version 3, 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
|
|
|
* *
|
|
|
|
**************************************************************************/
|
|
|
|
|
2008-07-12 02:13:22 +00:00
|
|
|
#include "proto.h"
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#include <ctype.h>
|
2008-03-12 04:44:14 +00:00
|
|
|
#include <string.h>
|
2008-03-05 07:34:01 +00:00
|
|
|
#include <strings.h>
|
|
|
|
#include "assert.h"
|
2000-06-06 05:53:49 +00:00
|
|
|
|
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. */
|
2008-07-31 04:24:04 +00:00
|
|
|
filestruct *cutbottom = NULL;
|
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
|
|
|
|
|
2009-01-24 22:40:41 +00:00
|
|
|
bool nodelay_mode = FALSE;
|
|
|
|
/* Are we in nodelay mode (checking for a cancel wile doing something */
|
|
|
|
|
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
|
|
|
|
|
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. */
|
2009-02-06 03:41:02 +00:00
|
|
|
|
2001-04-30 11:28:46 +00:00
|
|
|
#endif
|
|
|
|
|
2009-02-06 03:41:02 +00:00
|
|
|
bool edit_refresh_needed = NULL;
|
|
|
|
/* Did a command mangle enough of the buffer refresh that we
|
|
|
|
should repaint the screen */
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
const shortcut *currshortcut;
|
|
|
|
/* The current shortcut list we're using. */
|
2008-03-05 07:34:01 +00:00
|
|
|
int currmenu;
|
|
|
|
/* The currently loaded menu */
|
|
|
|
|
|
|
|
sc *sclist = NULL;
|
|
|
|
/* New shortcut key struct */
|
|
|
|
subnfunc *allfuncs = NULL;
|
|
|
|
/* New struct for the function list */
|
|
|
|
|
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
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
/* Return the number of entries in the shortcut list s for a given menu. */
|
|
|
|
size_t length_of_list(int menu)
|
2002-02-15 19:17:02 +00:00
|
|
|
{
|
2008-03-05 07:34:01 +00:00
|
|
|
subnfunc *f;
|
2004-07-01 18:59:52 +00:00
|
|
|
size_t i = 0;
|
2002-09-13 18:14:04 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
for (f = allfuncs; f != NULL; f = f->next)
|
2008-03-13 08:23:52 +00:00
|
|
|
if ((f->menus & menu) != 0
|
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
&& strlen(f->help) > 0
|
|
|
|
#endif
|
|
|
|
) {
|
2008-03-05 07:34:01 +00:00
|
|
|
i++;
|
|
|
|
}
|
2002-02-15 19:17:02 +00:00
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
/* Set type of function based on the string */
|
|
|
|
function_type strtokeytype(char *str)
|
|
|
|
{
|
2008-03-11 03:03:53 +00:00
|
|
|
if (str[0] == 'M' || str[0] == 'm')
|
2008-03-05 07:34:01 +00:00
|
|
|
return META;
|
2008-03-11 03:03:53 +00:00
|
|
|
else if (str[0] == '^')
|
2008-03-05 07:34:01 +00:00
|
|
|
return CONTROL;
|
2008-03-11 03:03:53 +00:00
|
|
|
else if (str[0] == 'F' || str[0] == 'F')
|
2008-03-05 07:34:01 +00:00
|
|
|
return FKEY;
|
2008-03-11 03:03:53 +00:00
|
|
|
else
|
2008-03-05 07:34:01 +00:00
|
|
|
return RAW;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add a string to the new function list strict.
|
|
|
|
Does not allow updates, yet anyway */
|
2009-01-19 19:10:39 +00:00
|
|
|
void add_to_funcs(short func, int menus, const char *desc, const char *help,
|
2008-03-05 07:34:01 +00:00
|
|
|
bool blank_after, bool viewok)
|
|
|
|
{
|
|
|
|
subnfunc *f;
|
|
|
|
|
|
|
|
if (allfuncs == NULL) {
|
2009-02-25 04:32:15 +00:00
|
|
|
allfuncs = (subnfunc *) nmalloc(sizeof(subnfunc));
|
2008-03-05 07:34:01 +00:00
|
|
|
f = allfuncs;
|
|
|
|
} else {
|
|
|
|
for (f = allfuncs; f->next != NULL; f = f->next)
|
|
|
|
;
|
|
|
|
f->next = (subnfunc *)nmalloc(sizeof(subnfunc));
|
|
|
|
f = f->next;
|
|
|
|
}
|
|
|
|
f->next = NULL;
|
|
|
|
f->scfunc = func;
|
|
|
|
f->menus = menus;
|
|
|
|
f->desc = desc;
|
|
|
|
f->viewok = viewok;
|
2008-08-30 21:00:00 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2008-03-05 07:34:01 +00:00
|
|
|
f->help = help;
|
|
|
|
f->blank_after = blank_after;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
fprintf(stderr, "Added func \"%s\"", f->desc);
|
2002-06-28 22:45:14 +00:00
|
|
|
#endif
|
2008-03-05 07:34:01 +00:00
|
|
|
}
|
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
const sc *first_sc_for(int menu, short func) {
|
2008-03-05 07:34:01 +00:00
|
|
|
const sc *s;
|
2008-03-09 05:07:37 +00:00
|
|
|
const sc *metasc = NULL;
|
2008-03-05 07:34:01 +00:00
|
|
|
|
|
|
|
for (s = sclist; s != NULL; s = s->next) {
|
|
|
|
if ((s->menu & menu) && s->scfunc == func) {
|
2008-03-09 05:07:37 +00:00
|
|
|
/* try to use a meta sequence as a last resort. Otherwise
|
|
|
|
we will run into problems when we try and handle things like
|
|
|
|
the arrow keys, home, etc, if for some reason the user bound
|
|
|
|
them to a meta sequence first *shrug* */
|
|
|
|
if (s->type == META) {
|
|
|
|
metasc = s;
|
|
|
|
continue;
|
|
|
|
} /* otherwise it was something else, use it */
|
2008-03-05 07:34:01 +00:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-09 05:07:37 +00:00
|
|
|
/* If we're here we may have found only meta sequences, if so use one */
|
|
|
|
if (metasc)
|
2008-03-11 03:03:53 +00:00
|
|
|
return metasc;
|
2008-03-09 05:07:37 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifdef DEBUG
|
2008-03-09 02:52:40 +00:00
|
|
|
fprintf(stderr, "Whoops, returning null given func %ld in menu %d\n", (long) func, menu);
|
2008-03-05 07:34:01 +00:00
|
|
|
#endif
|
|
|
|
/* Otherwise... */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Add a string to the new shortcut list implementation
|
|
|
|
Allows updates to existing entries in the list */
|
2009-01-19 19:10:39 +00:00
|
|
|
void add_to_sclist(int menu, char *scstring, short func, int toggle, int execute)
|
2000-06-06 05:53:49 +00:00
|
|
|
{
|
2008-03-05 07:34:01 +00:00
|
|
|
sc *s;
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
if (sclist == NULL) {
|
2009-02-25 04:32:15 +00:00
|
|
|
sclist = (sc *) nmalloc(sizeof(sc));
|
2008-03-05 07:34:01 +00:00
|
|
|
s = sclist;
|
|
|
|
s->next = NULL;
|
2002-02-15 19:17:02 +00:00
|
|
|
} else {
|
2008-03-05 07:34:01 +00:00
|
|
|
for (s = sclist; s->next != NULL; s = s->next)
|
|
|
|
if (s->menu == menu && s->keystr == scstring)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (s->menu != menu || s->keystr != scstring) { /* i.e. this is not a replace... */
|
|
|
|
#ifdef DEBUG
|
|
|
|
fprintf(stderr, "No match found...\n");
|
|
|
|
#endif
|
|
|
|
s->next = (sc *)nmalloc(sizeof(sc));
|
|
|
|
s = s->next;
|
|
|
|
s->next = NULL;
|
|
|
|
}
|
2002-02-15 19:17:02 +00:00
|
|
|
}
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
s->type = strtokeytype(scstring);
|
|
|
|
s->menu = menu;
|
|
|
|
s->toggle = toggle;
|
|
|
|
s->keystr = scstring;
|
|
|
|
s->scfunc = func;
|
|
|
|
s->execute = execute;
|
|
|
|
assign_keyinfo(s);
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
fprintf(stderr, "list val = %d\n", (int) s->menu);
|
|
|
|
fprintf(stderr, "Hey, set sequence to %d for shortcut \"%s\"\n", s->seq, scstring);
|
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
}
|
|
|
|
|
2008-03-09 02:52:40 +00:00
|
|
|
/* Return the given menu's first shortcut sequence, or the default value
|
|
|
|
(2nd arg). Assumes currmenu for the menu to check*/
|
2009-01-19 19:10:39 +00:00
|
|
|
int sc_seq_or (short func, int defaultval)
|
2008-03-09 02:52:40 +00:00
|
|
|
{
|
|
|
|
const sc *s = first_sc_for(currmenu, func);
|
|
|
|
|
|
|
|
if (s)
|
|
|
|
return s->seq;
|
|
|
|
/* else */
|
|
|
|
return defaultval;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
/* Assign the info to the shortcut struct
|
|
|
|
Assumes keystr is already assigned, naturally */
|
|
|
|
void assign_keyinfo(sc *s)
|
|
|
|
{
|
|
|
|
if (s->type == CONTROL) {
|
|
|
|
assert(strlen(s->keystr) > 1);
|
|
|
|
s->seq = s->keystr[1] - 64;
|
|
|
|
} else if (s->type == META) {
|
|
|
|
assert(strlen(s->keystr) > 2);
|
|
|
|
s->seq = tolower((int) s->keystr[2]);
|
|
|
|
} else if (s->type == FKEY) {
|
|
|
|
assert(strlen(s->keystr) > 1);
|
|
|
|
s->seq = KEY_F0 + atoi(&s->keystr[1]);
|
|
|
|
} else /* raw */
|
|
|
|
s->seq = (int) s->keystr[0];
|
2008-03-05 17:15:33 +00:00
|
|
|
|
|
|
|
/* Override some keys which don't bind as nicely as we'd like */
|
|
|
|
if (s->type == CONTROL && (!strcasecmp(&s->keystr[1], "space")))
|
|
|
|
s->seq = 0;
|
|
|
|
else if (s->type == META && (!strcasecmp(&s->keystr[2], "space")))
|
|
|
|
s->seq = (int) ' ';
|
2008-03-11 03:03:53 +00:00
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kup")))
|
|
|
|
s->seq = KEY_UP;
|
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kdown")))
|
|
|
|
s->seq = KEY_DOWN;
|
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kleft")))
|
|
|
|
s->seq = KEY_LEFT;
|
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kright")))
|
|
|
|
s->seq = KEY_RIGHT;
|
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kinsert")))
|
|
|
|
s->seq = KEY_IC;
|
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kdel")))
|
|
|
|
s->seq = KEY_DC;
|
2008-03-12 04:44:14 +00:00
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kbsp")))
|
|
|
|
s->seq = KEY_BACKSPACE;
|
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kenter")))
|
|
|
|
s->seq = KEY_ENTER;
|
2008-03-11 03:03:53 +00:00
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kpup")))
|
|
|
|
s->seq = KEY_PPAGE;
|
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kpdown")))
|
|
|
|
s->seq = KEY_NPAGE;
|
|
|
|
#ifdef KEY_HOME
|
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "khome")))
|
|
|
|
s->seq = KEY_HOME;
|
|
|
|
#endif
|
|
|
|
#ifdef KEY_END
|
|
|
|
else if (s->type == RAW && (!strcasecmp(s->keystr, "kend")))
|
|
|
|
s->seq = KEY_END;
|
|
|
|
#endif
|
2008-03-05 17:15:33 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
|
|
void print_sclist(void)
|
|
|
|
{
|
|
|
|
sc *s;
|
|
|
|
const subnfunc *f;
|
|
|
|
|
|
|
|
for (s = sclist; s->next != NULL; s = s->next) {
|
|
|
|
f = sctofunc(s);
|
|
|
|
if (f)
|
2008-03-09 02:52:40 +00:00
|
|
|
fprintf(stderr, "Shortcut \"%s\", function: %s, menus %d\n", s->keystr, f->desc, f->menus);
|
2008-03-05 07:34:01 +00:00
|
|
|
else
|
|
|
|
fprintf(stderr, "Hmm, didnt find a func for \"%s\"\n", s->keystr);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Stuff we need to make at least static here so we can access it below */
|
|
|
|
const char *cancel_msg = N_("Cancel");
|
|
|
|
|
|
|
|
#ifndef NANO_TINY
|
|
|
|
const char *case_sens_msg = N_("Case Sens");
|
|
|
|
const char *backwards_msg = N_("Backwards");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
const char *regexp_msg = N_("Regexp");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Stuff we want to just stun out if we're in TINY mode */
|
|
|
|
#ifdef NANO_TINY
|
|
|
|
const char *gototext_msg = "";
|
2008-03-09 02:52:40 +00:00
|
|
|
const char *do_para_begin_msg = "";
|
|
|
|
const char *do_para_end_msg = "";
|
2008-03-05 07:34:01 +00:00
|
|
|
const char *case_sens_msg = "";
|
|
|
|
const char *backwards_msg = "";
|
|
|
|
const char *do_cut_till_end = "";
|
|
|
|
const char *dos_format_msg = "";
|
|
|
|
const char *mac_format_msg = "";
|
|
|
|
const char *append_msg = "";
|
|
|
|
const char *prepend_msg = "";
|
|
|
|
const char *backup_file_msg = "";
|
|
|
|
const char *to_files_msg = "";
|
2008-03-09 02:52:40 +00:00
|
|
|
const char *first_file_msg = "";
|
|
|
|
const char *whereis_next_msg = "";
|
|
|
|
const char *last_file_msg = "";
|
|
|
|
const char *new_buffer_msg = "";
|
|
|
|
const char *goto_dir_msg;
|
2008-03-13 08:23:52 +00:00
|
|
|
const char *ext_cmd_msg = "";
|
2008-03-09 02:52:40 +00:00
|
|
|
|
|
|
|
#else
|
2008-03-18 03:06:27 +00:00
|
|
|
/* TRANSLATORS: Try to keep the next five strings at most 10 characters. */
|
2008-03-09 02:52:40 +00:00
|
|
|
const char *prev_history_msg = N_("PrevHstory");
|
2008-03-05 07:34:01 +00:00
|
|
|
const char *next_history_msg = N_("NextHstory");
|
|
|
|
const char *replace_msg = N_("Replace");
|
|
|
|
const char *no_replace_msg = N_("No Replace");
|
|
|
|
const char *gototext_msg = N_("Go To Text");
|
2008-03-18 03:06:27 +00:00
|
|
|
/* TRANSLATORS: Try to keep the next three strings at most 12 characters. */
|
2008-03-09 02:52:40 +00:00
|
|
|
const char *whereis_next_msg = N_("WhereIs Next");
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
|
|
|
const char *first_file_msg = N_("First File");
|
|
|
|
const char *last_file_msg = N_("Last File");
|
2008-03-18 03:06:27 +00:00
|
|
|
/* TRANSLATORS: Try to keep the next nine strings at most 16 characters. */
|
|
|
|
const char *to_files_msg = N_("To Files");
|
2008-03-05 07:34:01 +00:00
|
|
|
#endif
|
|
|
|
const char *dos_format_msg = N_("DOS Format");
|
|
|
|
const char *mac_format_msg = N_("Mac Format");
|
|
|
|
const char *append_msg = N_("Append");
|
|
|
|
const char *prepend_msg = N_("Prepend");
|
|
|
|
const char *backup_file_msg = N_("Backup File");
|
2008-03-12 04:44:14 +00:00
|
|
|
const char *ext_cmd_msg = N_("Execute Command");
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
const char *new_buffer_msg = N_("New Buffer");
|
|
|
|
#endif
|
2008-03-09 02:52:40 +00:00
|
|
|
const char *goto_dir_msg = N_("Go To Dir");
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2008-03-09 02:52:40 +00:00
|
|
|
#endif /* NANO_TINY */
|
2008-03-05 07:34:01 +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
|
|
|
{
|
2008-03-18 03:06:27 +00:00
|
|
|
/* TRANSLATORS: Try to keep the following strings at most 10 characters. */
|
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 *first_line_msg = N_("First Line");
|
|
|
|
const char *last_line_msg = N_("Last Line");
|
2008-03-13 08:23:52 +00:00
|
|
|
const char *suspend_msg = N_("Suspend");
|
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");
|
2008-03-05 07:34:01 +00:00
|
|
|
const char *insert_file_msg = N_("Insert File");
|
2008-03-09 02:52:40 +00:00
|
|
|
const char *go_to_line_msg = N_("Go To Line");
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2008-08-30 21:00:00 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
const char *nano_justify_msg = N_("Justify the current paragraph");
|
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2008-03-18 03:06:27 +00:00
|
|
|
/* TRANSLATORS: The next long series of strings are shortcut descriptions;
|
|
|
|
* they are best kept shorter than 56 characters, but may be longer. */
|
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_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");
|
2006-05-21 21:37:21 +00:00
|
|
|
const char *nano_replace_msg =
|
|
|
|
N_("Replace a string or a regular expression");
|
2008-03-05 07:34:01 +00:00
|
|
|
const char *nano_gotoline_msg = N_("Go to line and column number");
|
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");
|
2008-07-10 20:13:04 +00:00
|
|
|
const char *nano_undo_msg = N_("Undo the last operation");
|
|
|
|
const char *nano_redo_msg = N_("Redo the last undone operation");
|
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");
|
2008-03-13 08:23:52 +00:00
|
|
|
const char *nano_suspend_msg =
|
|
|
|
N_("Suspend the editor (if suspend is enabled)");
|
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");
|
2008-03-05 07:34:01 +00:00
|
|
|
|
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-03-02 22:52:57 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2008-03-13 08:23:52 +00:00
|
|
|
#define IFSCHELP(help) help
|
2004-03-02 22:52:57 +00:00
|
|
|
#else
|
2008-03-13 08:23:52 +00:00
|
|
|
#define IFSCHELP(help) ""
|
2002-04-23 10:56:06 +00:00
|
|
|
#endif
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
while (allfuncs != NULL) {
|
|
|
|
subnfunc *f = allfuncs;
|
|
|
|
allfuncs = (allfuncs)->next;
|
|
|
|
free(f);
|
|
|
|
}
|
2004-07-12 03:10:30 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_HELP_VOID, MALL, get_help_msg, IFSCHELP(nano_help_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, VIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( CANCEL_MSG,
|
2008-03-19 02:32:48 +00:00
|
|
|
(MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR|MYESNO),
|
2008-03-13 08:23:52 +00:00
|
|
|
cancel_msg, IFSCHELP(nano_cancel_msg), FALSE, VIEW);
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_EXIT, MMAIN,
|
2004-11-25 04:39:07 +00:00
|
|
|
#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
|
2008-03-13 08:23:52 +00:00
|
|
|
exit_msg, IFSCHELP(nano_exit_msg), FALSE, VIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_EXIT, MHELP, exit_msg, IFSCHELP(nano_exit_msg), FALSE, VIEW);
|
2008-03-20 04:45:55 +00:00
|
|
|
|
2008-03-20 04:51:26 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_EXIT, MBROWSER, exit_msg, IFSCHELP(nano_exitbrowser_msg), FALSE, VIEW);
|
2008-03-20 04:51:26 +00:00
|
|
|
#endif
|
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. */
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_WRITEOUT_VOID, MMAIN, N_("WriteOut"),
|
2008-03-13 08:23:52 +00:00
|
|
|
IFSCHELP(nano_writeout_msg), FALSE, NOVIEW);
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2004-06-29 00:43:56 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2008-03-05 07:34:01 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_JUSTIFY_VOID, MMAIN, N_("Justify"),
|
2008-03-05 07:34:01 +00:00
|
|
|
nano_justify_msg, TRUE, NOVIEW);
|
2004-04-30 04:49:02 +00:00
|
|
|
#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
|
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. */
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(!ISSET(RESTRICTED) ? DO_INSERTFILE_VOID : NANO_DISABLED_MSG,
|
2008-03-18 03:06:27 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2008-03-13 08:23:52 +00:00
|
|
|
MMAIN, N_("Read File"), IFSCHELP(nano_insert_msg), FALSE,
|
2002-01-02 15:12:21 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2008-03-05 07:34:01 +00:00
|
|
|
VIEW);
|
2002-01-02 15:12:21 +00:00
|
|
|
#else
|
2008-03-05 07:34:01 +00:00
|
|
|
NOVIEW);
|
2002-01-02 15:12:21 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_SEARCH, MMAIN|MBROWSER, whereis_msg,
|
2008-03-13 08:23:52 +00:00
|
|
|
IFSCHELP(nano_whereis_msg), FALSE, VIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_PAGE_UP, MMAIN|MHELP,
|
2008-03-13 08:23:52 +00:00
|
|
|
prev_page_msg, IFSCHELP(nano_prevpage_msg), FALSE, VIEW);
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_PAGE_DOWN, MMAIN|MHELP,
|
2008-03-13 08:23:52 +00:00
|
|
|
next_page_msg, IFSCHELP(nano_nextpage_msg), TRUE, VIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2008-07-10 20:13:04 +00:00
|
|
|
|
2006-04-09 18:27:42 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_CUT_TEXT_VOID, MMAIN, N_("Cut Text"), IFSCHELP(nano_cut_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, NOVIEW);
|
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. */
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_UNCUT_TEXT, MMAIN, N_("UnJustify"), "",
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, NOVIEW);
|
|
|
|
|
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. */
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_UNCUT_TEXT, MMAIN, N_("UnCut Text"), IFSCHELP(nano_uncut_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, NOVIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2008-03-09 02:52:40 +00:00
|
|
|
#ifndef NANO_TINY
|
2008-03-18 03:06:27 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_CURSORPOS_VOID, MMAIN, N_("Cur Pos"), IFSCHELP(nano_cursorpos_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, VIEW);
|
2008-03-09 02:52:40 +00:00
|
|
|
#endif
|
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. */
|
2004-04-30 04:49:02 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2008-03-05 07:34:01 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2008-03-18 03:06:27 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_SPELL, MMAIN, N_("To Spell"), IFSCHELP(nano_spell_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
TRUE, NOVIEW);
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_FIRST_LINE,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MHELP),
|
2008-03-18 03:06:27 +00:00
|
|
|
first_line_msg, IFSCHELP(nano_firstline_msg), FALSE, VIEW);
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_LAST_LINE,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MHELP),
|
2008-03-13 08:23:52 +00:00
|
|
|
last_line_msg, IFSCHELP(nano_lastline_msg), TRUE, VIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-04-27 23:39:49 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_GOTOLINECOLUMN_VOID, (MMAIN|MWHEREIS),
|
2008-03-13 08:23:52 +00:00
|
|
|
go_to_line_msg, IFSCHELP(nano_gotoline_msg), FALSE, VIEW);
|
2006-04-28 13:19:56 +00:00
|
|
|
|
2008-03-09 02:52:40 +00:00
|
|
|
#ifdef NANO_TINY
|
2008-03-18 03:06:27 +00:00
|
|
|
/* TRANSLATORS: Try to keep this at most 10 characters. */
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_CURSORPOS_VOID, MMAIN, N_("Cur Pos"), IFSCHELP(nano_cursorpos_msg),
|
2008-03-09 02:52:40 +00:00
|
|
|
FALSE, VIEW);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_REPLACE, (MMAIN|MWHEREIS), replace_msg, IFSCHELP(nano_replace_msg),
|
2006-04-28 13:19:56 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
FALSE,
|
|
|
|
#else
|
|
|
|
TRUE,
|
2006-04-19 14:09:01 +00:00
|
|
|
#endif
|
2008-03-05 07:34:01 +00:00
|
|
|
NOVIEW);
|
2006-04-19 14:09:01 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2002-06-21 03:20:06 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_MARK, MMAIN, N_("Mark Text"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_mark_msg), FALSE, VIEW);
|
2005-06-12 22:31:03 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_RESEARCH, (MMAIN|MBROWSER), whereis_next_msg,
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_whereis_next_msg), TRUE, VIEW);
|
2005-10-24 02:12:09 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_COPY_TEXT, MMAIN, N_("Copy Text"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_copy_msg), FALSE, NOVIEW);
|
2005-10-24 02:12:09 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_INDENT_VOID, MMAIN, N_("Indent Text"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_indent_msg), FALSE, NOVIEW);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_UNINDENT, MMAIN, N_("Unindent Text"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_unindent_msg), FALSE, NOVIEW);
|
2008-07-10 20:13:04 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_UNDO, MMAIN, N_("Undo"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_undo_msg), FALSE, NOVIEW);
|
2008-07-10 20:13:04 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_REDO, MMAIN, N_("Redo"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_redo_msg), TRUE, NOVIEW);
|
2003-08-23 21:11:06 +00:00
|
|
|
|
2004-09-11 21:41:13 +00:00
|
|
|
#endif
|
2003-08-23 21:11:06 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_PAGE_UP, MBROWSER,
|
2008-03-13 08:23:52 +00:00
|
|
|
prev_page_msg, IFSCHELP(nano_prevpage_msg), FALSE, VIEW);
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_PAGE_DOWN, MBROWSER,
|
2008-03-13 08:23:52 +00:00
|
|
|
next_page_msg, IFSCHELP(nano_nextpage_msg), TRUE, VIEW);
|
2008-03-09 02:52:40 +00:00
|
|
|
|
2006-04-21 02:05:09 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_RIGHT, (MMAIN|MBROWSER), N_("Forward"), IFSCHELP(nano_forward_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, VIEW);
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_RIGHT, MALL, "", "", FALSE, VIEW);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_LEFT, (MMAIN|MBROWSER), N_("Back"), IFSCHELP(nano_back_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, VIEW);
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_LEFT, MALL, "", "", FALSE, VIEW);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_NEXT_WORD_VOID, MMAIN, N_("Next Word"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_nextword_msg), FALSE, VIEW);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_PREV_WORD_VOID, MMAIN, N_("Prev Word"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_prevword_msg), FALSE, VIEW);
|
2006-04-22 19:45:26 +00:00
|
|
|
#endif
|
2006-04-21 02:05:09 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_UP_VOID, (MMAIN|MHELP|MBROWSER), N_("Prev Line"),
|
2008-03-13 08:23:52 +00:00
|
|
|
IFSCHELP(nano_prevline_msg), FALSE, VIEW);
|
2003-11-28 19:47:42 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_DOWN_VOID, (MMAIN|MHELP|MBROWSER), N_("Next Line"),
|
2008-03-13 08:23:52 +00:00
|
|
|
IFSCHELP(nano_nextline_msg), TRUE, VIEW);
|
2001-10-22 03:15:31 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_HOME, MMAIN, N_("Home"), IFSCHELP(nano_home_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, VIEW);
|
2004-09-11 21:41:13 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_END, MMAIN, N_("End"), IFSCHELP(nano_end_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, VIEW);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_PARA_BEGIN_VOID, (MMAIN|MWHEREIS), beg_of_par_msg,
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_parabegin_msg), FALSE, VIEW);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_PARA_END_VOID, (MMAIN|MWHEREIS), end_of_par_msg,
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_paraend_msg), FALSE, VIEW);
|
2006-04-24 20:50:52 +00:00
|
|
|
#endif
|
2005-01-01 07:43:32 +00:00
|
|
|
|
2006-04-23 19:15:15 +00:00
|
|
|
#ifndef NANO_TINY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_FIND_BRACKET, MMAIN, _("Find Other Bracket"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_bracket_msg), FALSE, VIEW);
|
2006-04-23 19:15:15 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_SCROLL_UP, MMAIN, N_("Scroll Up"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_scrollup_msg), FALSE, VIEW);
|
2004-09-11 21:41:13 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_SCROLL_DOWN, MMAIN, N_("Scroll Down"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_scrolldown_msg), FALSE, VIEW);
|
2003-11-28 19:47:42 +00:00
|
|
|
#endif
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(SWITCH_TO_PREV_BUFFER_VOID, MMAIN, _("Previous File"),
|
2008-03-31 06:25:14 +00:00
|
|
|
IFSCHELP(nano_prevfile_msg), FALSE, VIEW);
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(SWITCH_TO_NEXT_BUFFER_VOID, MMAIN, N_("Next File"),
|
2008-03-31 06:25:14 +00:00
|
|
|
IFSCHELP(nano_nextfile_msg), TRUE, VIEW);
|
2008-03-05 07:34:01 +00:00
|
|
|
#endif
|
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_VERBATIM_INPUT, MMAIN, N_("Verbatim Input"),
|
2008-03-13 08:23:52 +00:00
|
|
|
IFSCHELP(nano_verbatim_msg), FALSE, NOVIEW);
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_VERBATIM_INPUT, MWHEREIS|MREPLACE|MREPLACE2|MEXTCMD|MSPELL,
|
2008-03-17 05:50:04 +00:00
|
|
|
"", "", FALSE, NOVIEW);
|
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_TAB, MMAIN, N_("Tab"), IFSCHELP(nano_tab_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, NOVIEW);
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_TAB, MALL, "", "", FALSE, NOVIEW);
|
|
|
|
add_to_funcs(DO_ENTER, MMAIN, N_("Enter"), IFSCHELP(nano_enter_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, NOVIEW);
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_ENTER, MALL, "", "", FALSE, NOVIEW);
|
|
|
|
add_to_funcs(DO_DELETE, MMAIN, N_("Delete"), IFSCHELP(nano_delete_msg),
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE, NOVIEW);
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_DELETE, MALL, "", "", FALSE, NOVIEW);
|
|
|
|
add_to_funcs(DO_BACKSPACE, MMAIN, N_("Backspace"), IFSCHELP(nano_backspace_msg),
|
2006-04-22 20:00:23 +00:00
|
|
|
#ifndef NANO_TINY
|
2008-03-05 07:34:01 +00:00
|
|
|
FALSE,
|
2006-04-22 20:00:23 +00:00
|
|
|
#else
|
2008-03-05 07:34:01 +00:00
|
|
|
TRUE,
|
2006-04-22 20:00:23 +00:00
|
|
|
#endif
|
2008-03-12 04:44:14 +00:00
|
|
|
NOVIEW);
|
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_BACKSPACE, MALL, "", "",
|
2008-03-12 04:44:14 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
FALSE,
|
|
|
|
#else
|
|
|
|
TRUE,
|
|
|
|
#endif
|
|
|
|
NOVIEW);
|
2006-04-22 19:45:26 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_CUT_TILL_END, MMAIN, N_("CutTillEnd"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_cut_till_end_msg), TRUE, NOVIEW);
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(XON_COMPLAINT, MMAIN, "", "", FALSE, VIEW);
|
|
|
|
add_to_funcs(XOFF_COMPLAINT, MMAIN, "", "", FALSE, VIEW);
|
2000-06-29 01:30:04 +00:00
|
|
|
|
2003-09-04 20:25:29 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_FULL_JUSTIFY, (MMAIN|MWHEREIS), fulljstify_msg,
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_fulljustify_msg), FALSE, NOVIEW);
|
2003-09-04 20:25:29 +00:00
|
|
|
#endif
|
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_WORDLINECHAR_COUNT, MMAIN, N_("Word Count"),
|
2008-08-30 21:00:00 +00:00
|
|
|
IFSCHELP(nano_wordcount_msg), FALSE, VIEW);
|
2001-06-14 02:54:22 +00:00
|
|
|
#endif
|
2003-01-05 20:41:21 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(TOTAL_REFRESH, (MMAIN|MHELP), refresh_msg,
|
2008-03-13 08:23:52 +00:00
|
|
|
IFSCHELP(nano_refresh_msg), FALSE, VIEW);
|
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs(DO_SUSPEND_VOID, MMAIN, suspend_msg,
|
2008-03-13 08:23:52 +00:00
|
|
|
IFSCHELP(nano_suspend_msg), TRUE, VIEW);
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( CASE_SENS_MSG,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MWHEREIS|MREPLACE|MWHEREISFILE),
|
2008-08-30 21:00:00 +00:00
|
|
|
case_sens_msg, IFSCHELP(nano_case_msg), FALSE, VIEW);
|
2001-06-14 02:54:22 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( BACKWARDS_MSG,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MWHEREIS|MREPLACE|MWHEREISFILE),
|
2008-08-30 21:00:00 +00:00
|
|
|
backwards_msg, IFSCHELP(nano_reverse_msg), FALSE, VIEW);
|
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
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( REGEXP_MSG,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MWHEREIS|MREPLACE|MWHEREISFILE),
|
2008-03-13 08:23:52 +00:00
|
|
|
regexp_msg, IFSCHELP(nano_regexp_msg), FALSE, VIEW);
|
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
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( PREV_HISTORY_MSG,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE),
|
2008-08-30 21:00:00 +00:00
|
|
|
prev_history_msg, IFSCHELP(nano_prev_history_msg), FALSE, VIEW);
|
2006-05-24 19:48:03 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( NEXT_HISTORY_MSG,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE),
|
2008-08-30 21:00:00 +00:00
|
|
|
next_history_msg, IFSCHELP(nano_next_history_msg), FALSE, VIEW);
|
2005-06-03 20:51:39 +00:00
|
|
|
#endif
|
2001-07-16 00:48:53 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( NO_REPLACE_MSG, MREPLACE,
|
2008-03-13 08:23:52 +00:00
|
|
|
no_replace_msg, IFSCHELP(nano_whereis_msg), FALSE, VIEW);
|
2000-10-31 05:10:10 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( GOTOTEXT_MSG, MGOTOLINE,
|
2008-03-14 04:08:51 +00:00
|
|
|
gototext_msg, IFSCHELP(nano_whereis_msg), TRUE, VIEW);
|
2004-07-12 03:10:30 +00:00
|
|
|
|
2001-01-12 07:51:05 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( TO_FILES_MSG,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MGOTOLINE|MINSERTFILE),
|
2008-08-30 21:00:00 +00:00
|
|
|
to_files_msg, IFSCHELP(nano_tofiles_msg), FALSE, VIEW);
|
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))
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( DOS_FORMAT_MSG, MWRITEFILE,
|
2008-08-30 21:00:00 +00:00
|
|
|
dos_format_msg, IFSCHELP(nano_dos_msg), FALSE, NOVIEW);
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( MAC_FORMAT_MSG, MWRITEFILE,
|
2008-08-30 21:00:00 +00:00
|
|
|
mac_format_msg, IFSCHELP(nano_mac_msg), FALSE, NOVIEW);
|
2002-02-15 19:17:02 +00:00
|
|
|
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( APPEND_MSG, MWRITEFILE,
|
2008-08-30 21:00:00 +00:00
|
|
|
append_msg, IFSCHELP(nano_append_msg), FALSE, NOVIEW);
|
2001-05-29 04:21:44 +00:00
|
|
|
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( PREPEND_MSG, MWRITEFILE,
|
2008-08-30 21:00:00 +00:00
|
|
|
prepend_msg, IFSCHELP(nano_prepend_msg), FALSE, NOVIEW);
|
2002-04-16 03:15:47 +00:00
|
|
|
|
2004-04-30 04:49:02 +00:00
|
|
|
if (!ISSET(RESTRICTED))
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( BACKUP_FILE_MSG, MWRITEFILE,
|
2008-08-30 21:00:00 +00:00
|
|
|
backup_file_msg, IFSCHELP(nano_backup_msg), FALSE, NOVIEW);
|
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))
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( EXT_CMD_MSG, MINSERTFILE,
|
2008-08-30 21:00:00 +00:00
|
|
|
ext_cmd_msg, IFSCHELP(nano_execute_msg), FALSE, NOVIEW);
|
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))
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( NEW_BUFFER_MSG, MINSERTFILE,
|
2008-08-30 21:00:00 +00:00
|
|
|
new_buffer_msg, IFSCHELP(nano_multibuffer_msg), FALSE, NOVIEW);
|
2002-09-03 22:58:40 +00:00
|
|
|
#endif
|
2001-05-29 04:21:44 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( INSERT_FILE_MSG, MEXTCMD,
|
2008-03-13 08:23:52 +00:00
|
|
|
insert_file_msg, IFSCHELP(nano_insert_msg), FALSE, VIEW);
|
2004-09-30 22:07:21 +00:00
|
|
|
|
2004-09-28 22:21:46 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( NEW_BUFFER_MSG, MEXTCMD,
|
2008-08-30 21:00:00 +00:00
|
|
|
new_buffer_msg, IFSCHELP(nano_multibuffer_msg), FALSE, NOVIEW);
|
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
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( REFRESH_MSG, MHELP,
|
2008-03-05 07:34:01 +00:00
|
|
|
refresh_msg, nano_refresh_msg, FALSE, VIEW);
|
2005-12-08 07:09:08 +00:00
|
|
|
#endif
|
|
|
|
|
2001-01-12 07:51:05 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2006-05-06 15:07:26 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( FIRST_FILE_MSG,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MBROWSER|MWHEREISFILE),
|
2008-08-30 21:00:00 +00:00
|
|
|
first_file_msg, IFSCHELP(nano_firstfile_msg), FALSE, VIEW);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( LAST_FILE_MSG,
|
2008-03-05 07:34:01 +00:00
|
|
|
(MBROWSER|MWHEREISFILE),
|
2008-08-30 21:00:00 +00:00
|
|
|
last_file_msg, IFSCHELP(nano_lastfile_msg), FALSE, VIEW);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_funcs( GOTO_DIR_MSG, MBROWSER,
|
2008-08-30 21:00:00 +00:00
|
|
|
goto_dir_msg, IFSCHELP(nano_gotodir_msg), FALSE, VIEW);
|
2006-03-30 07:03:04 +00:00
|
|
|
#endif
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
currmenu = MMAIN;
|
2006-03-30 07:03:04 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MALL, "^G", DO_HELP_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "F1", DO_HELP_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "^X", DO_EXIT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MHELP|MBROWSER, "F2", DO_EXIT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^_", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F13", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^O", DO_WRITEOUT_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F3", DO_WRITEOUT_VOID, 0, TRUE);
|
2008-03-16 12:55:41 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MMAIN, "^J", DO_JUSTIFY_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F4", DO_JUSTIFY_VOID, 0, TRUE);
|
|
|
|
#endif
|
|
|
|
add_to_sclist(MMAIN, "^R", DO_INSERTFILE_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F5", DO_INSERTFILE_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "kinsert", DO_INSERTFILE_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER, "^W", DO_SEARCH, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER, "F6", DO_SEARCH, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER|MHELP|MWHEREISFILE, "^Y", DO_PAGE_UP, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER|MHELP|MWHEREISFILE, "F7", DO_PAGE_UP, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER|MHELP|MWHEREISFILE, "kpup", DO_PAGE_UP, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER|MHELP|MWHEREISFILE, "^V", DO_PAGE_DOWN, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER|MHELP|MWHEREISFILE, "F8", DO_PAGE_DOWN, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN|MBROWSER|MHELP|MWHEREISFILE, "kpdown", DO_PAGE_DOWN, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^K", DO_CUT_TEXT_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F9", DO_CUT_TEXT_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^U", DO_UNCUT_TEXT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F10", DO_UNCUT_TEXT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^C", DO_CURSORPOS_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F11", DO_CURSORPOS_VOID, 0, TRUE);
|
2008-05-31 22:49:55 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MMAIN, "^T", DO_SPELL, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F12", DO_SPELL, 0, TRUE);
|
|
|
|
#endif
|
|
|
|
add_to_sclist(MMAIN, "^_", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F13", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-G", DO_GOTOLINECOLUMN_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^\\", DO_REPLACE, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F14", DO_REPLACE, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-R", DO_REPLACE, 0, TRUE);
|
|
|
|
add_to_sclist(MWHEREIS, "^R", DO_REPLACE, 0, FALSE);
|
|
|
|
add_to_sclist(MREPLACE, "^R", NO_REPLACE_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MWHEREIS, "^T", DO_GOTOLINECOLUMN_VOID, 0, FALSE);
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MMAIN, "^^", DO_MARK, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "F15", DO_MARK, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-A", DO_MARK, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "M-W", DO_RESEARCH, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "F16", DO_RESEARCH, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-^", DO_COPY_TEXT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-6", DO_COPY_TEXT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-}", DO_INDENT_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-{", DO_UNINDENT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-U", DO_UNDO, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-E", DO_REDO, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "^F", DO_RIGHT, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "^B", DO_LEFT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^Space", DO_NEXT_WORD_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-Space", DO_PREV_WORD_VOID, 0, TRUE);
|
|
|
|
#endif
|
|
|
|
add_to_sclist(MALL, "kright", DO_RIGHT, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "kleft", DO_LEFT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^Q", XON_COMPLAINT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^S", XOFF_COMPLAINT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^P", DO_UP_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "kup", DO_UP_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "^N", DO_DOWN_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "kdown", DO_DOWN_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "^A", DO_HOME, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "khome", DO_HOME, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "^E", DO_END, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "kend", DO_END, 0, TRUE);
|
2008-06-03 08:09:05 +00:00
|
|
|
#ifndef NANO_TINY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE, "^P", PREV_HISTORY_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE, "kup", PREV_HISTORY_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE, "^N", NEXT_HISTORY_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MWHEREISFILE, "kdown", NEXT_HISTORY_MSG, 0, FALSE);
|
2008-06-03 08:09:05 +00:00
|
|
|
#endif
|
2008-06-29 06:22:31 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2008-03-05 07:34:01 +00:00
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2,
|
2009-01-19 19:10:39 +00:00
|
|
|
"^W", DO_PARA_BEGIN_VOID, 0, TRUE);
|
2008-03-05 07:34:01 +00:00
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2,
|
2009-01-19 19:10:39 +00:00
|
|
|
"^O", DO_PARA_END_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "M-(", DO_PARA_BEGIN_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "M-9", DO_PARA_BEGIN_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "M-)", DO_PARA_END_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "M-0", DO_PARA_END_VOID, 0, TRUE);
|
2008-03-09 02:52:40 +00:00
|
|
|
#endif
|
2008-03-05 07:34:01 +00:00
|
|
|
add_to_sclist(MWHEREIS,
|
2009-01-19 19:10:39 +00:00
|
|
|
"M-C", CASE_SENS_MSG, 0, FALSE);
|
2008-03-05 07:34:01 +00:00
|
|
|
add_to_sclist(MREPLACE,
|
2009-01-19 19:10:39 +00:00
|
|
|
"M-C", CASE_SENS_MSG, 0, FALSE);
|
2008-03-05 07:34:01 +00:00
|
|
|
add_to_sclist(MREPLACE2,
|
2009-01-19 19:10:39 +00:00
|
|
|
"M-C", CASE_SENS_MSG, 0, FALSE);
|
2008-03-05 07:34:01 +00:00
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2,
|
2009-01-19 19:10:39 +00:00
|
|
|
"M-B", BACKWARDS_MSG, 0, FALSE);
|
2008-03-05 07:34:01 +00:00
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2,
|
2009-01-19 19:10:39 +00:00
|
|
|
"M-R", REGEXP_MSG, 0, FALSE);
|
2008-03-05 07:34:01 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MMAIN, "M-\\", DO_FIRST_LINE, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-|", DO_FIRST_LINE, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-/", DO_LAST_LINE, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-?", DO_LAST_LINE, 0, TRUE);
|
2008-03-13 08:23:52 +00:00
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MHELP,
|
2009-01-19 19:10:39 +00:00
|
|
|
"^Y", DO_FIRST_LINE, 0, TRUE);
|
2008-03-13 08:23:52 +00:00
|
|
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MHELP,
|
2009-01-19 19:10:39 +00:00
|
|
|
"^V", DO_LAST_LINE, 0, TRUE);
|
2008-03-13 08:23:52 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MBROWSER|MWHEREISFILE, "M-\\", FIRST_FILE_MSG, 0, TRUE);
|
|
|
|
add_to_sclist(MBROWSER|MWHEREISFILE, "M-|", FIRST_FILE_MSG, 0, TRUE);
|
|
|
|
add_to_sclist(MBROWSER|MWHEREISFILE, "M-/", LAST_FILE_MSG, 0, TRUE);
|
|
|
|
add_to_sclist(MBROWSER|MWHEREISFILE, "M-?", LAST_FILE_MSG, 0, TRUE);
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MMAIN, "M-]", DO_FIND_BRACKET, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M--", DO_SCROLL_UP, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-_", DO_SCROLL_UP, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-+", DO_SCROLL_DOWN, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-=", DO_SCROLL_DOWN, 0, TRUE);
|
2006-03-30 07:03:04 +00:00
|
|
|
#endif
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MMAIN, "M-<", SWITCH_TO_PREV_BUFFER_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-,", SWITCH_TO_PREV_BUFFER_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M->", SWITCH_TO_NEXT_BUFFER_VOID, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-.", SWITCH_TO_NEXT_BUFFER_VOID, 0, TRUE);
|
2008-03-05 07:34:01 +00:00
|
|
|
#endif
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MALL, "M-V", DO_VERBATIM_INPUT, 0, TRUE);
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MALL, "M-T", DO_CUT_TILL_END, 0, TRUE);
|
2008-03-16 12:55:41 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2009-01-19 19:10:39 +00:00
|
|
|
add_to_sclist(MALL, "M-J", DO_FULL_JUSTIFY, 0, TRUE);
|
|
|
|
#endif
|
|
|
|
add_to_sclist(MMAIN, "M-D", DO_WORDLINECHAR_COUNT, 0, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-X", DO_TOGGLE, NO_HELP, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-C", DO_TOGGLE, CONST_UPDATE, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-O", DO_TOGGLE, MORE_SPACE, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-S", DO_TOGGLE, SMOOTH_SCROLL, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-P", DO_TOGGLE, WHITESPACE_DISPLAY, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-Y", DO_TOGGLE, NO_COLOR_SYNTAX, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-H", DO_TOGGLE, SMART_HOME, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-I", DO_TOGGLE, AUTOINDENT, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-K", DO_TOGGLE, CUT_TO_END, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-L", DO_TOGGLE, NO_WRAP, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-Q", DO_TOGGLE, TABS_TO_SPACES, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-B", DO_TOGGLE, BACKUP_FILE, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-F", DO_TOGGLE, MULTIBUFFER, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-M", DO_TOGGLE, USE_MOUSE, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-N", DO_TOGGLE, NO_CONVERT, TRUE);
|
|
|
|
add_to_sclist(MMAIN, "M-Z", DO_TOGGLE, SUSPEND, TRUE);
|
|
|
|
#endif
|
|
|
|
add_to_sclist(MGOTOLINE, "^T", GOTOTEXT_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MINSERTFILE|MEXTCMD, "M-F", NEW_BUFFER_MSG, 0, FALSE);
|
2008-03-19 02:32:48 +00:00
|
|
|
add_to_sclist((MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR|MYESNO),
|
2009-01-19 19:10:39 +00:00
|
|
|
"^C", CANCEL_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MHELP, "^X", DO_EXIT, 0, TRUE);
|
|
|
|
add_to_sclist(MHELP, "F2", DO_EXIT, 0, TRUE);
|
|
|
|
add_to_sclist(MWRITEFILE, "M-D", DOS_FORMAT_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MWRITEFILE, "M-M", MAC_FORMAT_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MWRITEFILE, "M-A", APPEND_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MWRITEFILE, "M-P", PREPEND_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MWRITEFILE, "M-B", BACKUP_FILE_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MWRITEFILE, "^T", TO_FILES_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MINSERTFILE, "^T", TO_FILES_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MINSERTFILE, "^X", EXT_CMD_MSG, 0, FALSE);
|
|
|
|
add_to_sclist(MMAIN, "^Z", DO_SUSPEND_VOID, 0, FALSE);
|
|
|
|
add_to_sclist(MMAIN, "^L", TOTAL_REFRESH, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "^I", DO_TAB, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "^M", DO_ENTER, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "kenter", DO_ENTER, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "^D", DO_DELETE, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "kdel", DO_DELETE, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "^H", DO_BACKSPACE, 0, TRUE);
|
|
|
|
add_to_sclist(MALL, "kbsp", DO_BACKSPACE, 0, TRUE);
|
2001-01-03 07:11:47 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
print_sclist();
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
|
|
|
|
2002-04-23 10:56:06 +00:00
|
|
|
}
|
2002-02-27 04:14:16 +00:00
|
|
|
|
2009-01-19 19:10:39 +00:00
|
|
|
/* Given a function alias, execute the proper
|
|
|
|
function, and then me */
|
|
|
|
void iso_me_harder_funcmap(short func)
|
|
|
|
{
|
|
|
|
if (func == TOTAL_REFRESH)
|
|
|
|
total_refresh();
|
|
|
|
else if (func == DO_HELP_VOID)
|
|
|
|
do_help_void();
|
|
|
|
else if (func == DO_SEARCH)
|
|
|
|
do_search();
|
|
|
|
else if (func == DO_PAGE_UP)
|
|
|
|
do_page_up();
|
|
|
|
else if (func == DO_PAGE_DOWN)
|
|
|
|
do_page_down();
|
|
|
|
else if (func == DO_UP_VOID)
|
|
|
|
do_up_void();
|
|
|
|
else if (func == DO_LEFT)
|
|
|
|
do_left();
|
|
|
|
else if (func == DO_DOWN_VOID)
|
|
|
|
do_down_void();
|
|
|
|
else if (func == DO_RIGHT)
|
|
|
|
do_right();
|
|
|
|
else if (func == DO_ENTER)
|
2009-04-25 03:31:30 +00:00
|
|
|
do_enter(FALSE);
|
2009-01-19 19:10:39 +00:00
|
|
|
else if (func == DO_EXIT)
|
|
|
|
do_exit();
|
|
|
|
else if (func == DO_FIRST_LINE)
|
|
|
|
do_first_line();
|
|
|
|
else if (func == DO_LAST_LINE)
|
|
|
|
do_last_line();
|
|
|
|
else if (func == DO_BACKSPACE)
|
|
|
|
do_backspace();
|
|
|
|
else if (func == DO_DELETE)
|
|
|
|
do_delete();
|
|
|
|
else if (func == DO_TAB)
|
|
|
|
do_tab();
|
|
|
|
else if (func == DO_VERBATIM_INPUT)
|
|
|
|
do_verbatim_input();
|
2009-01-28 05:11:57 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2009-01-19 19:10:39 +00:00
|
|
|
else if (func == SWITCH_TO_NEXT_BUFFER_VOID)
|
|
|
|
switch_to_next_buffer_void();
|
|
|
|
else if (func == SWITCH_TO_PREV_BUFFER_VOID)
|
|
|
|
switch_to_prev_buffer_void();
|
2009-01-28 05:11:57 +00:00
|
|
|
#endif
|
2009-01-19 19:10:39 +00:00
|
|
|
else if (func == DO_END)
|
|
|
|
do_end();
|
|
|
|
else if (func == DO_HOME)
|
|
|
|
do_home();
|
|
|
|
else if (func == DO_SUSPEND_VOID)
|
|
|
|
do_suspend_void();
|
|
|
|
else if (func == DO_WRITEOUT_VOID)
|
|
|
|
do_writeout_void();
|
|
|
|
else if (func == DO_INSERTFILE_VOID)
|
|
|
|
do_insertfile_void();
|
|
|
|
else if (func == DO_CUT_TEXT_VOID)
|
|
|
|
do_cut_text_void();
|
|
|
|
else if (func == DO_UNCUT_TEXT)
|
|
|
|
do_uncut_text();
|
|
|
|
else if (func == DO_CURSORPOS_VOID)
|
|
|
|
do_cursorpos_void();
|
|
|
|
else if (func == DO_GOTOLINECOLUMN_VOID)
|
|
|
|
do_gotolinecolumn_void();
|
|
|
|
else if (func == DO_REPLACE)
|
|
|
|
do_replace();
|
2009-01-28 05:11:57 +00:00
|
|
|
else if (func == XOFF_COMPLAINT)
|
|
|
|
xoff_complaint();
|
|
|
|
else if (func == XON_COMPLAINT)
|
|
|
|
xon_complaint();
|
|
|
|
else if (func == DO_CUT_TEXT)
|
|
|
|
do_cut_text_void();
|
|
|
|
#ifndef NANO_TINY
|
|
|
|
else if (func == DO_CUT_TILL_END)
|
|
|
|
do_cut_till_end();
|
|
|
|
else if (func == DO_REDO)
|
|
|
|
do_redo();
|
|
|
|
else if (func == DO_UNDO)
|
|
|
|
do_undo();
|
|
|
|
else if (func == DO_WORDLINECHAR_COUNT)
|
|
|
|
do_wordlinechar_count();
|
|
|
|
else if (func == DO_FIND_BRACKET)
|
|
|
|
do_find_bracket();
|
|
|
|
else if (func == DO_PREV_WORD_VOID)
|
|
|
|
do_prev_word_void();
|
2009-01-31 16:13:03 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2009-01-19 19:10:39 +00:00
|
|
|
else if (func == DO_JUSTIFY_VOID)
|
|
|
|
do_justify_void();
|
|
|
|
else if (func == DO_PARA_BEGIN_VOID)
|
|
|
|
do_para_begin_void();
|
|
|
|
else if (func == DO_PARA_END_VOID)
|
|
|
|
do_para_end_void();
|
|
|
|
else if (func == DO_FULL_JUSTIFY)
|
|
|
|
do_full_justify();
|
2009-01-31 16:13:03 +00:00
|
|
|
#endif
|
2009-01-19 19:10:39 +00:00
|
|
|
else if (func == DO_MARK)
|
|
|
|
do_mark();
|
|
|
|
else if (func == DO_RESEARCH)
|
|
|
|
do_research();
|
|
|
|
else if (func == DO_COPY_TEXT)
|
|
|
|
do_copy_text();
|
|
|
|
else if (func == DO_INDENT_VOID)
|
|
|
|
do_indent_void();
|
|
|
|
else if (func == DO_UNINDENT)
|
|
|
|
do_unindent();
|
|
|
|
else if (func == DO_SCROLL_UP)
|
|
|
|
do_scroll_up();
|
|
|
|
else if (func == DO_SCROLL_DOWN)
|
|
|
|
do_scroll_down();
|
|
|
|
else if (func == DO_NEXT_WORD_VOID)
|
|
|
|
do_next_word_void();
|
2009-01-28 05:11:57 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2009-01-19 19:10:39 +00:00
|
|
|
else if (func == DO_SPELL)
|
|
|
|
do_spell();
|
2009-01-28 05:11:57 +00:00
|
|
|
#endif
|
2009-01-19 19:10:39 +00:00
|
|
|
else if (func == DO_NEXT_WORD)
|
|
|
|
do_next_word_void();
|
|
|
|
else if (func == DO_PREV_WORD)
|
|
|
|
do_prev_word_void();
|
2009-01-28 05:11:57 +00:00
|
|
|
#endif
|
2009-01-19 19:10:39 +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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
const subnfunc *sctofunc(sc *s)
|
2004-07-12 03:10:30 +00:00
|
|
|
{
|
2008-03-05 07:34:01 +00:00
|
|
|
subnfunc *f;
|
2004-07-12 03:10:30 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
for (f = allfuncs; f != NULL && s->scfunc != f->scfunc; f = f->next)
|
|
|
|
;
|
2004-07-12 03:10:30 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
return f;
|
2004-07-12 03:10:30 +00:00
|
|
|
}
|
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
/* Now lets come up with a single (hopefully)
|
|
|
|
function to get a string for each flag */
|
|
|
|
char *flagtostr(int flag)
|
2004-07-12 03:10:30 +00:00
|
|
|
{
|
2008-03-05 07:34:01 +00:00
|
|
|
switch (flag) {
|
|
|
|
case NO_HELP:
|
|
|
|
return N_("Help mode");
|
|
|
|
case CONST_UPDATE:
|
|
|
|
return N_("Constant cursor position display");
|
|
|
|
case MORE_SPACE:
|
|
|
|
return N_("Use of one more line for editing");
|
|
|
|
case SMOOTH_SCROLL:
|
|
|
|
return N_("Smooth scrolling");
|
|
|
|
case WHITESPACE_DISPLAY:
|
|
|
|
return N_("Whitespace display");
|
|
|
|
case NO_COLOR_SYNTAX:
|
|
|
|
return N_("Color syntax highlighting");
|
|
|
|
case SMART_HOME:
|
|
|
|
return N_("Smart home key");
|
|
|
|
case AUTOINDENT:
|
|
|
|
return N_("Auto indent");
|
|
|
|
case CUT_TO_END:
|
|
|
|
return N_("Cut to end");
|
|
|
|
case NO_WRAP:
|
|
|
|
return N_("Long line wrapping");
|
|
|
|
case TABS_TO_SPACES:
|
|
|
|
return N_("Conversion of typed tabs to spaces");
|
|
|
|
case BACKUP_FILE:
|
|
|
|
return N_("Backup files");
|
|
|
|
case MULTIBUFFER:
|
|
|
|
return N_("Multiple file buffers");
|
|
|
|
case USE_MOUSE:
|
|
|
|
return N_("Mouse support");
|
|
|
|
case NO_CONVERT:
|
|
|
|
return N_("No conversion from DOS/Mac format");
|
|
|
|
case SUSPEND:
|
|
|
|
return N_("Suspension");
|
|
|
|
default:
|
|
|
|
return "?????";
|
|
|
|
}
|
|
|
|
}
|
2008-03-09 02:52:40 +00:00
|
|
|
#endif /* NANO_TINY */
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
/* Interpret the string given by the rc file and return a
|
|
|
|
shortcut struct, complete with proper value for execute */
|
|
|
|
sc *strtosc(int menu, char *input)
|
|
|
|
{
|
|
|
|
sc *s;
|
|
|
|
|
|
|
|
s = (sc *)nmalloc(sizeof(sc));
|
|
|
|
s->execute = TRUE; /* overridden as needed below */
|
|
|
|
|
2008-03-09 02:52:40 +00:00
|
|
|
|
|
|
|
#ifndef DISABLE_HELP
|
2008-03-05 07:34:01 +00:00
|
|
|
if (!strcasecmp(input, "help"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_HELP_VOID;
|
2008-03-09 02:52:40 +00:00
|
|
|
else
|
|
|
|
#endif
|
|
|
|
if (!strcasecmp(input, "cancel")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = CANCEL_MSG;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "exit"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_EXIT;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "writeout"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_WRITEOUT_VOID;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "insert"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_INSERTFILE_VOID;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "whereis"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_SEARCH;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "up"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_UP_VOID;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "down"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_DOWN_VOID;
|
2008-03-11 03:03:53 +00:00
|
|
|
else if (!strcasecmp(input, "pageup")
|
|
|
|
|| !strcasecmp(input, "prevpage"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_PAGE_UP;
|
2008-03-11 03:03:53 +00:00
|
|
|
else if (!strcasecmp(input, "pagedown")
|
|
|
|
|| !strcasecmp(input, "nextpage"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_PAGE_DOWN;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "cut"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_CUT_TEXT_VOID;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "uncut"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_UNCUT_TEXT;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "curpos") ||
|
|
|
|
!strcasecmp(input, "cursorpos"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_CURSORPOS_VOID;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "firstline"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_FIRST_LINE;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "lastline"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_LAST_LINE;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "gotoline"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_GOTOLINECOLUMN_VOID;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "replace"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_REPLACE;
|
2008-03-16 12:55:41 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "justify"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_JUSTIFY_VOID;
|
2008-03-16 12:55:41 +00:00
|
|
|
else if (!strcasecmp(input, "beginpara"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_PARA_BEGIN_VOID;
|
2008-03-16 12:55:41 +00:00
|
|
|
else if (!strcasecmp(input, "endpara"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_PARA_END_VOID;
|
2008-03-16 12:55:41 +00:00
|
|
|
else if (!strcasecmp(input, "fulljustify"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_FULL_JUSTIFY;
|
2008-03-16 12:55:41 +00:00
|
|
|
#endif
|
|
|
|
#ifndef NANO_TINY
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "mark"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_MARK;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "searchagain") ||
|
|
|
|
!strcasecmp(input, "research"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_RESEARCH;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "copytext"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_COPY_TEXT;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "indent"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_INDENT_VOID;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "unindent"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_UNINDENT;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "scrollup"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_SCROLL_UP;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "scrolldown"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_SCROLL_DOWN;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "nextword"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_NEXT_WORD_VOID;
|
2008-03-13 08:23:52 +00:00
|
|
|
else if (!strcasecmp(input, "suspend"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_SUSPEND_VOID;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "prevword"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_PREV_WORD_VOID;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "findbracket"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_FIND_BRACKET;
|
2008-03-05 07:34:01 +00:00
|
|
|
else if (!strcasecmp(input, "wordcount"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_WORDLINECHAR_COUNT;
|
2008-07-13 01:36:06 +00:00
|
|
|
else if (!strcasecmp(input, "undo"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_UNDO;
|
2008-07-13 01:36:06 +00:00
|
|
|
else if (!strcasecmp(input, "redo"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_REDO;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "prevhistory")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = PREV_HISTORY_MSG;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "nexthistory")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = NEXT_HISTORY_MSG;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "nohelp") ||
|
|
|
|
!strcasecmp(input, "nohelp")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = NO_HELP;
|
|
|
|
} else if (!strcasecmp(input, "constupdate")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = CONST_UPDATE;
|
|
|
|
} else if (!strcasecmp(input, "morespace")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = MORE_SPACE;
|
|
|
|
} else if (!strcasecmp(input, "smoothscroll")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = SMOOTH_SCROLL;
|
2008-03-16 23:57:14 +00:00
|
|
|
} else if (!strcasecmp(input, "whitespacedisplay")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = WHITESPACE_DISPLAY;
|
|
|
|
} else if (!strcasecmp(input, "nosyntax")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = NO_COLOR_SYNTAX;
|
|
|
|
} else if (!strcasecmp(input, "smarthome")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = SMART_HOME;
|
|
|
|
} else if (!strcasecmp(input, "autoindent")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = AUTOINDENT;
|
|
|
|
} else if (!strcasecmp(input, "cuttoend")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = CUT_TO_END;
|
|
|
|
} else if (!strcasecmp(input, "nowrap")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = NO_WRAP;
|
|
|
|
} else if (!strcasecmp(input, "tabstospaces")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = TABS_TO_SPACES;
|
|
|
|
} else if (!strcasecmp(input, "backupfile")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = BACKUP_FILE;
|
|
|
|
} else if (!strcasecmp(input, "mutlibuffer")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = MULTIBUFFER;
|
|
|
|
} else if (!strcasecmp(input, "mouse")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = USE_MOUSE;
|
|
|
|
} else if (!strcasecmp(input, "noconvert")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = NO_CONVERT;
|
2008-03-13 08:23:52 +00:00
|
|
|
} else if (!strcasecmp(input, "suspendenable")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TOGGLE;
|
2008-03-05 07:34:01 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
s->toggle = SUSPEND;
|
2008-03-16 12:55:41 +00:00
|
|
|
}
|
2008-03-09 02:52:40 +00:00
|
|
|
#endif /* NANO_TINY */
|
|
|
|
else if (!strcasecmp(input, "right") ||
|
|
|
|
!strcasecmp(input, "forward"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_RIGHT;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "left") ||
|
|
|
|
!strcasecmp(input, "back"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_LEFT;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "up") ||
|
|
|
|
!strcasecmp(input, "prevline"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_UP_VOID;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "down") ||
|
|
|
|
!strcasecmp(input, "nextline"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_DOWN_VOID;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "home"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_HOME;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "end"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_END;
|
2008-03-09 02:52:40 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
else if (!strcasecmp(input, "prevbuf"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = SWITCH_TO_PREV_BUFFER_VOID;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "nextbuf"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = SWITCH_TO_NEXT_BUFFER_VOID;
|
2008-03-09 02:52:40 +00:00
|
|
|
#endif
|
|
|
|
else if (!strcasecmp(input, "verbatim"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_VERBATIM_INPUT;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "tab"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_TAB;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "enter"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_ENTER;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "delete"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_DELETE;
|
2008-07-13 16:44:19 +00:00
|
|
|
else if (!strcasecmp(input, "backspace"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DO_BACKSPACE;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "refresh"))
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = TOTAL_REFRESH;
|
2008-03-09 02:52:40 +00:00
|
|
|
else if (!strcasecmp(input, "casesens")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = CASE_SENS_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "regexp") ||
|
|
|
|
!strcasecmp(input, "regex")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = REGEXP_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "dontreplace")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = NO_REPLACE_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "gototext")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = GOTOTEXT_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "browser") ||
|
|
|
|
!strcasecmp(input, "tofiles")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = TO_FILES_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "dosformat")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = DOS_FORMAT_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "macformat")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = MAC_FORMAT_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "append")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = APPEND_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "prepend")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = PREPEND_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "backup")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = BACKUP_FILE_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
} else if (!strcasecmp(input, "newbuffer")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = NEW_BUFFER_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
#endif
|
|
|
|
} else if (!strcasecmp(input, "firstfile")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = FIRST_FILE_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
|
|
|
} else if (!strcasecmp(input, "lastfile")) {
|
2009-01-19 19:10:39 +00:00
|
|
|
s->scfunc = LAST_FILE_MSG;
|
2008-03-09 02:52:40 +00:00
|
|
|
s->execute = FALSE;
|
2008-03-05 07:34:01 +00:00
|
|
|
} else {
|
|
|
|
free(s);
|
|
|
|
return NULL;
|
|
|
|
}
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
return s;
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
}
|
2006-04-20 22:29:02 +00:00
|
|
|
|
2008-03-09 02:52:40 +00:00
|
|
|
#ifdef ENABLE_NANORC
|
2008-03-05 07:34:01 +00:00
|
|
|
/* Same thing as abnove but for the menu */
|
|
|
|
int strtomenu(char *input)
|
|
|
|
{
|
|
|
|
if (!strcasecmp(input, "all"))
|
|
|
|
return MALL;
|
|
|
|
else if (!strcasecmp(input, "main"))
|
|
|
|
return MMAIN;
|
|
|
|
else if (!strcasecmp(input, "search"))
|
|
|
|
return MWHEREIS;
|
|
|
|
else if (!strcasecmp(input, "replace"))
|
|
|
|
return MREPLACE;
|
|
|
|
else if (!strcasecmp(input, "replace2") ||
|
|
|
|
!strcasecmp(input, "replacewith"))
|
|
|
|
return MREPLACE2;
|
|
|
|
else if (!strcasecmp(input, "gotoline"))
|
|
|
|
return MGOTOLINE;
|
|
|
|
else if (!strcasecmp(input, "writeout"))
|
|
|
|
return MWRITEFILE;
|
|
|
|
else if (!strcasecmp(input, "insert"))
|
|
|
|
return MINSERTFILE;
|
|
|
|
else if (!strcasecmp(input, "externalcmd") ||
|
|
|
|
!strcasecmp(input, "extcmd"))
|
|
|
|
return MEXTCMD;
|
|
|
|
else if (!strcasecmp(input, "help"))
|
|
|
|
return MHELP;
|
|
|
|
else if (!strcasecmp(input, "spell"))
|
|
|
|
return MSPELL;
|
|
|
|
else if (!strcasecmp(input, "browser"))
|
|
|
|
return MBROWSER;
|
|
|
|
else if (!strcasecmp(input, "whereisfile"))
|
|
|
|
return MWHEREISFILE;
|
|
|
|
else if (!strcasecmp(input, "gotodir"))
|
|
|
|
return MGOTODIR;
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
2006-04-20 22:36:10 +00:00
|
|
|
#endif
|
|
|
|
|
2008-03-09 02:52:40 +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);
|
2005-05-26 05:17:13 +00:00
|
|
|
#endif
|
2009-02-16 23:06:09 +00:00
|
|
|
#ifdef DEBUG
|
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);
|
2009-02-16 23:06:09 +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;
|
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 */
|
2008-03-05 07:34:01 +00:00
|
|
|
|