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