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 | cb801d6 | 2006-11-10 02:47:11 +0000 | [diff] [blame] | 5 | * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Chris Allegretta * |
| 6 | * Copyright (C) 2005, 2006 David Lawrence Ramsey * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 7 | * This program is free software; you can redistribute it and/or modify * |
| 8 | * 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] | 9 | * the Free Software Foundation; either version 2, or (at your option) * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 10 | * any later version. * |
| 11 | * * |
David Lawrence Ramsey | 6e925cf | 2005-05-15 19:57:17 +0000 | [diff] [blame] | 12 | * This program is distributed in the hope that it will be useful, but * |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
| 15 | * General Public License for more details. * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 16 | * * |
| 17 | * You should have received a copy of the GNU General Public License * |
| 18 | * along with this program; if not, write to the Free Software * |
David Lawrence Ramsey | 6e925cf | 2005-05-15 19:57:17 +0000 | [diff] [blame] | 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * |
| 20 | * 02110-1301, USA. * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 21 | * * |
| 22 | **************************************************************************/ |
| 23 | |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 24 | #include "proto.h" |
| 25 | |
David Lawrence Ramsey | fc0f8f8 | 2006-05-10 13:41:53 +0000 | [diff] [blame] | 26 | /* Global variables. */ |
| 27 | #ifndef NANO_TINY |
David Lawrence Ramsey | 1c5af64 | 2006-05-10 15:15:06 +0000 | [diff] [blame] | 28 | sigjmp_buf jump_buf; |
David Lawrence Ramsey | b6fb688 | 2006-11-27 07:28:52 +0000 | [diff] [blame] | 29 | /* Used to return to either main() or the unjustify routine in |
David Lawrence Ramsey | fc0f8f8 | 2006-05-10 13:41:53 +0000 | [diff] [blame] | 30 | * do_justify() after a SIGWINCH. */ |
David Lawrence Ramsey | 1c5af64 | 2006-05-10 15:15:06 +0000 | [diff] [blame] | 31 | bool jump_buf_main = FALSE; |
| 32 | /* Have we set jump_buf so that we return to main() after a |
| 33 | * SIGWINCH? */ |
David Lawrence Ramsey | fc0f8f8 | 2006-05-10 13:41:53 +0000 | [diff] [blame] | 34 | #endif |
| 35 | |
David Lawrence Ramsey | f5b256b | 2003-10-03 20:26:25 +0000 | [diff] [blame] | 36 | #ifndef DISABLE_WRAPJUSTIFY |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 37 | ssize_t fill = 0; |
| 38 | /* The column where we will wrap lines. */ |
David Lawrence Ramsey | 691698a | 2005-07-24 19:57:51 +0000 | [diff] [blame] | 39 | ssize_t wrap_at = -CHARS_FROM_EOL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 40 | /* The position where we will wrap lines. fill is equal to this |
| 41 | * if it's greater than zero, and equal to (COLS + this) if it |
| 42 | * isn't. */ |
David Lawrence Ramsey | f5b256b | 2003-10-03 20:26:25 +0000 | [diff] [blame] | 43 | #endif |
| 44 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 45 | char *last_search = NULL; |
| 46 | /* The last string we searched for. */ |
| 47 | char *last_replace = NULL; |
| 48 | /* The last replacement string we searched for. */ |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 49 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 50 | long flags = 0; |
| 51 | /* Our flag containing the states of all global options. */ |
| 52 | WINDOW *topwin; |
| 53 | /* The top portion of the window, where we display the version |
| 54 | * number of nano, the name of the current file, and whether the |
| 55 | * current file has been modified. */ |
| 56 | WINDOW *edit; |
David Lawrence Ramsey | b159f94 | 2006-07-28 17:06:27 +0000 | [diff] [blame] | 57 | /* The middle portion of the window, i.e. the edit window, where |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 58 | * we display the current file we're editing. */ |
| 59 | WINDOW *bottomwin; |
| 60 | /* The bottom portion of the window, where we display statusbar |
| 61 | * messages, the statusbar prompt, and a list of shortcuts. */ |
| 62 | int editwinrows = 0; |
| 63 | /* How many rows does the edit window take up? */ |
David Lawrence Ramsey | 5db0cdc | 2002-06-28 22:45:14 +0000 | [diff] [blame] | 64 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 65 | filestruct *cutbuffer = NULL; |
| 66 | /* The buffer where we store cut text. */ |
David Lawrence Ramsey | 93c8405 | 2004-11-23 04:08:28 +0000 | [diff] [blame] | 67 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 68 | filestruct *jusbuffer = NULL; |
| 69 | /* The buffer where we store unjustified text. */ |
David Lawrence Ramsey | 93c8405 | 2004-11-23 04:08:28 +0000 | [diff] [blame] | 70 | #endif |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 71 | partition *filepart = NULL; |
| 72 | /* The partition where we store a portion of the current |
| 73 | * file. */ |
David Lawrence Ramsey | 64661ac | 2005-07-08 19:57:25 +0000 | [diff] [blame] | 74 | openfilestruct *openfile = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 75 | /* The list of all open file buffers. */ |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 76 | |
David Lawrence Ramsey | d89617f | 2006-01-06 21:51:10 +0000 | [diff] [blame] | 77 | #ifndef NANO_TINY |
| 78 | char *matchbrackets = NULL; |
| 79 | /* The opening and closing brackets that can be found by bracket |
| 80 | * searches. */ |
| 81 | #endif |
| 82 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 83 | #if !defined(NANO_TINY) && defined(ENABLE_NANORC) |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 84 | char *whitespace = NULL; |
| 85 | /* The characters used when displaying the first characters of |
| 86 | * tabs and spaces. */ |
| 87 | int whitespace_len[2]; |
| 88 | /* The length of these characters. */ |
David Lawrence Ramsey | 89bb937 | 2004-05-29 16:47:52 +0000 | [diff] [blame] | 89 | #endif |
| 90 | |
Chris Allegretta | e4f940d | 2002-03-03 22:36:36 +0000 | [diff] [blame] | 91 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 92 | char *punct = NULL; |
| 93 | /* The closing punctuation that can end sentences. */ |
| 94 | char *brackets = NULL; |
| 95 | /* The closing brackets that can follow closing punctuation and |
| 96 | * can end sentences. */ |
| 97 | char *quotestr = NULL; |
| 98 | /* The quoting string. The default value is set in main(). */ |
David Lawrence Ramsey | 819c7f0 | 2004-07-30 03:54:34 +0000 | [diff] [blame] | 99 | #ifdef HAVE_REGEX_H |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 100 | regex_t quotereg; |
| 101 | /* The compiled regular expression from the quoting string. */ |
| 102 | int quoterc; |
David Lawrence Ramsey | 8816564 | 2006-05-22 18:30:09 +0000 | [diff] [blame] | 103 | /* Whether it was compiled successfully. */ |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 104 | char *quoteerr = NULL; |
| 105 | /* The error message, if it didn't. */ |
David Lawrence Ramsey | 819c7f0 | 2004-07-30 03:54:34 +0000 | [diff] [blame] | 106 | #else |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 107 | size_t quotelen; |
| 108 | /* The length of the quoting string in bytes. */ |
David Lawrence Ramsey | 819c7f0 | 2004-07-30 03:54:34 +0000 | [diff] [blame] | 109 | #endif |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 110 | #endif |
Chris Allegretta | e4f940d | 2002-03-03 22:36:36 +0000 | [diff] [blame] | 111 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 112 | char *answer = NULL; |
| 113 | /* The answer string used in the statusbar prompt. */ |
| 114 | |
| 115 | ssize_t tabsize = -1; |
| 116 | /* The width of a tab in spaces. The default value is set in |
| 117 | * main(). */ |
| 118 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 119 | #ifndef NANO_TINY |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 120 | char *backup_dir = NULL; |
| 121 | /* The directory where we store backup files. */ |
David Lawrence Ramsey | 04e42a6 | 2004-02-28 16:24:31 +0000 | [diff] [blame] | 122 | #endif |
Chris Allegretta | e1f1452 | 2001-09-19 03:19:43 +0000 | [diff] [blame] | 123 | #ifndef DISABLE_OPERATINGDIR |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 124 | char *operating_dir = NULL; |
| 125 | /* The relative path to the operating directory, which we can't |
| 126 | * move outside of. */ |
| 127 | char *full_operating_dir = NULL; |
| 128 | /* The full path to it. */ |
Chris Allegretta | e1f1452 | 2001-09-19 03:19:43 +0000 | [diff] [blame] | 129 | #endif |
| 130 | |
Chris Allegretta | 8d8e012 | 2001-04-18 04:28:54 +0000 | [diff] [blame] | 131 | #ifndef DISABLE_SPELLER |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 132 | char *alt_speller = NULL; |
| 133 | /* The command to use for the alternate spell checker. */ |
Chris Allegretta | 8d8e012 | 2001-04-18 04:28:54 +0000 | [diff] [blame] | 134 | #endif |
| 135 | |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 136 | shortcut *main_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 137 | /* The main shortcut list. */ |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 138 | shortcut *whereis_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 139 | /* The "Search" shortcut list. */ |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 140 | shortcut *replace_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 141 | /* The "Search (to replace)" shortcut list. */ |
| 142 | shortcut *replace_list_2 = NULL; |
| 143 | /* The "Replace with" shortcut list. */ |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 144 | shortcut *gotoline_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 145 | /* The "Enter line number, column number" shortcut list. */ |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 146 | shortcut *writefile_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 147 | /* The "File Name to Write" shortcut list. */ |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 148 | shortcut *insertfile_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 149 | /* The "File to insert" shortcut list. */ |
| 150 | #ifndef NANO_TINY |
| 151 | shortcut *extcmd_list = NULL; |
| 152 | /* The "Command to execute" shortcut list. */ |
| 153 | #endif |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 154 | #ifndef DISABLE_HELP |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 155 | shortcut *help_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 156 | /* The help text shortcut list. */ |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 157 | #endif |
| 158 | #ifndef DISABLE_SPELLER |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 159 | shortcut *spell_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 160 | /* The internal spell checker shortcut list. */ |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 161 | #endif |
Rocco Corsi | af5c302 | 2001-01-12 07:51:05 +0000 | [diff] [blame] | 162 | #ifndef DISABLE_BROWSER |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 163 | shortcut *browser_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 164 | /* The file browser shortcut list. */ |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 165 | shortcut *whereis_file_list = NULL; |
| 166 | /* The file browser "Search" shortcut list. */ |
Chris Allegretta | 201f1d9 | 2003-02-05 02:51:19 +0000 | [diff] [blame] | 167 | shortcut *gotodir_list = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 168 | /* The "Go To Directory" shortcut list. */ |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 169 | #endif |
Chris Allegretta | 201f1d9 | 2003-02-05 02:51:19 +0000 | [diff] [blame] | 170 | |
Chris Allegretta | 8ce2413 | 2001-04-30 11:28:46 +0000 | [diff] [blame] | 171 | #ifdef ENABLE_COLOR |
David Lawrence Ramsey | 9b13ff3 | 2002-12-22 16:30:00 +0000 | [diff] [blame] | 172 | syntaxtype *syntaxes = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 173 | /* The global list of color syntaxes. */ |
David Lawrence Ramsey | 9b13ff3 | 2002-12-22 16:30:00 +0000 | [diff] [blame] | 174 | char *syntaxstr = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 175 | /* The color syntax name specified on the command line. */ |
Chris Allegretta | 8ce2413 | 2001-04-30 11:28:46 +0000 | [diff] [blame] | 176 | #endif |
| 177 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 178 | const shortcut *currshortcut; |
| 179 | /* The current shortcut list we're using. */ |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 180 | #ifndef NANO_TINY |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 181 | toggle *toggles = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 182 | /* The global toggle list. */ |
Chris Allegretta | f0b26df | 2001-01-20 22:18:18 +0000 | [diff] [blame] | 183 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 184 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 185 | #ifndef NANO_TINY |
David Lawrence Ramsey | 934f968 | 2005-05-23 16:30:06 +0000 | [diff] [blame] | 186 | filestruct *search_history = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 187 | /* The search string history list. */ |
David Lawrence Ramsey | 934f968 | 2005-05-23 16:30:06 +0000 | [diff] [blame] | 188 | filestruct *searchage = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 189 | /* The top of the search string history list. */ |
David Lawrence Ramsey | 934f968 | 2005-05-23 16:30:06 +0000 | [diff] [blame] | 190 | filestruct *searchbot = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 191 | /* The bottom of the search string history list. */ |
David Lawrence Ramsey | 934f968 | 2005-05-23 16:30:06 +0000 | [diff] [blame] | 192 | filestruct *replace_history = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 193 | /* The replace string history list. */ |
David Lawrence Ramsey | 934f968 | 2005-05-23 16:30:06 +0000 | [diff] [blame] | 194 | filestruct *replaceage = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 195 | /* The top of the replace string history list. */ |
David Lawrence Ramsey | 934f968 | 2005-05-23 16:30:06 +0000 | [diff] [blame] | 196 | filestruct *replacebot = NULL; |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 197 | /* The bottom of the replace string history list. */ |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 198 | #endif |
| 199 | |
David Lawrence Ramsey | fc0f8f8 | 2006-05-10 13:41:53 +0000 | [diff] [blame] | 200 | /* Regular expressions. */ |
Chris Allegretta | 805c26d | 2000-09-06 13:39:17 +0000 | [diff] [blame] | 201 | #ifdef HAVE_REGEX_H |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 202 | regex_t search_regexp; |
| 203 | /* The compiled regular expression to use in searches. */ |
| 204 | regmatch_t regmatches[10]; |
| 205 | /* The match positions for parenthetical subexpressions, 10 |
| 206 | * maximum, used in regular expression searches. */ |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 207 | #endif |
Chris Allegretta | 3533a34 | 2002-03-24 23:19:32 +0000 | [diff] [blame] | 208 | |
David Lawrence Ramsey | 4d72de7 | 2006-04-12 15:27:40 +0000 | [diff] [blame] | 209 | int reverse_attr = A_REVERSE; |
| 210 | /* The curses attribute we use for reverse video. */ |
Chris Allegretta | a0d8997 | 2003-02-03 03:32:08 +0000 | [diff] [blame] | 211 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 212 | char *homedir = NULL; |
David Lawrence Ramsey | c1c818e | 2006-05-14 18:22:01 +0000 | [diff] [blame] | 213 | /* The user's home directory, from $HOME or /etc/passwd. */ |
David Lawrence Ramsey | a27bd65 | 2004-08-17 05:23:38 +0000 | [diff] [blame] | 214 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 215 | /* Return the number of entries in the shortcut list s. */ |
David Lawrence Ramsey | ebd0d7c | 2004-07-01 18:59:52 +0000 | [diff] [blame] | 216 | size_t length_of_list(const shortcut *s) |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 217 | { |
David Lawrence Ramsey | ebd0d7c | 2004-07-01 18:59:52 +0000 | [diff] [blame] | 218 | size_t i = 0; |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 219 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 220 | for (; s != NULL; s = s->next) |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 221 | i++; |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 222 | return i; |
| 223 | } |
| 224 | |
David Lawrence Ramsey | e6757b9 | 2006-04-19 13:36:56 +0000 | [diff] [blame] | 225 | /* Add a new shortcut to the end of the shortcut list. */ |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 226 | void sc_init_one(shortcut **shortcutage, int ctrlval, const char *desc |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 227 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 228 | , const char *help, bool blank_after |
David Lawrence Ramsey | 5db0cdc | 2002-06-28 22:45:14 +0000 | [diff] [blame] | 229 | #endif |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 230 | , int metaval, int funcval, int miscval, bool view, |
| 231 | void (*func)(void)) |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 232 | { |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 233 | shortcut *s; |
| 234 | |
| 235 | if (*shortcutage == NULL) { |
David Lawrence Ramsey | 70047ee | 2003-06-14 20:41:34 +0000 | [diff] [blame] | 236 | *shortcutage = (shortcut *)nmalloc(sizeof(shortcut)); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 237 | s = *shortcutage; |
| 238 | } else { |
| 239 | for (s = *shortcutage; s->next != NULL; s = s->next) |
| 240 | ; |
David Lawrence Ramsey | 70047ee | 2003-06-14 20:41:34 +0000 | [diff] [blame] | 241 | s->next = (shortcut *)nmalloc(sizeof(shortcut)); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 242 | s = s->next; |
| 243 | } |
| 244 | |
David Lawrence Ramsey | 1576d53 | 2004-03-19 21:46:34 +0000 | [diff] [blame] | 245 | s->ctrlval = ctrlval; |
David Lawrence Ramsey | efb4b0a | 2006-04-19 14:09:01 +0000 | [diff] [blame] | 246 | s->desc = (desc == NULL) ? "" : _(desc); |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 247 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | efb4b0a | 2006-04-19 14:09:01 +0000 | [diff] [blame] | 248 | s->help = (help == NULL) ? "" : _(help); |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 249 | s->blank_after = blank_after; |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 250 | #endif |
David Lawrence Ramsey | 1576d53 | 2004-03-19 21:46:34 +0000 | [diff] [blame] | 251 | s->metaval = metaval; |
| 252 | s->funcval = funcval; |
| 253 | s->miscval = miscval; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 254 | s->viewok = view; |
| 255 | s->func = func; |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 256 | s->next = NULL; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 257 | } |
| 258 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 259 | /* Initialize all shortcut lists. If unjustify is TRUE, replace the |
| 260 | * Uncut shortcut in the main shortcut list with UnJustify. */ |
David Lawrence Ramsey | 1f1ebb8 | 2004-11-11 21:50:01 +0000 | [diff] [blame] | 261 | void shortcut_init(bool unjustify) |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 262 | { |
David Lawrence Ramsey | ed467e5 | 2006-07-03 18:40:53 +0000 | [diff] [blame] | 263 | /* TRANSLATORS: Try to keep this and following strings at most 10 |
| 264 | * characters. */ |
David Lawrence Ramsey | 12c08dd | 2006-03-25 15:56:40 +0000 | [diff] [blame] | 265 | const char *cancel_msg = N_("Cancel"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 266 | const char *get_help_msg = N_("Get Help"); |
| 267 | const char *exit_msg = N_("Exit"); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 268 | const char *whereis_msg = N_("Where Is"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 269 | const char *prev_page_msg = N_("Prev Page"); |
| 270 | const char *next_page_msg = N_("Next Page"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 271 | const char *go_to_line_msg = N_("Go To Line"); |
David Lawrence Ramsey | ed467e5 | 2006-07-03 18:40:53 +0000 | [diff] [blame] | 272 | /* TRANSLATORS: Try to keep this and previous strings at most 10 |
| 273 | * characters. */ |
David Lawrence Ramsey | 12c08dd | 2006-03-25 15:56:40 +0000 | [diff] [blame] | 274 | const char *replace_msg = N_("Replace"); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 275 | #ifndef NANO_TINY |
David Lawrence Ramsey | 0ec909c | 2006-05-06 15:07:26 +0000 | [diff] [blame] | 276 | /* TRANSLATORS: Try to keep this at most 12 characters. */ |
| 277 | const char *whereis_next_msg = N_("WhereIs Next"); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 278 | #endif |
David Lawrence Ramsey | ed467e5 | 2006-07-03 18:40:53 +0000 | [diff] [blame] | 279 | /* TRANSLATORS: Try to keep this and following strings at most 10 |
| 280 | * characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 281 | const char *first_line_msg = N_("First Line"); |
| 282 | const char *last_line_msg = N_("Last Line"); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 283 | #ifndef DISABLE_JUSTIFY |
| 284 | const char *beg_of_par_msg = N_("Beg of Par"); |
| 285 | const char *end_of_par_msg = N_("End of Par"); |
| 286 | const char *fulljstify_msg = N_("FullJstify"); |
| 287 | #endif |
David Lawrence Ramsey | 8137876 | 2006-04-24 20:53:43 +0000 | [diff] [blame] | 288 | const char *refresh_msg = N_("Refresh"); |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 289 | #ifndef NANO_TINY |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 290 | const char *case_sens_msg = N_("Case Sens"); |
David Lawrence Ramsey | f3ecffd | 2005-06-16 18:48:30 +0000 | [diff] [blame] | 291 | const char *backwards_msg = N_("Backwards"); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 292 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 293 | #ifdef HAVE_REGEX_H |
| 294 | const char *regexp_msg = N_("Regexp"); |
| 295 | #endif |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 296 | #ifndef NANO_TINY |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 297 | const char *prev_history_msg = N_("PrevHstory"); |
David Lawrence Ramsey | ed467e5 | 2006-07-03 18:40:53 +0000 | [diff] [blame] | 298 | /* TRANSLATORS: Try to keep this and previous strings at most 10 |
| 299 | * characters. */ |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 300 | const char *next_history_msg = N_("NextHstory"); |
David Lawrence Ramsey | 47e82b1 | 2004-09-28 22:21:46 +0000 | [diff] [blame] | 301 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | af318aa | 2006-04-12 12:54:23 +0000 | [diff] [blame] | 302 | /* TRANSLATORS: Try to keep this at most 16 characters. */ |
David Lawrence Ramsey | 04a8d1c | 2004-09-28 22:14:58 +0000 | [diff] [blame] | 303 | const char *new_buffer_msg = N_("New Buffer"); |
David Lawrence Ramsey | 47e82b1 | 2004-09-28 22:21:46 +0000 | [diff] [blame] | 304 | #endif |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 305 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 306 | #ifndef DISABLE_BROWSER |
David Lawrence Ramsey | 602199d | 2006-05-06 15:31:32 +0000 | [diff] [blame] | 307 | /* TRANSLATORS: Try to keep this at most 16 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 308 | const char *to_files_msg = N_("To Files"); |
David Lawrence Ramsey | be231d3 | 2006-05-21 21:37:21 +0000 | [diff] [blame] | 309 | /* TRANSLATORS: Try to keep this at most 12 characters. */ |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 310 | const char *first_file_msg = N_("First File"); |
David Lawrence Ramsey | be231d3 | 2006-05-21 21:37:21 +0000 | [diff] [blame] | 311 | /* TRANSLATORS: Try to keep this at most 12 characters. */ |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 312 | const char *last_file_msg = N_("Last File"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 313 | #endif |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 314 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | 804e107 | 2006-03-29 19:43:32 +0000 | [diff] [blame] | 315 | const char *nano_cancel_msg = N_("Cancel the current function"); |
David Lawrence Ramsey | 57c9afb | 2006-04-14 20:21:45 +0000 | [diff] [blame] | 316 | const char *nano_help_msg = N_("Display this help text"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 317 | const char *nano_exit_msg = |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 318 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | be231d3 | 2006-05-21 21:37:21 +0000 | [diff] [blame] | 319 | N_("Close the current file buffer / Exit from nano") |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 320 | #else |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 321 | N_("Exit from nano") |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 322 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 323 | ; |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 324 | const char *nano_writeout_msg = |
| 325 | N_("Write the current file to disk"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 326 | const char *nano_justify_msg = N_("Justify the current paragraph"); |
| 327 | const char *nano_insert_msg = |
| 328 | N_("Insert another file into the current one"); |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 329 | const char *nano_whereis_msg = |
David Lawrence Ramsey | be231d3 | 2006-05-21 21:37:21 +0000 | [diff] [blame] | 330 | N_("Search for a string or a regular expression"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 331 | const char *nano_prevpage_msg = N_("Move to the previous screen"); |
| 332 | const char *nano_nextpage_msg = N_("Move to the next screen"); |
| 333 | const char *nano_cut_msg = |
| 334 | N_("Cut the current line and store it in the cutbuffer"); |
| 335 | const char *nano_uncut_msg = |
| 336 | N_("Uncut from the cutbuffer into the current line"); |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 337 | const char *nano_cursorpos_msg = |
David Lawrence Ramsey | f50bd4b | 2006-04-14 20:15:44 +0000 | [diff] [blame] | 338 | N_("Display the position of the cursor"); |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 339 | const char *nano_spell_msg = |
| 340 | N_("Invoke the spell checker, if available"); |
David Lawrence Ramsey | 16349c9 | 2005-07-11 20:50:43 +0000 | [diff] [blame] | 341 | const char *nano_gotoline_msg = N_("Go to line and column number"); |
David Lawrence Ramsey | be231d3 | 2006-05-21 21:37:21 +0000 | [diff] [blame] | 342 | const char *nano_replace_msg = |
| 343 | N_("Replace a string or a regular expression"); |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 344 | #ifndef NANO_TINY |
David Lawrence Ramsey | 8381fdd | 2004-11-01 22:40:02 +0000 | [diff] [blame] | 345 | const char *nano_mark_msg = N_("Mark text at the cursor position"); |
| 346 | const char *nano_whereis_next_msg = N_("Repeat last search"); |
David Lawrence Ramsey | cf1879b | 2006-04-27 23:39:49 +0000 | [diff] [blame] | 347 | const char *nano_copy_msg = |
| 348 | N_("Copy the current line and store it in the cutbuffer"); |
David Lawrence Ramsey | aee00d4 | 2006-07-05 18:42:22 +0000 | [diff] [blame] | 349 | const char *nano_indent_msg = N_("Indent the current line"); |
| 350 | const char *nano_unindent_msg = N_("Unindent the current line"); |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 351 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 352 | const char *nano_forward_msg = N_("Move forward one character"); |
| 353 | const char *nano_back_msg = N_("Move back one character"); |
David Lawrence Ramsey | 854a44a | 2006-04-24 21:14:55 +0000 | [diff] [blame] | 354 | #ifndef NANO_TINY |
| 355 | const char *nano_nextword_msg = N_("Move forward one word"); |
David Lawrence Ramsey | 69e1ce5 | 2006-06-08 02:37:45 +0000 | [diff] [blame] | 356 | const char *nano_prevword_msg = N_("Move back one word"); |
David Lawrence Ramsey | 854a44a | 2006-04-24 21:14:55 +0000 | [diff] [blame] | 357 | #endif |
| 358 | const char *nano_prevline_msg = N_("Move to the previous line"); |
| 359 | const char *nano_nextline_msg = N_("Move to the next line"); |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 360 | const char *nano_home_msg = |
| 361 | N_("Move to the beginning of the current line"); |
| 362 | const char *nano_end_msg = |
| 363 | N_("Move to the end of the current line"); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 364 | #ifndef DISABLE_JUSTIFY |
| 365 | const char *nano_parabegin_msg = |
David Lawrence Ramsey | 40e0572 | 2006-04-23 19:21:12 +0000 | [diff] [blame] | 366 | N_("Move to the beginning of the current paragraph"); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 367 | const char *nano_paraend_msg = |
David Lawrence Ramsey | 40e0572 | 2006-04-23 19:21:12 +0000 | [diff] [blame] | 368 | N_("Move to the end of the current paragraph"); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 369 | #endif |
David Lawrence Ramsey | 854a44a | 2006-04-24 21:14:55 +0000 | [diff] [blame] | 370 | const char *nano_firstline_msg = |
| 371 | N_("Move to the first line of the file"); |
| 372 | const char *nano_lastline_msg = |
| 373 | N_("Move to the last line of the file"); |
| 374 | #ifndef NANO_TINY |
| 375 | const char *nano_bracket_msg = N_("Move to the matching bracket"); |
| 376 | const char *nano_scrollup_msg = |
| 377 | N_("Scroll up one line without scrolling the cursor"); |
| 378 | const char *nano_scrolldown_msg = |
| 379 | N_("Scroll down one line without scrolling the cursor"); |
| 380 | #endif |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 381 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 6ad59cd | 2005-07-08 20:09:16 +0000 | [diff] [blame] | 382 | const char *nano_prevfile_msg = |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 383 | N_("Switch to the previous file buffer"); |
David Lawrence Ramsey | 6ad59cd | 2005-07-08 20:09:16 +0000 | [diff] [blame] | 384 | const char *nano_nextfile_msg = |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 385 | N_("Switch to the next file buffer"); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 386 | #endif |
David Lawrence Ramsey | 40e0572 | 2006-04-23 19:21:12 +0000 | [diff] [blame] | 387 | const char *nano_verbatim_msg = |
David Lawrence Ramsey | 939d423 | 2006-04-24 21:00:17 +0000 | [diff] [blame] | 388 | N_("Insert the next keystroke verbatim"); |
David Lawrence Ramsey | 854a44a | 2006-04-24 21:14:55 +0000 | [diff] [blame] | 389 | const char *nano_tab_msg = |
David Lawrence Ramsey | bf78420 | 2006-04-29 13:59:04 +0000 | [diff] [blame] | 390 | N_("Insert a tab at the cursor position"); |
David Lawrence Ramsey | 854a44a | 2006-04-24 21:14:55 +0000 | [diff] [blame] | 391 | const char *nano_enter_msg = |
David Lawrence Ramsey | cf1879b | 2006-04-27 23:39:49 +0000 | [diff] [blame] | 392 | N_("Insert a newline at the cursor position"); |
David Lawrence Ramsey | 854a44a | 2006-04-24 21:14:55 +0000 | [diff] [blame] | 393 | const char *nano_delete_msg = |
| 394 | N_("Delete the character under the cursor"); |
| 395 | const char *nano_backspace_msg = |
| 396 | N_("Delete the character to the left of the cursor"); |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 397 | #ifndef NANO_TINY |
David Lawrence Ramsey | 295d172 | 2005-01-01 07:43:32 +0000 | [diff] [blame] | 398 | const char *nano_cut_till_end_msg = |
| 399 | N_("Cut from the cursor position to the end of the file"); |
| 400 | #endif |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 401 | #ifndef DISABLE_JUSTIFY |
| 402 | const char *nano_fulljustify_msg = N_("Justify the entire file"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 403 | #endif |
David Lawrence Ramsey | c5c5230 | 2005-11-15 23:45:29 +0000 | [diff] [blame] | 404 | #ifndef NANO_TINY |
David Lawrence Ramsey | 854a44a | 2006-04-24 21:14:55 +0000 | [diff] [blame] | 405 | const char *nano_wordcount_msg = |
| 406 | N_("Count the number of words, lines, and characters"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 407 | #endif |
David Lawrence Ramsey | 854a44a | 2006-04-24 21:14:55 +0000 | [diff] [blame] | 408 | const char *nano_refresh_msg = |
| 409 | N_("Refresh (redraw) the current screen"); |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 410 | #ifndef NANO_TINY |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 411 | const char *nano_case_msg = |
David Lawrence Ramsey | 69e1ce5 | 2006-06-08 02:37:45 +0000 | [diff] [blame] | 412 | N_("Toggle the case sensitivity of the search"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 413 | const char *nano_reverse_msg = |
David Lawrence Ramsey | 69e1ce5 | 2006-06-08 02:37:45 +0000 | [diff] [blame] | 414 | N_("Reverse the direction of the search"); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 415 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 416 | #ifdef HAVE_REGEX_H |
David Lawrence Ramsey | 69e1ce5 | 2006-06-08 02:37:45 +0000 | [diff] [blame] | 417 | const char *nano_regexp_msg = |
| 418 | N_("Toggle the use of regular expressions"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 419 | #endif |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 420 | #ifndef NANO_TINY |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 421 | const char *nano_prev_history_msg = |
David Lawrence Ramsey | 7b0531a | 2006-07-31 01:30:31 +0000 | [diff] [blame] | 422 | N_("Recall the previous search/replace string"); |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 423 | const char *nano_next_history_msg = |
David Lawrence Ramsey | 7b0531a | 2006-07-31 01:30:31 +0000 | [diff] [blame] | 424 | N_("Recall the next search/replace string"); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 425 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 426 | #ifndef DISABLE_BROWSER |
| 427 | const char *nano_tofiles_msg = N_("Go to file browser"); |
| 428 | #endif |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 429 | #ifndef NANO_TINY |
David Lawrence Ramsey | 69e1ce5 | 2006-06-08 02:37:45 +0000 | [diff] [blame] | 430 | const char *nano_dos_msg = N_("Toggle the use of DOS format"); |
| 431 | const char *nano_mac_msg = N_("Toggle the use of Mac format"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 432 | #endif |
David Lawrence Ramsey | 69e1ce5 | 2006-06-08 02:37:45 +0000 | [diff] [blame] | 433 | const char *nano_append_msg = N_("Toggle appending"); |
| 434 | const char *nano_prepend_msg = N_("Toggle prepending"); |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 435 | #ifndef NANO_TINY |
David Lawrence Ramsey | 9b108c2 | 2005-06-06 18:38:16 +0000 | [diff] [blame] | 436 | const char *nano_backup_msg = |
David Lawrence Ramsey | 69e1ce5 | 2006-06-08 02:37:45 +0000 | [diff] [blame] | 437 | N_("Toggle backing up of the original file"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 438 | const char *nano_execute_msg = N_("Execute external command"); |
| 439 | #endif |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 440 | #if !defined(NANO_TINY) && defined(ENABLE_MULTIBUFFER) |
David Lawrence Ramsey | 69e1ce5 | 2006-06-08 02:37:45 +0000 | [diff] [blame] | 441 | const char *nano_multibuffer_msg = |
| 442 | N_("Toggle the use of a new buffer"); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 443 | #endif |
| 444 | #ifndef DISABLE_BROWSER |
David Lawrence Ramsey | c41d428 | 2004-07-23 12:51:40 +0000 | [diff] [blame] | 445 | const char *nano_exitbrowser_msg = N_("Exit from the file browser"); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 446 | const char *nano_firstfile_msg = |
| 447 | N_("Go to the first file in the list"); |
| 448 | const char *nano_lastfile_msg = |
| 449 | N_("Go to the last file in the list"); |
David Lawrence Ramsey | c41d428 | 2004-07-23 12:51:40 +0000 | [diff] [blame] | 450 | const char *nano_gotodir_msg = N_("Go to directory"); |
Chris Allegretta | 2bef182 | 2001-09-28 19:53:11 +0000 | [diff] [blame] | 451 | #endif |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 452 | #endif /* !DISABLE_HELP */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 453 | |
David Lawrence Ramsey | 8e4adcd | 2004-05-20 03:29:33 +0000 | [diff] [blame] | 454 | /* The following macro is to be used in calling sc_init_one(). The |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 455 | * point is that sc_init_one() takes 10 arguments, unless DISABLE_HELP |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 456 | * is defined, when the 4th and 5th ones should not be there. */ |
David Lawrence Ramsey | ea43a1d | 2004-03-02 22:52:57 +0000 | [diff] [blame] | 457 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 458 | #define IFSCHELP(help, blank, nextvar) help, blank, nextvar |
David Lawrence Ramsey | ea43a1d | 2004-03-02 22:52:57 +0000 | [diff] [blame] | 459 | #else |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 460 | #define IFSCHELP(help, blank, nextvar) nextvar |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 461 | #endif |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 462 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 463 | free_shortcutage(&main_list); |
| 464 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 465 | sc_init_one(&main_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 466 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 467 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 468 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 469 | do_help_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 470 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 471 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 472 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 473 | ); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 474 | |
David Lawrence Ramsey | 5b3dd0f | 2004-11-25 04:39:07 +0000 | [diff] [blame] | 475 | sc_init_one(&main_list, NANO_EXIT_KEY, |
Chris Allegretta | 355fbe5 | 2001-07-14 19:32:47 +0000 | [diff] [blame] | 476 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 477 | /* TRANSLATORS: Try to keep this at most 10 characters. */ |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 478 | openfile != NULL && openfile != openfile->next ? N_("Close") : |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 479 | #endif |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 480 | exit_msg, IFSCHELP(nano_exit_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 481 | NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, do_exit); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 482 | |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 483 | /* TRANSLATORS: Try to keep this at most 10 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 484 | sc_init_one(&main_list, NANO_WRITEOUT_KEY, N_("WriteOut"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 485 | IFSCHELP(nano_writeout_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 486 | NANO_WRITEOUT_FKEY, NANO_NO_KEY, NOVIEW, do_writeout_void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 487 | |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 488 | /* TRANSLATORS: Try to keep this at most 10 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 489 | sc_init_one(&main_list, NANO_JUSTIFY_KEY, N_("Justify"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 490 | IFSCHELP(nano_justify_msg, TRUE, NANO_NO_KEY), |
| 491 | NANO_JUSTIFY_FKEY, NANO_NO_KEY, NOVIEW, |
David Lawrence Ramsey | a539fce | 2004-06-29 00:43:56 +0000 | [diff] [blame] | 492 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 493 | do_justify_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 494 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 495 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 496 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 497 | ); |
Chris Allegretta | 32da456 | 2002-01-02 15:12:21 +0000 | [diff] [blame] | 498 | |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 499 | /* We allow inserting files in view mode if multibuffers are |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 500 | * available, so that we can view multiple files. If we're using |
| 501 | * restricted mode, inserting files is disabled, since it allows |
| 502 | * reading from or writing to files not specified on the command |
| 503 | * line. */ |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 504 | /* TRANSLATORS: Try to keep this at most 10 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 505 | sc_init_one(&main_list, NANO_INSERTFILE_KEY, N_("Read File"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 506 | IFSCHELP(nano_insert_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 507 | NANO_INSERTFILE_FKEY, NANO_NO_KEY, |
Chris Allegretta | 32da456 | 2002-01-02 15:12:21 +0000 | [diff] [blame] | 508 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 509 | VIEW |
Chris Allegretta | 32da456 | 2002-01-02 15:12:21 +0000 | [diff] [blame] | 510 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 511 | NOVIEW |
Chris Allegretta | 32da456 | 2002-01-02 15:12:21 +0000 | [diff] [blame] | 512 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 513 | , !ISSET(RESTRICTED) ? do_insertfile_void : nano_disabled_msg); |
Chris Allegretta | af6414a | 2001-02-11 19:05:05 +0000 | [diff] [blame] | 514 | |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 515 | sc_init_one(&main_list, NANO_WHEREIS_KEY, whereis_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 516 | IFSCHELP(nano_whereis_msg, FALSE, NANO_NO_KEY), |
| 517 | NANO_WHEREIS_FKEY, NANO_NO_KEY, VIEW, do_search); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 518 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 519 | sc_init_one(&main_list, NANO_PREVPAGE_KEY, prev_page_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 520 | IFSCHELP(nano_prevpage_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 521 | NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, do_page_up); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 522 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 523 | sc_init_one(&main_list, NANO_NEXTPAGE_KEY, next_page_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 524 | IFSCHELP(nano_nextpage_msg, TRUE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 525 | NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, do_page_down); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 526 | |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 527 | /* TRANSLATORS: Try to keep this at most 10 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 528 | sc_init_one(&main_list, NANO_CUT_KEY, N_("Cut Text"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 529 | IFSCHELP(nano_cut_msg, FALSE, NANO_NO_KEY), NANO_CUT_FKEY, |
David Lawrence Ramsey | c87e0c0 | 2006-04-25 02:23:28 +0000 | [diff] [blame] | 530 | NANO_NO_KEY, NOVIEW, do_cut_text_void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 531 | |
Chris Allegretta | 0779835 | 2000-11-27 22:58:23 +0000 | [diff] [blame] | 532 | if (unjustify) |
David Lawrence Ramsey | ed467e5 | 2006-07-03 18:40:53 +0000 | [diff] [blame] | 533 | /* TRANSLATORS: Try to keep this at most 10 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 534 | sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, N_("UnJustify"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 535 | IFSCHELP(NULL, FALSE, NANO_NO_KEY), NANO_UNJUSTIFY_FKEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 536 | NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | 0779835 | 2000-11-27 22:58:23 +0000 | [diff] [blame] | 537 | else |
David Lawrence Ramsey | ed467e5 | 2006-07-03 18:40:53 +0000 | [diff] [blame] | 538 | /* TRANSLATORS: Try to keep this at most 10 characters. */ |
David Lawrence Ramsey | 0ec909c | 2006-05-06 15:07:26 +0000 | [diff] [blame] | 539 | sc_init_one(&main_list, NANO_UNCUT_KEY, N_("UnCut Text"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 540 | IFSCHELP(nano_uncut_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 541 | NANO_UNCUT_FKEY, NANO_NO_KEY, NOVIEW, do_uncut_text); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 542 | |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 543 | /* TRANSLATORS: Try to keep this at most 10 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 544 | sc_init_one(&main_list, NANO_CURSORPOS_KEY, N_("Cur Pos"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 545 | IFSCHELP(nano_cursorpos_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 546 | NANO_CURSORPOS_FKEY, NANO_NO_KEY, VIEW, do_cursorpos_void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 547 | |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 548 | /* If we're using restricted mode, spell checking is disabled |
| 549 | * because it allows reading from or writing to files not specified |
| 550 | * on the command line. */ |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 551 | /* TRANSLATORS: Try to keep this at most 10 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 552 | sc_init_one(&main_list, NANO_SPELL_KEY, N_("To Spell"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 553 | IFSCHELP(nano_spell_msg, TRUE, NANO_NO_KEY), NANO_SPELL_FKEY, |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 554 | NANO_NO_KEY, NOVIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 555 | #ifndef DISABLE_SPELLER |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 556 | !ISSET(RESTRICTED) ? do_spell : |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 557 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 558 | nano_disabled_msg); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 559 | |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 560 | sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 561 | IFSCHELP(nano_gotoline_msg, FALSE, NANO_GOTOLINE_METAKEY), |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 562 | NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, |
| 563 | do_gotolinecolumn_void); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 564 | |
David Lawrence Ramsey | f1e5627 | 2006-05-22 18:28:20 +0000 | [diff] [blame] | 565 | sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg |
| 566 | #ifndef NANO_TINY |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 567 | , IFSCHELP(nano_replace_msg, FALSE, NANO_REPLACE_METAKEY) |
David Lawrence Ramsey | f1e5627 | 2006-05-22 18:28:20 +0000 | [diff] [blame] | 568 | #else |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 569 | , IFSCHELP(nano_replace_msg, TRUE, NANO_REPLACE_METAKEY) |
David Lawrence Ramsey | f1e5627 | 2006-05-22 18:28:20 +0000 | [diff] [blame] | 570 | #endif |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 571 | , NANO_REPLACE_FKEY, NANO_NO_KEY, NOVIEW, do_replace); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 572 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 573 | #ifndef NANO_TINY |
David Lawrence Ramsey | 8381fdd | 2004-11-01 22:40:02 +0000 | [diff] [blame] | 574 | sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"), |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 575 | IFSCHELP(nano_mark_msg, FALSE, NANO_MARK_METAKEY), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 576 | NANO_MARK_FKEY, NANO_NO_KEY, VIEW, do_mark); |
David Lawrence Ramsey | efb4b0a | 2006-04-19 14:09:01 +0000 | [diff] [blame] | 577 | |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 578 | sc_init_one(&main_list, NANO_NO_KEY, whereis_next_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 579 | IFSCHELP(nano_whereis_next_msg, TRUE, NANO_WHEREIS_NEXT_KEY), |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 580 | NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, do_research); |
David Lawrence Ramsey | cf1879b | 2006-04-27 23:39:49 +0000 | [diff] [blame] | 581 | |
| 582 | sc_init_one(&main_list, NANO_NO_KEY, N_("Copy Text"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 583 | IFSCHELP(nano_copy_msg, FALSE, NANO_COPY_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 584 | NANO_COPY_METAKEY, NOVIEW, do_copy_text); |
David Lawrence Ramsey | f85001a | 2006-04-28 13:19:56 +0000 | [diff] [blame] | 585 | |
| 586 | sc_init_one(&main_list, NANO_NO_KEY, N_("Indent Text"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 587 | IFSCHELP(nano_indent_msg, FALSE, NANO_INDENT_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | aee00d4 | 2006-07-05 18:42:22 +0000 | [diff] [blame] | 588 | NANO_NO_KEY, NOVIEW, do_indent_void); |
David Lawrence Ramsey | f85001a | 2006-04-28 13:19:56 +0000 | [diff] [blame] | 589 | |
| 590 | sc_init_one(&main_list, NANO_NO_KEY, N_("Unindent Text"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 591 | IFSCHELP(nano_unindent_msg, TRUE, NANO_UNINDENT_KEY), |
| 592 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_unindent); |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 593 | #endif |
| 594 | |
| 595 | sc_init_one(&main_list, NANO_FORWARD_KEY, N_("Forward"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 596 | IFSCHELP(nano_forward_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 597 | NANO_NO_KEY, VIEW, do_right); |
| 598 | |
| 599 | sc_init_one(&main_list, NANO_BACK_KEY, N_("Back"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 600 | IFSCHELP(nano_back_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 601 | NANO_NO_KEY, VIEW, do_left); |
| 602 | |
| 603 | #ifndef NANO_TINY |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 604 | sc_init_one(&main_list, NANO_NEXTWORD_KEY, N_("Next Word"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 605 | IFSCHELP(nano_nextword_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | e010edd | 2005-06-12 22:31:03 +0000 | [diff] [blame] | 606 | NANO_NO_KEY, VIEW, do_next_word_void); |
David Lawrence Ramsey | c596755 | 2002-06-21 03:20:06 +0000 | [diff] [blame] | 607 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 608 | sc_init_one(&main_list, NANO_NO_KEY, N_("Prev Word"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 609 | IFSCHELP(nano_prevword_msg, FALSE, NANO_PREVWORD_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 610 | NANO_NO_KEY, NANO_NO_KEY, VIEW, do_prev_word_void); |
Chris Allegretta | 8d990b5 | 2001-09-22 22:14:25 +0000 | [diff] [blame] | 611 | #endif |
David Lawrence Ramsey | e049706 | 2003-08-23 21:11:06 +0000 | [diff] [blame] | 612 | |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 613 | sc_init_one(&main_list, NANO_PREVLINE_KEY, N_("Prev Line"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 614 | IFSCHELP(nano_prevline_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 2c36e2e | 2006-07-06 22:17:47 +0000 | [diff] [blame] | 615 | NANO_NO_KEY, VIEW, do_up_void); |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 616 | |
| 617 | sc_init_one(&main_list, NANO_NEXTLINE_KEY, N_("Next Line"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 618 | IFSCHELP(nano_nextline_msg, TRUE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 2c36e2e | 2006-07-06 22:17:47 +0000 | [diff] [blame] | 619 | NANO_NO_KEY, VIEW, do_down_void); |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 620 | |
| 621 | sc_init_one(&main_list, NANO_HOME_KEY, N_("Home"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 622 | IFSCHELP(nano_home_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 623 | NANO_NO_KEY, VIEW, do_home); |
| 624 | |
| 625 | sc_init_one(&main_list, NANO_END_KEY, N_("End"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 626 | IFSCHELP(nano_end_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 627 | NANO_NO_KEY, VIEW, do_end); |
| 628 | |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 629 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 630 | sc_init_one(&main_list, NANO_NO_KEY, beg_of_par_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 631 | IFSCHELP(nano_parabegin_msg, FALSE, NANO_PARABEGIN_METAKEY), |
| 632 | NANO_NO_KEY, NANO_PARABEGIN_METAKEY2, VIEW, do_para_begin_void); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 633 | |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 634 | sc_init_one(&main_list, NANO_NO_KEY, end_of_par_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 635 | IFSCHELP(nano_paraend_msg, FALSE, NANO_PARAEND_METAKEY), |
| 636 | NANO_NO_KEY, NANO_PARAEND_METAKEY2, VIEW, do_para_end_void); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 637 | #endif |
David Lawrence Ramsey | e049706 | 2003-08-23 21:11:06 +0000 | [diff] [blame] | 638 | |
David Lawrence Ramsey | df45365 | 2006-04-21 02:05:09 +0000 | [diff] [blame] | 639 | sc_init_one(&main_list, NANO_NO_KEY, first_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 640 | IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY), |
| 641 | NANO_NO_KEY, NANO_FIRSTLINE_METAKEY2, VIEW, do_first_line); |
David Lawrence Ramsey | df45365 | 2006-04-21 02:05:09 +0000 | [diff] [blame] | 642 | |
| 643 | sc_init_one(&main_list, NANO_NO_KEY, last_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 644 | IFSCHELP(nano_lastline_msg, TRUE, NANO_LASTLINE_METAKEY), |
| 645 | NANO_NO_KEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line); |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 646 | |
| 647 | #ifndef NANO_TINY |
David Lawrence Ramsey | f5d6d99 | 2006-05-12 12:37:53 +0000 | [diff] [blame] | 648 | sc_init_one(&main_list, NANO_NO_KEY, N_("Find Other Bracket"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 649 | IFSCHELP(nano_bracket_msg, FALSE, NANO_BRACKET_KEY), |
| 650 | NANO_NO_KEY, NANO_NO_KEY, VIEW, do_find_bracket); |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 651 | |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 652 | sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Up"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 653 | IFSCHELP(nano_scrollup_msg, FALSE, NANO_SCROLLUP_KEY), |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 654 | NANO_NO_KEY, NANO_SCROLLUP_METAKEY, VIEW, do_scroll_up); |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 655 | |
| 656 | sc_init_one(&main_list, NANO_NO_KEY, N_("Scroll Down"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 657 | IFSCHELP(nano_scrolldown_msg, TRUE, NANO_SCROLLDOWN_KEY), |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 658 | NANO_NO_KEY, NANO_SCROLLDOWN_METAKEY, VIEW, do_scroll_down); |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 659 | #endif |
David Lawrence Ramsey | df45365 | 2006-04-21 02:05:09 +0000 | [diff] [blame] | 660 | |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 661 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 662 | sc_init_one(&main_list, NANO_NO_KEY, N_("Previous File"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 663 | IFSCHELP(nano_prevfile_msg, FALSE, NANO_PREVFILE_KEY), |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 664 | NANO_NO_KEY, NANO_PREVFILE_METAKEY, VIEW, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 665 | switch_to_prev_buffer_void); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 666 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 667 | sc_init_one(&main_list, NANO_NO_KEY, N_("Next File"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 668 | IFSCHELP(nano_nextfile_msg, TRUE, NANO_NEXTFILE_KEY), |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 669 | NANO_NO_KEY, NANO_NEXTFILE_METAKEY, VIEW, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 670 | switch_to_next_buffer_void); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 671 | #endif |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 672 | |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 673 | sc_init_one(&main_list, NANO_NO_KEY, N_("Verbatim Input"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 674 | IFSCHELP(nano_verbatim_msg, FALSE, NANO_VERBATIM_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 675 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_verbatim_input); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 676 | |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 677 | sc_init_one(&main_list, NANO_TAB_KEY, N_("Tab"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 678 | IFSCHELP(nano_tab_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 679 | NANO_NO_KEY, NOVIEW, do_tab); |
| 680 | |
| 681 | sc_init_one(&main_list, NANO_ENTER_KEY, N_("Enter"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 682 | IFSCHELP(nano_enter_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 683 | NANO_NO_KEY, NOVIEW, do_enter); |
| 684 | |
| 685 | sc_init_one(&main_list, NANO_DELETE_KEY, N_("Delete"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 686 | IFSCHELP(nano_delete_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 687 | NANO_NO_KEY, NOVIEW, do_delete); |
| 688 | |
David Lawrence Ramsey | bf48798 | 2006-04-24 20:50:52 +0000 | [diff] [blame] | 689 | sc_init_one(&main_list, NANO_BACKSPACE_KEY, N_("Backspace") |
| 690 | #ifndef NANO_TINY |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 691 | , IFSCHELP(nano_backspace_msg, FALSE, NANO_NO_KEY) |
David Lawrence Ramsey | bf48798 | 2006-04-24 20:50:52 +0000 | [diff] [blame] | 692 | #else |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 693 | , IFSCHELP(nano_backspace_msg, TRUE, NANO_NO_KEY) |
David Lawrence Ramsey | bf48798 | 2006-04-24 20:50:52 +0000 | [diff] [blame] | 694 | #endif |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 695 | , NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_backspace); |
David Lawrence Ramsey | 295d172 | 2005-01-01 07:43:32 +0000 | [diff] [blame] | 696 | |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 697 | #ifndef NANO_TINY |
David Lawrence Ramsey | f7b8783 | 2006-08-22 18:48:13 +0000 | [diff] [blame] | 698 | sc_init_one(&main_list, NANO_NO_KEY, N_("CutTillEnd"), |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 699 | IFSCHELP(nano_cut_till_end_msg, TRUE, NANO_CUTTILLEND_METAKEY), |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 700 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end); |
| 701 | #endif |
| 702 | |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 703 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 704 | sc_init_one(&main_list, NANO_NO_KEY, fulljstify_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 705 | IFSCHELP(nano_fulljustify_msg, FALSE, NANO_FULLJUSTIFY_METAKEY), |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 706 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 707 | #endif |
| 708 | |
David Lawrence Ramsey | c5c5230 | 2005-11-15 23:45:29 +0000 | [diff] [blame] | 709 | #ifndef NANO_TINY |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 710 | sc_init_one(&main_list, NANO_NO_KEY, N_("Word Count"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 711 | IFSCHELP(nano_wordcount_msg, FALSE, NANO_WORDCOUNT_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 712 | NANO_NO_KEY, NANO_NO_KEY, VIEW, do_wordlinechar_count); |
| 713 | #endif |
David Lawrence Ramsey | efb4b0a | 2006-04-19 14:09:01 +0000 | [diff] [blame] | 714 | |
David Lawrence Ramsey | 97415df | 2006-04-22 20:03:05 +0000 | [diff] [blame] | 715 | sc_init_one(&main_list, NANO_REFRESH_KEY, refresh_msg |
David Lawrence Ramsey | 03252d4 | 2006-04-22 20:00:23 +0000 | [diff] [blame] | 716 | #ifndef NANO_TINY |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 717 | , IFSCHELP(nano_refresh_msg, TRUE, NANO_NO_KEY) |
David Lawrence Ramsey | 03252d4 | 2006-04-22 20:00:23 +0000 | [diff] [blame] | 718 | #else |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 719 | , IFSCHELP(nano_refresh_msg, FALSE, NANO_NO_KEY) |
David Lawrence Ramsey | 03252d4 | 2006-04-22 20:00:23 +0000 | [diff] [blame] | 720 | #endif |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 721 | , NANO_NO_KEY, NANO_NO_KEY, VIEW, total_refresh); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 722 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 723 | free_shortcutage(&whereis_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 724 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 725 | sc_init_one(&whereis_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 726 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 727 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 728 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 729 | do_help_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 730 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 731 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 732 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 733 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 734 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 735 | sc_init_one(&whereis_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 736 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 737 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 738 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 739 | sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, first_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 740 | IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY), |
| 741 | NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_METAKEY2, VIEW, |
David Lawrence Ramsey | 5f0a58b | 2006-04-21 02:24:34 +0000 | [diff] [blame] | 742 | do_first_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 743 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 744 | sc_init_one(&whereis_list, NANO_LASTLINE_KEY, last_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 745 | IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_METAKEY), |
| 746 | NANO_LASTLINE_FKEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 747 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 748 | sc_init_one(&whereis_list, NANO_TOOTHERSEARCH_KEY, replace_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 749 | IFSCHELP(nano_replace_msg, FALSE, NANO_NO_KEY), |
| 750 | NANO_REPLACE_FKEY, NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 751 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 752 | sc_init_one(&whereis_list, NANO_TOGOTOLINE_KEY, go_to_line_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 753 | IFSCHELP(nano_gotoline_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 754 | NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 8c2b40f | 2000-06-29 01:30:04 +0000 | [diff] [blame] | 755 | |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 756 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 757 | sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, beg_of_par_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 758 | IFSCHELP(nano_parabegin_msg, FALSE, NANO_PARABEGIN_METAKEY), |
| 759 | NANO_NO_KEY, NANO_PARABEGIN_METAKEY2, VIEW, do_para_begin_void); |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 760 | |
David Lawrence Ramsey | db6015c | 2004-09-11 21:41:13 +0000 | [diff] [blame] | 761 | sc_init_one(&whereis_list, NANO_PARAEND_KEY, end_of_par_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 762 | IFSCHELP(nano_paraend_msg, FALSE, NANO_PARAEND_METAKEY), |
| 763 | NANO_NO_KEY, NANO_PARAEND_METAKEY2, VIEW, do_para_end_void); |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 764 | #endif |
| 765 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 766 | #ifndef NANO_TINY |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 767 | sc_init_one(&whereis_list, NANO_NO_KEY, case_sens_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 768 | IFSCHELP(nano_case_msg, FALSE, TOGGLE_CASE_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 769 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 770 | |
David Lawrence Ramsey | f3ecffd | 2005-06-16 18:48:30 +0000 | [diff] [blame] | 771 | sc_init_one(&whereis_list, NANO_NO_KEY, backwards_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 772 | IFSCHELP(nano_reverse_msg, FALSE, TOGGLE_BACKWARDS_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 773 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 774 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 775 | |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 776 | #ifdef HAVE_REGEX_H |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 777 | sc_init_one(&whereis_list, NANO_NO_KEY, regexp_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 778 | IFSCHELP(nano_regexp_msg, FALSE, NANO_REGEXP_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 779 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 780 | #endif |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 781 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 782 | #ifndef NANO_TINY |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 783 | sc_init_one(&whereis_list, NANO_PREVLINE_KEY, prev_history_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 784 | IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY), |
| 785 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 786 | |
| 787 | sc_init_one(&whereis_list, NANO_NEXTLINE_KEY, next_history_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 788 | IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY), |
| 789 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 790 | #endif |
David Lawrence Ramsey | 02085d7 | 2004-11-07 16:04:18 +0000 | [diff] [blame] | 791 | |
| 792 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | 02085d7 | 2004-11-07 16:04:18 +0000 | [diff] [blame] | 793 | sc_init_one(&whereis_list, NANO_FULLJUSTIFY_KEY, fulljstify_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 794 | IFSCHELP(nano_fulljustify_msg, FALSE, NANO_FULLJUSTIFY_METAKEY), |
David Lawrence Ramsey | 02085d7 | 2004-11-07 16:04:18 +0000 | [diff] [blame] | 795 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_full_justify); |
| 796 | #endif |
Chris Allegretta | 5f36c37 | 2001-07-16 00:48:53 +0000 | [diff] [blame] | 797 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 798 | free_shortcutage(&replace_list); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 799 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 800 | sc_init_one(&replace_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 801 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 802 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 803 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 804 | do_help_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 805 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 806 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 807 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 808 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 809 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 810 | sc_init_one(&replace_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 811 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 812 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 5f36c37 | 2001-07-16 00:48:53 +0000 | [diff] [blame] | 813 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 814 | sc_init_one(&replace_list, NANO_FIRSTLINE_KEY, first_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 815 | IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY), |
| 816 | NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_METAKEY2, VIEW, |
David Lawrence Ramsey | 5f0a58b | 2006-04-21 02:24:34 +0000 | [diff] [blame] | 817 | do_first_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 818 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 819 | sc_init_one(&replace_list, NANO_LASTLINE_KEY, last_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 820 | IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_METAKEY), |
| 821 | NANO_LASTLINE_FKEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 822 | |
David Lawrence Ramsey | e328ae9 | 2006-05-25 04:02:50 +0000 | [diff] [blame] | 823 | /* TRANSLATORS: Try to keep this at most 12 characters. */ |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 824 | sc_init_one(&replace_list, NANO_TOOTHERSEARCH_KEY, N_("No Replace"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 825 | IFSCHELP(nano_whereis_msg, FALSE, NANO_NO_KEY), |
| 826 | NANO_REPLACE_FKEY, NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 827 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 828 | #ifndef NANO_TINY |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 829 | sc_init_one(&replace_list, NANO_NO_KEY, case_sens_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 830 | IFSCHELP(nano_case_msg, FALSE, TOGGLE_CASE_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 831 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 832 | |
David Lawrence Ramsey | f3ecffd | 2005-06-16 18:48:30 +0000 | [diff] [blame] | 833 | sc_init_one(&replace_list, NANO_NO_KEY, backwards_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 834 | IFSCHELP(nano_reverse_msg, FALSE, TOGGLE_BACKWARDS_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 835 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 836 | #endif |
Chris Allegretta | 105da33 | 2000-10-31 05:10:10 +0000 | [diff] [blame] | 837 | |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 838 | #ifdef HAVE_REGEX_H |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 839 | sc_init_one(&replace_list, NANO_NO_KEY, regexp_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 840 | IFSCHELP(nano_regexp_msg, FALSE, NANO_REGEXP_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 841 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 658399a | 2001-06-14 02:54:22 +0000 | [diff] [blame] | 842 | #endif |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 843 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 844 | #ifndef NANO_TINY |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 845 | sc_init_one(&replace_list, NANO_PREVLINE_KEY, prev_history_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 846 | IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY), |
| 847 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 848 | |
| 849 | sc_init_one(&replace_list, NANO_NEXTLINE_KEY, next_history_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 850 | IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY), |
| 851 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | c10d8ff | 2005-06-03 20:51:39 +0000 | [diff] [blame] | 852 | #endif |
Chris Allegretta | 5f36c37 | 2001-07-16 00:48:53 +0000 | [diff] [blame] | 853 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 854 | free_shortcutage(&replace_list_2); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 855 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 856 | sc_init_one(&replace_list_2, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 857 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 858 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 859 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 860 | do_help_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 861 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 862 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 863 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 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(&replace_list_2, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 867 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 868 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 105da33 | 2000-10-31 05:10:10 +0000 | [diff] [blame] | 869 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 870 | sc_init_one(&replace_list_2, NANO_FIRSTLINE_KEY, first_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 871 | IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY), |
| 872 | NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_METAKEY2, VIEW, |
David Lawrence Ramsey | 5f0a58b | 2006-04-21 02:24:34 +0000 | [diff] [blame] | 873 | do_first_line); |
Chris Allegretta | 105da33 | 2000-10-31 05:10:10 +0000 | [diff] [blame] | 874 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 875 | sc_init_one(&replace_list_2, NANO_LASTLINE_KEY, last_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 876 | IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_METAKEY), |
| 877 | NANO_LASTLINE_FKEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line); |
Chris Allegretta | 105da33 | 2000-10-31 05:10:10 +0000 | [diff] [blame] | 878 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 879 | #ifndef NANO_TINY |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 880 | sc_init_one(&replace_list_2, NANO_PREVLINE_KEY, prev_history_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 881 | IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY), |
| 882 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 883 | |
| 884 | sc_init_one(&replace_list_2, NANO_NEXTLINE_KEY, next_history_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 885 | IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY), |
| 886 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 887 | #endif |
| 888 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 889 | free_shortcutage(&gotoline_list); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 890 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 891 | sc_init_one(&gotoline_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 892 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 893 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 894 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 895 | do_help_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 896 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 897 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 898 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 899 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 900 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 901 | sc_init_one(&gotoline_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 902 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 903 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 904 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 905 | sc_init_one(&gotoline_list, NANO_FIRSTLINE_KEY, first_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 906 | IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY), |
| 907 | NANO_FIRSTLINE_FKEY, NANO_FIRSTLINE_METAKEY2, VIEW, |
David Lawrence Ramsey | 5f0a58b | 2006-04-21 02:24:34 +0000 | [diff] [blame] | 908 | do_first_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 909 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 910 | sc_init_one(&gotoline_list, NANO_LASTLINE_KEY, last_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 911 | IFSCHELP(nano_lastline_msg, FALSE, NANO_LASTLINE_METAKEY), |
| 912 | NANO_LASTLINE_FKEY, NANO_LASTLINE_METAKEY2, VIEW, do_last_line); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 913 | |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 914 | sc_init_one(&gotoline_list, NANO_TOOTHERWHEREIS_KEY, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 915 | N_("Go To Text"), IFSCHELP(nano_whereis_msg, FALSE, |
| 916 | NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 917 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 918 | free_shortcutage(&writefile_list); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 919 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 920 | sc_init_one(&writefile_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 921 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 922 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 923 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 924 | do_help_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 925 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 926 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 927 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 928 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 929 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 930 | sc_init_one(&writefile_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 931 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 932 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 933 | |
Rocco Corsi | af5c302 | 2001-01-12 07:51:05 +0000 | [diff] [blame] | 934 | #ifndef DISABLE_BROWSER |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 935 | /* If we're using restricted mode, the file browser is disabled. |
| 936 | * It's useless since inserting files is disabled. */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 937 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 938 | sc_init_one(&writefile_list, NANO_TOFILES_KEY, to_files_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 939 | IFSCHELP(nano_tofiles_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 940 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 941 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 942 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 943 | #ifndef NANO_TINY |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 944 | /* If we're using restricted mode, the DOS format, Mac format, |
| 945 | * append, prepend, and backup toggles are disabled. The first and |
| 946 | * second are useless since inserting files is disabled, the third |
| 947 | * and fourth are disabled because they allow writing to files not |
| 948 | * specified on the command line, and the fifth is useless since |
| 949 | * backups are disabled. */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 950 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 951 | /* TRANSLATORS: Try to keep this at most 16 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 952 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("DOS Format"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 953 | IFSCHELP(nano_dos_msg, FALSE, TOGGLE_DOS_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 954 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 955 | |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 956 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 957 | /* TRANSLATORS: Try to keep this at most 16 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 958 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("Mac Format"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 959 | IFSCHELP(nano_mac_msg, FALSE, TOGGLE_MAC_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 960 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 961 | #endif |
| 962 | |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 963 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 964 | /* TRANSLATORS: Try to keep this at most 16 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 965 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("Append"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 966 | IFSCHELP(nano_append_msg, FALSE, NANO_APPEND_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 967 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | cc197ef | 2001-05-29 04:21:44 +0000 | [diff] [blame] | 968 | |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 969 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 970 | /* TRANSLATORS: Try to keep this at most 16 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 971 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("Prepend"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 972 | IFSCHELP(nano_prepend_msg, FALSE, NANO_PREPEND_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 973 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | 0e9b7aa | 2002-04-16 03:15:47 +0000 | [diff] [blame] | 974 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 975 | #ifndef NANO_TINY |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 976 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | cde9039 | 2006-04-09 18:27:42 +0000 | [diff] [blame] | 977 | /* TRANSLATORS: Try to keep this at most 16 characters. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 978 | sc_init_one(&writefile_list, NANO_NO_KEY, N_("Backup File"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 979 | IFSCHELP(nano_backup_msg, FALSE, TOGGLE_BACKUP_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 980 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
David Lawrence Ramsey | 5db0cdc | 2002-06-28 22:45:14 +0000 | [diff] [blame] | 981 | #endif |
| 982 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 983 | free_shortcutage(&insertfile_list); |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 984 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 985 | sc_init_one(&insertfile_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 986 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 987 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 988 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 989 | do_help_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 990 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 991 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 992 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 993 | ); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 994 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 995 | sc_init_one(&insertfile_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 996 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 997 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 998 | |
Chris Allegretta | cc197ef | 2001-05-29 04:21:44 +0000 | [diff] [blame] | 999 | #ifndef DISABLE_BROWSER |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 1000 | /* If we're using restricted mode, the file browser is disabled. |
| 1001 | * It's useless since inserting files is disabled. */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1002 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1003 | sc_init_one(&insertfile_list, NANO_TOFILES_KEY, to_files_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1004 | IFSCHELP(nano_tofiles_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1005 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | cc197ef | 2001-05-29 04:21:44 +0000 | [diff] [blame] | 1006 | #endif |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 1007 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 1008 | #ifndef NANO_TINY |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 1009 | /* If we're using restricted mode, command execution is disabled. |
| 1010 | * It's useless since inserting files is disabled. */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1011 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 4b4b608 | 2004-11-01 22:54:40 +0000 | [diff] [blame] | 1012 | sc_init_one(&insertfile_list, NANO_TOOTHERINSERT_KEY, |
David Lawrence Ramsey | ed467e5 | 2006-07-03 18:40:53 +0000 | [diff] [blame] | 1013 | /* TRANSLATORS: Try to keep this at most 22 |
| 1014 | * characters. */ |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1015 | N_("Execute Command"), IFSCHELP(nano_execute_msg, FALSE, |
| 1016 | NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 1017 | |
Chris Allegretta | f7c6811 | 2002-09-03 22:58:40 +0000 | [diff] [blame] | 1018 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 32e3b88 | 2004-05-29 01:20:17 +0000 | [diff] [blame] | 1019 | /* If we're using restricted mode, the multibuffer toggle is |
| 1020 | * disabled. It's useless since inserting files is disabled. */ |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1021 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 04a8d1c | 2004-09-28 22:14:58 +0000 | [diff] [blame] | 1022 | sc_init_one(&insertfile_list, NANO_NO_KEY, new_buffer_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1023 | IFSCHELP(nano_multibuffer_msg, FALSE, |
| 1024 | TOGGLE_MULTIBUFFER_KEY), NANO_NO_KEY, NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1025 | NOVIEW, NULL); |
Chris Allegretta | f7c6811 | 2002-09-03 22:58:40 +0000 | [diff] [blame] | 1026 | #endif |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 1027 | #endif |
Chris Allegretta | cc197ef | 2001-05-29 04:21:44 +0000 | [diff] [blame] | 1028 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 1029 | #ifndef NANO_TINY |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 1030 | free_shortcutage(&extcmd_list); |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 1031 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1032 | sc_init_one(&extcmd_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1033 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1034 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1035 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1036 | do_help_void |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1037 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 1038 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1039 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 1040 | ); |
Chris Allegretta | 52c5a6e | 2002-03-21 05:07:28 +0000 | [diff] [blame] | 1041 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1042 | sc_init_one(&extcmd_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1043 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1044 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 04a8d1c | 2004-09-28 22:14:58 +0000 | [diff] [blame] | 1045 | |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 1046 | sc_init_one(&extcmd_list, NANO_TOOTHERINSERT_KEY, N_("Insert File"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1047 | IFSCHELP(nano_insert_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1048 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 1049 | |
David Lawrence Ramsey | 47e82b1 | 2004-09-28 22:21:46 +0000 | [diff] [blame] | 1050 | #ifdef ENABLE_MULTIBUFFER |
David Lawrence Ramsey | 04a8d1c | 2004-09-28 22:14:58 +0000 | [diff] [blame] | 1051 | sc_init_one(&extcmd_list, NANO_NO_KEY, new_buffer_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1052 | IFSCHELP(nano_multibuffer_msg, FALSE, TOGGLE_MULTIBUFFER_KEY), |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1053 | NANO_NO_KEY, NANO_NO_KEY, NOVIEW, NULL); |
Chris Allegretta | 52c5a6e | 2002-03-21 05:07:28 +0000 | [diff] [blame] | 1054 | #endif |
David Lawrence Ramsey | 47e82b1 | 2004-09-28 22:21:46 +0000 | [diff] [blame] | 1055 | #endif |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 1056 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1057 | #ifndef DISABLE_HELP |
| 1058 | free_shortcutage(&help_list); |
| 1059 | |
| 1060 | sc_init_one(&help_list, NANO_REFRESH_KEY, refresh_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1061 | IFSCHELP(nano_refresh_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1062 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1063 | |
| 1064 | sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1065 | IFSCHELP(nano_exit_msg, FALSE, NANO_NO_KEY), NANO_EXIT_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1066 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1067 | |
| 1068 | sc_init_one(&help_list, NANO_PREVPAGE_KEY, prev_page_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1069 | IFSCHELP(nano_prevpage_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1070 | NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1071 | |
| 1072 | sc_init_one(&help_list, NANO_NEXTPAGE_KEY, next_page_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1073 | IFSCHELP(nano_nextpage_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1074 | NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1075 | |
| 1076 | sc_init_one(&help_list, NANO_PREVLINE_KEY, N_("Prev Line"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1077 | IFSCHELP(nano_prevline_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1078 | NANO_NO_KEY, VIEW, NULL); |
| 1079 | |
| 1080 | sc_init_one(&help_list, NANO_NEXTLINE_KEY, N_("Next Line"), |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1081 | IFSCHELP(nano_nextline_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1082 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 6e7d24d | 2006-05-06 02:26:18 +0000 | [diff] [blame] | 1083 | |
| 1084 | sc_init_one(&help_list, NANO_NO_KEY, first_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 1085 | IFSCHELP(nano_firstline_msg, FALSE, NANO_FIRSTLINE_METAKEY), |
| 1086 | NANO_NO_KEY, NANO_FIRSTLINE_METAKEY2, VIEW, NULL); |
David Lawrence Ramsey | 6e7d24d | 2006-05-06 02:26:18 +0000 | [diff] [blame] | 1087 | |
| 1088 | sc_init_one(&help_list, NANO_NO_KEY, last_line_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 1089 | IFSCHELP(nano_lastline_msg, TRUE, NANO_LASTLINE_METAKEY), |
| 1090 | NANO_NO_KEY, NANO_LASTLINE_METAKEY2, VIEW, NULL); |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1091 | #endif |
| 1092 | |
| 1093 | #ifndef DISABLE_SPELLER |
| 1094 | free_shortcutage(&spell_list); |
| 1095 | |
| 1096 | sc_init_one(&spell_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1097 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1098 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1099 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1100 | do_help_void |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1101 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 1102 | nano_disabled_msg |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1103 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 1104 | ); |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1105 | |
| 1106 | sc_init_one(&spell_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1107 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1108 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1109 | #endif |
| 1110 | |
Rocco Corsi | af5c302 | 2001-01-12 07:51:05 +0000 | [diff] [blame] | 1111 | #ifndef DISABLE_BROWSER |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 1112 | free_shortcutage(&browser_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1113 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1114 | sc_init_one(&browser_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1115 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1116 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 1117 | |
David Lawrence Ramsey | 8037fe0 | 2004-07-23 12:30:40 +0000 | [diff] [blame] | 1118 | sc_init_one(&browser_list, NANO_EXIT_KEY, exit_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1119 | IFSCHELP(nano_exitbrowser_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1120 | NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 1121 | |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1122 | sc_init_one(&browser_list, NANO_WHEREIS_KEY, whereis_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1123 | IFSCHELP(nano_whereis_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1124 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1125 | |
| 1126 | sc_init_one(&browser_list, NANO_NO_KEY, whereis_next_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1127 | IFSCHELP(nano_whereis_next_msg, FALSE, NANO_WHEREIS_NEXT_KEY), |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1128 | NANO_WHEREIS_NEXT_FKEY, NANO_NO_KEY, VIEW, NULL); |
| 1129 | |
David Lawrence Ramsey | 0ec909c | 2006-05-06 15:07:26 +0000 | [diff] [blame] | 1130 | sc_init_one(&browser_list, NANO_PREVPAGE_KEY, prev_page_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1131 | IFSCHELP(nano_prevpage_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 0ec909c | 2006-05-06 15:07:26 +0000 | [diff] [blame] | 1132 | NANO_PREVPAGE_FKEY, NANO_NO_KEY, VIEW, NULL); |
| 1133 | |
| 1134 | sc_init_one(&browser_list, NANO_NEXTPAGE_KEY, next_page_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1135 | IFSCHELP(nano_nextpage_msg, FALSE, NANO_NO_KEY), |
David Lawrence Ramsey | 0ec909c | 2006-05-06 15:07:26 +0000 | [diff] [blame] | 1136 | NANO_NEXTPAGE_FKEY, NANO_NO_KEY, VIEW, NULL); |
| 1137 | |
| 1138 | sc_init_one(&browser_list, NANO_NO_KEY, first_file_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 1139 | IFSCHELP(nano_firstfile_msg, FALSE, NANO_FIRSTFILE_METAKEY), |
| 1140 | NANO_NO_KEY, NANO_FIRSTFILE_METAKEY2, VIEW, NULL); |
David Lawrence Ramsey | 0ec909c | 2006-05-06 15:07:26 +0000 | [diff] [blame] | 1141 | |
| 1142 | sc_init_one(&browser_list, NANO_NO_KEY, last_file_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 1143 | IFSCHELP(nano_lastfile_msg, FALSE, NANO_LASTFILE_METAKEY), |
| 1144 | NANO_NO_KEY, NANO_LASTFILE_METAKEY2, VIEW, NULL); |
David Lawrence Ramsey | 0ec909c | 2006-05-06 15:07:26 +0000 | [diff] [blame] | 1145 | |
David Lawrence Ramsey | 602199d | 2006-05-06 15:31:32 +0000 | [diff] [blame] | 1146 | /* TRANSLATORS: Try to keep this at most 12 characters. */ |
David Lawrence Ramsey | 0ec909c | 2006-05-06 15:07:26 +0000 | [diff] [blame] | 1147 | sc_init_one(&browser_list, NANO_GOTODIR_KEY, N_("Go To Dir"), |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 1148 | IFSCHELP(nano_gotodir_msg, FALSE, NANO_GOTODIR_METAKEY), |
David Lawrence Ramsey | 0ec909c | 2006-05-06 15:07:26 +0000 | [diff] [blame] | 1149 | NANO_GOTODIR_FKEY, NANO_NO_KEY, VIEW, NULL); |
Rocco Corsi | 12f294c | 2001-04-14 06:50:24 +0000 | [diff] [blame] | 1150 | |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1151 | free_shortcutage(&whereis_file_list); |
| 1152 | |
| 1153 | sc_init_one(&whereis_file_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1154 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1155 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1156 | #ifndef DISABLE_HELP |
| 1157 | do_browser_help |
| 1158 | #else |
| 1159 | nano_disabled_msg |
| 1160 | #endif |
| 1161 | ); |
| 1162 | |
| 1163 | sc_init_one(&whereis_file_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1164 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1165 | NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1166 | |
| 1167 | sc_init_one(&whereis_file_list, NANO_FIRSTFILE_KEY, first_file_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 1168 | IFSCHELP(nano_firstfile_msg, FALSE, NANO_FIRSTFILE_METAKEY), |
| 1169 | NANO_FIRSTFILE_FKEY, NANO_FIRSTFILE_METAKEY2, VIEW, |
David Lawrence Ramsey | 5f0a58b | 2006-04-21 02:24:34 +0000 | [diff] [blame] | 1170 | do_first_file); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1171 | |
| 1172 | sc_init_one(&whereis_file_list, NANO_LASTFILE_KEY, last_file_msg, |
David Lawrence Ramsey | 5a8182e | 2006-11-21 04:20:53 +0000 | [diff] [blame] | 1173 | IFSCHELP(nano_lastfile_msg, FALSE, NANO_LASTFILE_METAKEY), |
| 1174 | NANO_LASTFILE_FKEY, NANO_LASTFILE_METAKEY2, VIEW, do_last_file); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1175 | |
| 1176 | #ifndef NANO_SMALL |
| 1177 | sc_init_one(&whereis_file_list, NANO_NO_KEY, case_sens_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1178 | IFSCHELP(nano_case_msg, FALSE, TOGGLE_CASE_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1179 | NANO_NO_KEY, VIEW, NULL); |
| 1180 | |
| 1181 | sc_init_one(&whereis_file_list, NANO_NO_KEY, backwards_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1182 | IFSCHELP(nano_reverse_msg, FALSE, TOGGLE_BACKWARDS_KEY), |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1183 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1184 | #endif |
| 1185 | |
| 1186 | #ifdef HAVE_REGEX_H |
| 1187 | sc_init_one(&whereis_file_list, NANO_NO_KEY, regexp_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1188 | IFSCHELP(nano_regexp_msg, FALSE, NANO_REGEXP_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1189 | NANO_NO_KEY, VIEW, NULL); |
| 1190 | #endif |
| 1191 | |
| 1192 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 1193 | sc_init_one(&whereis_file_list, NANO_PREVLINE_KEY, prev_history_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1194 | IFSCHELP(nano_prev_history_msg, FALSE, NANO_NO_KEY), |
| 1195 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | 305d889 | 2006-05-24 19:48:03 +0000 | [diff] [blame] | 1196 | |
| 1197 | sc_init_one(&whereis_file_list, NANO_NEXTLINE_KEY, next_history_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1198 | IFSCHELP(nano_next_history_msg, FALSE, NANO_NO_KEY), |
| 1199 | NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); |
David Lawrence Ramsey | e38b808 | 2006-03-30 07:03:04 +0000 | [diff] [blame] | 1200 | #endif |
| 1201 | |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 1202 | free_shortcutage(&gotodir_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1203 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1204 | sc_init_one(&gotodir_list, NANO_HELP_KEY, get_help_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1205 | IFSCHELP(nano_help_msg, FALSE, NANO_NO_KEY), NANO_HELP_FKEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1206 | NANO_NO_KEY, VIEW, |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1207 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | 56ec592 | 2006-08-25 19:26:48 +0000 | [diff] [blame] | 1208 | do_browser_help |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1209 | #else |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 1210 | nano_disabled_msg |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 1211 | #endif |
David Lawrence Ramsey | 017dde2 | 2006-03-24 05:28:03 +0000 | [diff] [blame] | 1212 | ); |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 1213 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1214 | sc_init_one(&gotodir_list, NANO_CANCEL_KEY, cancel_msg, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1215 | IFSCHELP(nano_cancel_msg, FALSE, NANO_NO_KEY), NANO_NO_KEY, |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1216 | NANO_NO_KEY, VIEW, NULL); |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 1217 | #endif |
| 1218 | |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 1219 | currshortcut = main_list; |
David Lawrence Ramsey | 35e9713 | 2005-01-08 06:04:19 +0000 | [diff] [blame] | 1220 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 1221 | #ifndef NANO_TINY |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 1222 | toggle_init(); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1223 | #endif |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 1224 | } |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1225 | |
David Lawrence Ramsey | e6757b9 | 2006-04-19 13:36:56 +0000 | [diff] [blame] | 1226 | /* Free the given shortcut. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1227 | void free_shortcutage(shortcut **shortcutage) |
| 1228 | { |
| 1229 | assert(shortcutage != NULL); |
David Lawrence Ramsey | 193b0e5 | 2005-06-06 18:41:17 +0000 | [diff] [blame] | 1230 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1231 | while (*shortcutage != NULL) { |
| 1232 | shortcut *ps = *shortcutage; |
| 1233 | *shortcutage = (*shortcutage)->next; |
| 1234 | free(ps); |
| 1235 | } |
| 1236 | } |
| 1237 | |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 1238 | #ifndef NANO_TINY |
David Lawrence Ramsey | e6757b9 | 2006-04-19 13:36:56 +0000 | [diff] [blame] | 1239 | /* Add a new toggle to the end of the global toggle list. */ |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1240 | void toggle_init_one(int val |
| 1241 | #ifndef DISABLE_HELP |
| 1242 | , const char *desc, bool blank_after |
| 1243 | #endif |
| 1244 | , long flag) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1245 | { |
| 1246 | toggle *u; |
| 1247 | |
| 1248 | if (toggles == NULL) { |
David Lawrence Ramsey | 94b975c | 2004-07-20 12:57:34 +0000 | [diff] [blame] | 1249 | toggles = (toggle *)nmalloc(sizeof(toggle)); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1250 | u = toggles; |
| 1251 | } else { |
| 1252 | for (u = toggles; u->next != NULL; u = u->next) |
| 1253 | ; |
David Lawrence Ramsey | 94b975c | 2004-07-20 12:57:34 +0000 | [diff] [blame] | 1254 | u->next = (toggle *)nmalloc(sizeof(toggle)); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1255 | u = u->next; |
| 1256 | } |
| 1257 | |
| 1258 | u->val = val; |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1259 | #ifndef DISABLE_HELP |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1260 | u->desc = (desc == NULL) ? "" : _(desc); |
David Lawrence Ramsey | 1df3e2d | 2006-04-22 19:45:26 +0000 | [diff] [blame] | 1261 | u->blank_after = blank_after; |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1262 | #endif |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1263 | u->flag = flag; |
| 1264 | u->next = NULL; |
| 1265 | } |
| 1266 | |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1267 | /* Initialize the global toggle list. */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1268 | void toggle_init(void) |
| 1269 | { |
| 1270 | /* There is no need to reinitialize the toggles. They can't |
| 1271 | * change. */ |
| 1272 | if (toggles != NULL) |
| 1273 | return; |
| 1274 | |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1275 | /* The following macro is to be used in calling toggle_init_one(). The |
| 1276 | * point is that toggle_init_one() takes 4 arguments, unless |
| 1277 | * DISABLE_HELP is defined, when the 2nd and 3rd ones should not be |
| 1278 | * there. */ |
| 1279 | #ifndef DISABLE_HELP |
| 1280 | #define IFTHELP(help, blank, nextvar) help, blank, nextvar |
| 1281 | #else |
| 1282 | #define IFTHELP(help, blank, nextvar) nextvar |
| 1283 | #endif |
| 1284 | |
| 1285 | toggle_init_one(TOGGLE_NOHELP_KEY, IFTHELP(N_("Help mode"), FALSE, |
| 1286 | NO_HELP)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1287 | |
David Lawrence Ramsey | 8ff785c | 2006-04-19 23:13:44 +0000 | [diff] [blame] | 1288 | toggle_init_one(TOGGLE_CONST_KEY, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1289 | IFTHELP(N_("Constant cursor position display"), FALSE, |
| 1290 | CONST_UPDATE)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1291 | |
| 1292 | toggle_init_one(TOGGLE_MORESPACE_KEY, |
David Lawrence Ramsey | 7b0531a | 2006-07-31 01:30:31 +0000 | [diff] [blame] | 1293 | IFTHELP(N_("Use of one more line for editing"), FALSE, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1294 | MORE_SPACE)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1295 | |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1296 | toggle_init_one(TOGGLE_SMOOTH_KEY, |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 1297 | #ifdef ENABLE_NANORC |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1298 | IFTHELP(N_("Smooth scrolling"), FALSE, SMOOTH_SCROLL) |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 1299 | #else |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1300 | IFTHELP(N_("Smooth scrolling"), TRUE, SMOOTH_SCROLL) |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 1301 | #endif |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1302 | ); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1303 | |
| 1304 | #ifdef ENABLE_NANORC |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1305 | toggle_init_one(TOGGLE_WHITESPACE_KEY, |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 1306 | #ifdef ENABLE_COLOR |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1307 | IFTHELP(N_("Whitespace display"), FALSE, WHITESPACE_DISPLAY) |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 1308 | #else |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1309 | IFTHELP(N_("Whitespace display"), TRUE, WHITESPACE_DISPLAY) |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 1310 | #endif |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1311 | ); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1312 | #endif |
| 1313 | |
| 1314 | #ifdef ENABLE_COLOR |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1315 | toggle_init_one(TOGGLE_SYNTAX_KEY, |
| 1316 | IFTHELP(N_("Color syntax highlighting"), TRUE, NO_COLOR_SYNTAX)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1317 | #endif |
| 1318 | |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1319 | toggle_init_one(TOGGLE_SMARTHOME_KEY, IFTHELP(N_("Smart home key"), |
| 1320 | FALSE, SMART_HOME)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1321 | |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1322 | toggle_init_one(TOGGLE_AUTOINDENT_KEY, IFTHELP(N_("Auto indent"), |
| 1323 | FALSE, AUTOINDENT)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1324 | |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1325 | toggle_init_one(TOGGLE_CUTTOEND_KEY, IFTHELP(N_("Cut to end"), |
| 1326 | FALSE, CUT_TO_END)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1327 | |
| 1328 | #ifndef DISABLE_WRAPPING |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1329 | toggle_init_one(TOGGLE_WRAP_KEY, IFTHELP(N_("Long line wrapping"), |
| 1330 | FALSE, NO_WRAP)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1331 | #endif |
| 1332 | |
| 1333 | toggle_init_one(TOGGLE_TABSTOSPACES_KEY, |
David Lawrence Ramsey | 2f70228 | 2006-07-25 22:24:48 +0000 | [diff] [blame] | 1334 | #ifndef DISABLE_MOUSE |
| 1335 | IFTHELP(N_("Conversion of typed tabs to spaces"), TRUE, |
| 1336 | TABS_TO_SPACES) |
| 1337 | #else |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1338 | IFTHELP(N_("Conversion of typed tabs to spaces"), |
| 1339 | !ISSET(RESTRICTED) ? TRUE : FALSE, TABS_TO_SPACES) |
David Lawrence Ramsey | 2ca2356 | 2006-04-23 19:15:15 +0000 | [diff] [blame] | 1340 | #endif |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1341 | ); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1342 | |
| 1343 | /* If we're using restricted mode, the backup toggle is disabled. |
| 1344 | * It's useless since backups are disabled. */ |
| 1345 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1346 | toggle_init_one(TOGGLE_BACKUP_KEY, IFTHELP(N_("Backup files"), |
| 1347 | FALSE, BACKUP_FILE)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1348 | |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1349 | #ifdef ENABLE_MULTIBUFFER |
| 1350 | /* If we're using restricted mode, the multibuffer toggle is |
| 1351 | * disabled. It's useless since inserting files is disabled. */ |
| 1352 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 637b8bb | 2005-01-17 05:06:55 +0000 | [diff] [blame] | 1353 | toggle_init_one(TOGGLE_MULTIBUFFER_KEY, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1354 | IFTHELP(N_("Multiple file buffers"), FALSE, |
| 1355 | MULTIBUFFER)); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1356 | #endif |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1357 | |
David Lawrence Ramsey | 6397b59 | 2006-04-20 22:36:10 +0000 | [diff] [blame] | 1358 | #ifndef DISABLE_MOUSE |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1359 | toggle_init_one(TOGGLE_MOUSE_KEY, IFTHELP(N_("Mouse support"), |
| 1360 | FALSE, USE_MOUSE)); |
David Lawrence Ramsey | 6397b59 | 2006-04-20 22:36:10 +0000 | [diff] [blame] | 1361 | #endif |
| 1362 | |
David Lawrence Ramsey | 7483571 | 2004-12-04 17:41:52 +0000 | [diff] [blame] | 1363 | /* If we're using restricted mode, the DOS/Mac conversion toggle is |
| 1364 | * disabled. It's useless since inserting files is disabled. */ |
| 1365 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1366 | toggle_init_one(TOGGLE_NOCONVERT_KEY, |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1367 | IFTHELP(N_("No conversion from DOS/Mac format"), FALSE, |
| 1368 | NO_CONVERT)); |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1369 | |
David Lawrence Ramsey | e313f5b | 2006-04-20 22:29:02 +0000 | [diff] [blame] | 1370 | /* If we're using restricted mode, the suspend toggle is disabled. |
| 1371 | * It's useless since suspending is disabled. */ |
David Lawrence Ramsey | 7483571 | 2004-12-04 17:41:52 +0000 | [diff] [blame] | 1372 | if (!ISSET(RESTRICTED)) |
David Lawrence Ramsey | bd28ee4 | 2006-07-25 21:13:30 +0000 | [diff] [blame] | 1373 | toggle_init_one(TOGGLE_SUSPEND_KEY, IFTHELP(N_("Suspension"), |
| 1374 | FALSE, SUSPEND)); |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1375 | } |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 1376 | #endif /* !NANO_TINY */ |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1377 | |
David Lawrence Ramsey | e6757b9 | 2006-04-19 13:36:56 +0000 | [diff] [blame] | 1378 | #ifdef DEBUG |
| 1379 | /* This function is used to gracefully return all the memory we've used. |
| 1380 | * It should be called just before calling exit(). Practically, the |
Chris Allegretta | 6232d66 | 2002-05-12 19:52:15 +0000 | [diff] [blame] | 1381 | * only effect is to cause a segmentation fault if the various data |
| 1382 | * structures got bolloxed earlier. Thus, we don't bother having this |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1383 | * function unless debugging is turned on. */ |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1384 | void thanks_for_all_the_fish(void) |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1385 | { |
David Lawrence Ramsey | 576bf33 | 2004-07-12 03:10:30 +0000 | [diff] [blame] | 1386 | delwin(topwin); |
| 1387 | delwin(edit); |
| 1388 | delwin(bottomwin); |
| 1389 | |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1390 | #ifndef DISABLE_JUSTIFY |
| 1391 | if (quotestr != NULL) |
| 1392 | free(quotestr); |
David Lawrence Ramsey | 819c7f0 | 2004-07-30 03:54:34 +0000 | [diff] [blame] | 1393 | #ifdef HAVE_REGEX_H |
| 1394 | regfree("ereg); |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1395 | if (quoteerr != NULL) |
| 1396 | free(quoteerr); |
David Lawrence Ramsey | 819c7f0 | 2004-07-30 03:54:34 +0000 | [diff] [blame] | 1397 | #endif |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1398 | #endif |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 1399 | #ifndef NANO_TINY |
David Lawrence Ramsey | 04e42a6 | 2004-02-28 16:24:31 +0000 | [diff] [blame] | 1400 | if (backup_dir != NULL) |
| 1401 | free(backup_dir); |
| 1402 | #endif |
Chris Allegretta | 2598c66 | 2002-03-28 01:59:34 +0000 | [diff] [blame] | 1403 | #ifndef DISABLE_OPERATINGDIR |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1404 | if (operating_dir != NULL) |
| 1405 | free(operating_dir); |
| 1406 | if (full_operating_dir != NULL) |
| 1407 | free(full_operating_dir); |
| 1408 | #endif |
| 1409 | if (last_search != NULL) |
| 1410 | free(last_search); |
| 1411 | if (last_replace != NULL) |
| 1412 | free(last_replace); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1413 | #ifndef DISABLE_SPELLER |
| 1414 | if (alt_speller != NULL) |
| 1415 | free(alt_speller); |
| 1416 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1417 | if (answer != NULL) |
| 1418 | free(answer); |
| 1419 | if (cutbuffer != NULL) |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1420 | free_filestruct(cutbuffer); |
David Lawrence Ramsey | 93c8405 | 2004-11-23 04:08:28 +0000 | [diff] [blame] | 1421 | #ifndef DISABLE_JUSTIFY |
| 1422 | if (jusbuffer != NULL) |
| 1423 | free_filestruct(jusbuffer); |
| 1424 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1425 | free_shortcutage(&main_list); |
| 1426 | free_shortcutage(&whereis_list); |
| 1427 | free_shortcutage(&replace_list); |
| 1428 | free_shortcutage(&replace_list_2); |
David Lawrence Ramsey | e5d8f32 | 2004-09-30 22:07:21 +0000 | [diff] [blame] | 1429 | free_shortcutage(&gotoline_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1430 | free_shortcutage(&writefile_list); |
| 1431 | free_shortcutage(&insertfile_list); |
David Lawrence Ramsey | 6d6a36c | 2005-12-08 07:09:08 +0000 | [diff] [blame] | 1432 | #ifndef NANO_TINY |
| 1433 | free_shortcutage(&extcmd_list); |
| 1434 | #endif |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1435 | #ifndef DISABLE_HELP |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1436 | free_shortcutage(&help_list); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1437 | #endif |
| 1438 | #ifndef DISABLE_SPELLER |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1439 | free_shortcutage(&spell_list); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1440 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1441 | #ifndef DISABLE_BROWSER |
| 1442 | free_shortcutage(&browser_list); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 1443 | free_shortcutage(&gotodir_list); |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1444 | #endif |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 1445 | #ifndef NANO_TINY |
David Lawrence Ramsey | 40e4acf | 2005-05-26 06:09:07 +0000 | [diff] [blame] | 1446 | /* Free the memory associated with each toggle. */ |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1447 | while (toggles != NULL) { |
| 1448 | toggle *t = toggles; |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1449 | |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1450 | toggles = toggles->next; |
| 1451 | free(t); |
| 1452 | } |
| 1453 | #endif |
David Lawrence Ramsey | 5d8d0b1 | 2005-05-26 05:53:29 +0000 | [diff] [blame] | 1454 | /* Free the memory associated with each open file buffer. */ |
David Lawrence Ramsey | 6ad59cd | 2005-07-08 20:09:16 +0000 | [diff] [blame] | 1455 | if (openfile != NULL) |
David Lawrence Ramsey | 64661ac | 2005-07-08 19:57:25 +0000 | [diff] [blame] | 1456 | free_openfilestruct(openfile); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1457 | #ifdef ENABLE_COLOR |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1458 | if (syntaxstr != NULL) |
| 1459 | free(syntaxstr); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1460 | while (syntaxes != NULL) { |
| 1461 | syntaxtype *bill = syntaxes; |
| 1462 | |
| 1463 | free(syntaxes->desc); |
| 1464 | while (syntaxes->extensions != NULL) { |
| 1465 | exttype *bob = syntaxes->extensions; |
| 1466 | |
| 1467 | syntaxes->extensions = bob->next; |
David Lawrence Ramsey | 2385c1a | 2005-07-29 21:42:08 +0000 | [diff] [blame] | 1468 | free(bob->ext_regex); |
David Lawrence Ramsey | 7fc0ada | 2005-08-29 18:52:06 +0000 | [diff] [blame] | 1469 | if (bob->ext != NULL) { |
| 1470 | regfree(bob->ext); |
| 1471 | free(bob->ext); |
| 1472 | } |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1473 | free(bob); |
| 1474 | } |
| 1475 | while (syntaxes->color != NULL) { |
| 1476 | colortype *bob = syntaxes->color; |
| 1477 | |
| 1478 | syntaxes->color = bob->next; |
David Lawrence Ramsey | 2385c1a | 2005-07-29 21:42:08 +0000 | [diff] [blame] | 1479 | free(bob->start_regex); |
David Lawrence Ramsey | db95802 | 2005-07-13 20:18:46 +0000 | [diff] [blame] | 1480 | if (bob->start != NULL) { |
| 1481 | regfree(bob->start); |
| 1482 | free(bob->start); |
| 1483 | } |
David Lawrence Ramsey | d2361f0 | 2005-07-14 18:33:51 +0000 | [diff] [blame] | 1484 | if (bob->end_regex != NULL) |
| 1485 | free(bob->end_regex); |
David Lawrence Ramsey | db95802 | 2005-07-13 20:18:46 +0000 | [diff] [blame] | 1486 | if (bob->end != NULL) { |
Chris Allegretta | ce452fb | 2003-02-03 02:56:44 +0000 | [diff] [blame] | 1487 | regfree(bob->end); |
David Lawrence Ramsey | db95802 | 2005-07-13 20:18:46 +0000 | [diff] [blame] | 1488 | free(bob->end); |
| 1489 | } |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 1490 | free(bob); |
| 1491 | } |
| 1492 | syntaxes = syntaxes->next; |
| 1493 | free(bill); |
| 1494 | } |
| 1495 | #endif /* ENABLE_COLOR */ |
David Lawrence Ramsey | ebe3425 | 2005-11-15 03:17:35 +0000 | [diff] [blame] | 1496 | #ifndef NANO_TINY |
David Lawrence Ramsey | 40e4acf | 2005-05-26 06:09:07 +0000 | [diff] [blame] | 1497 | /* Free the search and replace history lists. */ |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1498 | if (searchage != NULL) |
| 1499 | free_filestruct(searchage); |
| 1500 | if (replaceage != NULL) |
| 1501 | free_filestruct(replaceage); |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 1502 | #endif |
David Lawrence Ramsey | a27bd65 | 2004-08-17 05:23:38 +0000 | [diff] [blame] | 1503 | #ifdef ENABLE_NANORC |
David Lawrence Ramsey | 31b159c | 2005-05-26 05:17:13 +0000 | [diff] [blame] | 1504 | if (homedir != NULL) |
| 1505 | free(homedir); |
David Lawrence Ramsey | a27bd65 | 2004-08-17 05:23:38 +0000 | [diff] [blame] | 1506 | #endif |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 1507 | } |
Chris Allegretta | 6232d66 | 2002-05-12 19:52:15 +0000 | [diff] [blame] | 1508 | #endif /* DEBUG */ |