Chris Allegretta | 11b0011 | 2000-08-06 21:13:45 +0000 | [diff] [blame] | 1 | /* $Id$ */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 2 | /************************************************************************** |
| 3 | * global.c * |
| 4 | * * |
David Lawrence Ramsey | c13b7f0 | 2005-01-01 07:28:15 +0000 | [diff] [blame] | 5 | * Copyright (C) 1999-2005 Chris Allegretta * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 6 | * This program is free software; you can redistribute it and/or modify * |
| 7 | * it under the terms of the GNU General Public License as published by * |
Chris Allegretta | 3a24f3f | 2001-10-24 11:33:54 +0000 | [diff] [blame] | 8 | * the Free Software Foundation; either version 2, or (at your option) * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 9 | * any later version. * |
| 10 | * * |
David Lawrence Ramsey | 6e925cf | 2005-05-15 19:57:17 +0000 | [diff] [blame] | 11 | * This program is distributed in the hope that it will be useful, but * |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
| 14 | * General Public License for more details. * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 15 | * * |
| 16 | * You should have received a copy of the GNU General Public License * |
| 17 | * along with this program; if not, write to the Free Software * |
David Lawrence Ramsey | 6e925cf | 2005-05-15 19:57:17 +0000 | [diff] [blame] | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * |
| 19 | * 02110-1301, USA. * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 20 | * * |
| 21 | **************************************************************************/ |
| 22 | |
Jordi Mallach | 55381aa | 2004-11-17 23:17:05 +0000 | [diff] [blame] | 23 | #ifdef HAVE_CONFIG_H |
| 24 | #include <config.h> |
| 25 | #endif |
Chris Allegretta | 6efda54 | 2001-04-28 18:03:52 +0000 | [diff] [blame] | 26 | |
Chris Allegretta | 1dd0bc9 | 2002-10-13 18:43:45 +0000 | [diff] [blame] | 27 | #include <stdlib.h> |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 28 | #include <assert.h> |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 29 | #include "proto.h" |
| 30 | |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 31 | /* Global variables */ |
Chris Allegretta | 48b0670 | 2002-02-22 04:30:50 +0000 | [diff] [blame] | 32 | |
David Lawrence Ramsey | f5b256b | 2003-10-03 20:26:25 +0000 | [diff] [blame] | 33 | #ifndef DISABLE_WRAPJUSTIFY |
David Lawrence Ramsey | 49c3f24 | 2004-07-12 16:07:14 +0000 | [diff] [blame] | 34 | /* wrap_at might be set in rcfile.c or nano.c. */ |
| 35 | ssize_t wrap_at = -CHARS_FROM_EOL; /* Right justified fill value, |
| 36 | allows resize */ |
David Lawrence Ramsey | f5b256b | 2003-10-03 20:26:25 +0000 | [diff] [blame] | 37 | #endif |
| 38 | |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 39 | char *last_search = NULL; /* Last string we searched for */ |
| 40 | char *last_replace = NULL; /* Last replacement string */ |
| 41 | int search_last_line; /* Is this the last search line? */ |
| 42 | |
David Lawrence Ramsey | 23c4450 | 2005-01-27 20:49:07 +0000 | [diff] [blame] | 43 | unsigned long flags = 0; /* Our flag containing many options */ |
David Lawrence Ramsey | 637b8bb | 2005-01-17 05:06:55 +0000 | [diff] [blame] | 44 | WINDOW *topwin; /* Top buffer */ |
David Lawrence Ramsey | f21cd10 | 2002-06-13 00:40:19 +0000 | [diff] [blame] | 45 | WINDOW *edit; /* The file portion of the editor */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 46 | WINDOW *bottomwin; /* Bottom buffer */ |
Chris Allegretta | 1a6e904 | 2000-12-14 13:56:28 +0000 | [diff] [blame] | 47 | char *filename = NULL; /* Name of the file */ |
David Lawrence Ramsey | 5db0cdc | 2002-06-28 22:45:14 +0000 | [diff] [blame] | 48 | |
| 49 | #ifndef NANO_SMALL |
| 50 | struct stat originalfilestat; /* Stat for the file as we loaded it */ |
| 51 | #endif |
| 52 | |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 53 | int editwinrows = 0; /* How many rows long is the edit |
| 54 | window? */ |
| 55 | filestruct *current; /* Current buffer pointer */ |
David Lawrence Ramsey | 7a97e18 | 2004-10-30 01:03:15 +0000 | [diff] [blame] | 56 | size_t current_x = 0; /* Current x-coordinate in the edit |
| 57 | window */ |
| 58 | int current_y = 0; /* Current y-coordinate in the edit |
| 59 | window */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 60 | filestruct *fileage = NULL; /* Our file buffer */ |
| 61 | filestruct *edittop = NULL; /* Pointer to the top of the edit |
| 62 | buffer with respect to the |
| 63 | file struct */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 64 | filestruct *filebot = NULL; /* Last node in the file struct */ |
| 65 | filestruct *cutbuffer = NULL; /* A place to store cut text */ |
David Lawrence Ramsey | 93c8405 | 2004-11-23 04:08:28 +0000 | [diff] [blame] | 66 | #ifndef DISABLE_JUSTIFY |
| 67 | filestruct *jusbuffer = NULL; /* A place to store unjustified text */ |
| 68 | #endif |
David Lawrence Ramsey | 40bdb68 | 2004-11-03 22:03:41 +0000 | [diff] [blame] | 69 | partition *filepart = NULL; /* A place to store a portion of the |
| 70 | file struct */ |
David Lawrence Ramsey | 40bdb68 | 2004-11-03 22:03:41 +0000 | [diff] [blame] | 71 | |
Chris Allegretta | 355fbe5 | 2001-07-14 19:32:47 +0000 | [diff] [blame] | 72 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 3ece0b9 | 2004-12-01 15:11:27 +0000 | [diff] [blame] | 73 | openfilestruct *open_files = NULL; /* The list of open file |
| 74 | buffers */ |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 75 | #endif |
| 76 | |
David Lawrence Ramsey | 89bb937 | 2004-05-29 16:47:52 +0000 | [diff] [blame] | 77 | #if !defined(NANO_SMALL) && defined(ENABLE_NANORC) |
| 78 | char *whitespace = NULL; /* Characters used when displaying |
| 79 | the first characters of tabs and |
| 80 | spaces. */ |
David Lawrence Ramsey | 6e60db6 | 2005-03-10 22:52:21 +0000 | [diff] [blame] | 81 | int whitespace_len[2]; /* The length of the characters. */ |
David Lawrence Ramsey | 89bb937 | 2004-05-29 16:47:52 +0000 | [diff] [blame] | 82 | #endif |
| 83 | |
Chris Allegretta | e4f940d | 2002-03-03 22:36:36 +0000 | [diff] [blame] | 84 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | 2c62b07 | 2004-05-29 16:38:57 +0000 | [diff] [blame] | 85 | char *punct = NULL; /* Closing punctuation that can end |
| 86 | sentences. */ |
| 87 | char *brackets = NULL; /* Closing brackets that can follow |
| 88 | closing punctuation and can end |
| 89 | sentences. */ |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 90 | char *quotestr = NULL; /* Quote string. The default value is |
| 91 | set in main(). */ |
David Lawrence Ramsey | 819c7f0 | 2004-07-30 03:54:34 +0000 | [diff] [blame] | 92 | #ifdef HAVE_REGEX_H |
| 93 | regex_t quotereg; /* Compiled quotestr regular expression. */ |
| 94 | int quoterc; /* Did it compile? */ |
| 95 | char *quoteerr = NULL; /* The error message. */ |
| 96 | #else |
| 97 | size_t quotelen; /* strlen(quotestr) */ |
| 98 | #endif |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 99 | #endif |
Chris Allegretta | e4f940d | 2002-03-03 22:36:36 +0000 | [diff] [blame] | 100 | |
David Lawrence Ramsey | 04e42a6 | 2004-02-28 16:24:31 +0000 | [diff] [blame] | 101 | #ifndef NANO_SMALL |
| 102 | char *backup_dir = NULL; /* Backup directory. */ |
| 103 | #endif |
| 104 | |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 105 | char *answer = NULL; /* Answer str to many questions */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 106 | int totlines = 0; /* Total number of lines in the file */ |
David Lawrence Ramsey | 23c4450 | 2005-01-27 20:49:07 +0000 | [diff] [blame] | 107 | size_t totsize = 0; /* Total number of characters in the |
| 108 | file */ |
David Lawrence Ramsey | 86e851b | 2004-07-28 20:46:25 +0000 | [diff] [blame] | 109 | size_t placewewant = 0; /* The column we'd like the cursor |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 110 | to jump to when we go to the |
| 111 | next or previous line */ |
| 112 | |
David Lawrence Ramsey | 49c3f24 | 2004-07-12 16:07:14 +0000 | [diff] [blame] | 113 | ssize_t tabsize = -1; /* Our internal tabsize variable. The |
| 114 | default value is set in main(). */ |
Chris Allegretta | 6d690a3 | 2000-08-03 22:51:21 +0000 | [diff] [blame] | 115 | |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 116 | char *hblank = NULL; /* A horizontal blank line */ |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 117 | #ifndef DISABLE_HELP |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 118 | char *help_text; /* The text in the help window */ |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 119 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 120 | |
| 121 | /* More stuff for the marker select */ |
| 122 | |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 123 | #ifndef NANO_SMALL |
David Lawrence Ramsey | f28f50e | 2004-01-09 23:04:55 +0000 | [diff] [blame] | 124 | filestruct *mark_beginbuf; /* The begin marker buffer */ |
David Lawrence Ramsey | 687776b | 2004-10-30 01:16:08 +0000 | [diff] [blame] | 125 | size_t mark_beginx; /* X value in the string to start */ |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 126 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 127 | |
Chris Allegretta | e1f1452 | 2001-09-19 03:19:43 +0000 | [diff] [blame] | 128 | #ifndef DISABLE_OPERATINGDIR |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 129 | char *operating_dir = NULL; /* Operating directory, which we can't */ |
| 130 | char *full_operating_dir = NULL;/* go higher than */ |
Chris Allegretta | e1f1452 | 2001-09-19 03:19:43 +0000 | [diff] [blame] | 131 | #endif |
| 132 | |
Chris Allegretta | 8d8e012 | 2001-04-18 04:28:54 +0000 | [diff] [blame] | 133 | #ifndef DISABLE_SPELLER |
Chris Allegretta | 7c27be4 | 2002-05-05 23:03:54 +0000 | [diff] [blame] | 134 | char *alt_speller = NULL; /* Alternative spell command */ |
Chris Allegretta | 8d8e012 | 2001-04-18 04:28:54 +0000 | [diff] [blame] | 135 | #endif |
| 136 | |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 137 | shortcut *main_list = NULL; |
| 138 | shortcut *whereis_list = NULL; |
| 139 | shortcut *replace_list = NULL; |
Chris Allegretta | 48b0670 | 2002-02-22 04:30:50 +0000 | [diff] [blame] | 140 | shortcut *replace_list_2 = NULL; /* 2nd half of replace dialog */ |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 141 | shortcut *gotoline_list = NULL; |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 142 | shortcut *writefile_list = NULL; |
| 143 | shortcut *insertfile_list = NULL; |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 144 | #ifndef DISABLE_HELP |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 145 | shortcut *help_list = NULL; |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 146 | #endif |
| 147 | #ifndef DISABLE_SPELLER |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 148 | shortcut *spell_list = NULL; |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 149 | #endif |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 150 | #ifndef NANO_SMALL |
Chris Allegretta | 52c5a6e | 2002-03-21 05:07:28 +0000 | [diff] [blame] | 151 | shortcut *extcmd_list = NULL; |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 152 | #endif |
Rocco Corsi | af5c302 | 2001-01-12 07:51:05 +0000 | [diff] [blame] | 153 | #ifndef DISABLE_BROWSER |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 154 | shortcut *browser_list = NULL; |
Chris Allegretta | 201f1d9 | 2003-02-05 02:51:19 +0000 | [diff] [blame] | 155 | shortcut *gotodir_list = NULL; |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 156 | #endif |
Chris Allegretta | 201f1d9 | 2003-02-05 02:51:19 +0000 | [diff] [blame] | 157 | |
Chris Allegretta | 8ce2413 | 2001-04-30 11:28:46 +0000 | [diff] [blame] | 158 | #ifdef ENABLE_COLOR |
David Lawrence Ramsey | 9b13ff3 | 2002-12-22 16:30:00 +0000 | [diff] [blame] | 159 | const colortype *colorstrings = NULL; |
| 160 | syntaxtype *syntaxes = NULL; |
| 161 | char *syntaxstr = NULL; |
Chris Allegretta | 8ce2413 | 2001-04-30 11:28:46 +0000 | [diff] [blame] | 162 | #endif |
| 163 | |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 164 | const shortcut *currshortcut; /* Current shortcut list we're using */ |
Chris Allegretta | 6b58acd | 2001-04-12 03:01:53 +0000 | [diff] [blame] | 165 | |
Chris Allegretta | f0b26df | 2001-01-20 22:18:18 +0000 | [diff] [blame] | 166 | #ifndef NANO_SMALL |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 167 | toggle *toggles = NULL; |
Chris Allegretta | f0b26df | 2001-01-20 22:18:18 +0000 | [diff] [blame] | 168 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 169 | |
David Lawrence Ramsey | 1addd60 | 2005-06-03 19:28:30 +0000 | [diff] [blame] | 170 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 934f968 | 2005-05-23 16:30:06 +0000 | [diff] [blame] | 171 | filestruct *search_history = NULL; |
| 172 | filestruct *searchage = NULL; |
| 173 | filestruct *searchbot = NULL; |
| 174 | filestruct *replace_history = NULL; |
| 175 | filestruct *replaceage = NULL; |
| 176 | filestruct *replacebot = NULL; |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 177 | #endif |
| 178 | |
Chris Allegretta | 9fc8d43 | 2000-07-07 01:49:52 +0000 | [diff] [blame] | 179 | /* Regular expressions */ |
Chris Allegretta | 805c26d | 2000-09-06 13:39:17 +0000 | [diff] [blame] | 180 | #ifdef HAVE_REGEX_H |
Chris Allegretta | bd9e7c3 | 2000-10-26 01:44:42 +0000 | [diff] [blame] | 181 | regex_t search_regexp; /* Global to store compiled search regexp */ |
| 182 | regmatch_t regmatches[10]; /* Match positions for parenthetical |
| 183 | subexpressions, max of 10 */ |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 184 | #endif |
Chris Allegretta | 3533a34 | 2002-03-24 23:19:32 +0000 | [diff] [blame] | 185 | |
David Lawrence Ramsey | 82dc1c1 | 2004-08-12 03:27:54 +0000 | [diff] [blame] | 186 | bool curses_ended = FALSE; /* Indicates to statusbar() to simply |
Chris Allegretta | a0d8997 | 2003-02-03 03:32:08 +0000 | [diff] [blame] | 187 | * write to stderr, since endwin() has |
| 188 | * ended curses mode. */ |
| 189 | |
David Lawrence Ramsey | a27bd65 | 2004-08-17 05:23:38 +0000 | [diff] [blame] | 190 | char *homedir = NULL; /* $HOME or from /etc/passwd. */ |
David Lawrence Ramsey | a27bd65 | 2004-08-17 05:23:38 +0000 | [diff] [blame] | 191 | |
David Lawrence Ramsey | ebd0d7c | 2004-07-01 18:59:52 +0000 | [diff] [blame] | 192 | size_t length_of_list(const shortcut *s) |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 193 | { |
David Lawrence Ramsey | ebd0d7c | 2004-07-01 18:59:52 +0000 | [diff] [blame] | 194 | size_t i = 0; |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 195 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 196 | for (; s != NULL; s = s->next) |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 197 | i++; |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 198 | return i; |
| 199 | } |
| 200 | |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 201 | /* Initialize a struct *without* our lovely braces =( */ |
David Lawrence Ramsey | 1576d53 | 2004-03-19 21:46:34 +0000 | [diff] [blame] | 202 | void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc, |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 203 | #ifndef DISABLE_HELP |
Chris Allegretta | f717f98 | 2003-02-13 22:25:01 +0000 | [diff] [blame] | 204 | const char *help, |
David Lawrence Ramsey | 5db0cdc | 2002-06-28 22:45:14 +0000 | [diff] [blame] | 205 | #endif |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 206 | int metaval, int funcval, int miscval, bool view, void |
David Lawrence Ramsey | 1576d53 | 2004-03-19 21:46:34 +0000 | [diff] [blame] | 207 | (*func)(void)) |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 208 | { |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 209 | shortcut *s; |
| 210 | |
| 211 | if (*shortcutage == NULL) { |
David Lawrence Ramsey | 70047ee | 2003-06-14 20:41:34 +0000 | [diff] [blame] | 212 | *shortcutage = (shortcut *)nmalloc(sizeof(shortcut)); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 213 | s = *shortcutage; |
| 214 | } else { |
| 215 | for (s = *shortcutage; s->next != NULL; s = s->next) |
| 216 | ; |
David Lawrence Ramsey | 70047ee | 2003-06-14 20:41:34 +0000 | [diff] [blame] | 217 | s->next = (shortcut *)nmalloc(sizeof(shortcut)); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 218 | s = s->next; |
| 219 | } |
| 220 | |
David Lawrence Ramsey | 1576d53 | 2004-03-19 21:46:34 +0000 | [diff] [blame] | 221 | s->ctrlval = ctrlval; |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 222 | s->desc = _(desc); |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 223 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 224 | s->help = _(help); |
David Lawrence Ramsey | 5db0cdc | 2002-06-28 22:45:14 +0000 | [diff] [blame] | 225 | #endif |
David Lawrence Ramsey | 1576d53 | 2004-03-19 21:46:34 +0000 | [diff] [blame] | 226 | s->metaval = metaval; |
| 227 | s->funcval = funcval; |
| 228 | s->miscval = miscval; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 229 | s->viewok = view; |
| 230 | s->func = func; |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 231 | s->next = NULL; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 232 | } |
| 233 | |
David Lawrence Ramsey | 1f1ebb8 | 2004-11-11 21:50:01 +0000 | [diff] [blame] | 234 | void shortcut_init(bool unjustify) |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 235 | { |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 236 | const char *get_help_msg = N_("Get Help"); |
| 237 | const char *exit_msg = N_("Exit"); |
| 238 | const char *prev_page_msg = N_("Prev Page"); |
| 239 | const char *next_page_msg = N_("Next Page"); |
| 240 | const char *replace_msg = N_("Replace"); |
| 241 | const char *go_to_line_msg = N_("Go To Line"); |
| 242 | const char *cancel_msg = N_("Cancel"); |
| 243 | const char *first_line_msg = N_("First Line"); |
| 244 | const char *last_line_msg = N_("Last Line"); |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 245 | const char *refresh_msg = N_("Refresh"); |
David Lawrence Ramsey | 295d172 | 2005-01-01 07:43:32 +0000 | [diff] [blame] | 246 | #ifndef NANO_SMALL |
| 247 | const char *cut_till_end_msg = N_("CutTillEnd"); |
| 248 | #endif |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 249 | #ifndef DISABLE_JUSTIFY |
| 250 | const char *beg_of_par_msg = N_("Beg of Par"); |
| 251 | const char *end_of_par_msg = N_("End of Par"); |
| 252 | const char *fulljstify_msg = N_("FullJstify"); |
| 253 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 254 | #ifndef NANO_SMALL |
| 255 | const char *case_sens_msg = N_("Case Sens"); |
| 256 | const char *direction_msg = N_("Direction"); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 257 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 258 | #ifdef HAVE_REGEX_H |
| 259 | const char *regexp_msg = N_("Regexp"); |
| 260 | #endif |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 261 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 5e73eec | 2005-05-03 20:57:13 +0000 | [diff] [blame] | 262 | const char *history_msg = N_("History"); |
David Lawrence Ramsey | 47e82b1 | 2004-09-28 22:21:46 +0000 | [diff] [blame] | 263 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 04a8d1c | 2004-09-28 22:14:58 +0000 | [diff] [blame] | 264 | const char *new_buffer_msg = N_("New Buffer"); |
David Lawrence Ramsey | 47e82b1 | 2004-09-28 22:21:46 +0000 | [diff] [blame] | 265 | #endif |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 266 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 267 | #ifndef DISABLE_BROWSER |
| 268 | const char *to_files_msg = N_("To Files"); |
| 269 | #endif |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 270 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 271 | const char *nano_help_msg = N_("Invoke the help menu"); |
| 272 | const char *nano_exit_msg = |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 273 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 274 | N_("Close currently loaded file/Exit from nano") |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 275 | #else |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 276 | N_("Exit from nano") |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 277 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 278 | ; |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 279 | const char *nano_writeout_msg = |
| 280 | N_("Write the current file to disk"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 281 | const char *nano_justify_msg = N_("Justify the current paragraph"); |
| 282 | const char *nano_insert_msg = |
| 283 | N_("Insert another file into the current one"); |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 284 | const char *nano_whereis_msg = |
| 285 | N_("Search for text within the editor"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 286 | const char *nano_prevpage_msg = N_("Move to the previous screen"); |
| 287 | const char *nano_nextpage_msg = N_("Move to the next screen"); |
| 288 | const char *nano_cut_msg = |
| 289 | N_("Cut the current line and store it in the cutbuffer"); |
| 290 | const char *nano_uncut_msg = |
| 291 | N_("Uncut from the cutbuffer into the current line"); |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 292 | const char *nano_cursorpos_msg = |
| 293 | N_("Show the position of the cursor"); |
| 294 | const char *nano_spell_msg = |
| 295 | N_("Invoke the spell checker, if available"); |
David Lawrence Ramsey | d3d3743 | 2005-05-17 21:49:19 +0000 | [diff] [blame] | 296 | const char *nano_gotoline_msg = |
| 297 | N_("Go to a specific line number and column number"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 298 | const char *nano_replace_msg = N_("Replace text within the editor"); |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 299 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 8381fdd | 2004-11-01 22:40:02 +0000 | [diff] [blame] | 300 | const char *nano_mark_msg = N_("Mark text at the cursor position"); |
| 301 | const char *nano_whereis_next_msg = N_("Repeat last search"); |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 302 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 303 | const char *nano_prevline_msg = N_("Move to the previous line"); |
| 304 | const char *nano_nextline_msg = N_("Move to the next line"); |
| 305 | const char *nano_forward_msg = N_("Move forward one character"); |
| 306 | const char *nano_back_msg = N_("Move back one character"); |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 307 | const char *nano_home_msg = |
| 308 | N_("Move to the beginning of the current line"); |
| 309 | const char *nano_end_msg = |
| 310 | N_("Move to the end of the current line"); |
| 311 | const char *nano_refresh_msg = |
| 312 | N_("Refresh (redraw) the current screen"); |
| 313 | const char *nano_delete_msg = |
| 314 | N_("Delete the character under the cursor"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 315 | const char *nano_backspace_msg = |
| 316 | N_("Delete the character to the left of the cursor"); |
David Lawrence Ramsey | e7c4168 | 2004-10-23 14:53:07 +0000 | [diff] [blame] | 317 | const char *nano_tab_msg = |
| 318 | N_("Insert a tab character at the cursor position"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 319 | const char *nano_enter_msg = |
| 320 | N_("Insert a carriage return at the cursor position"); |
David Lawrence Ramsey | 00d7798 | 2004-08-07 21:27:37 +0000 | [diff] [blame] | 321 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 322 | const char *nano_nextword_msg = N_("Move forward one word"); |
| 323 | const char *nano_prevword_msg = N_("Move backward one word"); |
David Lawrence Ramsey | e010edd | 2005-06-12 22:31:03 +0000 | [diff] [blame] | 324 | const char *nano_wordcount_msg = |
| 325 | N_("Count the number of words in the file"); |
David Lawrence Ramsey | 00d7798 | 2004-08-07 21:27:37 +0000 | [diff] [blame] | 326 | #endif |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 327 | #ifndef DISABLE_JUSTIFY |
| 328 | const char *nano_parabegin_msg = |
| 329 | N_("Go to the beginning of the current paragraph"); |
| 330 | const char *nano_paraend_msg = |
| 331 | N_("Go to the end of the current paragraph"); |
| 332 | #endif |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 333 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 334 | const char *nano_openprev_msg = |
| 335 | N_("Switch to the previous file buffer"); |
| 336 | const char *nano_opennext_msg = |
| 337 | N_("Switch to the next file buffer"); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 338 | #endif |
| 339 | const char *nano_verbatim_msg = N_("Insert character(s) verbatim"); |
David Lawrence Ramsey | 295d172 | 2005-01-01 07:43:32 +0000 | [diff] [blame] | 340 | #ifndef NANO_SMALL |
| 341 | const char *nano_cut_till_end_msg = |
| 342 | N_("Cut from the cursor position to the end of the file"); |
| 343 | #endif |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 344 | #ifndef DISABLE_JUSTIFY |
| 345 | const char *nano_fulljustify_msg = N_("Justify the entire file"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 346 | #endif |
David Lawrence Ramsey | 8381fdd | 2004-11-01 22:40:02 +0000 | [diff] [blame] | 347 | #if !defined(NANO_SMALL) && defined(HAVE_REGEX_H) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 348 | const char *nano_bracket_msg = N_("Find other bracket"); |
| 349 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 350 | const char *nano_cancel_msg = N_("Cancel the current function"); |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 351 | const char *nano_firstline_msg = |
| 352 | N_("Go to the first line of the file"); |
| 353 | const char *nano_lastline_msg = |
| 354 | N_("Go to the last line of the file"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 355 | #ifndef NANO_SMALL |
| 356 | const char *nano_case_msg = |
| 357 | N_("Make the current search/replace case (in)sensitive"); |
| 358 | const char *nano_reverse_msg = |
| 359 | N_("Make the current search/replace go backwards"); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 360 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 361 | #ifdef HAVE_REGEX_H |
| 362 | const char *nano_regexp_msg = N_("Use regular expressions"); |
| 363 | #endif |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 364 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 5e73eec | 2005-05-03 20:57:13 +0000 | [diff] [blame] | 365 | const char *nano_history_msg = |
| 366 | N_("Edit the previous search/replace strings"); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 367 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 368 | #ifndef DISABLE_BROWSER |
| 369 | const char *nano_tofiles_msg = N_("Go to file browser"); |
| 370 | #endif |
| 371 | #ifndef NANO_SMALL |
| 372 | const char *nano_dos_msg = N_("Write file out in DOS format"); |
| 373 | const char *nano_mac_msg = N_("Write file out in Mac format"); |
| 374 | #endif |
| 375 | const char *nano_append_msg = N_("Append to the current file"); |
| 376 | const char *nano_prepend_msg = N_("Prepend to the current file"); |
| 377 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 378 | const char *nano_backup_msg = |
| 379 | N_("Back up original file when saving"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 380 | const char *nano_execute_msg = N_("Execute external command"); |
| 381 | #endif |
David Lawrence Ramsey | ad96aff | 2005-02-22 23:22:37 +0000 | [diff] [blame] | 382 | #if !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 383 | const char *nano_multibuffer_msg = N_("Insert into new buffer"); |
| 384 | #endif |
| 385 | #ifndef DISABLE_BROWSER |
David Lawrence Ramsey | c41d428 | 2004-07-23 12:51:40 +0000 | [diff] [blame] | 386 | const char *nano_exitbrowser_msg = N_("Exit from the file browser"); |
| 387 | const char *nano_gotodir_msg = N_("Go to directory"); |
Chris Allegretta | 2bef182 | 2001-09-28 19:53:11 +0000 | [diff] [blame] | 388 | #endif |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 389 | #endif /* !DISABLE_HELP */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 390 | |
David Lawrence Ramsey | 8e4adcd | 2004-05-20 03:29:33 +0000 | [diff] [blame] | 391 | /* The following macro is to be used in calling sc_init_one(). The |
| 392 | * point is that sc_init_one() takes 9 arguments, unless DISABLE_HELP is |
| 393 | * defined, when the 4th one should not be there. */ |
David Lawrence Ramsey | ea43a1d | 2004-03-02 22:52:57 +0000 | [diff] [blame] | 394 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | eb50922 | 2005-03-22 04:50:11 +0000 | [diff] [blame] | 395 | #define IFHELP(help, nextvar) help, nextvar |
David Lawrence Ramsey | ea43a1d | 2004-03-02 22:52:57 +0000 | [diff] [blame] | 396 | #else |
David Lawrence Ramsey | eb50922 | 2005-03-22 04:50:11 +0000 | [diff] [blame] | 397 | #define IFHELP(help, nextvar) nextvar |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 398 | #endif |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 399 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 400 | free_shortcutage(&main_list); |
| 401 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 402 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 403 | sc_init_one(&main_list, NANO_HELP_KEY, get_help_msg, |
| 404 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 405 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 406 | #ifndef DISABLE_HELP |
| 407 | do_help |
| 408 | #else |
| 409 | nano_disabled_msg |
| 410 | #endif |
| 411 | ); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 412 | |
David Lawrence Ramsey | 5b3dd0f | 2004-11-25 04:39:07 +0000 | [diff] [blame] | 413 | /* Translators: try to keep this string under 10 characters long */ |
| 414 | sc_init_one(&main_list, NANO_EXIT_KEY, |
Chris Allegretta | 355fbe5 | 2001-07-14 19:32:47 +0000 | [diff] [blame] | 415 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 5b3dd0f | 2004-11-25 04:39:07 +0000 | [diff] [blame] | 416 | open_files != NULL && open_files != open_files->next ? |
| 417 | N_("Close") : |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 418 | #endif |
David Lawrence Ramsey | 5b3dd0f | 2004-11-25 04:39:07 +0000 | [diff] [blame] | 419 | exit_msg, IFHELP(nano_exit_msg, NANO_NO_KEY), NANO_EXIT_FKEY, |
| 420 | NANO_NO_KEY, VIEW, do_exit); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 421 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 422 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 423 | sc_init_one(&main_list, NANO_WRITEOUT_KEY, N_("WriteOut"), |
| 424 | IFHELP(nano_writeout_msg, NANO_NO_KEY), NANO_WRITEOUT_FKEY, |
| 425 | NANO_NO_KEY, NOVIEW, do_writeout_void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 426 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 427 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 428 | sc_init_one(&main_list, NANO_JUSTIFY_KEY, N_("Justify"), |
| 429 | IFHELP(nano_justify_msg, NANO_NO_KEY), |
| 430 | NANO_JUSTIFY_FKEY, NANO_NO_KEY, NOVIEW, |
David Lawrence Ramsey | a539fce | 2004-06-29 00:43:56 +0000 | [diff] [blame] | 431 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | 8d3e7f3 | 2004-05-13 17:28:03 +0000 | [diff] [blame] | 432 | do_justify_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 433 | #else |
| 434 | nano_disabled_msg |
| 435 | #endif |
| 436 | ); |
Chris Allegretta | 32da456 | 2002-01-02 15:12:21 +0000 | [diff] [blame] | 437 | |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 438 | /* We allow inserting files in view mode if multibuffers are |
| 439 | * available, so that we can view multiple files. */ |
| 440 | /* If we're using restricted mode, inserting files is disabled since |
| 441 | * it allows reading from or writing to files not specified on the |
| 442 | * command line. */ |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 443 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 444 | sc_init_one(&main_list, NANO_INSERTFILE_KEY, N_("Read File"), |
| 445 | IFHELP(nano_insert_msg, NANO_NO_KEY), NANO_INSERTFILE_FKEY, |
| 446 | NANO_NO_KEY, |
Chris Allegretta | 32da456 | 2002-01-02 15:12:21 +0000 | [diff] [blame] | 447 | #ifdef ENABLE_MULTIBUFFER |
Chris Allegretta | d845193 | 2003-03-11 03:50:40 +0000 | [diff] [blame] | 448 | VIEW |
Chris Allegretta | 32da456 | 2002-01-02 15:12:21 +0000 | [diff] [blame] | 449 | #else |
Chris Allegretta | d845193 | 2003-03-11 03:50:40 +0000 | [diff] [blame] | 450 | NOVIEW |
Chris Allegretta | 32da456 | 2002-01-02 15:12:21 +0000 | [diff] [blame] | 451 | #endif |
David Lawrence Ramsey | 8001e27 | 2004-11-12 00:48:18 +0000 | [diff] [blame] | 452 | , !ISSET(RESTRICTED) ? do_insertfile_void : |
| 453 | nano_disabled_msg); |
Chris Allegretta | af6414a | 2001-02-11 19:05:05 +0000 | [diff] [blame] | 454 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 455 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 456 | sc_init_one(&main_list, NANO_WHEREIS_KEY, N_("Where Is"), |
| 457 | IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_WHEREIS_FKEY, |
| 458 | NANO_NO_KEY, VIEW, do_search); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 459 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 460 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 461 | sc_init_one(&main_list, NANO_PREVPAGE_KEY, prev_page_msg, |
| 462 | IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY, |
| 463 | NANO_NO_KEY, VIEW, do_page_up); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 464 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 465 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 466 | sc_init_one(&main_list, NANO_NEXTPAGE_KEY, next_page_msg, |
| 467 | IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY, |
| 468 | NANO_NO_KEY, VIEW, do_page_down); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 469 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 470 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 471 | sc_init_one(&main_list, NANO_CUT_KEY, N_("Cut Text"), |
| 472 | IFHELP(nano_cut_msg, NANO_NO_KEY), NANO_CUT_FKEY, |
| 473 | NANO_NO_KEY, NOVIEW, do_cut_text); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 474 | |
Chris Allegretta | 0779835 | 2000-11-27 22:58:23 +0000 | [diff] [blame] | 475 | if (unjustify) |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 476 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 477 | sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, N_("UnJustify"), |
| 478 | IFHELP(NULL, NANO_NO_KEY), NANO_UNJUSTIFY_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 479 | NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | 0779835 | 2000-11-27 22:58:23 +0000 | [diff] [blame] | 480 | else |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 481 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 482 | sc_init_one(&main_list, NANO_UNCUT_KEY, N_("UnCut Txt"), |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 483 | IFHELP(nano_uncut_msg, NANO_NO_KEY), NANO_UNCUT_FKEY, |
| 484 | NANO_NO_KEY, NOVIEW, do_uncut_text); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 485 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 486 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 487 | sc_init_one(&main_list, NANO_CURSORPOS_KEY, N_("Cur Pos"), |
| 488 | IFHELP(nano_cursorpos_msg, NANO_NO_KEY), NANO_CURSORPOS_FKEY, |
| 489 | NANO_NO_KEY, VIEW, do_cursorpos_void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 490 | |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 491 | /* If we're using restricted mode, spell checking is disabled |
| 492 | * because it allows reading from or writing to files not specified |
| 493 | * on the command line. */ |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 494 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 495 | sc_init_one(&main_list, NANO_SPELL_KEY, N_("To Spell"), |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 496 | IFHELP(nano_spell_msg, NANO_NO_KEY), NANO_SPELL_FKEY, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 497 | NANO_NO_KEY, NOVIEW, |
| 498 | #ifndef DISABLE_SPELLER |
| 499 | !ISSET(RESTRICTED) ? do_spell : |
| 500 | #endif |
| 501 | nano_disabled_msg); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 502 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 503 | sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg, |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 504 | IFHELP(nano_gotoline_msg, NANO_GOTOLINE_ALTKEY), |
David Lawrence Ramsey | 9245f97 | 2005-05-17 18:06:26 +0000 | [diff] [blame] | 505 | NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, |
| 506 | do_gotolinecolumn_void); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 507 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 508 | sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg, |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 509 | IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY), |
| 510 | NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, do_replace); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 511 | |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 512 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 8381fdd | 2004-11-01 22:40:02 +0000 | [diff] [blame] | 513 | sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"), |
| 514 | IFHELP(nano_mark_msg, NANO_MARK_ALTKEY), NANO_MARK_FKEY, |
David Lawrence Ramsey | a049c83 | 2005-06-12 23:53:28 +0000 | [diff] [blame^] | 515 | NANO_NO_KEY, VIEW, do_mark); |
David Lawrence Ramsey | 8381fdd | 2004-11-01 22:40:02 +0000 | [diff] [blame] | 516 | |
| 517 | sc_init_one(&main_list, NANO_NO_KEY, N_("Where Is Next"), |
| 518 | IFHELP(nano_whereis_next_msg, NANO_WHEREIS_NEXT_KEY), |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 519 | NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, do_research); |
David Lawrence Ramsey | 8381fdd | 2004-11-01 22:40:02 +0000 | [diff] [blame] | 520 | #endif |
David Lawrence Ramsey | 8381fdd | 2004-11-01 22:40:02 +0000 | [diff] [blame] | 521 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 522 | sc_init_one(&main_list, NANO_PREVLINE_KEY, N_("Prev Line"), |
| 523 | IFHELP(nano_prevline_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 524 | NANO_NO_KEY, VIEW, do_up); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 525 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 526 | sc_init_one(&main_list, NANO_NEXTLINE_KEY, N_("Next Line"), |
| 527 | IFHELP(nano_nextline_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 528 | NANO_NO_KEY, VIEW, do_down); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 529 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 530 | sc_init_one(&main_list, NANO_FORWARD_KEY, N_("Forward"), |
| 531 | IFHELP(nano_forward_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 532 | NANO_NO_KEY, VIEW, do_right_void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 533 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 534 | sc_init_one(&main_list, NANO_BACK_KEY, N_("Back"), |
| 535 | IFHELP(nano_back_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 536 | NANO_NO_KEY, VIEW, do_left_void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 537 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 538 | sc_init_one(&main_list, NANO_HOME_KEY, N_("Home"), |
| 539 | IFHELP(nano_home_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 540 | NANO_NO_KEY, VIEW, do_home); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 541 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 542 | sc_init_one(&main_list, NANO_END_KEY, N_("End"), |
| 543 | IFHELP(nano_end_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 544 | NANO_NO_KEY, VIEW, do_end); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 545 | |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 546 | sc_init_one(&main_list, NANO_REFRESH_KEY, refresh_msg, |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 547 | IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 548 | NANO_NO_KEY, VIEW, total_refresh); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 549 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 550 | sc_init_one(&main_list, NANO_DELETE_KEY, N_("Delete"), |
| 551 | IFHELP(nano_delete_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 552 | NANO_NO_KEY, NOVIEW, do_delete); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 553 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 554 | sc_init_one(&main_list, NANO_BACKSPACE_KEY, N_("Backspace"), |
| 555 | IFHELP(nano_backspace_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 556 | NANO_NO_KEY, NOVIEW, do_backspace); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 557 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 558 | sc_init_one(&main_list, NANO_TAB_KEY, N_("Tab"), |
| 559 | IFHELP(nano_tab_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 560 | NANO_NO_KEY, NOVIEW, do_tab); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 561 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 562 | sc_init_one(&main_list, NANO_ENTER_KEY, N_("Enter"), |
| 563 | IFHELP(nano_enter_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 564 | NANO_NO_KEY, NOVIEW, do_enter); |
Chris Allegretta | af6414a | 2001-02-11 19:05:05 +0000 | [diff] [blame] | 565 | |
David Lawrence Ramsey | c596755 | 2002-06-21 03:20:06 +0000 | [diff] [blame] | 566 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 567 | sc_init_one(&main_list, NANO_NEXTWORD_KEY, N_("Next Word"), |
| 568 | IFHELP(nano_nextword_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | e010edd | 2005-06-12 22:31:03 +0000 | [diff] [blame] | 569 | NANO_NO_KEY, VIEW, do_next_word_void); |
David Lawrence Ramsey | c596755 | 2002-06-21 03:20:06 +0000 | [diff] [blame] | 570 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 571 | sc_init_one(&main_list, NANO_NO_KEY, N_("Prev Word"), |
| 572 | IFHELP(nano_prevword_msg, NANO_PREVWORD_KEY), NANO_NO_KEY, |
| 573 | NANO_NO_KEY, VIEW, do_prev_word); |
David Lawrence Ramsey | e010edd | 2005-06-12 22:31:03 +0000 | [diff] [blame] | 574 | |
| 575 | sc_init_one(&main_list, NANO_NO_KEY, N_("Word Count"), |
| 576 | IFHELP(nano_wordcount_msg, NANO_WORDCOUNT_KEY), NANO_NO_KEY, |
| 577 | NANO_NO_KEY, VIEW, do_word_count); |
Chris Allegretta | 8d990b5 | 2001-09-22 22:14:25 +0000 | [diff] [blame] | 578 | #endif |
David Lawrence Ramsey | e049706 | 2003-08-23 21:11:06 +0000 | [diff] [blame] | 579 | |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 580 | #ifndef DISABLE_JUSTIFY |
| 581 | /* Translators: try to keep this string under 10 characters long */ |
| 582 | sc_init_one(&main_list, NANO_NO_KEY, beg_of_par_msg, |
| 583 | IFHELP(nano_parabegin_msg, NANO_PARABEGIN_ALTKEY1), NANO_NO_KEY, |
David Lawrence Ramsey | ff4a487 | 2005-03-13 21:12:25 +0000 | [diff] [blame] | 584 | NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 585 | |
| 586 | /* Translators: try to keep this string under 10 characters long */ |
| 587 | sc_init_one(&main_list, NANO_NO_KEY, end_of_par_msg, |
| 588 | IFHELP(nano_paraend_msg, NANO_PARAEND_ALTKEY1), NANO_NO_KEY, |
David Lawrence Ramsey | ff4a487 | 2005-03-13 21:12:25 +0000 | [diff] [blame] | 589 | NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 590 | #endif |
David Lawrence Ramsey | e049706 | 2003-08-23 21:11:06 +0000 | [diff] [blame] | 591 | |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 592 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 593 | sc_init_one(&main_list, NANO_NO_KEY, N_("Previous File"), |
| 594 | IFHELP(nano_openprev_msg, NANO_OPENPREV_KEY), NANO_NO_KEY, |
| 595 | NANO_OPENPREV_ALTKEY, VIEW, open_prevfile_void); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 596 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 597 | sc_init_one(&main_list, NANO_NO_KEY, N_("Next File"), |
| 598 | IFHELP(nano_opennext_msg, NANO_OPENNEXT_KEY), NANO_NO_KEY, |
| 599 | NANO_OPENNEXT_ALTKEY, VIEW, open_nextfile_void); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 600 | #endif |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 601 | |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 602 | sc_init_one(&main_list, NANO_NO_KEY, N_("Verbatim Input"), |
| 603 | IFHELP(nano_verbatim_msg, NANO_VERBATIM_KEY), NANO_NO_KEY, |
| 604 | NANO_NO_KEY, NOVIEW, do_verbatim_input); |
| 605 | |
David Lawrence Ramsey | 295d172 | 2005-01-01 07:43:32 +0000 | [diff] [blame] | 606 | #ifndef NANO_SMALL |
| 607 | /* Translators: try to keep this string under 10 characters long */ |
| 608 | sc_init_one(&main_list, NANO_NO_KEY, cut_till_end_msg, |
| 609 | IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY), |
| 610 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end); |
| 611 | #endif |
| 612 | |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 613 | #ifndef DISABLE_JUSTIFY |
| 614 | /* Translators: try to keep this string under 10 characters long */ |
| 615 | sc_init_one(&main_list, NANO_NO_KEY, fulljstify_msg, |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 616 | IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY), |
| 617 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 618 | #endif |
| 619 | |
David Lawrence Ramsey | 8381fdd | 2004-11-01 22:40:02 +0000 | [diff] [blame] | 620 | #if !defined(NANO_SMALL) && defined(HAVE_REGEX_H) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 621 | sc_init_one(&main_list, NANO_NO_KEY, N_("Find Other Bracket"), |
| 622 | IFHELP(nano_bracket_msg, NANO_BRACKET_KEY), NANO_NO_KEY, |
| 623 | NANO_NO_KEY, VIEW, do_find_bracket); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 624 | #endif |
| 625 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 626 | free_shortcutage(&whereis_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 627 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 628 | sc_init_one(&whereis_list, NANO_HELP_KEY, get_help_msg, |
| 629 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 630 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 631 | #ifndef DISABLE_HELP |
| 632 | do_help |
| 633 | #else |
| 634 | nano_disabled_msg |
| 635 | #endif |
| 636 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 637 | |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 638 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 639 | sc_init_one(&whereis_list, NANO_CANCEL_KEY, cancel_msg, |
| 640 | IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 641 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 642 | |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 643 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 644 | sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, first_line_msg, |
| 645 | IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_FIRSTLINE_FKEY, |
| 646 | NANO_NO_KEY, VIEW, do_first_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 647 | |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 648 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 649 | sc_init_one(&whereis_list, NANO_LASTLINE_KEY, last_line_msg, |
| 650 | IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_LASTLINE_FKEY, |
| 651 | NANO_NO_KEY, VIEW, do_last_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 652 | |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 653 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 654 | sc_init_one(&whereis_list, NANO_TOOTHERSEARCH_KEY, replace_msg, |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 655 | IFHELP(nano_replace_msg, NANO_NO_KEY), NANO_REPLACE_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 656 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 657 | |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 658 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 659 | sc_init_one(&whereis_list, NANO_TOGOTOLINE_KEY, go_to_line_msg, |
| 660 | IFHELP(nano_gotoline_msg, NANO_NO_KEY), NANO_GOTOLINE_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 661 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 8c2b40f | 2000-06-29 01:30:04 +0000 | [diff] [blame] | 662 | |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 663 | #ifndef DISABLE_JUSTIFY |
| 664 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 665 | sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, beg_of_par_msg, |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 666 | IFHELP(nano_parabegin_msg, NANO_PARABEGIN_ALTKEY1), NANO_NO_KEY, |
David Lawrence Ramsey | ff4a487 | 2005-03-13 21:12:25 +0000 | [diff] [blame] | 667 | NANO_PARABEGIN_ALTKEY2, VIEW, do_para_begin_void); |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 668 | |
| 669 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 670 | sc_init_one(&whereis_list, NANO_PARAEND_KEY, end_of_par_msg, |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 671 | IFHELP(nano_paraend_msg, NANO_PARAEND_ALTKEY1), NANO_NO_KEY, |
David Lawrence Ramsey | ff4a487 | 2005-03-13 21:12:25 +0000 | [diff] [blame] | 672 | NANO_PARAEND_ALTKEY2, VIEW, do_para_end_void); |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 673 | #endif |
| 674 | |
Chris Allegretta | 5f36c37 | 2001-07-16 00:48:53 +0000 | [diff] [blame] | 675 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 676 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 677 | sc_init_one(&whereis_list, NANO_NO_KEY, case_sens_msg, |
| 678 | IFHELP(nano_case_msg, TOGGLE_CASE_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 679 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 680 | |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 681 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 682 | sc_init_one(&whereis_list, NANO_NO_KEY, direction_msg, |
| 683 | IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 684 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 685 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 686 | |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 687 | #ifdef HAVE_REGEX_H |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 688 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 689 | sc_init_one(&whereis_list, NANO_NO_KEY, regexp_msg, |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 690 | IFHELP(nano_regexp_msg, NANO_REGEXP_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 691 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 692 | #endif |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 693 | |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 694 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 695 | /* Translators: try to keep this string under 10 characters long */ |
David Lawrence Ramsey | 5e73eec | 2005-05-03 20:57:13 +0000 | [diff] [blame] | 696 | sc_init_one(&whereis_list, NANO_PREVLINE_KEY, history_msg, |
| 697 | IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 698 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 295d172 | 2005-01-01 07:43:32 +0000 | [diff] [blame] | 699 | |
| 700 | /* Translators: try to keep this string under 10 characters long */ |
| 701 | sc_init_one(&whereis_list, NANO_CUTTILLEND_KEY, cut_till_end_msg, |
| 702 | IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY), |
| 703 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 704 | #endif |
David Lawrence Ramsey | 02085d7 | 2004-11-07 16:04:18 +0000 | [diff] [blame] | 705 | |
| 706 | #ifndef DISABLE_JUSTIFY |
| 707 | /* Translators: try to keep this string under 10 characters long */ |
| 708 | sc_init_one(&whereis_list, NANO_FULLJUSTIFY_KEY, fulljstify_msg, |
| 709 | IFHELP(nano_fulljustify_msg, NANO_FULLJUSTIFY_ALTKEY), |
| 710 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); |
| 711 | #endif |
Chris Allegretta | 5f36c37 | 2001-07-16 00:48:53 +0000 | [diff] [blame] | 712 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 713 | free_shortcutage(&replace_list); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 714 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 715 | sc_init_one(&replace_list, NANO_HELP_KEY, get_help_msg, |
| 716 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 717 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 718 | #ifndef DISABLE_HELP |
| 719 | do_help |
| 720 | #else |
| 721 | nano_disabled_msg |
| 722 | #endif |
| 723 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 724 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 725 | sc_init_one(&replace_list, NANO_CANCEL_KEY, cancel_msg, |
| 726 | IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 727 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 5f36c37 | 2001-07-16 00:48:53 +0000 | [diff] [blame] | 728 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 729 | sc_init_one(&replace_list, NANO_FIRSTLINE_KEY, first_line_msg, |
| 730 | IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_FIRSTLINE_FKEY, |
| 731 | NANO_NO_KEY, VIEW, do_first_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 732 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 733 | sc_init_one(&replace_list, NANO_LASTLINE_KEY, last_line_msg, |
| 734 | IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_LASTLINE_FKEY, |
| 735 | NANO_NO_KEY, VIEW, do_last_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 736 | |
David Lawrence Ramsey | 5e73eec | 2005-05-03 20:57:13 +0000 | [diff] [blame] | 737 | /* Translators: try to keep this string under 12 characters long */ |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 738 | sc_init_one(&replace_list, NANO_TOOTHERSEARCH_KEY, N_("No Replace"), |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 739 | IFHELP(nano_whereis_msg, NANO_NO_KEY), NANO_REPLACE_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 740 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 741 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 742 | sc_init_one(&replace_list, NANO_TOGOTOLINE_KEY, go_to_line_msg, |
| 743 | IFHELP(nano_gotoline_msg, NANO_NO_KEY), NANO_GOTOLINE_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 744 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 8c2b40f | 2000-06-29 01:30:04 +0000 | [diff] [blame] | 745 | |
Chris Allegretta | 5f36c37 | 2001-07-16 00:48:53 +0000 | [diff] [blame] | 746 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 747 | sc_init_one(&replace_list, NANO_NO_KEY, case_sens_msg, |
| 748 | IFHELP(nano_case_msg, TOGGLE_CASE_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 749 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 750 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 751 | sc_init_one(&replace_list, NANO_NO_KEY, direction_msg, |
| 752 | IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 753 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 754 | #endif |
Chris Allegretta | 105da33 | 2000-10-31 05:10:10 +0000 | [diff] [blame] | 755 | |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 756 | #ifdef HAVE_REGEX_H |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 757 | sc_init_one(&replace_list, NANO_NO_KEY, regexp_msg, |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 758 | IFHELP(nano_regexp_msg, NANO_REGEXP_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 759 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 760 | #endif |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 761 | |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 762 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 5e73eec | 2005-05-03 20:57:13 +0000 | [diff] [blame] | 763 | sc_init_one(&replace_list, NANO_PREVLINE_KEY, history_msg, |
| 764 | IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 765 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 766 | #endif |
Chris Allegretta | 5f36c37 | 2001-07-16 00:48:53 +0000 | [diff] [blame] | 767 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 768 | free_shortcutage(&replace_list_2); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 769 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 770 | sc_init_one(&replace_list_2, NANO_HELP_KEY, get_help_msg, |
| 771 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 772 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 773 | #ifndef DISABLE_HELP |
| 774 | do_help |
| 775 | #else |
| 776 | nano_disabled_msg |
| 777 | #endif |
| 778 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 779 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 780 | sc_init_one(&replace_list_2, NANO_CANCEL_KEY, cancel_msg, |
| 781 | IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 782 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 105da33 | 2000-10-31 05:10:10 +0000 | [diff] [blame] | 783 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 784 | sc_init_one(&replace_list_2, NANO_FIRSTLINE_KEY, first_line_msg, |
| 785 | IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 786 | NANO_NO_KEY, VIEW, do_first_line); |
Chris Allegretta | 105da33 | 2000-10-31 05:10:10 +0000 | [diff] [blame] | 787 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 788 | sc_init_one(&replace_list_2, NANO_LASTLINE_KEY, last_line_msg, |
| 789 | IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 790 | NANO_NO_KEY, VIEW, do_last_line); |
Chris Allegretta | 105da33 | 2000-10-31 05:10:10 +0000 | [diff] [blame] | 791 | |
David Lawrence Ramsey | 1addd60 | 2005-06-03 19:28:30 +0000 | [diff] [blame] | 792 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 5e73eec | 2005-05-03 20:57:13 +0000 | [diff] [blame] | 793 | sc_init_one(&replace_list_2, NANO_PREVLINE_KEY, history_msg, |
| 794 | IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 795 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 796 | #endif |
| 797 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 798 | free_shortcutage(&gotoline_list); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 799 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 800 | sc_init_one(&gotoline_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 801 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 802 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 803 | #ifndef DISABLE_HELP |
| 804 | do_help |
| 805 | #else |
| 806 | nano_disabled_msg |
| 807 | #endif |
| 808 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 809 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 810 | sc_init_one(&gotoline_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 811 | IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 812 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 813 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 814 | sc_init_one(&gotoline_list, NANO_FIRSTLINE_KEY, first_line_msg, |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 815 | IFHELP(nano_firstline_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 816 | NANO_NO_KEY, VIEW, do_first_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 817 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 818 | sc_init_one(&gotoline_list, NANO_LASTLINE_KEY, last_line_msg, |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 819 | IFHELP(nano_lastline_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 820 | NANO_NO_KEY, VIEW, do_last_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 821 | |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 822 | sc_init_one(&gotoline_list, NANO_TOOTHERWHEREIS_KEY, |
| 823 | N_("Go To Text"), IFHELP(nano_whereis_msg, NANO_NO_KEY), |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 824 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 825 | |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 826 | #ifndef DISABLE_HELP |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 827 | free_shortcutage(&help_list); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 828 | |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 829 | sc_init_one(&help_list, NANO_REFRESH_KEY, refresh_msg, |
David Lawrence Ramsey | 6439330 | 2005-04-25 21:48:22 +0000 | [diff] [blame] | 830 | IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY, |
| 831 | NANO_NO_KEY, VIEW, NULL); |
| 832 | |
| 833 | sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg, |
| 834 | IFHELP(nano_exit_msg, NANO_NO_KEY), NANO_EXIT_FKEY, |
| 835 | NANO_NO_KEY, VIEW, NULL); |
| 836 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 837 | sc_init_one(&help_list, NANO_PREVPAGE_KEY, prev_page_msg, |
| 838 | IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 839 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 840 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 841 | sc_init_one(&help_list, NANO_NEXTPAGE_KEY, next_page_msg, |
| 842 | IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 843 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | be26561 | 2004-05-29 20:38:08 +0000 | [diff] [blame] | 844 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 845 | sc_init_one(&help_list, NANO_PREVLINE_KEY, N_("Prev Line"), |
| 846 | IFHELP(nano_prevline_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 847 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | be26561 | 2004-05-29 20:38:08 +0000 | [diff] [blame] | 848 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 849 | sc_init_one(&help_list, NANO_NEXTLINE_KEY, N_("Next Line"), |
| 850 | IFHELP(nano_nextline_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 851 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 852 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 853 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 854 | free_shortcutage(&writefile_list); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 855 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 856 | sc_init_one(&writefile_list, NANO_HELP_KEY, get_help_msg, |
| 857 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 858 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 859 | #ifndef DISABLE_HELP |
| 860 | do_help |
| 861 | #else |
| 862 | nano_disabled_msg |
| 863 | #endif |
| 864 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 865 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 866 | sc_init_one(&writefile_list, NANO_CANCEL_KEY, cancel_msg, |
| 867 | IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 868 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 869 | |
Rocco Corsi | af5c302 | 2001-01-12 07:51:05 +0000 | [diff] [blame] | 870 | #ifndef DISABLE_BROWSER |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 871 | /* If we're using restricted mode, the file browser is disabled. |
| 872 | * It's useless since inserting files is disabled. */ |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 873 | /* Translators: try to keep this string under 16 characters long */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 874 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 875 | sc_init_one(&writefile_list, NANO_TOFILES_KEY, to_files_msg, |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 876 | IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 877 | NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 878 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 879 | |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 880 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 881 | /* If we're using restricted mode, the DOS format, Mac format, |
| 882 | * append, prepend, and backup toggles are disabled. The first and |
| 883 | * second are useless since inserting files is disabled, the third |
| 884 | * and fourth are disabled because they allow writing to files not |
| 885 | * specified on the command line, and the fifth is useless since |
| 886 | * backups are disabled. */ |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 887 | /* Translators: try to keep this string under 16 characters long */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 888 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 889 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("DOS Format"), |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 890 | IFHELP(nano_dos_msg, TOGGLE_DOS_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 891 | NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 892 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 893 | /* Translators: try to keep this string under 16 characters long */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 894 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 895 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("Mac Format"), |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 896 | IFHELP(nano_mac_msg, TOGGLE_MAC_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 897 | NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 898 | #endif |
| 899 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 900 | /* Translators: try to keep this string under 16 characters long */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 901 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 902 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("Append"), |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 903 | IFHELP(nano_append_msg, NANO_APPEND_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 904 | NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | cc197ef | 2001-05-29 04:21:44 +0000 | [diff] [blame] | 905 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 906 | /* Translators: try to keep this string under 16 characters long */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 907 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 908 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("Prepend"), |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 909 | IFHELP(nano_prepend_msg, NANO_PREPEND_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 910 | NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | 0e9b7aa | 2002-04-16 03:15:47 +0000 | [diff] [blame] | 911 | |
David Lawrence Ramsey | 5db0cdc | 2002-06-28 22:45:14 +0000 | [diff] [blame] | 912 | #ifndef NANO_SMALL |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 913 | /* Translators: try to keep this string under 16 characters long */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 914 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 915 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("Backup File"), |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 916 | IFHELP(nano_backup_msg, TOGGLE_BACKUP_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 917 | NANO_NO_KEY, NOVIEW, NULL); |
David Lawrence Ramsey | 5db0cdc | 2002-06-28 22:45:14 +0000 | [diff] [blame] | 918 | #endif |
| 919 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 920 | free_shortcutage(&insertfile_list); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 921 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 922 | sc_init_one(&insertfile_list, NANO_HELP_KEY, get_help_msg, |
| 923 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 924 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 925 | #ifndef DISABLE_HELP |
| 926 | do_help |
| 927 | #else |
| 928 | nano_disabled_msg |
| 929 | #endif |
| 930 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 931 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 932 | sc_init_one(&insertfile_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 933 | IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 934 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 935 | |
Chris Allegretta | cc197ef | 2001-05-29 04:21:44 +0000 | [diff] [blame] | 936 | #ifndef DISABLE_BROWSER |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 937 | /* If we're using restricted mode, the file browser is disabled. |
| 938 | * It's useless since inserting files is disabled. */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 939 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 940 | sc_init_one(&insertfile_list, NANO_TOFILES_KEY, to_files_msg, |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 941 | IFHELP(nano_tofiles_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 942 | NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | cc197ef | 2001-05-29 04:21:44 +0000 | [diff] [blame] | 943 | #endif |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 944 | |
Chris Allegretta | 52c5a6e | 2002-03-21 05:07:28 +0000 | [diff] [blame] | 945 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 946 | /* If we're using restricted mode, command execution is disabled. |
| 947 | * It's useless since inserting files is disabled. */ |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 948 | /* Translators: try to keep this string under 22 characters long */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 949 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 950 | sc_init_one(&insertfile_list, NANO_TOOTHERINSERT_KEY, |
| 951 | N_("Execute Command"), IFHELP(nano_execute_msg, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 952 | NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 953 | |
Chris Allegretta | f7c6811 | 2002-09-03 22:58:40 +0000 | [diff] [blame] | 954 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 955 | /* If we're using restricted mode, the multibuffer toggle is |
| 956 | * disabled. It's useless since inserting files is disabled. */ |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 957 | /* Translators: try to keep this string under 22 characters long */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 958 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 04a8d1c | 2004-09-28 22:14:58 +0000 | [diff] [blame] | 959 | sc_init_one(&insertfile_list, NANO_NO_KEY, new_buffer_msg, |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 960 | IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 961 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | f7c6811 | 2002-09-03 22:58:40 +0000 | [diff] [blame] | 962 | #endif |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 963 | #endif |
Chris Allegretta | cc197ef | 2001-05-29 04:21:44 +0000 | [diff] [blame] | 964 | |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 965 | #ifndef DISABLE_SPELLER |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 966 | free_shortcutage(&spell_list); |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 967 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 968 | sc_init_one(&spell_list, NANO_HELP_KEY, get_help_msg, |
| 969 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 970 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 971 | #ifndef DISABLE_HELP |
| 972 | do_help |
| 973 | #else |
| 974 | nano_disabled_msg |
| 975 | #endif |
| 976 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 977 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 978 | sc_init_one(&spell_list, NANO_CANCEL_KEY, cancel_msg, |
| 979 | IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 980 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 981 | #endif |
Chris Allegretta | cc197ef | 2001-05-29 04:21:44 +0000 | [diff] [blame] | 982 | |
Chris Allegretta | 52c5a6e | 2002-03-21 05:07:28 +0000 | [diff] [blame] | 983 | #ifndef NANO_SMALL |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 984 | free_shortcutage(&extcmd_list); |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 985 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 986 | sc_init_one(&extcmd_list, NANO_HELP_KEY, get_help_msg, |
| 987 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 988 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 989 | #ifndef DISABLE_HELP |
| 990 | do_help |
| 991 | #else |
| 992 | nano_disabled_msg |
| 993 | #endif |
| 994 | ); |
Chris Allegretta | 52c5a6e | 2002-03-21 05:07:28 +0000 | [diff] [blame] | 995 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 996 | sc_init_one(&extcmd_list, NANO_CANCEL_KEY, cancel_msg, |
| 997 | IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 998 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 04a8d1c | 2004-09-28 22:14:58 +0000 | [diff] [blame] | 999 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 1000 | sc_init_one(&extcmd_list, NANO_TOOTHERINSERT_KEY, N_("Insert File"), |
| 1001 | IFHELP(nano_insert_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1002 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 1003 | |
David Lawrence Ramsey | 47e82b1 | 2004-09-28 22:21:46 +0000 | [diff] [blame] | 1004 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 04a8d1c | 2004-09-28 22:14:58 +0000 | [diff] [blame] | 1005 | sc_init_one(&extcmd_list, NANO_NO_KEY, new_buffer_msg, |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 1006 | IFHELP(nano_multibuffer_msg, TOGGLE_MULTIBUFFER_KEY), |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1007 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | 52c5a6e | 2002-03-21 05:07:28 +0000 | [diff] [blame] | 1008 | #endif |
David Lawrence Ramsey | 47e82b1 | 2004-09-28 22:21:46 +0000 | [diff] [blame] | 1009 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 1010 | |
Rocco Corsi | af5c302 | 2001-01-12 07:51:05 +0000 | [diff] [blame] | 1011 | #ifndef DISABLE_BROWSER |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 1012 | free_shortcutage(&browser_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1013 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1014 | sc_init_one(&browser_list, NANO_HELP_KEY, get_help_msg, |
| 1015 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 1016 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1017 | #ifndef DISABLE_HELP |
| 1018 | do_help |
| 1019 | #else |
| 1020 | nano_disabled_msg |
| 1021 | #endif |
| 1022 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 1023 | |
David Lawrence Ramsey | 8037fe0 | 2004-07-23 12:30:40 +0000 | [diff] [blame] | 1024 | sc_init_one(&browser_list, NANO_EXIT_KEY, exit_msg, |
David Lawrence Ramsey | c41d428 | 2004-07-23 12:51:40 +0000 | [diff] [blame] | 1025 | IFHELP(nano_exitbrowser_msg, NANO_NO_KEY), NANO_EXIT_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1026 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 1027 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1028 | sc_init_one(&browser_list, NANO_PREVPAGE_KEY, prev_page_msg, |
| 1029 | IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1030 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 1031 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1032 | sc_init_one(&browser_list, NANO_NEXTPAGE_KEY, next_page_msg, |
| 1033 | IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1034 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 1035 | |
Jordi Mallach | f9390af | 2003-08-05 19:31:12 +0000 | [diff] [blame] | 1036 | /* Translators: try to keep this string under 22 characters long */ |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 1037 | sc_init_one(&browser_list, NANO_GOTOLINE_KEY, N_("Go To Dir"), |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 1038 | IFHELP(nano_gotodir_msg, NANO_GOTOLINE_ALTKEY), |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1039 | NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, NULL); |
Rocco Corsi | 12f294c | 2001-04-14 06:50:24 +0000 | [diff] [blame] | 1040 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 1041 | free_shortcutage(&gotodir_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1042 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1043 | sc_init_one(&gotodir_list, NANO_HELP_KEY, get_help_msg, |
| 1044 | IFHELP(nano_help_msg, NANO_NO_KEY), NANO_HELP_FKEY, |
| 1045 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1046 | #ifndef DISABLE_HELP |
| 1047 | do_help |
| 1048 | #else |
| 1049 | nano_disabled_msg |
| 1050 | #endif |
| 1051 | ); |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 1052 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1053 | sc_init_one(&gotodir_list, NANO_CANCEL_KEY, cancel_msg, |
| 1054 | IFHELP(nano_cancel_msg, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1055 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 1056 | #endif |
| 1057 | |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 1058 | currshortcut = main_list; |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1059 | |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1060 | #ifndef NANO_SMALL |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 1061 | toggle_init(); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1062 | #endif |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 1063 | } |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1064 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1065 | /* Deallocate the given shortcut. */ |
| 1066 | void free_shortcutage(shortcut **shortcutage) |
| 1067 | { |
| 1068 | assert(shortcutage != NULL); |
David Lawrence Ramsey | 193b0e5 | 2005-06-06 18:41:17 +0000 | [diff] [blame] | 1069 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1070 | while (*shortcutage != NULL) { |
| 1071 | shortcut *ps = *shortcutage; |
| 1072 | *shortcutage = (*shortcutage)->next; |
| 1073 | free(ps); |
| 1074 | } |
| 1075 | } |
| 1076 | |
| 1077 | #ifndef NANO_SMALL |
| 1078 | /* Create one new toggle structure, at the end of the toggles linked |
| 1079 | * list. */ |
| 1080 | void toggle_init_one(int val, const char *desc, long flag) |
| 1081 | { |
| 1082 | toggle *u; |
| 1083 | |
| 1084 | if (toggles == NULL) { |
David Lawrence Ramsey | 94b975c | 2004-07-20 12:57:34 +0000 | [diff] [blame] | 1085 | toggles = (toggle *)nmalloc(sizeof(toggle)); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1086 | u = toggles; |
| 1087 | } else { |
| 1088 | for (u = toggles; u->next != NULL; u = u->next) |
| 1089 | ; |
David Lawrence Ramsey | 94b975c | 2004-07-20 12:57:34 +0000 | [diff] [blame] | 1090 | u->next = (toggle *)nmalloc(sizeof(toggle)); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1091 | u = u->next; |
| 1092 | } |
| 1093 | |
| 1094 | u->val = val; |
| 1095 | u->desc = _(desc); |
| 1096 | u->flag = flag; |
| 1097 | u->next = NULL; |
| 1098 | } |
| 1099 | |
| 1100 | void toggle_init(void) |
| 1101 | { |
| 1102 | /* There is no need to reinitialize the toggles. They can't |
| 1103 | * change. */ |
| 1104 | if (toggles != NULL) |
| 1105 | return; |
| 1106 | |
| 1107 | toggle_init_one(TOGGLE_NOHELP_KEY, N_("Help mode"), NO_HELP); |
| 1108 | #ifdef ENABLE_MULTIBUFFER |
| 1109 | /* If we're using restricted mode, the multibuffer toggle is |
| 1110 | * disabled. It's useless since inserting files is disabled. */ |
| 1111 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 637b8bb | 2005-01-17 05:06:55 +0000 | [diff] [blame] | 1112 | toggle_init_one(TOGGLE_MULTIBUFFER_KEY, |
| 1113 | N_("Multiple file buffers"), MULTIBUFFER); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1114 | #endif |
| 1115 | toggle_init_one(TOGGLE_CONST_KEY, N_("Constant cursor position"), |
| 1116 | CONSTUPDATE); |
David Lawrence Ramsey | 637b8bb | 2005-01-17 05:06:55 +0000 | [diff] [blame] | 1117 | toggle_init_one(TOGGLE_AUTOINDENT_KEY, N_("Auto indent"), |
| 1118 | AUTOINDENT); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1119 | #ifndef DISABLE_WRAPPING |
| 1120 | toggle_init_one(TOGGLE_WRAP_KEY, N_("Auto line wrap"), NO_WRAP); |
| 1121 | #endif |
| 1122 | toggle_init_one(TOGGLE_CUTTOEND_KEY, N_("Cut to end"), CUT_TO_END); |
| 1123 | /* If we're using restricted mode, the suspend toggle is disabled. |
| 1124 | * It's useless since suspending is disabled. */ |
| 1125 | if (!ISSET(RESTRICTED)) |
| 1126 | toggle_init_one(TOGGLE_SUSPEND_KEY, N_("Suspend"), SUSPEND); |
| 1127 | #ifndef DISABLE_MOUSE |
| 1128 | toggle_init_one(TOGGLE_MOUSE_KEY, N_("Mouse support"), USE_MOUSE); |
| 1129 | #endif |
David Lawrence Ramsey | 7483571 | 2004-12-04 17:41:52 +0000 | [diff] [blame] | 1130 | /* If we're using restricted mode, the DOS/Mac conversion toggle is |
| 1131 | * disabled. It's useless since inserting files is disabled. */ |
| 1132 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1133 | toggle_init_one(TOGGLE_NOCONVERT_KEY, |
| 1134 | N_("No conversion from DOS/Mac format"), NO_CONVERT); |
David Lawrence Ramsey | 7483571 | 2004-12-04 17:41:52 +0000 | [diff] [blame] | 1135 | /* If we're using restricted mode, the backup toggle is disabled. |
| 1136 | * It's useless since backups are disabled. */ |
| 1137 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 637b8bb | 2005-01-17 05:06:55 +0000 | [diff] [blame] | 1138 | toggle_init_one(TOGGLE_BACKUP_KEY, N_("Backup files"), |
| 1139 | BACKUP_FILE); |
| 1140 | toggle_init_one(TOGGLE_SMOOTH_KEY, N_("Smooth scrolling"), |
| 1141 | SMOOTHSCROLL); |
| 1142 | toggle_init_one(TOGGLE_SMARTHOME_KEY, N_("Smart home key"), |
| 1143 | SMART_HOME); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1144 | #ifdef ENABLE_COLOR |
| 1145 | toggle_init_one(TOGGLE_SYNTAX_KEY, N_("Color syntax highlighting"), |
David Lawrence Ramsey | 202d3c2 | 2005-03-10 20:55:11 +0000 | [diff] [blame] | 1146 | NO_COLOR_SYNTAX); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1147 | #endif |
| 1148 | #ifdef ENABLE_NANORC |
| 1149 | toggle_init_one(TOGGLE_WHITESPACE_KEY, N_("Whitespace display"), |
| 1150 | WHITESPACE_DISPLAY); |
| 1151 | #endif |
David Lawrence Ramsey | aeeb96e | 2005-06-12 16:00:09 +0000 | [diff] [blame] | 1152 | toggle_init_one(TOGGLE_MORESPACE_KEY, |
| 1153 | N_("Use of more space for editing"), MORE_SPACE); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1154 | } |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1155 | #endif /* !NANO_SMALL */ |
| 1156 | |
Chris Allegretta | 6232d66 | 2002-05-12 19:52:15 +0000 | [diff] [blame] | 1157 | /* This function is called just before calling exit(). Practically, the |
| 1158 | * only effect is to cause a segmentation fault if the various data |
| 1159 | * structures got bolloxed earlier. Thus, we don't bother having this |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1160 | * function unless debugging is turned on. */ |
Chris Allegretta | 6232d66 | 2002-05-12 19:52:15 +0000 | [diff] [blame] | 1161 | #ifdef DEBUG |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1162 | /* Added by SPK for memory cleanup; gracefully return our malloc()s. */ |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1163 | void thanks_for_all_the_fish(void) |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1164 | { |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1165 | delwin(topwin); |
| 1166 | delwin(edit); |
| 1167 | delwin(bottomwin); |
| 1168 | |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1169 | #ifndef DISABLE_JUSTIFY |
| 1170 | if (quotestr != NULL) |
| 1171 | free(quotestr); |
David Lawrence Ramsey | 819c7f0 | 2004-07-30 03:54:34 +0000 | [diff] [blame] | 1172 | #ifdef HAVE_REGEX_H |
| 1173 | regfree("ereg); |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1174 | if (quoteerr != NULL) |
| 1175 | free(quoteerr); |
David Lawrence Ramsey | 819c7f0 | 2004-07-30 03:54:34 +0000 | [diff] [blame] | 1176 | #endif |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1177 | #endif |
David Lawrence Ramsey | 04e42a6 | 2004-02-28 16:24:31 +0000 | [diff] [blame] | 1178 | #ifndef NANO_SMALL |
| 1179 | if (backup_dir != NULL) |
| 1180 | free(backup_dir); |
| 1181 | #endif |
Chris Allegretta | 2598c66 | 2002-03-28 01:59:34 +0000 | [diff] [blame] | 1182 | #ifndef DISABLE_OPERATINGDIR |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1183 | if (operating_dir != NULL) |
| 1184 | free(operating_dir); |
| 1185 | if (full_operating_dir != NULL) |
| 1186 | free(full_operating_dir); |
| 1187 | #endif |
| 1188 | if (last_search != NULL) |
| 1189 | free(last_search); |
| 1190 | if (last_replace != NULL) |
| 1191 | free(last_replace); |
| 1192 | if (hblank != NULL) |
| 1193 | free(hblank); |
| 1194 | #ifndef DISABLE_SPELLER |
| 1195 | if (alt_speller != NULL) |
| 1196 | free(alt_speller); |
| 1197 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 1198 | #ifndef DISABLE_HELP |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1199 | if (help_text != NULL) |
| 1200 | free(help_text); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 1201 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1202 | if (filename != NULL) |
| 1203 | free(filename); |
| 1204 | if (answer != NULL) |
| 1205 | free(answer); |
| 1206 | if (cutbuffer != NULL) |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1207 | free_filestruct(cutbuffer); |
David Lawrence Ramsey | 93c8405 | 2004-11-23 04:08:28 +0000 | [diff] [blame] | 1208 | #ifndef DISABLE_JUSTIFY |
| 1209 | if (jusbuffer != NULL) |
| 1210 | free_filestruct(jusbuffer); |
| 1211 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1212 | free_shortcutage(&main_list); |
| 1213 | free_shortcutage(&whereis_list); |
| 1214 | free_shortcutage(&replace_list); |
| 1215 | free_shortcutage(&replace_list_2); |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 1216 | free_shortcutage(&gotoline_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1217 | free_shortcutage(&writefile_list); |
| 1218 | free_shortcutage(&insertfile_list); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1219 | #ifndef DISABLE_HELP |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1220 | free_shortcutage(&help_list); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1221 | #endif |
| 1222 | #ifndef DISABLE_SPELLER |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1223 | free_shortcutage(&spell_list); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1224 | #endif |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1225 | #ifndef NANO_SMALL |
| 1226 | free_shortcutage(&extcmd_list); |
| 1227 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1228 | #ifndef DISABLE_BROWSER |
| 1229 | free_shortcutage(&browser_list); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1230 | free_shortcutage(&gotodir_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1231 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1232 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 40e4acf | 2005-05-26 06:09:07 +0000 | [diff] [blame] | 1233 | /* Free the memory associated with each toggle. */ |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1234 | while (toggles != NULL) { |
| 1235 | toggle *t = toggles; |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1236 | |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1237 | toggles = toggles->next; |
| 1238 | free(t); |
| 1239 | } |
| 1240 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1241 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 5d8d0b1 | 2005-05-26 05:53:29 +0000 | [diff] [blame] | 1242 | /* Free the memory associated with each open file buffer. */ |
David Lawrence Ramsey | 40e4acf | 2005-05-26 06:09:07 +0000 | [diff] [blame] | 1243 | if (open_files != NULL) { |
| 1244 | /* Make sure open_files->fileage is up to date, in case we've |
| 1245 | * cut the top line of the file. */ |
| 1246 | open_files->fileage = fileage; |
| 1247 | |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1248 | free_openfilestruct(open_files); |
David Lawrence Ramsey | 40e4acf | 2005-05-26 06:09:07 +0000 | [diff] [blame] | 1249 | } |
Chris Allegretta | f2387fb | 2002-04-10 02:31:20 +0000 | [diff] [blame] | 1250 | #else |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1251 | if (fileage != NULL) |
| 1252 | free_filestruct(fileage); |
Chris Allegretta | f2387fb | 2002-04-10 02:31:20 +0000 | [diff] [blame] | 1253 | #endif |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1254 | #ifdef ENABLE_COLOR |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1255 | if (syntaxstr != NULL) |
| 1256 | free(syntaxstr); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1257 | while (syntaxes != NULL) { |
| 1258 | syntaxtype *bill = syntaxes; |
| 1259 | |
| 1260 | free(syntaxes->desc); |
| 1261 | while (syntaxes->extensions != NULL) { |
| 1262 | exttype *bob = syntaxes->extensions; |
| 1263 | |
| 1264 | syntaxes->extensions = bob->next; |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1265 | regfree(&bob->val); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1266 | free(bob); |
| 1267 | } |
| 1268 | while (syntaxes->color != NULL) { |
| 1269 | colortype *bob = syntaxes->color; |
| 1270 | |
| 1271 | syntaxes->color = bob->next; |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1272 | regfree(&bob->start); |
| 1273 | if (bob->end != NULL) |
Chris Allegretta | ce452fb | 2003-02-03 02:56:44 +0000 | [diff] [blame] | 1274 | regfree(bob->end); |
| 1275 | free(bob->end); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1276 | free(bob); |
| 1277 | } |
| 1278 | syntaxes = syntaxes->next; |
| 1279 | free(bill); |
| 1280 | } |
| 1281 | #endif /* ENABLE_COLOR */ |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 1282 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 40e4acf | 2005-05-26 06:09:07 +0000 | [diff] [blame] | 1283 | /* Free the search and replace history lists. */ |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1284 | if (searchage != NULL) |
| 1285 | free_filestruct(searchage); |
| 1286 | if (replaceage != NULL) |
| 1287 | free_filestruct(replaceage); |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 1288 | #endif |
David Lawrence Ramsey | a27bd65 | 2004-08-17 05:23:38 +0000 | [diff] [blame] | 1289 | #ifdef ENABLE_NANORC |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1290 | if (homedir != NULL) |
| 1291 | free(homedir); |
David Lawrence Ramsey | a27bd65 | 2004-08-17 05:23:38 +0000 | [diff] [blame] | 1292 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1293 | } |
Chris Allegretta | 6232d66 | 2002-05-12 19:52:15 +0000 | [diff] [blame] | 1294 | #endif /* DEBUG */ |