Compare commits

...

241 Commits

Author SHA1 Message Date
Chris Allegretta
6da149adf9 0.9.20 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@297 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-19 02:23:03 +00:00
Chris Allegretta
3ebac1c886 Okay reworded 4.6 a little
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@296 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-19 00:47:30 +00:00
Chris Allegretta
42004f0831 Update faq for missing blockquote and changed frozen dist in debian portion to stable
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@295 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-19 00:34:46 +00:00
Chris Allegretta
47ddfaf44f Added new previous string display to section 4 of faq
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@294 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-18 19:04:32 +00:00
Chris Allegretta
44b52ca67b Added NEWS for upcoming release, username comp to TODO
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@293 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-18 16:46:14 +00:00
Jordi Mallach
d25385b090 Final, tiny updates in es.po for 0.9.20.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@292 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-18 03:31:21 +00:00
Chris Allegretta
258ac42140 comment out username completino code with macros since unimplemented, fix -Wall warnings on Irix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@291 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-18 03:06:56 +00:00
Chris Allegretta
63a89d386b comment out username completino code with macros since unimplemented, fix -Wall warnings on Irix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@290 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-18 03:05:50 +00:00
Chris Allegretta
6e8ed7128e Update TODO for release (oops)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@289 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-18 02:22:28 +00:00
Chris Allegretta
bf9a8cc23d Changed PICO_MSGS to PICO_MODE and strings
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@288 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-17 01:37:39 +00:00
Chris Allegretta
5b1faac336 nanogetstr(): Added check for ASCII 54[124] when using PDCURSES, ignore them if found
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@287 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-16 19:55:30 +00:00
Chris Allegretta
5bf51d3872 Updated BUGS, optimized search_init a little, fixed bug #47
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@286 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-16 06:01:10 +00:00
Chris Allegretta
cbb0f8bde2 -pedantic fixes by Rocco Corsi
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@285 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-15 03:50:02 +00:00
Chris Allegretta
2c9752291d tab completion fixes, removed wefresh() from blank_edit
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@284 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-15 01:25:42 +00:00
Chris Allegretta
b5b89aeb93 Aha, works even better now. Made input_tab much more grabby, it touches lastWasTab now also...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@283 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-14 18:25:26 +00:00
Chris Allegretta
022b96f941 Rocco's latest spellcheck fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@282 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-14 17:47:58 +00:00
Chris Allegretta
442f2c5156 Latest tab completion update, sort of works =)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@281 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-14 17:46:06 +00:00
Chris Allegretta
0468612b4d replace update patch from rocco
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@280 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-13 15:45:50 +00:00
Chris Allegretta
271e972ff0 Rocco's changes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@279 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-10 18:15:43 +00:00
Chris Allegretta
a60e02c950 Okay, for some reason the statusq call in do_int_spell wasn't updated
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@278 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-06 13:18:25 +00:00
Chris Allegretta
85b19e9110 *sigh*, okay, if there's only 1 match, dont beep either. Done, I swear
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@277 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-06 05:47:36 +00:00
Chris Allegretta
24dd8d6532 Oops, dont beep so much ;) Yes when we find one match and fill in buf, no otherwise
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@276 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-06 05:45:48 +00:00
Chris Allegretta
24342437c7 Blank edit window when no matches found
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@275 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-06 05:41:20 +00:00
Chris Allegretta
e118acc068 Change num_matches check from if to switch, fix check for num_matches == 0, fix allocation for matchBuf. Ugh.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@274 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-06 05:40:03 +00:00
Chris Allegretta
7d97ce7baf Much more sane matches allocation, beep when multiple matches found, or none...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@273 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-06 04:04:15 +00:00
Chris Allegretta
b684805da7 Add a nice (more) tag when there's too many completions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@272 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-06 02:59:11 +00:00
Chris Allegretta
7da4e9f28b Add tab completion option to statusq and nanogetstr, beep when multiple/no matches found
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@271 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-06 02:57:22 +00:00
Chris Allegretta
7586495813 Okay, now format the matches the right way
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@270 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-05 22:48:35 +00:00
Chris Allegretta
3b0d14444f Oops, free foo and don't allocate it every time throught the loop
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@269 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-05 21:56:54 +00:00
Chris Allegretta
ec58a99326 input_tab: Now autocomplete up until the matches diverge by nanme works, yay
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@268 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-05 21:54:23 +00:00
Chris Allegretta
04d848e6d9 Added tab completion code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@267 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-05 17:54:41 +00:00
Chris Allegretta
27eb13f0fa Rocco's spelling code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@266 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-05 16:52:21 +00:00
Chris Allegretta
71844ba03a Use old-style editing with PICO_MSGS enabled
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@265 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-03 14:23:00 +00:00
Chris Allegretta
67574f483e Format general changes for CVS code the right way
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@264 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-03 03:35:29 +00:00
Chris Allegretta
0bd807782a Fixed bug #45, stupid...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@263 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-03 01:29:37 +00:00
Chris Allegretta
1cc0b7fdca Fixed bug #45, stupid...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@262 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-03 01:29:04 +00:00
Chris Allegretta
90594e268a Update ChangeLog for the stuff I just hacked
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@261 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-02 15:53:40 +00:00
Chris Allegretta
0d1e8d66e4 Make nanoget_repaint be much more eleet. Uses $ for indication of beyond COLS, prompt is always displayed
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@260 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-02 15:30:24 +00:00
Chris Allegretta
92d2bab3ef nanoget_repaint changes, do_writeout fix with var length strings
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@259 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-02 14:53:46 +00:00
Chris Allegretta
f5deac3d0f Oops, fix answer getting borked when using shortcuts at statusbar and nothing's typed
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@258 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-02 05:10:26 +00:00
Chris Allegretta
31925e4517 Allow variable length strings on statusbar
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@257 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-02 04:40:39 +00:00
Jordi Mallach
e7a647c343 Added some missing gettext calls and updated Spanish.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@256 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-01 18:43:21 +00:00
Chris Allegretta
b46df990ad Lend replace_line() a void
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@255 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-01 02:12:13 +00:00
Chris Allegretta
dd5328ccbb Removed null string code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@254 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-31 05:32:22 +00:00
Chris Allegretta
4d29be19c8 Removed null string code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@253 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-31 05:32:09 +00:00
Chris Allegretta
e364740aea Added checks for deleting search string when there was a previous value
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@252 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-31 05:28:50 +00:00
Chris Allegretta
86f8b3a163 Added checks for deleting search string when there was a previous value
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@251 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-31 05:28:33 +00:00
Chris Allegretta
105da33276 Made previous s/r values editable text
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@250 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-31 05:10:10 +00:00
Chris Allegretta
f754eaadd2 Credit Jordi
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@249 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-30 05:12:41 +00:00
Jordi Mallach
0ae0dcd580 Updated Spanish strings for lattest CVS.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@248 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-28 12:38:02 +00:00
Chris Allegretta
9c371a24e3 Converted ifs to switches, added Rocco's optmiization
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@247 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-27 05:48:05 +00:00
Chris Allegretta
462a1997e9 Remove redundant code in do_replace()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@246 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-27 05:33:18 +00:00
Chris Allegretta
810632d666 Bug #46, discovered and fixed
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@245 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-27 04:36:01 +00:00
Chris Allegretta
69fbef6e76 Re-added NANO_NULL_KEY case to search_init code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@244 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-26 12:49:54 +00:00
Chris Allegretta
bd9e7c3c36 Replace with null string option, ran source through indent again
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@243 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-26 01:44:42 +00:00
Chris Allegretta
a0e957bc0d Rocco's findnextstr fixes, lost of other tweaks
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@242 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-24 22:25:36 +00:00
Chris Allegretta
f9b6c9b398 Fixed iris-ansi term problem
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@241 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-18 19:35:59 +00:00
Chris Allegretta
d7934d4c85 Added #ifdef around toggle_regex_msg to get rid of compiler warning (toggle_init())
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@240 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-03 05:39:29 +00:00
Chris Allegretta
de8f833989 configure sync with configure.in *shrug*
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@239 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-03 05:15:59 +00:00
Chris Allegretta
70e82f3084 Back to CVS version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@238 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-03 02:36:50 +00:00
Chris Allegretta
35d90259ed Nano 0.9.19 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@236 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-03 02:32:07 +00:00
Chris Allegretta
07e97d61c0 Updates for upcoming 0.9.19 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@235 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-03 01:52:50 +00:00
Chris Allegretta
71348eeb1f Get rid of punctuation at end of nofollow option, as it was the only one punctuated
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@234 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-02 04:21:23 +00:00
Chris Allegretta
9e7efa3202 Added (int) casts to remove compile warnings with -Wall
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@233 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-02 03:42:55 +00:00
Chris Allegretta
df3afdce0d Added initializations for last_search and last_replace (Rocco Corsi)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@232 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-10-01 17:50:29 +00:00
Chris Allegretta
66989d6ece Changing addresses again
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@231 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-27 03:16:11 +00:00
Chris Allegretta
7c44b68e05 PDCurses support
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@230 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-21 04:27:01 +00:00
Chris Allegretta
ad1daccecc PDCurses support
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@229 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-21 04:25:45 +00:00
Chris Allegretta
4aacee6627 CVS Version update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@228 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-19 00:29:45 +00:00
Chris Allegretta
629edad237 0.9.18 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@226 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-19 00:27:19 +00:00
Chris Allegretta
834a69d5a4 Revised de.po translations by floki@bigfoot.com
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@225 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-18 17:11:33 +00:00
Chris Allegretta
f45c18daa0 Fix bug #44 by Rocco Corsi
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@224 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-16 05:25:06 +00:00
Chris Allegretta
0b88ce08cb Mouse fix for new key handling code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@223 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-15 15:46:32 +00:00
Chris Allegretta
c9f147aba3 Finally closed bug #16 for inactivity, updated TODO
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@222 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-15 13:28:05 +00:00
Chris Allegretta
e7034c6087 onekey() - Off by one error fix fix ;-) (Rocco Corsi)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@221 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-15 03:31:09 +00:00
Chris Allegretta
90bd712c88 Default case for slang AC_TRY_RUNs in configure.in
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@220 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-13 18:12:05 +00:00
Chris Allegretta
9c35eb0def Made insert key call do_insertfile()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@219 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-13 14:24:52 +00:00
Chris Allegretta
92c9dd255c Oops, update editwinrows in window_init()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@218 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-13 14:03:27 +00:00
Chris Allegretta
2a42af1d62 More display updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@217 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-12 23:02:49 +00:00
Chris Allegretta
16e4168993 A heapin spoonful of updates in key handling
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@216 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-11 22:33:54 +00:00
Chris Allegretta
d0dbb40ef6 Oops, I meant in gnome terminal, not xterm ;)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-11 13:36:46 +00:00
Chris Allegretta
91d392cd2b Adding a new BUG and closing out #41
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@214 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-11 13:27:09 +00:00
Chris Allegretta
b9bfc9bc4f back out change in findnexstr that was causing more bugs *sigh*
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@213 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-10 05:06:09 +00:00
Jordi Mallach
2dc0f6b2bf Gettextized the new Meta strings in nano.c and updated es.po.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@212 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-07 10:48:00 +00:00
Chris Allegretta
44e73dfc96 Show two lines from previous page in help file when paging down
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@211 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-07 03:37:38 +00:00
Chris Allegretta
9239d742d6 Use raw mode if _POSIX_VDISABLE isn't available, to allow support under cygwin
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@210 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-06 15:19:18 +00:00
Chris Allegretta
43932bd17b Type in nano.h
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@209 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-06 14:08:37 +00:00
Chris Allegretta
805c26d1a6 Changed _POSIX_VERSION checks in regex code to HAVE_REGEX_H, added check for regex.h in configure.in
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@208 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-06 13:39:17 +00:00
Chris Allegretta
d746d90cc3 Assigned entire file cut a number, crediting Ken in BUGS instead of ChangeLog
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@207 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-05 13:15:44 +00:00
Chris Allegretta
429a5518ea Fix to cut.c for cutting entire file with marker
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@206 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-05 13:09:56 +00:00
Chris Allegretta
bf9da287a0 Changed version and files to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@205 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 17:44:59 +00:00
Chris Allegretta
423cbfd743 off by one in toggle help code and set up for 0.9.17 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@203 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 16:21:29 +00:00
Chris Allegretta
5577aec4e8 5 newlines instead of 4 on suspend and po update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@202 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 03:53:04 +00:00
Chris Allegretta
18f8be0058 Implemented suspend code to work with Meta-Z
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@201 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 03:20:38 +00:00
Chris Allegretta
f8163dc2e7 Added space to autoindent toggle string
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@200 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-03 01:06:40 +00:00
Chris Allegretta
f0f63a82fb Changed awkward messages for no help and no wrap mode toggles
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@199 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 18:44:21 +00:00
Chris Allegretta
a547fd1e0e Removed commented out wrap code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@198 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 17:38:44 +00:00
Chris Allegretta
6306a11ad6 update_line(): Added check for binary data >= 1 and <= 26, and use ^+letter ot display it
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@197 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:55:41 +00:00
Chris Allegretta
9541f2a1d3 credit to Mini edit team for Meta idea
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@196 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:31:32 +00:00
Chris Allegretta
d56bd79daf Fixed typos and updated PO files
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@195 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:27:10 +00:00
Chris Allegretta
e49f123cc0 Moved the toggle Meta keystrokes to the first column. Updated documentation and help code for Meta keys rather than 'alt keys'
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@194 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:20:39 +00:00
Chris Allegretta
4c780be883 Added small message when using --enable-tiny and toggle keys
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@193 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-01 17:59:18 +00:00
Chris Allegretta
220e7fb132 Oops, fixed the VERSION back to -cvs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@192 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-01 13:37:49 +00:00
Chris Allegretta
756f220a26 New toggles for flags via Meta
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@191 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-01 13:32:47 +00:00
Chris Allegretta
cf7c9936ad Updated BUGS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@190 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-30 13:57:36 +00:00
Chris Allegretta
9babaf3b38 findnextstr() - Fixed check for string that only occurs on the same line failing
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@189 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-30 13:49:33 +00:00
Chris Allegretta
340d6e50c2 Made wrapping code less ambitious
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@188 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-29 03:55:29 +00:00
Chris Allegretta
dabc3cb0df Off by one error fix (Rocco Corsi)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@187 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-25 01:44:12 +00:00
Chris Allegretta
e10debd14b Updates by Ben Roberts
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@186 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-22 01:26:42 +00:00
Chris Allegretta
f1d33d30ce Get rid of lack of update when searching andmark is set
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@185 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-19 03:53:39 +00:00
Chris Allegretta
8c81d23a7e Doc updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@184 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-16 02:52:44 +00:00
Chris Allegretta
8d458043d1 cvs branch for 0.9.16
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@183 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 22:11:20 +00:00
Chris Allegretta
5286ccbaf9 0.9.16 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@181 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 22:09:38 +00:00
Chris Allegretta
ba96f7afac Doc updates for 0.9.16 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@180 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 21:38:28 +00:00
Chris Allegretta
a2efc36799 One more time, configure.in slang check
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@179 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 03:26:33 +00:00
Chris Allegretta
e5935973f9 New (and again revised =) slang test code (Albert Chin-A-Young)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@178 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-08 22:00:30 +00:00
Chris Allegretta
13415991e8 Added Id to Makefile.am
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@177 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-08 16:59:04 +00:00
Chris Allegretta
b7ea9d45bb New libm test for slang
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@176 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-08 01:49:55 +00:00
Chris Allegretta
0286ba436e Whoops, must let check for blowing away cutbuffer get run before exit on cutting magic line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@175 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 14:58:26 +00:00
Chris Allegretta
c86f714a15 No more cutting the macic line, added check_statblank() to cut and uncut
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@174 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 14:39:32 +00:00
Chris Allegretta
9b45ff54ac Okay, it's not going to work for Makefile.am
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@173 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 02:25:43 +00:00
Chris Allegretta
2b78429248 More RCS schtuff
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@172 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 02:22:40 +00:00
Chris Allegretta
c87a411624 More RCS schtuff
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@171 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 02:16:24 +00:00
Chris Allegretta
141c1274c4 Testing RCS headers
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@170 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-06 21:13:46 +00:00
Chris Allegretta
11b0011b1f Testing RCS headers
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@169 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-06 21:13:45 +00:00
Chris Allegretta
b4dc9e0944 New slang test code (Albert Chin-A-Young)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@168 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-05 22:49:30 +00:00
Chris Allegretta
81b1eea10f Patch to handle
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@167 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-05 16:09:07 +00:00
Chris Allegretta
7dc14e81d7 Fixed getting locked into cutbuffer on cutting first line of file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@166 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-05 16:03:19 +00:00
Chris Allegretta
4dbcc3cd9e Changed tabsize long arg to actually accept an argument *sigh*
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@165 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 15:44:29 +00:00
Chris Allegretta
1f2a072e33 0.9.15 sync
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@163 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 04:13:43 +00:00
Chris Allegretta
0bf4e146a0 Update of ChangeLog and NEWS for 0.9.15 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@162 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 02:42:04 +00:00
Chris Allegretta
bbd96ea838 Updated man pages for universal -T option
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@161 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 02:05:44 +00:00
Chris Allegretta
5027a18c2c Regenerated Makefile.in with automake -i *shrug*
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@160 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 00:42:16 +00:00
Chris Allegretta
99bf73fe66 Removed now useless usrtabsize variable (Christian Weisgerber)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@159 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 00:22:08 +00:00
Chris Allegretta
d7c31c1123 Bug update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@158 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-03 23:01:12 +00:00
Chris Allegretta
6d690a39dc New tabsize code, Im very excited
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@157 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-03 22:51:21 +00:00
Chris Allegretta
ed02216378 Added recursive loop check
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@156 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-03 16:54:11 +00:00
Chris Allegretta
55d5455abd More BUGS fixed
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@155 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-01 04:26:55 +00:00
Chris Allegretta
5d8f6250de BUGS update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@154 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-31 13:52:20 +00:00
Chris Allegretta
7a6f0d9868 Finally fixed slang check message, or lack of
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@153 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-31 13:00:24 +00:00
Chris Allegretta
145a0450ea Fixed silly page_up_center prototype
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@152 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-31 12:51:00 +00:00
Chris Allegretta
da721be17a Bug fixes for do_enter and do_backspace
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@151 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-31 01:26:42 +00:00
Chris Allegretta
234a34d273 Chris goes berzerk on no sleep
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@150 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-29 04:33:38 +00:00
Chris Allegretta
84ff479b24 Updated html man page
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@149 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 17:29:22 +00:00
Jordi Mallach
3206ab4fe0 Added a reference to -k, --cut option. Need a nano.1.html update!
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@148 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 16:55:47 +00:00
Chris Allegretta
f5d7a8b4fd Back out edit_refresh->edit_update until page up/down problems are fixed
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@147 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 15:33:03 +00:00
Chris Allegretta
d069ac02d1 More bugs, YAY
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@146 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 14:34:48 +00:00
Chris Allegretta
d63d11be58 Sigh, cancel that
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@145 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 14:09:29 +00:00
Chris Allegretta
1a471392c5 Another page_down tweak
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@144 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 14:08:01 +00:00
Chris Allegretta
f6a6b5aa86 Fix for page down onto EOF
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@143 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 12:24:43 +00:00
Chris Allegretta
95b0b5249a edit_refresh()->edit_update() redundancy
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@142 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 02:58:06 +00:00
Chris Allegretta
29d9025381 Got to love typos
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@141 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 01:48:43 +00:00
Chris Allegretta
6925bbd360 Added null_at()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@140 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 01:41:29 +00:00
Chris Allegretta
18bd029981 Bugfixes and cruft cleanout take 1
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@139 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 01:18:10 +00:00
Chris Allegretta
7975ed86a7 New cvs code, data abstraction is good
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@138 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 00:58:35 +00:00
Chris Allegretta
a1a55c79c8 official 0.9.14 sync
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@136 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-28 00:36:03 +00:00
Chris Allegretta
2ece167f56 Revised germal translation by floki@bigfoot.com
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@135 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 15:25:52 +00:00
Chris Allegretta
0e5faca531 Added documentation for all the -k cut changes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@134 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 13:32:46 +00:00
Chris Allegretta
939fdbd64d Last minute touches on -k code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@133 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 13:03:31 +00:00
Chris Allegretta
293849eb69 This should finish the -k functionality. Would someone be kind enough to test this against Pico and send me a comparison?
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@132 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 05:09:22 +00:00
Chris Allegretta
1013e14a87 Updated BUGS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@131 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 04:31:52 +00:00
Chris Allegretta
63aa0f7f16 More -k fixes, almost works perfectly ;-)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@130 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-27 04:09:23 +00:00
Chris Allegretta
cf037ba969 0.9.14-pre1 sync
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@128 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-25 03:38:15 +00:00
Chris Allegretta
45dfda97d8 slightly better cut to end behavior, still doesn't preserve cutbuffer w/multi line cuts
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@127 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-25 03:20:07 +00:00
Robert Siemborski
c9b1dba4a3 continued existance of do_justify bug documented (#31)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@126 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-25 02:19:07 +00:00
Robert Siemborski
a417ddca91 some random totsize-related bugfixes. (do_justify & do_wrap)
shouldn't break anything (famous last words)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@125 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 23:18:48 +00:00
Chris Allegretta
461b2a9dfe More -t and exit fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@124 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 22:05:18 +00:00
Chris Allegretta
962c3c9c21 Fix for bug #30, I hope it doesn't break anything else
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@123 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 21:52:17 +00:00
Chris Allegretta
05597197f3 doc updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@122 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 21:16:12 +00:00
Chris Allegretta
f4e75e1256 Fixed bug #31
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@121 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 18:28:30 +00:00
Chris Allegretta
d8346ffb84 Fix -k sets TEMP_OPT
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@120 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 15:16:02 +00:00
Chris Allegretta
90d6895e94 anchor fix in FAQ
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@119 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-24 02:55:49 +00:00
Chris Allegretta
f1171c3c0e Marked cut to end of line as done
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@118 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-23 21:56:01 +00:00
Chris Allegretta
723845c0cc Changed to CVS version #
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@117 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-23 18:15:28 +00:00
Chris Allegretta
1d7110d657 Oops, screwed up ChangeLog for 0.9.13
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@116 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-23 16:59:07 +00:00
Chris Allegretta
edebbe6039 0.9.13 sync
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@114 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-23 16:45:20 +00:00
Chris Allegretta
065bb1e1a0 Added FAQ
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@113 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-23 16:09:33 +00:00
Chris Allegretta
231d3d6979 Update BUGS for closed bugs and update NEWS for the upcoming .13 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@112 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-22 19:33:19 +00:00
Chris Allegretta
acb6234263 Added code to check to see if using -l and the file is not fact a link. Please test
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@111 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-21 22:42:46 +00:00
Chris Allegretta
8f6c069543 Spelling, Read_file and term setting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@110 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-19 01:16:18 +00:00
Robert Siemborski
fcf32bf3d1 more intelligent filename selection in die()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@109 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-17 03:04:54 +00:00
Robert Siemborski
aa44841315 cleaned up BUGS so open bugs were separate from closed ones
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@108 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-17 02:54:17 +00:00
Chris Allegretta
a299b039c4 Better fix for bug #29
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@107 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-14 02:44:02 +00:00
Chris Allegretta
3088555a15 Changed static temp_opt to flag TEMP_OPT. Fixed bug #29
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@106 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-14 01:20:12 +00:00
Jordi Mallach
8d7ac1b004 Updated es.po to 0.9.13 strings, rebuilt po's and gmo's.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@105 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-13 03:10:01 +00:00
Chris Allegretta
82bd1b34f2 Added bug #29
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@104 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-12 23:57:25 +00:00
Chris Allegretta
d19e9916cb #ifdef'ed -k option for not NANO_SMALL b/c it requires the marker code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@103 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-12 18:14:51 +00:00
Adam Rogoyski
ed0cb890fb - refreshing fixes.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@102 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-12 04:02:45 +00:00
Chris Allegretta
fa8f7bf0dc Fixed consecutive search substring replace bug (28)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@101 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-12 02:41:13 +00:00
Chris Allegretta
6a2273d781 Added some bugs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@100 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-12 02:28:33 +00:00
Chris Allegretta
627de19ce0 Added Pico's -k option (in 5 lines of code :-)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@99 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-12 02:09:17 +00:00
Chris Allegretta
7539a829c4 French update by Clement Laforet <clem_laf@wanadoo.fr>
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@98 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-09 23:55:13 +00:00
Adam Rogoyski
a966d991e6 - findnextstr() off by one with past_editbot.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@97 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-09 18:42:53 +00:00
Chris Allegretta
635fae3ed0 Removed search/replace abort call before calling other search/replace function.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@96 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-09 03:26:34 +00:00
Adam Rogoyski
2a4ef924c8 - change findnextstr() to only edit_update if we have gone off the screen.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@95 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-09 00:15:11 +00:00
Chris Allegretta
a4d2162091 Added '(to replace)' to prompt in search_init when we are replacing
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@94 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-08 23:57:03 +00:00
Robert Siemborski
6967eec4cb Bill's TABSIZE fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@93 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-08 14:23:32 +00:00
Robert Siemborski
7ecc435f5a bring up to date with project
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@92 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-08 05:15:45 +00:00
Adam Rogoyski
1e328fbd72 - change lines ==> num_lines to avoid name conflict on AIX with xlC.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@91 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-08 03:57:16 +00:00
Chris Allegretta
688fc032b3 Sync with official 0.9.12 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@89 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-08 01:47:51 +00:00
Chris Allegretta
b275aacc3f Trivial fix for 'winio.c:564: warning: `/*' within comment'
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@88 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-08 01:22:33 +00:00
Robert Siemborski
20d61d5628 updates to winio.c rev 1.20
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@87 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-08 00:43:35 +00:00
Robert Siemborski
9d58455825 lots of commenting for display functions, so hopefully future people
will have an easier time understanding it than I first did ;)

Also, a removal of a redundant call to mvwaddnstr.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@86 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-08 00:41:29 +00:00
Chris Allegretta
e955dae711 Updated docs for impending 0.9.12 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@85 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-07 22:24:59 +00:00
Chris Allegretta
68b12334d5 More regexp fixes by bill
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@84 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-07 13:10:28 +00:00
Chris Allegretta
dba37aef66 Added stdlib.h to winio.c includes, found by OpenBSD gcc.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@83 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-07 05:13:09 +00:00
Chris Allegretta
f6b13420d7 Regexp/search fixes by Bill Soudan
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@82 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-07 04:25:00 +00:00
Chris Allegretta
a408edd486 Updated man page slightly and redid html man page
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@81 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-07 04:20:09 +00:00
Chris Allegretta
47805612c3 Added _POSIX_VERSION check to regexp code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@80 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-07 02:35:34 +00:00
Robert Siemborski
cdff015d06 help_init newline change
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@79 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-07 01:58:52 +00:00
Chris Allegretta
9fc8d43a82 New regexp search feature by Bill Soudan
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@78 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-07 01:49:52 +00:00
Chris Allegretta
5537387352 Increment totsize when recreating magic line in backspace and delete
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@77 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-06 22:38:37 +00:00
Robert Siemborski
976847c016 moved '\n' outside of if at bottom of help_init
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@76 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-06 03:43:05 +00:00
Robert Siemborski
82e603d273 brought up to date due to recent totsize fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@75 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-06 02:18:22 +00:00
Adam Rogoyski
acf71da636 - page_down() do not edit_update() if we are moving to the bottom of the file
and the bottom is currently in the edit buffer.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@74 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-06 02:14:06 +00:00
Adam Rogoyski
01dc83ae12 - remove old assert() from do_wrap().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@73 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-06 02:01:44 +00:00
Chris Allegretta
28a0f89d90 Add magic line code to do_backspace() and do_delete()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@72 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-05 22:47:54 +00:00
Robert Siemborski
29e9a76f36 additional fix_editbot call
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@71 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-05 03:16:04 +00:00
Robert Siemborski
e0e568fe17 bugfix for page_down_center
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@70 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-05 03:08:28 +00:00
Robert Siemborski
23ecb17595 totsize and magic line changes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@69 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-04 22:21:40 +00:00
Robert Siemborski
63b3d7e0c0 Magic Line Code Added
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@68 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-04 22:15:39 +00:00
Robert Siemborski
66b0fc5b6c cuting newline-related totsize fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@66 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-04 21:29:24 +00:00
Robert Siemborski
deca3e727a updated for fix_editbot changes...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@65 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-04 02:40:41 +00:00
Robert Siemborski
dd53ec2a87 Fixed 2 FIXMEs in nano.c:
do_enter: the reset_cursor was needed. code cleaned up a bit with a comment
          explaining the situation there.
do_justify: the second edit_refresh exposed a bug in how we were updateing
            editbot when we needed to rebuild it.  This functionality has
            been moved into winio.c:fix_editbot, and all places that were
            doing so that I could find have been updated. (files.c:
            do_insertfile, nano.c: handle_sigwinch and do_justify)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@64 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-04 02:35:19 +00:00
Chris Allegretta
48fd2cb833 Oops, fix was really in edit_update_top in winio.c
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@63 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-03 04:31:13 +00:00
Chris Allegretta
1e57e68e57 Fixed a bug in page_down() and moved page_up() to move.c where it belongs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@62 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-03 04:24:39 +00:00
Chris Allegretta
67105eb11f Oops, fix for --enable-tiny
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@61 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-03 03:18:32 +00:00
Chris Allegretta
dbc12b2070 Removed do_oldspell() and put an ifdef around do_spell()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@60 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-03 03:10:14 +00:00
Robert Siemborski
6d0e9cd556 changed all 'sprintf' calls to 'snprintf'
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@59 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-01 21:43:16 +00:00
Robert Siemborski
6af1431eaa changed all 'sprintf' calls to 'snprintf'
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@58 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-07-01 21:34:26 +00:00
Chris Allegretta
715e7dd403 Change 'To Replace' to just 'Replace', more like Pico
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@57 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-30 20:35:26 +00:00
Chris Allegretta
518b8ef7a2 Um, the translation for No Replace is NOT the same as for Replace...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@56 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-29 01:34:54 +00:00
Chris Allegretta
8c2b40f06c Made search functions and keys more like Pico
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@55 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-29 01:30:04 +00:00
Chris Allegretta
8b709372b7 Removed gettext calls for Yes, No, etc. till we decide if we translate them...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@54 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-24 01:39:07 +00:00
Chris Allegretta
f7eba0ba8b Finnish translation by pauli.virtanen@saunalahti.fi
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@53 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-24 01:33:27 +00:00
Jordi Mallach
0b0fc4944f Removed gettext calls for "Yes", "No", etc. till we decide if we translate
them. Updated po's and gmo's and pot to reflect this.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@52 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-23 01:00:13 +00:00
Chris Allegretta
5204ea9e86 Removed now unnecessary raw/cbreak combos.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@51 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-22 01:56:23 +00:00
Chris Allegretta
6e80585b0d New german translation by floki@bigfoot.com
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@50 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-22 01:53:29 +00:00
Chris Allegretta
8a9fe7e4dd Oops, two alt_speller vars
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@49 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-21 22:29:38 +00:00
Chris Allegretta
5a4eb33590 Oops, two alt_speller vars
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@48 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-21 21:26:31 +00:00
Jordi Mallach
fc5fb2ea48 small, stupid, trivial modification to test write access. It worked!
Key bindings on ^X need not to be hardcoded, in the meanwhile, I
untranslated "S" to "Y".


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@47 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-06-21 15:31:48 +00:00
44 changed files with 7442 additions and 3014 deletions

View File

@@ -224,3 +224,4 @@ distribution.
If December 1997 seems to be old, you may fetch a more recent copy
of this `ABOUT-NLS' file on most GNU archive sites.
$Id$

View File

@@ -1,9 +1,10 @@
$Id$
This file lists people who have made significant contribution to the nano
editor. Please see the ChangeLog for specific changes by author.
-------------------------------------------------------------------------
Chris Allegretta <chrisa@asty.org>
* Main program author and maintainer
* Main program author and maintainer.
Jordi Mallach <jordi@sindominio.net>
* Debian package maintainer, fellow bug squasher.
@@ -16,5 +17,5 @@ Adam Rogoyski <rogoyski@cs.utexas.edu>
Robert Siemborski <rjs3@andrew.cmu.edu>
* Miscellaneous cut, display, replace, and other bug fixes,
original "magic line" code, read_line() function, new
original and new "magic line" code, read_line() function, new
edit display routines.

70
BUGS
View File

@@ -1,13 +1,10 @@
- Marked cutting sometimes leaves a newline in the file unintelligently,
such as when all of a line is selected but the mark doesn't proceed to
the new line. (8) { Is this an issue? compare to pico 3.5 }
- Certains are not lined up properly when there are tabs in them at
certain col values. (9) [FIXED]
- edit_refresh() and update_line() do not handle selecting text when the
cursor is beyond COLS (10) [FIXED]
- no way to do a replace with the empty string. (11)
- no way to do a replace with the empty string (11) [FIXED, yay!]
- Spelling support is not elegant like pico's integration of the 'spell'
program. Nano only uses ispell (for now) (12)
program. Nano only uses ispell (for now) (12) [FIXED]
- Moving to the end of a line when close to a multiple of COLS and at
least COLS * 2 does not make the screen jump early like it would for
if we were around COLS (bugs in edit_refresh, update_line) (13)
@@ -18,22 +15,73 @@
- Doing a replacement of a substring of the replace string (e.g. replacing
"ed" with "fred" causes an infinite loop. (15) [FIXED]
- Cutting a file with marked text and both marker ends on the same line
causes a random segfault (16)
causes a random segfault (16) [FIXED]
- Cutting more than one line resets the KEEP_CUTBUFFER flag in 0.9.3
Error is in bitwise assignment (nano.h). (17) [FIXED]
- The wrapping code does not work right for lines like the following:
* *
Error is in do_wrap, must be rewritten (18).
- Wrapping a line with autoindent mode sometimes causes a segfault (19).
Error is in do_wrap, must be rewritten. (18) [FIXED]
- Nano fails to follow symlinks, even though -l isn't being used (20).
[Bug in global flag init, FIXED]
- When using --help or --version, the SIGINT character gets lost. (21) [FIXED]
- When inserting files, the display sometimes fails to display properly
until a pageup/down occurs (22).
- edit_refresh() and update_line() (and related functions), have
trouble when a tab is the character that is the boundry at COLS (23) [FIXED]
- there is an off-by-one error in keeping track of totsize. It is caused
by the fact that we count the newline at the end when we read in a file
but we do not, in fact, display this newline. This should go away
implicitly when the "Magic Line" returns, but it is noted here for
documentation's sake. (24)
documentation's sake. (24) [FIXED]
- In replace with completely adjacent strings, every other search string
will be missed (try replace ':' in a string like ':::::::::') (28) [FIXED]
- If nano opens a read-only file with the --tempfile option, and a change
is made to the buffer, and a write is attempted, nano will not give you
a dialog about not being able to write the file, and it will not let the
user exit (29, discovered by Joshua Jensen) [FIXED]
- Using nano -k, marked text is not cut properly. (31) [FIXED]
- Invoking -t or -k has the effect of invoking both option. (32) [FIXED]
- totsize becomes incorrect after word-wrapping (25) [FIXED]
- Wrapping a line with autoindent mode sometimes causes a segfault (19)[FIXED]
- When inserting files, the display sometimes fails to display properly
until a pageup/down occurs (22)[FIXED]
- In search/replace code there is too much refreshing in bottomwin (26)
[FIXED]
- In replace, there is no way to accept the default replace string. (27)
[FIXED]
- Using nano -t, user can not exit until a filename is given via ^O. (30)
[FIXED]
- Using -k cut text is not pasted properly. (34) [FIXED].
- Using -k pasted text is not updated properly if it goes beyond editbot. (35)
[FIXED]
- Doing a cut with -k can screw up the filestruct, fault is in cutting
code. (36) [FIXED]
- Hitting enter on the magic line makes new lines, but they are not
written out to disk when saved..... (37). [FIXED]
- Page up and page down do not work the same way as Pico (# of lines). (38)
[FIXED]
- When doing a search and the marker is set, the screen does not always
properly update the inverted text (39). [FIXED]
- Searches for a string that only exist on one line multiple times will
fail after finding the last occurance (discovered by Ken Tyler) (40). [FIXED]
- Alt-Z is current broken to toggle suspend. I guess I still don't know
signals very well =-) (41) [FIXED].
- Unable to cut the entire file using the marker (discovered by Kev Tyler)
(42). [FIXED]
- The keypad does not work when nano runs in the Gnome terminal (43). [FIXED]
- When reading in a file, if the file is a directory the contents of the
file being edited are blown away (discovered by Chris Pimlot) (44). [FIXED]
- in certain terms, nano will leave a "ghost" of screen upon exit
when called from inside mutt (among other settings) (45). [FIXED]
- In replace, hitting the Goto line shortcut key does nothing after a
search string is entered (discovered by Rocco Corsi) (46) [FIXED].
- When typing in a string in serahc or replace and hitting CASE_SENSITVE
or the other search string, the current string edit is blown away in
favor of the last stored search (47) [FIXED]
** Open BUGS **
- Marked cutting sometimes leaves a newline in the file unintelligently,
such as when all of a line is selected but the mark doesn't proceed to
the new line. (8) { Is this an issue? compare to pico 3.5 }
- totsize problems still abound in do_justify (33).
$Id$

398
ChangeLog
View File

@@ -1,3 +1,399 @@
nano 0.9.20 - 11/18/2000
- General
- Ran source through indent -kr again. Make everything pretty.
- Changed behavior of "search" and "replace" prompts to make all
previous values editable. This change was made so that you can
replace with the null string without needing a special key for it.
changed code in search_init(), do_replace(), nanogetstr (see
below).
- Added some missing gettext calls here and there (Jordi).
- Revamped nanogetsr() and calls to it to use variable length strings.
MANY changes in nanogetstr(), many chances in search.c, new
function mallocstrcpy which is sure to be a programmatic
nightmare, changed last_search, last_replace, answer to
pointers. New function not_found_msg in search.c for displaying
truncated strings in satusbar when the string is not found
(-pedantic fixes by Rocco Corsi). We disable this feature when
using PICO_MODE (-p).
- New spelling code by Rocco Corsi. New functions
do_int_speller, do_alt_speller, changes to do_spell in nano.c,
New functions search_init_globals and do_replace_loop, changes
to search_init(), do_replace, findnextstr, moved last_search and
last_replace back to nano.c (*shrug*).
- New tab completion code. Used check_wildcard_match, input_tab,
cwd_tab_completion, username_tab_completion from busybox,
hacked them a lot, changes to nanogetstr(). nanogetstr() and
statusq() now take an arg for whether or not to allow tab
completion.
- Fixed value being input in statusbar during a search or replace
and CASE_SENSITIVE or the other search is called and the
string being typed in is blown away. Reported by Ken Tyler.
- Changed PICO_MSGS flag to PICO_MODE, changed help strings
accordingly.
- files.c:
do_writeout()
- Change strcpy to answer to mallocstrcpy.
- global.c
- New global replace_list_2, for 2nd half of the replace dialog
("Replace with:"), has fewer options than first half because
they were inapropriate.
toggle_init()
- Added #ifdef around toggle_regex_msg to get rid of compiler
warning.
- nano.c:
keypad_on()
- New function, toggles turning the keypad on and off in edit and
bottomwin(). Added call to this in finish(), fixes bug #45.
- search.c
findnexstr()
- New arg for begin_x variable, basically a rewrite that
makes a little more sense and isn't quite as messy (Rocco Corsi).
- Update the line we're checking if not the whole screen, because
it's quite possible the search team could exist somewhere way
to the right on the same line, for example.
replace_abort()
- Add reset of placewewant, stops cursor from jumping when moving
cursor after a replace.
do_replace()
- Added code for Gotoline key after entering the search term.
Fixes bug #46.
- Removed redundant code involving processing replacemenet string.
Converted if statements to switch statements.
- Optimizations by Rocco Corsi.
- Removed code for deleted shortcuts from in replace_list_2.
do_search()
- Converted if statements to one switch statement.
- winio.c
nanogetstr()
- Added check for 343 in while loop to get rid of getting "locked"
into statusbar" bug in odd $TERMs like iris-ansi.
- Changed check to return -2 on "enter" from answer == ""
to answer == def.
- Fixed fallthrough code because there was no break. Make much
more sense now.
- Added check for ASCII 54[124] when using PDCURSES, ignore them
if noticed.
nanoget_repaint()
- New function, removes about 30 lines of duplicate code in
nanogetstr().
- Black magic code to make $ appear in prompt if we're past
COLS.
blank_edit()
- Removed wrefresh() call, much less choppy now. If there's a need
for a wrefresh after a specific call, let me know.
- es.po:
- Updated translation for 0.9.20 (Jordi).
nano 0.9.19 - 10/02/2000
- General
- Added PDCurses support under cygwin, which allows building
a nice stand-alone nano.exe for those poor Windows users.
Extra check in configure.in for initscr() in -lcurses (as
PDcurses has no tgetent), some #ifdef PDCURSES statements
in main().
- Changed web site and email to new nano-editor.org domain.
- nano.c
- Added (int) casts to remove compile warnings with -Wall.
main()
- Added check for _POSIX_VDISABLE around term variable definition.
- search.c
- Added initializations for last_search and last_replace (Rocco Corsi)
nano 0.9.18 - 09/18/2000
- General
- Changed _POSIX_VERSION checks in regex code to HAVE_REGEX_H,
added check for regex.h in configure.in.
- configure.in:
- Added default case for cross-compiling to get rid of annoying
AC_TRY_RUN warning.
- cut.c:
do_cut_text()
- Don't immediately abort if we're on filebot and the marker is
set (fixes bug #42).
- files.c:
open_file()
- Fix for bug #44 (Rocco Corsi).
- global.c:
shortcut_init()
- Added in FKEYs that for some reason were left out. *boggle*
- nano.c:
main()
- Added check for _POSIX_VDISABLE and use raw mode if not
available, allows nano to work with cygwin.
- Added gettext calls to enable/disable strings (Jordi).
- Revamped a great deal of the F-key and keypad key handling,
because we not longer use keypad() (see below).
- Removed keypad() call because nano was not working with the
keypad in many terms, which is very bad.
- Made insert key call do_insertfile().
do_toggle()
- Rewrote function to allow NOHELP toggle to wotk on systems
without a working resizewin(). New function window_init().
mouse_init()
- Add keypad only if mouse support is on, otherwise mouse doesn't
work. I guess you have to choose between having the mouse and
having a working keypad for the time being (thank god for Meta-m).
- winio.c:
total_refresh()
- Added titlebar() call.
onekey()
- Off by one error fix fix ;-) (Rocco Corsi).
- search.c:
findnextstr()
- Reset starting at current for search instead of begin.
- es.po:
- Translated new strings and minor updates (Jordi).
- de.po
- Revised translations by floki@bigfoot.com
nano-0.9.17 - 09/04/2000
- General
- New shortcuts to toggle certain options that are normally only
flags via Alt/Meta. See Alt-C,E,I,K,M,P,X,Z. New struct called
toggles in nano.h, toggle_init(), toggle_init_one() in global.c
called from shortcut_init(), and do_toggle in nano.c. Also
moved the signal code into a separate function in nano.c called
signal_init(). Moved "struct sigaction act"into a static in
nano.c.
- Changed from Alt-key symbol (@) which is completely nonstandard
to the *nix "Meta" symbol (M-). Changed help_init to show
the M-key usage and the help text to explain keys whcih generate
Meta. Moved the toggle Meta keystrokes to the first column
instead of the third as they are the primary keystrokes for the
functions. Thanks Mini editor team :->
- Changed last_search and last_replace vars to statically
allocated (hence nulled) and moved to search.c (Matt Kraai).
- global.c:
toggle_init()
- Changed "No auto wrap" and "No help mode" to "Auto wrap" and
"Help mode". See the change to do_toggle() below.
- nano.c:
do_mouse()
- Patch for handling lines w/tabs and mouse better (Ben Roberts).
do_wrap()
- Made wrapping code less ambitious.
do_toggle()
- Added checks for no help and no wrap mode, and print opposite
enable/disable message.
do_suspend(), do_cont():
- New functions, handle suspend signal in a Pico-like manner and
work with Meta-Z.
- winio.c:
total_refresh()
- Added edit_refresh() call to actually update the screen if messy.
edit_refresh_clearok()
- New function, does a total update for edit refresh, needed to fix
lack of reversed text on searching with MARK_ISSET.
onekey()
- Off by one error fix (Rocco Corsi).
update_line()
- Added check for binary data >= 1 and <= 26, and use ^+letter
to display it. Should fix editing text files with binary
data in them. Placing of the cursor seems to be a bit screwed
though...
- search.c:
search_abort()
- Now calls edit_refresh_clearok when MARK_ISSET to handle screen
ugliness bug (reported by Ken Tyler).
findnextstr():
- Added reset for placewewant (Ben Roberts).
- Fixed check for string that only occurs on the same line failing
(discovered by Ken Tyler).
nano-0.9.16 - 08/09/2000
- cut.c:
do_cut_text()
- Fixed getting locked into cutbuffer on cutting first line of file.
- Added check_statblank().
- Check for fileptr == filebot, if so return, we shouldn't bother
cutting the magic line.
do_uncut_text()
- Added check_statblank().
- nano.c:
main()
- Changed tabsize long arg to actually accept an argument *sigh*.
- po/Makefile.in.in:
- Patch to handle $DESTDIR (orig by Dan Harnett contributed by
Christian Weisgerber)
- configure.in:
- New (and severally revised =) slang test code (Albert Chin-A-Young)
nano-0.9.15 - 08/03/2000
- Changed edit_update call to take arguments TOP, CENTER or BOTTOM.
Affects many many functions. Removed functions edit_update_top and
edit_update_bot.
- Added global variable tabsize, we no longer screw with the curses
library in order to implement -T (suggested by Christian Weisgerber).
- configure.in:
- Finally fixed check for slang to report "no" if not called
with --with-slang or --without-slang
- nano.c:
splice_node()
- New function, abstracts linking in nodes. Fixes bug #36.
null_at()
- New function, nulls a string at a given index and realigns it.
delete_buffer()
- Removed, same as free_filestruct().
do_backspace()
- Now calls page_up_center instead of page_up (as it should?)
do_enter()
- Fixed typo (?) in check for inptr->next. Caused lots of
grief for editing lines at filebot.
main()
- Removed now useless usrtabsize variable (Christian Weisgerber).
- search.c:
replace_abort()
- redundant, now just calls search abort until it does something
different.
- winio.c:
edit_refresh()
- Added check for current line "running" off the screen.
Hopefully this will not cause any recursive lockups.
(Who am I kidding, of course it will!)
- Added check to stop infinite loop calling edit_update.
edit_update()
- Rewritten, hopefully this will remove a lot of the
scrolling the cursor back and forth needlessly.
- move.c:
page_down()
- do an edit_update() at last case. Made function more like
Pico's version, only move down to two lines before editbot.
page_up()
- Made function more like Pico's version, only move down to two
lines after edittop.
nano-0.9.14 - 07/27/2000
- nano.h:
- Set CUT_TO_END to a different bit than TEMP_OPT. Fixes bug #32.
- cut.c:
do_cut_text()
- Added check for MARK_ISSET when using CUT_TO_END. Fixes bug #31.
- Simplified check for freeing cutbuffer. Added checks for doing
multiple cuts with -k, now sets marked_cut to 2 for later
processing by do_uncut_text().
do_uncut_text()
- Added handler for uncutting with -k cuts.
- files.c:
write_file()
- Removed (redundant) check for writing out files with -t.
do_writeout()
- Changed check for filename to filename[0]. Added some code,
overall fixes bug #30 =-)
- nano.c:
do_justify() & do_wrap():
- totsize-related fixes (Rob)
- de.po
- Revised translations by floki@bigfoot.com
nano-0.9.13 - 07/23/2000
- Implemented Pico's -k mode. New flag CUT_TO_END, option (-k, --cut),
affects do_cut_text in cut.c. Not available with SMALL_NANO because it
depends on the marker code which is not available with that setting.
- Changed static temp_opt to flag TEMP_OPT. Fixed bug #29 (using
-t with an unwritable file causes users to get locked into editor).
- move.c
page_down()
- Don't edit_refresh() if the bottom of the file is in the edit
buffer. (Adam)
- nano.c:
main():
- TABSIZE now set before first call to edit_refresh (Bill Soudan)
- Different ^C kill code (patch by Christian Weisgerber).
die():
- More intelligent emergency-save filename selection (Rob)
do_spell():
- Changed exit semantincs a bit so that aspell wouldn't get
all screwy (bug disovered by Joshua Jensen.
- files.c:
read_file():
- Added init of buf variable, hopefully this will stop the
"bleeding" of text seen with mutt and using i18n.
write_file():
- Added code to check to see if using -l and the file is not
in fact a link. This should fix the behavior where a file
that does not have write permission but could be removed and
rewritten is saved without error. Please test this feature
and give feedback.
- search.c:
search_init():
- Added " (to replace)" statement to end of search string if
we are doing a replace. Manually converted all the translations
from '%s' to '%s%s' to ensure they still work with the new code.
Also put in the translation for " (replace)" in the .po's. Hope
I didn't step on your toes doing this Jordi. (Chris)
do_search(), do_replace():
- Removed call to search_abort()/replace_abort() before call to
the opposite function.
- Fixed bug #28.
findnextstr()
- do not center string found if it is currently visable. (Adam)
- fr.po:
- French update by Clement Laforet <clem_laf@wanadoo.fr>.
- es.po:
- Updated strings to 0.9.13 (Jordi).
nano-0.9.12 - 07/07/2000
- all:
- New regexp search feature by Bill Soudan. New flags USE_REGEXP
and REGEXP_COMPILED, new functions regexp_init, regexp_cleanup
replace_line, replace_regexp in search.c, changes to
search_init() and do_replace() and strstrwrapper().
- Added _POSIX_VERSION check to regexp code. Better than nothing
for non-POSIX systems...
- Made search functions & keys more like Pico. Added goto line from
search and replace function, changed wording to "No Replace" instead
of "To Search", "To Replace" to simply "Replace", and changed to
Pico's keystroke by default, ^R. Affects search_init(),
do_search() in search.c, globals in nano.h and
shortcut_init() in global.c.
- changed 'sprintf' calls to safer 'snprintf' (Rob)
- cut.c
- further totsize update corrections
- files.c:
- changed do_insertfile to call fix_editbot (Rob)
- Magic Line code in read_file (Rob)
- nano.c:
- Removed dual alt_speller variables, oops! (Rocco Corsi)
- Removed unnecessary do_oldspell function (Rocco Corsi). Added
SMALL_NANO #ifdef around actual spell function.
- Moved page_up() to move.c where is belongs.
- Corrected FIXME in do_enter with explanation. (Rob)
- Fixed FIXME in do_justify, resulted in creation of
fix_editbot [also fixed in do_enter] (winio.c) (Rob)
help_init():
- Moved newline out of if statement (Rocco Corsi)
do_char():
- Magic Line related code in do_char (Rob)
do_backspace(), do_delete():
- Added magic line code here too.
- de.po:
- Revised translations by floki@bigfoot.com.
- fi.po:
- Finnish translation by pauli.virtanen@saunalahti.fi.
- utils.c:
- Added new_magicline()
- winio.c:
- Added stdlib.h to includes, found by OpenBSD gcc.
- lots of new commenting around display functions
do_yesno(), nanogetstr():
- Removed now unnecessary raw/cbreak combos.
- Removed gettext calls from "Y(es)", "N(o)", "A(ll)" and "^C", till
we decide if those keybindings should be translated. (Jordi)
clear_bottomwin():
- Removed wrefresh(edit) call.
edit_update_top():
- Fixed a bug that caused nano to not update when
current->next == NULL (e.g. paging down to the very bottom of
ABOUT NLS wouldn't work).
fix_editbot:
- Added (should rebuild editbot from a valid edittop) (Rob)
edit_add:
- removal of redundant call to mvwaddnstr
nano-0.9.11 - 06/20/2000
- New flag "-T" or "--tabsize" to specify how to display tab widths.
Affects main() in nano.c, strlenpt(), xpt() and actual_x() (et al) in
@@ -711,3 +1107,5 @@ nano 0.7.6 - 01/15/2000
0.2 Read in data to buffer, bound keystrokes to stub functions,
initial cursor movement on screen. Initial autoconf support.
0.1 Initial program setup w/ncurses
$Id$

View File

@@ -180,3 +180,5 @@ operates.
script, and exit.
`configure' also accepts some other, not widely useful, options.
$Id$

View File

@@ -1,3 +1,4 @@
## $Id$
bin_PROGRAMS = nano
nano_SOURCES = cut.c \
files.c \
@@ -14,7 +15,8 @@ man_MANS = nano.1
nano_LDADD = @INTLLIBS@
EXTRA_DIST = AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README \
TODO install-sh missing mkinstalldirs nano.1 nano.1.html
TODO install-sh missing mkinstalldirs nano.1 nano.1.html \
faq.html
SUBDIRS = po intl

View File

@@ -94,7 +94,7 @@ nano_SOURCES = cut.c files.c global.c move.c nano.c nano.h proto.h
man_MANS = nano.1
nano_LDADD = @INTLLIBS@
EXTRA_DIST = AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README TODO install-sh missing mkinstalldirs nano.1 nano.1.html
EXTRA_DIST = AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README TODO install-sh missing mkinstalldirs nano.1 nano.1.html faq.html
SUBDIRS = po intl

88
NEWS
View File

@@ -1,3 +1,89 @@
11/18/00 - Nano 0.9.20 is finally out the door. Probably the biggest
change is the brand new way nano displays previous search
and replace strings (they are now editable!) This is a
break from Pico's (inconsistent) interface, so if you
don't like the new way, "Pico" mode (-p on the command
line or Meta-P within nano) still works the "old"
way.
Other new features include being able to deal with
search strings of any length, a new internal spell feature
(courtesy of Mr. Rocco Corsi) and tab completion when
reading in or writing out files! There's also the usual
billion or so bug fixes. Feedback on this release is
welcome because so much much has changed, especially with
the previous string display in search and replace. Email
-> nano@nano-editor.org <-. If you like something, don't
like something, or just want to order a pizza, let us know!
10/02/2000 - Nano 0.9.19 is the "Chris is getting married in less than
a week and needs a distraction" release. There are only
a few actual code changes, mainly portability and compiler
warning fixes. Nano now also supports PDCurses, which
enables easily-built nano executables for Windows NT
and 95/98 for the brave. The official nano site has
changed (again) as well, check out www.nano-editor.org for
all the latest nano schtuff.
09/18/2000 - Nano 0.9.18 is unleashed. It has some new keyboard
handling code, cygwin support out of the box, and
a more portable handler for the NOHELP toggle. There
is also a fix for a somewhat serious bug whereby trying
to insert a directory instead of a normal file would
destroy the contents of the editor. A must-see. Four
stars.
09/04/2000 - Nano 0.9.17, the Labor Day release, is released after a
quiet spell (almost an entire month since last release!)
New features include better (not yet perfect) binary
display support and toggle support for most of the program
flags (M-c, M-i, M-z, M-x, M-p, M-w, M-m, M-k and M-e for
-c, -i, -x, -p, -w, -k, and -R).
08/09/2000 - Nano 0.9.16, after some struggling, is release. This release
should fix a few of the holes that 0.9.15 dug. The
"cutting text on the first line" bug is fixed, as is the
"cutting text on the last line" bug. Nice symmetry there
huh? Also the --tabsize argument should now work as well
as by using -T.
08/03/2000 - Nano 0.9.15 is the "I cant think of a release description"
release. There are the usual gala of display bugfixes,
a for the the nasty bug in -k mode that could create a
loop in the file being edited, and some other code
cleanup. Also, the -T option should now work regardless
of the curses library used. Yay.
07/27/2000 - Nano 0.9.14 is officially the "13 is so unlucky it should
be skipped as a version number" release. One typo
caused unending problems (calling nano with either -t or
-k caused both flags to be used). The -k code is also now
closer in functionality to Pico's -k mode, please
note that this code is not finished yet. Working on this
code has made me realize that there is not enough
abstraction in the code, and I will be working on that
for the next release. Until then, have fun with this
version.
07/23/2000 - Nano 0.9.13 has a few new bits and bobs, most notably the
-k option from Pico (cut to end of line). The majority
of changes in this release are bugfixes however, including
the usual display fixes and fixes for writing to symbolic
links and un-writeable files. Barring any other major
changes, this should be the feature set for nano 1.0,
whenever it might be released =-)
07/07/2000 - Nano 0.9.12 (The "lucky day" release) is bursting with new
features, bug fixes, and yummy fruit flavor. For
changes, the alternate replace keystroke ^W^T is now
^W^R to be compatible with later version of Pico.
^W^T is now goto line, again for Pico compatibility.
As for new features, the wonderful/hated magic line
code has returned with a vengeance! Also, regular
expression searches and replaces have been incorporated
via the -R flag. And of course there are the usual
helping of display and other bug fixes to top it all
off.
06/20/2000 - Nano 0.9.11 presents drastic rewrites of the most buggy
routines in the program, specifically the wrapping code
and almost all of the display routines. There are many
@@ -212,3 +298,5 @@
http://faculty.plattsburgh.edu/astyanax/nano. Please
update your bookmarks, tell your friends, and all that
jazz.
$Id$

6
README
View File

@@ -39,7 +39,7 @@ How to compile and install nano
Web Page
http://www.asty.org/nano
http://www.nano-editor.org
Mailing List and Bug Reports
@@ -54,7 +54,7 @@ Mailing List and Bug Reports
with a subject of "subscribe", where <name> is the list you want to
subscribe to.
For general bug reports, send a description of the problem to
nano@asty.org or directly to the development list.
nano@nano-editor.org or directly to the development list.
Current Status
@@ -80,3 +80,5 @@ Current Status
can guess, I'm not much of an emacs fan ;)
Chris Allegretta (chrisa@asty.org)
$Id$

21
TODO
View File

@@ -1,14 +1,27 @@
TODO file (? means the feature may be implemented, but not definitely)
-----------------------------------------------------------------------------
- Implement Spelling [DONE, mostly...]
Current Version:
- Implement Spelling [DONE]
- Implement Help [DONE]
- Internationalization [In progress, translators welcome!]
- Allow nano to be resized in X. [DONE]
- Color syntax highlighting? (certainly seems like there's a demand for it.)
- On page up/down, put the cursor on the first line (like Pico), not the
center line [DONE]
- Rewrite edit_refresh, if at all possible [DONE]
- Implement justify function [DONE]
- Cut to end of line [DONE]
- Unjustify command (^U after ^J)
- Built-in speller command [needed for version 1.0] [DONE]
- Better statusbar interaction (scrolling, tab completion for filename)
[needed for version 1.0] [DONE]
- Now do username completion (~user, would be nice, need based on user
feedback).
For Next Version:
- Undo/Redo key?
- single line scroll up/down?
- Rewrite edit_refresh, if at all possible [In progress]
- Implement justify function [DONE]
- Color syntax highlighting? (certainly seems like there's a demand for it.)
- .nanorc ?????
$Id$

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Define this if you have the wresize function in your ncurses-type library */
#undef HAVE_WRESIZE
@@ -22,5 +24,3 @@
/* Define to use the slang wrappers for curses instead of native curses */
#undef USE_SLANG
/* Define this if you have a behaving TABSIZE global in your curses lib */
#undef HAVE_TABSIZE

View File

@@ -76,9 +76,6 @@
/* Define to use the slang wrappers for curses instead of native curses */
#undef USE_SLANG
/* Define this if you have a behaving TABSIZE global in your curses lib */
#undef HAVE_TABSIZE
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
@@ -157,6 +154,9 @@
/* Define if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H

561
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,9 @@
# $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(nano.c)
AM_INIT_AUTOMAKE(nano, 0.9.11-cvs)
AM_INIT_AUTOMAKE(nano, 0.9.20)
AM_CONFIG_HEADER(config.h:config.h.in)
ALL_LINGUAS="es de fr it id"
ALL_LINGUAS="es de fr it id fi"
dnl Checks for programs.
AC_PROG_CC
@@ -10,7 +11,7 @@ AC_ISC_POSIX
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h)
AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h)
dnl options
AC_ARG_ENABLE(tiny,
@@ -25,44 +26,78 @@ CURSES_LIB_NAME=""
AC_ARG_WITH(slang,
[ --with-slang[=DIR] Use the slang library instead of curses],
[ case "$with_slang" in
yes)
AC_MSG_RESULT(yes)
AC_CHECK_HEADER(slcurses.h,
AC_CHECK_LIB(slang, SLcurses_newwin,
[AC_DEFINE(USE_SLANG) slang_support=yes
CURSES_LIB="-lslang" CURSES_LIB_NAME=slang]),
AC_MSG_ERROR([
*** The header file slcurses.h was not found. If you wish to use
*** slang support this header file is required. Please either
*** install a version of slang that includes the slcurses.h file or
*** do not call the configure script with --with-slang
]))
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
# Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
# alternate readline path
_ldflags=${LDFLAGS}
_cppflags=${CPPFLAGS}
# Add additional search path
LDFLAGS="-L$with_slang/lib $LDFLAGS"
CPPFLAGS="-I$with_slang/include $CPPFLAGS"
if test "$with_slang" != "yes"; then
# Add additional search path
LDFLAGS="-L$with_slang/lib $LDFLAGS"
CPPFLAGS="-I$with_slang/include $CPPFLAGS"
fi
AC_CHECK_HEADER(slcurses.h,
AC_CHECK_LIB(slang, SLcurses_newwin,
[AC_DEFINE(USE_SLANG) slang_support=yes
CURSES_LIB="-L${with_slang}/lib -lslang"
CURSES_LIB_NAME=slang],
AC_MSG_ERROR([
*** The slang library was not found or the version you have installed
*** is incorrect.
])),
AC_MSG_CHECKING(for SLtt_initialize in -lslang)
_libs=$LIBS
LIBS="$LIBS -lslang"
AC_TRY_RUN([
#include <stdio.h>
#include <slcurses.h>
int main () { SLtt_initialize (NULL); return 0; }],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG)
slang_support=yes
if test "$with_slang" != "yes"; then
CURSES_LIB="-L${with_slang}/lib -lslang"
else
CURSES_LIB="-lslang"
fi
CURSES_LIB_NAME=slang], [
AC_MSG_RESULT(no)
# We might need the term library
for termlib in ncurses curses termcap terminfo termlib; do
AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
test -n "$tcap" && break
done
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap)
LIBS="$LIBS $tcap"
AC_TRY_RUN([
#include <stdio.h>
#include <slcurses.h>
int main () { SLtt_initialize (NULL); return 0; }],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG)
slang_support=yes
if test "$with_slang" != "yes"; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
else
CURSES_LIB="-lslang $tcap"
fi
CURSES_LIB_NAME=slang], [
AC_MSG_RESULT(no)
# We might need the math library
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap -lm)
LIBS="$LIBS -lm"
AC_TRY_RUN([
#include <stdio.h>
#include <slcurses.h>
int main () { SLtt_initialize (NULL); return 0; }],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG)
slang_support=yes
if test "$with_slang" != "yes"; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
else
CURSES_LIB="-lslang $tcap -lm"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling])),
AC_MSG_ERROR([
*** The header file slcurses.h was not found. If you wish to use
*** slang support this header file is required. Please either
@@ -70,9 +105,13 @@ AC_ARG_WITH(slang,
*** do not call the configure script with --with-slang
]))
LDFLAGS=${_ldflags}
test "${_libs+set}" = "set" && LIBS=$_libs
if test "$with_slang" != "yes"; then
LDFLAGS=${_ldflags}
fi
;;
esac])
esac], AC_MSG_RESULT(no))
dnl Checks for functions
AC_CHECK_FUNCS(snprintf vsnprintf)
@@ -101,9 +140,7 @@ dnl Checks for libraries.
if eval "test x$CURSES_LIB_NAME = x"
then
AC_CHECK_HEADERS(curses.h ncurses.h)
AC_CHECK_LIB(ncurses, tgetent,[CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses
dnl Only ncurses seems to have a working TABSIZE function.
AC_DEFINE(HAVE_TABSIZE)])
AC_CHECK_LIB(ncurses, tgetent,CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses)
fi
if eval "test x$CURSES_LIB_NAME = x"
@@ -111,6 +148,12 @@ then
AC_CHECK_LIB(curses, tgetent, CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses)
fi
# Fallback for PDCurses and less useful curses libs...
if eval "test x$CURSES_LIB_NAME = x"
then
AC_CHECK_LIB(curses, initscr, CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses)
fi
if eval "test x$CURSES_LIB_NAME = x"
then
AC_CHECK_LIB(termcap, tgetent, CURSES_LIB="-ltermcap" CURSES_LIB_NAME=termcap)

83
cut.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* cut.c *
* *
@@ -97,8 +98,7 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
free(top->data);
top->data = tmpstr;
bot->data[bot_x] = 0;
align(&bot->data);
null_at(bot->data, bot_x);
next = bot->next;
/* We explicitly don't decrement totlines here because we don't snarf
@@ -124,7 +124,7 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
}
}
if (top->lineno < edittop->lineno)
edit_update(top);
edit_update(top, CENTER);
}
#endif
@@ -133,22 +133,44 @@ int do_cut_text(void)
filestruct *tmp, *fileptr = current;
#ifndef NANO_SMALL
char *tmpstr;
int newsize;
int newsize, cuttingtoend = 0;
#endif
check_statblank();
if (fileptr == NULL || fileptr->data == NULL)
return 0;
tmp = fileptr->next;
if (!ISSET(KEEP_CUTBUFFER) || ISSET(MARK_ISSET)) {
if (!ISSET(KEEP_CUTBUFFER)) {
free_filestruct(cutbuffer);
cutbuffer = NULL;
#ifdef DEBUG
fprintf(stderr, _("Blew away cutbuffer =)\n"));
#endif
}
/* Must let cutbuffer get blown away first before we do this... */
if (fileptr == filebot && !ISSET(MARK_ISSET))
return 0;
#ifndef NANO_SMALL
if (ISSET(CUT_TO_END) && !ISSET(MARK_ISSET)) {
if (current_x == strlen(current->data)) {
do_delete();
SET(KEEP_CUTBUFFER);
marked_cut = 2;
return 1;
} else {
SET(MARK_ISSET);
SET(KEEP_CUTBUFFER);
mark_beginx = strlen(current->data);
mark_beginbuf = current;
cuttingtoend = 1;
}
}
if (ISSET(MARK_ISSET)) {
if (current->lineno == mark_beginbuf->lineno) {
tmp = copy_node(current);
@@ -183,9 +205,14 @@ int do_cut_text(void)
placewewant = xplustabs();
UNSET(MARK_ISSET);
marked_cut = 1;
set_modified();
edit_update(current);
if (cuttingtoend)
edit_refresh();
else
edit_update(current, CENTER);
return 1;
#else
if (0) {
@@ -197,10 +224,11 @@ int do_cut_text(void)
tmp = fileptr;
fileage = fileptr;
add_to_cutbuffer(fileptr->prev);
totsize--; /* get the newline */
totlines--;
fileptr->prev = NULL;
edit_update(fileage);
current = fileptr;
edit_update(fileage, CENTER);
} else {
add_to_cutbuffer(fileptr);
fileage = make_new_node(NULL);
@@ -216,19 +244,10 @@ int do_cut_text(void)
(fileptr->next)->prev = fileptr->prev;
current = fileptr->next;
totlines--;
} else {
/* we're deleteing the last line
and replacing it with a dummy line,
so totlines is the same */
tmp = fileptr->prev;
tmp->next = make_new_node(tmp);
tmp = tmp->next;
tmp->data = nmalloc(1);
strcpy(tmp->data, "");
current = tmp;
filebot = tmp;
totsize--; /* get the newline */
}
/* No longer an else here, because we never get here anymore...
No need to cut the magic line, as it's empty */
add_to_cutbuffer(fileptr);
}
@@ -259,6 +278,7 @@ int do_uncut_text(void)
int i;
wrap_reset();
check_statblank();
if (cutbuffer == NULL || fileptr == NULL)
return 0; /* AIEEEEEEEEEEEE */
@@ -270,7 +290,7 @@ int do_uncut_text(void)
/* Hook newbuf into fileptr */
#ifndef NANO_SMALL
if (marked_cut == 1) {
if (marked_cut) {
/* If there's only one line in the cutbuffer */
if (cutbuffer->next == NULL) {
tmpstr =
@@ -286,7 +306,6 @@ int do_uncut_text(void)
placewewant = xplustabs();
update_cursor();
renumber(current);
} else { /* yuck -- no kidding! */
tmp = current->next;
/* New beginning */
@@ -329,13 +348,27 @@ int do_uncut_text(void)
i = editbot->lineno;
renumber(current);
current = newend;
if (i <= newend->lineno)
edit_update(current);
edit_update(current, CENTER);
}
/* If marked cut == 2, that means that we're doing a cut to end
and we don't want anything else on the line, so we have to
screw up all the work we just did and separate the line. There
must be a better way to do this, but not at 1AM on a work night. */
if (marked_cut == 2 && current_x != strlen(current->data)) {
tmp = make_new_node(current);
tmp->data = nmalloc(strlen(&current->data[current_x]) + 1);
strcpy(tmp->data, &current->data[current_x]);
splice_node(current, tmp, current->next);
null_at(current->data, current_x);
current = current->next;
current_x = 0;
placewewant = 0;
}
renumber(current->prev);
dump_buffer(fileage);
dump_buffer(cutbuffer);
set_modified();
@@ -369,7 +402,7 @@ int do_uncut_text(void)
i = editbot->lineno;
renumber(newbuf);
if (i < newend->lineno)
edit_update(fileptr);
edit_update(fileptr, CENTER);
dump_buffer_reverse(fileptr);

565
faq.html Normal file
View File

@@ -0,0 +1,565 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.73 [en] (X11; U; Linux 2.2.16 i586) [Netscape]">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
<h1>
<font color="#CC0000">The nano FAQ</font></h1>
<h2>
<font color="#330000">Table of Contents</font></h2>
<h2>
<font color="#330000"><a href="#1">1.&nbsp; General</a></font></h2>
<blockquote><font color="#330000"><a href="#1.1">1.1 About this FAQ.</a></font>
<br><font color="#330000"><a href="#1.2">1.2. How do I contribute to it?</a></font>
<br><font color="#330000"><a href="#1.3">1.3. What is nano?</a></font>
<br><font color="#330000"><a href="#1.4">1.4. What is the history behind
nano?</a></font>
<br><font color="#330000"><a href="#1.5">1.5. Why the name change from
TIP?</a></font>
<br><font color="#330000"><a href="#1.6">1.6 What is the current version
of nano?</a></font>
<br><font color="#330000"><a href="#1.7">1.7. I want to read the man page
without having to download the program!</a></font></blockquote>
<h2>
<font color="#330000"><a href="#2">2. Where to get nano</a></font></h2>
<blockquote><font color="#330000"><a href="#2.1">2.1. FTP and WWW sites
that carry nano.</a></font>
<br><font color="#330000"><a href="#2.2">2.2. Redhat and derivatives (.rpm)
packages.</a></font>
<br><font color="#330000"><a href="#2.3">2.3. Debian (.deb) packages.</a></font>
<br><font color="#330000"><a href="#2.4">2.4. By CVS (for the brave).</a></font></blockquote>
<h2>
<font color="#330000"><a href="#3">3. Installation and Configuration</a></font></h2>
<blockquote><font color="#330000"><a href="#3.1">3.1. How do install the
RPM or DEB package?</a></font>
<br><font color="#330000"><a href="#3.2">3.2. Compiling from source: WHAT
THE HECK DO I DO NOW?</a></font>
<br><font color="#330000"><a href="#3.2">3.3. Why does everything go into
/usr/local?</a></font>
<br><font color="#330000"><a href="#3.4">3.4. I get errors about 'bindtextdomain',
'gettext' and/or 'gettextdomain'.&nbsp; What can I do about it?</a></font></blockquote>
<h2>
<font color="#330000"><a href="#4">4. Running</a></font></h2>
<blockquote><font color="#330000"><a href="#4.1">4.1. Ack!&nbsp; My backspace/delete/enter/double
bucky/meta key doesn't seem to work!&nbsp; What can I do?</a></font>
<br><font color="#330000"><a href="#4.2">4.2. Nano crashes when I type
&lt;insert keystroke here>!</a></font>
<br><font color="#330000"><a href="#4.3">4.3. Nano crashes when I resize
my window.&nbsp;&nbsp; How can I fix that?</a></font>
<br><font color="#330000"><a href="#4.4">4.4. Why does nano show ^\ and
^_ in the shortcut list instead of ^G and ^J?</a></font>
<br><font color="#330000"><a href="#4.5">4.5. When I type in a
search string, the string I last searched for is already in front of
my cursor! !What happened?!</a></font>
<br><a href="#4.6">4.6 How do I make nano my default editor (in Pine,
mutt, etc.)?</a></blockquote>
<h2>
<font color="#330000"><a href="#5">5. Internationalization</a></font></h2>
<blockquote><font color="#330000"><a href="#5.1">5.1. There's no translation
for my language!</a></font>
<br><font color="#330000"><a href="#5.2">5.2. I don't like the translation
for &lt;x> in my language.&nbsp;&nbsp; How can I fix it?</a></font></blockquote>
<h2>
<font color="#330000"><a href="#6">6. Advocacy and Licensing</a></font></h2>
<blockquote><font color="#330000"><a href="#6.1">6.1. Why should I use
nano instead of Pico?</a></font>
<br><font color="#330000"><a href="#6.2">6.2. Why should I use Pico instead
of nano?</a></font>
<br><font color="#330000"><a href="#6.3">6.3. What is so bad about the
PINE license?</a></font>
<br><font color="#330000"><a href="#6.4">6.4. Okay, well what mail program
should I use then?</a></font>
<br><font color="#330000"><a href="#6.5">6.5. Why doesn't UW simply change
their license?</a></font>
<br><font color="#330000"><a href="#6.6">6.6. What if tomorrow UW changes
the license to be truly Free Software?</a></font></blockquote>
<h2>
<font color="#330000"><a href="#7">7. Miscellaneous</a></font></h2>
<blockquote><font color="#330000"><a href="#7.1">7.1. Nano related mailing
lists.</a></font>
<br><font color="#330000"><a href="#7.2">7.2. I want to send the development
team a big load of cash (or just a thank you).</a></font>
<br><font color="#330000"><a href="#7.3">7.3. How do I submit a patch?</a></font>
<br><font color="#330000"><a href="#7.4">7.4. How do I join the development
team?</a></font>
<br><font color="#330000"><a href="#7.5">7.5. Can I have CVS write access?</a></font></blockquote>
<h2>
<a href="#8">8. ChangeLog</a></h2>
<hr WIDTH="100%">
<br>&nbsp;
<h1>
<a NAME="1"></a><font color="#330000">1.&nbsp; General</font></h1>
<h2>
<a NAME="1.1"></a><font color="#330000">1.1 About this FAQ.</font></h2>
<blockquote><font color="#330000">This FAQ was written and is maintained
by Chris Allegretta &lt;<a href="mailto:chrisa@asty.org">chrisa@asty.org</a>>,
who also happens to be the creator of nano.&nbsp;&nbsp; Maybe someone else
will volunteer to maintain this FAQ someday, who knows...</font></blockquote>
<h2>
<a NAME="1.2"></a><font color="#330000">1.2. How do I contribute to it?</font></h2>
<blockquote><font color="#330000">Your best bet is to send it to the nano
email address, <a
href="mailto:nano@nano-editor.org">nano@nano-editor.org</a> and if
it is useful enough it will be included in future versions.</font></blockquote>
<h2>
<a NAME="1.3"></a><font color="#330000">1.3. What is nano?</font></h2>
<blockquote><font color="#330000">Nano is designed to be a free replacement
for the Pico text editor, part of the PINE email suite from <a href="http://www.washington.edu/pine">The
University of Washington</a>.&nbsp; It aims to "emulate Pico as closely
as possible and perhaps include extra functionality WITHOUT breaking compatibility
with Pico.</font></blockquote>
<h2>
<a NAME="1.4"></a><font color="#330000">1.4. What is the history behind
nano?</font></h2>
<blockquote><font color="#330000">Funny you should ask!</font>
<p><b><font color="#330000">In the beginning...</font></b>
<p><font color="#330000">For years Pine was THE program used to read email
on a Unix system.&nbsp; The Pico text editor is the portion of the program
one would use to compose his or her mail messages.&nbsp; Many beginners
to Unix flocked to Pico and Pine because of their well organized, easy
to use interfaces.&nbsp; With the proliferation of Linux in the mid to
late 90's, many University students became intimately familiar with the
strengths (and weaknesses) of Pine and Pico.</font>
<p><b><font color="#330000">Then came debian...</font></b>
<p><font color="#330000">The <a href="http://www.debian.org">debian GNU/Linux</a>
distribution, known for its strict standards in distributing truly "free"
software (i.e. had no restrictions on redistribution), would not include
a binary package for Pine or Pico.&nbsp; Many people had a serious dilemma:&nbsp;
they loved these programs, but they were not truly free software in the
<a href="http://www.gnu.org/philosophy/free-sw.html">GNU</a>
sense of the word.</font>
<p><b><font color="#330000">The event...</font></b>
<p><font color="#330000">It was in late 1999 when Chris Allegretta (our
hero) was yet again complaining to himself about the less-than-perfect
license Pico was distributed under, the 10000 makefiles that came with
it and how just a few small improvements could make it the Best Editor
in the World (TM).&nbsp; Having been a convert from Slackware to debian,
he missed having a simple binary package that included Pine and Pico, and
had grown tired of downloading them himself.</font>
<p><font color="#330000">Finally something snapped inside and Chris coded
and hacked like a madman for many hours straight one weekend to make a
(barely usable) Pico clone, at the time called TIP (Tip Isn't Pico).&nbsp;
The program could not be invoked without a filename, could not save files,
had no help menu, spell checker, and so forth.&nbsp; But over time it improved,
and with the help of a few great coders it matured to the almost stable
state it is today.</font></blockquote>
<h2>
<a NAME="1.5"></a><font color="#330000">1.5. Why the name change from TIP?</font></h2>
<blockquote><font color="#330000">On January 10, 2000, TIP was officially
renamed to nano because of a namespace conflict with another program called
'tip'.&nbsp; The original 'tip' program "establishes a full duplex terminal
connection to a remote host", and was included with many older Unix systems
(and newer ones like Solaris). The conflict was not noticed at first because
there is no 'tip' utility included with most Linux distributions (where
nano was developed).</font></blockquote>
<h2>
<a NAME="1.6"></a><font color="#330000">1.6 What is the current version
of nano?</font></h2>
<blockquote><font color="#330000">The current version of nano *should*
be 0.9.20.&nbsp; Of course you should always check the nano hompage to
see what the latest and greatest version is.</font></blockquote>
<h2>
<a NAME="1.7"></a><font color="#330000">1.7. I want to read the man page
without having to download the program!</font></h2>
<blockquote><font color="#330000">Jeez, demanding, aren't we?&nbsp;&nbsp;
Okay, look <a href="http://www.nano-editor.org/dist/nano.1.html">here</a>.</font></blockquote>
<hr WIDTH="100%">
<h1>
<a NAME="2"></a><font color="#330000">2. Where to get nano</font></h1>
<h2>
<a NAME="2.1"></a><font color="#330000">2.1. FTP and WWW sites that carry
nano.</font></h2>
<blockquote><font color="#330000">The nano distribution can be downloaded
at the following fine web and ftp sites:</font>
<ul>
<li>
<font color="#330000"><a href="http://www.nano-editor.org/dist">http://www.nano-editor.org/dist</a></font></li>
<li>
<font color="#330000"><a href="http://www.ewtoo.org/~astyanax/nano/dist">http://www.ewtoo.org/~astyanax/nano/dist</a></font></li>
<li>
<font color="#330000"><a href="ftp://ftp.nano-editor.org/pub/nano">ftp://ftp.nano-editor.org/pub/nano</a></font></li>
<li>
<font color="#330000"><a href="ftp://nano.sourceforge.net/pub/nano/">ftp://nano.sourceforge.net/pub/nano</a></font></li>
</ul>
</blockquote>
<h2>
<a NAME="2.2"></a><font color="#330000">2.2. Redhat and derivatives (.rpm)
packages.</font></h2>
<blockquote>
<ul>
<li>
<font color="#330000"><a href="http://www.nano-editor.org/dist/RPMS">http://www.nano-editor.org/dist/RPMS</a></font></li>
<li>
<font color="#330000"><a href="http://www.ewtoo.org/~astyanax/nano/dist/RPMS">http://www.ewtoo.org/~astyanax/nano/dist/RPMS</a></font></li>
<li>
<font color="#330000"><a href="ftp://ftp.nano-editor.org/pub/nano/RPMS">ftp://ftp.nano-editor.org/pub/nano/RPMS</a></font></li>
<li>
<font color="#330000"><a href="ftp://nano.sourceforge.net/pub/nano/RPMS">ftp://nano.sourceforge.net/pub/nano/RPMS</a></font></li>
</ul>
<font color="#330000">Additionally, check out the Redhat contribs section
at:</font>
<ul>
<li>
<font color="#330000"><a href="http://metalab.unc.edu/pub/Linux/distributions/redhat/contrib/libc6/i386">http://metalab.unc.edu/pub/Linux/distributions/redhat/contrib/libc6/i386</a></font></li>
<li>
<font color="#330000"><a href="ftp://metalab.unc.edu/pub/Linux/distributions/redhat/contrib/libc6/i386">ftp://metalab.unc.edu/pub/Linux/distributions/redhat/contrib/libc6/i386</a></font></li>
</ul>
</blockquote>
<h2>
<a NAME="2.3"></a><font color="#330000">2.3. Debian (.deb) packages.</font></h2>
<blockquote><font color="#330000">For debian users, you can check out the
current nano packages for:</font>
<ul>
<li>
<font color="#330000"><a href="http://www.debian.org/Packages/stable/editors/nano.html">stable</a></font></li>
<li>
<font color="#330000"><a href="http://www.debian.org/Packages/unstable/editors/nano.html">unstable</a></font></li>
</ul>
<font color="#330000">Note that versions &lt; 0.9.10 are probably not for
those wanting to get serious work done, so until the stable distribution
has an updated version of nano, you are best off using the one in unstable
for now.</font></blockquote>
<h2>
<a NAME="2.4"></a><font color="#330000">2.4. By CVS (for the brave).</font></h2>
<blockquote><font color="#330000">For the 'bleeding edge' current version
of nano, you can use CVS to download the current source code.&nbsp; <b>Note:</b>
believe it or not, by downloading code that has not yet stabilized into
an official release, there could quite possibly be bugs, in fact the code
may not even compile!&nbsp; Anyway, see <a href="https://sourceforge.net/cvs/?group_id=1304">the
nano CVS page</a> for info on anonymous CVS access to the nano source.</font></blockquote>
<hr WIDTH="100%">
<h1>
<a NAME="3"></a><font color="#330000">3. Installation and Configuration</font></h1>
<h2>
<a NAME="3.1"></a><font color="#330000">3.1. How do install the RPM or
DEB package?</font></h2>
<blockquote><font color="#330000">It's simple really!&nbsp; As root, type
<b>rpm
-Uvh nano-x.y.z-1.i386.rpm</b> if you have a Redhat-ish system or
<b>dpkg
-i nano_x.y.z-1.deb</b> if you have a Debian-ish system, where
<b>x.y.z</b>
is the release of nano.&nbsp; There are other programs to install programs,
and if you wish to use those, knock yourself out.</font></blockquote>
<h2>
<a NAME="3.2"></a><font color="#330000">3.2. Compiling from source: WHAT
THE HECK DO I DO NOW?</font></h2>
<blockquote><font color="#330000">Okay, take a deep breath, this really
isn't hard.&nbsp; Unpack the nano source with a command like:</font>
<p><b><font color="#330000">tar -zxvf nano-x.y.z.tar.gz</font></b>
<p><font color="#330000">If you get error messages about the -z option,
try this:</font>
<p><b><font color="#330000">gzip -dc nano-x.y.z.tar.gz | tar xvf -</font></b>
<p><font color="#330000">(again, where x.y.z is the version number in question).&nbsp;
Then you need to run configure with any options you might want (if any).</font>
<p><font color="#330000">The average case is this:</font>
<p><b><font color="#330000">./configure</font></b>
<br><b><font color="#330000">make</font></b>
<br><font color="#330000"><b>make install </b>(as root, of course)</font></blockquote>
<h2>
<a NAME="3.3"></a><font color="#330000">3.3. Why does everything go into
/usr/local?</font></h2>
<blockquote><font color="#330000">Well, that's what the <b>configure</b>
script defaults to.&nbsp; If you wish to change this, simply do this:</font>
<p><b><font color="#330000">./configure --prefix=/usr</font></b>
<p><font color="#330000">to put nano into /usr/bin when you run <b>make
install</b>.</font></blockquote>
<h2>
<a NAME="3.4"></a><font color="#330000">3.4. I get errors about 'bindtextdomain',
'gettext' and/or 'gettextdomain'.&nbsp; What can I do about it?</font></h2>
<blockquote><font color="#330000">Try doing a <b>./configure --with-included-gettext</b>
and see if that solves your problem.&nbsp; You make need to do a <b>make
clean ; make</b> to get it to work fully.</font></blockquote>
<hr WIDTH="100%">
<h1>
<a NAME="4"></a><font color="#330000">4. Running</font></h1>
<h2>
<a NAME="4.1"></a><font color="#330000">4.1. Ack!&nbsp; My backspace/delete/enter/double
bucky/meta key doesn't seem to work!&nbsp; What can I do?</font></h2>
<blockquote><font color="#330000">Try setting your $TERM variable to 'vt100'.&nbsp;
Nano doesn't yet support every term entry under the sun.</font>
<p><font color="#330000">Bourne shell users (like bash): <b>export TERM=vt100</b></font>
<br><font color="#330000">C Shell users (tcsh and csh): <b>setenv TERM
vt100</b></font></blockquote>
<h2>
<a NAME="4.2"></a><font color="#330000">4.2. Nano crashes when I type &lt;insert
keystroke here>!</font></h2>
<blockquote><font color="#330000">If you aren't trying some bizarre keystroke
combination with some bizarre $TERM entry, chances are you have found a
bug.&nbsp;&nbsp; You are welcome to submit it to the nano-devel list or
to <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.</font></blockquote>
<h2>
<a NAME="4.3"></a><font color="#330000">4.3. Nano crashes when I resize
my window.&nbsp;&nbsp; How can I fix that?</font></h2>
<blockquote><font color="#330000">Older versions of nano had this problem,
please upgrade to a newer version (at least 0.9.9 would be great, 0.9.
12 is recommended).</font></blockquote>
<h2>
<a NAME="4.4"></a><font color="#330000">4.4. Why does nano show ^\ and
^_ in the shortcut list instead of ^G and ^J?</font></h2>
<blockquote><font color="#330000">The help (^G) and justify (^J) functions
were among the last to be written.&nbsp; To show the improvements that
nano had over Pico (goto line # and replace), ^_ and ^\ were put on the
shortcut list.&nbsp;&nbsp; If you use the <b>-p</b> option to nano you
will get the same shortcuts at the bottom as Pico.</font></blockquote>
<h2>
<a name="4.5"><font color="#330000">4.5. When I type in a search
string, the string I last searched for is already in front of my
cursor! !What happened?!</font></h2>
<blockquote><font color="#330000">In nano version 0.9.20, the default is
to have a completely consistent user interface across all user input
functions. This means that regardless of whether you're being asked for
a filename to insert or write, or a string to search for, the
previous value is already inserted before the cursor. If you prefer the
old behavior, use the pico emulation mode (-p or --pico) or just hit
Meta-P while in nano (see the ^G help text for more
details).</font></blockquote>
<h2>
<a NAME="4.6"></a>4.6. How do I make nano my default editor (in Pine,
mutt, etc)?</h2>
<blockquote>You need to make nano your $EDITOR.&nbsp; If you want this
to be saved, you should put a line like this in your <b>.bashrc</b> if
you use bash:
<p><b>export EDITOR=/usr/local/bin/nano</b>
<p>or if you use tcsh put this in your <b>.cshrc</b> file:
<p><b>setenv EDITOR /usr/local/bin/nano</b>
<p>Change /usr/local/bin/nano to wherever nano is installed in your system.&nbsp;
Type which nano to find out. This will not take effect until the next time
you login.&nbsp; So log out and back in again.
<p>Then on top that if you use Pine you must go into setup (type <b>S</b>
at the main menu), then configure (type <b>C</b>).&nbsp; Hit enter on the
lines that say:
<p><b>[ ]&nbsp; enable-alternate-editor-cmd</b>
<br><b>[ ]&nbsp; enable-alternate-editor-implicitly</b>
<p>Then exit (<b>E</b>) and select Yes (<b>Y</b>).
<p>Mutt users should see an effect immediately the next time you log in,
no further configuration is needed.&nbsp; However, if you want to let people
know you use nano to compose your email messages, you can put a line like
this in your <b>.muttrc</b>:
<p><b>my_hdr X-Composer: nano x.y.z</b>
<p>Again, replace x.y.z with the version of nano you use.
<br>&nbsp;</blockquote>
<hr WIDTH="100%">
<h1>
<a NAME="5"></a><font color="#330000">5. Internationalization</font></h1>
<h2>
<a NAME="5.1"></a><font color="#330000">5.1. There's no translation for
my language!</font></h2>
<blockquote><font color="#330000">So, uh, get someone who speaks your native
language to write one =-).&nbsp; Just grab the <b>nano.pot</b> file from
the latest and greatest nano distribution (it's in the <b>po/</b> directory)
and translate each line into your native language on the <b>msgstr</b>
line.&nbsp; Then send it to the nano devel list or <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.</font></blockquote>
<h2>
<a NAME="5.2"></a><font color="#330000">5.2. I don't like the translation
for &lt;x> in my language.&nbsp;&nbsp; How can I fix it?</font></h2>
<blockquote><font color="#330000">The best way would probably be to e-mail
the person listed in the <b>&lt;your_language>.po</b> file with your suggested
corrections and they can in turn forward it to the nano email address,
or the devel list.</font></blockquote>
<hr WIDTH="100%">
<h1>
<a NAME="6"></a><font color="#330000">6. Advocacy and Licensing</font></h1>
<h2>
<a NAME="6.1"></a><font color="#330000">6.1. Why should I use nano instead
of Pico?</font></h2>
<blockquote><font color="#330000">There are many reasons to use nano instead
of Pico, a more complete list can be found at the <a href="http://www.nano-edior.org">nano
homepage</a>.</font></blockquote>
<h2>
<a NAME="6.2"></a><font color="#330000">6.2. Why should I use Pico instead
of nano?</font></h2>
<blockquote>Again, check out the <a href="http://www.nano-editor.org">nano
homepage</a> for a good summary of reasons.&nbsp; It really is a matter
of personal preference as to which editor you should use.&nbsp; If you're
the type of person who likes using the original version of a program, then
Pico is the editor for you.&nbsp;&nbsp; If you're looking for a few more
features and a 'better' license as far as adding your own changes (sacrificing
mailer integration and a little stability), nano is the way to go.</blockquote>
<h2>
<a NAME="6.3"></a><font color="#330000">6.3. What is so bad about the PINE
license?</font></h2>
<blockquote><font color="#330000">Technically there is nothing "wrong"
with the U of W license for Pine and Pico.&nbsp; However, it is&nbsp; not
considered truly "free" according to the <a href="http://www.debian.org/social_contract#guidelines">Debian
Free Software Guidelines</a>.&nbsp; The only real problem as far as I'm
aware as that there are limitations on the redistribution of programs based
on the Pine and Pico source.&nbsp;&nbsp; So at a real nitty gritty level,
these programs are not considered Free Software.&nbsp; This is why Pico
isn't distributed in binary form in debian, and hence one of the main reasons
nano was started.</font></blockquote>
<h2>
<a NAME="6.4"></a><font color="#330000">6.4. Okay, well what mail program
should I use then?</font></h2>
<blockquote><font color="#330000">Well, there is nothing stopping you from
using Pine with nano (or Pine with Pico for that matter).&nbsp; But if
you want to use programs that are considered Free Software, you may want
to look into <a href="http://www.mutt.org">mutt</a>.&nbsp; It is a full-screen,
console based mail program that actually has a lot more flexibility than
Pine, but has a keymap included in the distribution that allows you to
use the same keystrokes as Pine would to send and receive mail.&nbsp; It's
also licensed under the GPL.</font></blockquote>
<h2>
<a NAME="6.5"></a><font color="#330000">6.5. Why doesn't UW simply change
their license?</font></h2>
<blockquote><font color="#330000">You're really not asking the right person
here.&nbsp; I (Chris) waited a long time to see if UW would change their
license because of the amount of high quality software being released and
developed under the GPL without being taken advantage of by malicious corporate
entities or other baddies, but no such luck so far.</font></blockquote>
<h2>
<a NAME="6.6"></a><font color="#330000">6.6. What if tomorrow UW changes
the license to be truly Free Software?</font></h2>
<blockquote><font color="#330000">Honestly nothing would make me happier
than to see that happen.&nbsp; Nano would continue to be developed independently
until such time as Pico had all the features nano did or the projects merged.&nbsp;
That just does not seem very likely given that there has been no sign of
any changes in the past few years in a positive direction.</font></blockquote>
<hr WIDTH="100%">
<h1>
<a NAME="7"></a><font color="#330000">7. Miscellaneous</font></h1>
<h2>
<a NAME="7.1"></a><font color="#330000">7.1. Nano related mailing lists.</font></h2>
<blockquote><font color="#330000">There are two mailing lists for nano
hosted at <a href="http://www.sourceforge.net">SourceForge</a>, nano-announce
and nano-devel.&nbsp; Nano-announce is a very low traffic list where new
versions of nano are announced (surprise!)&nbsp; Nano-devel is a sometimes
low, sometimes very high traffic list for dicussing the present and future
development of nano.&nbsp; Here are links to where you can sign up for
a given list:</font><font color="#330000"></font>
<p><font color="#330000">nano-announce - <a href="http://lists.sourceforge.net/mailman/listinfo/nano-announce">http://lists.sourceforge.net/mailman/listinfo/nano-announce</a></font>
<br><font color="#330000">nano-devel - <a href="http://lists.sourceforge.net/mailman/listinfo/nano-devel">http://lists.sourceforge.net/mailman/listinfo/nano-devel</a></font></blockquote>
<h2>
<a NAME="7.2"></a><font color="#330000">7.2. I want to send the development
team a big load of cash (or just a thank you).</font></h2>
<blockquote><font color="#330000">That's fine.&nbsp; Send it <a href="mailto:nano-devel@lists.sourceforge.net">our
way</a>!&nbsp; Better yet, fix a <a href="http://www.nano-editor.org/dist/BUGS">bug</a>
in the program or implement a <a href="http://www.nano-editor.org/dist/TODO">cool
feature</a> and send us that instead (though cash is fine too).</font></blockquote>
<h2>
<a NAME="7.3"></a><font color="#330000">7.3. How do I submit a patch?</font></h2>
<blockquote><font color="#330000">See Section <a href="#7.2">7.2</a>.</font></blockquote>
<h2>
<a NAME="7.4"></a><font color="#330000">7.4. How do I join the development
team?</font></h2>
<blockquote><font color="#330000">The easiest way is to consistently send
in good patches that add some needed functionality, fix a bug or two and/or
make the program more optimized/efficient.&nbsp; Then ask nicely and you
will probably be added to the SourceForge development list and be given
CVS write after awhile.&nbsp; There is a lot of responsibility that goes
along with being a team member, so don't think it's just something to add
to your resume.</font></blockquote>
<h2>
<a NAME="7.5"></a><font color="#330000">7.5. Can I have CVS write access?</font></h2>
<blockquote><font color="#330000">Re-read Section </font><a href="#7.4">7.4</a><font color="#330000">
and you should know the answer.</font></blockquote>
<h1>
<a NAME="8"></a>8. ChangeLog</h1>
<blockquote>06/31/2000 - Initial framework.</blockquote>
<P>
$Id$
</body>
</html>

397
files.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* files.c *
* *
@@ -26,6 +27,8 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
#include <dirent.h>
#include "config.h"
#include "proto.h"
@@ -125,7 +128,7 @@ filestruct *read_line(char *buf, filestruct * prev, int *line1ins)
int read_file(int fd, char *filename)
{
long size, lines = 0, linetemp = 0;
long size, num_lines = 0, linetemp = 0;
char input[2]; /* buffer */
char *buf;
long i = 0, bufx = 128;
@@ -133,6 +136,7 @@ int read_file(int fd, char *filename)
int line1ins = 0;
buf = nmalloc(bufx);
buf[0] = '\0';
if (fileptr != NULL && fileptr->prev != NULL) {
fileptr = fileptr->prev;
@@ -148,7 +152,7 @@ int read_file(int fd, char *filename)
linetemp = 0;
if (input[0] == '\n') {
fileptr = read_line(buf, fileptr, &line1ins);
lines++;
num_lines++;
buf[0] = 0;
i = 0;
} else {
@@ -171,15 +175,16 @@ int read_file(int fd, char *filename)
/* Did we not get a newline but still have stuff to do? */
if (buf[0]) {
fileptr = read_line(buf, fileptr, &line1ins);
lines++;
num_lines++;
buf[0] = 0;
}
/* Did we even GET a file? */
if (totsize == 0) {
new_file();
statusbar(_("Read %d lines"), lines);
statusbar(_("Read %d lines"), num_lines);
return 1;
}
if (current != NULL) {
fileptr->next = current;
current->prev = fileptr;
@@ -188,10 +193,13 @@ int read_file(int fd, char *filename)
placewewant = 0;
} else if (fileptr->next == NULL) {
filebot = fileptr;
new_magicline();
/* Update the edit buffer */
load_file();
}
statusbar(_("Read %d lines"), lines);
totlines += lines;
statusbar(_("Read %d lines"), num_lines);
totlines += num_lines;
free(buf);
close(fd);
@@ -222,7 +230,8 @@ int open_file(char *filename, int insert, int quiet)
} else { /* File is A-OK */
if (S_ISDIR(fileinfo.st_mode)) {
statusbar(_("File \"%s\" is a directory"), filename);
new_file();
if (!insert)
new_file();
return -1;
}
if (!quiet)
@@ -238,7 +247,7 @@ int do_insertfile(void)
int i;
wrap_reset();
i = statusq(writefile_list, WRITEFILE_LIST_LEN, "",
i = statusq(1, writefile_list, WRITEFILE_LIST_LEN, "",
_("File to insert [from ./] "));
if (i != -1) {
@@ -252,14 +261,11 @@ int do_insertfile(void)
set_modified();
/* Here we want to rebuild the edit window */
for (i = 0, editbot = edittop;
i <= editwinrows - 1
&& i <= totlines
&& editbot->next != NULL; editbot = editbot->next, i++);
fix_editbot();
/* If we've gone off the bottom, recenter, otherwise just redraw */
if (current->lineno > editbot->lineno)
edit_update(current);
edit_update(current, CENTER);
else
edit_refresh();
@@ -280,7 +286,7 @@ int do_insertfile(void)
* print out how many lines we wrote on the statusbar.
*
* Note that tmp is only set to 1 for storing temporary files internal
* to the editor, and is completely different from temp_opt.
* to the editor, and is completely different from TEMP_OPT.
*/
int write_file(char *name, int tmp)
{
@@ -298,11 +304,21 @@ int write_file(char *name, int tmp)
fileptr = fileage;
/* Check to see if the file is a regular file and FOLLOW_SYMLINKS is
set. If so then don't do the delete and recreate code which would
cause unexpected behavior */
lstat(name, &st);
/* Open the file and truncate it. Trust the symlink. */
if (ISSET(FOLLOW_SYMLINKS) && !tmp) {
if ((ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(st.st_mode)) && !tmp) {
if ((fd = open(name, O_WRONLY | O_CREAT | O_TRUNC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH |
S_IWOTH)) == -1) {
if (ISSET(TEMP_OPT)) {
UNSET(TEMP_OPT);
return do_writeout(1);
}
statusbar(_("Could not open file for writing: %s"),
strerror(errno));
return -1;
@@ -319,16 +335,22 @@ int write_file(char *name, int tmp)
strcat(buf, name);
strcat(buf, ".XXXXXX");
if ((fd = mkstemp(buf)) == -1) {
if (ISSET(TEMP_OPT)) {
UNSET(TEMP_OPT);
return do_writeout(1);
}
statusbar(_("Could not open file for writing: %s"),
strerror(errno));
return -1;
}
}
dump_buffer(fileage);
while (fileptr != NULL && fileptr->next != NULL) {
/* Next line is so we discount the "magic line" */
if (filebot == fileptr && fileptr->data[0] == '\0')
break;
size = write(fd, fileptr->data, strlen(fileptr->data));
if (size == -1) {
statusbar(_("Could not open file for writing: %s"),
@@ -424,16 +446,24 @@ int do_writeout(int exiting)
{
int i = 0;
strncpy(answer, filename, 132);
answer = mallocstrcpy(answer, filename);
if ((exiting) && (temp_opt) && (filename)) {
i = write_file(answer, 0);
display_main_list();
return i;
if ((exiting) && (ISSET(TEMP_OPT))) {
if (filename[0]) {
i = write_file(answer, 0);
display_main_list();
return i;
} else {
UNSET(TEMP_OPT);
do_exit();
/* They cancelled, abort quit */
return -1;
}
}
while (1) {
i = statusq(writefile_list, WRITEFILE_LIST_LEN, answer,
i = statusq(1, writefile_list, WRITEFILE_LIST_LEN, answer,
_("File Name to write"));
if (i != -1) {
@@ -441,7 +471,7 @@ int do_writeout(int exiting)
#ifdef DEBUG
fprintf(stderr, _("filename is %s"), answer);
#endif
if (strncmp(answer, filename, 132)) {
if (strcmp(answer, filename)) {
struct stat st;
if (!stat(answer, &st)) {
i = do_yesno(0, 0, _("File exists, OVERWRITE ?"));
@@ -466,3 +496,322 @@ int do_writeout_void(void)
{
return do_writeout(0);
}
/*
* These functions (username_tab_completion, cwd_tab_completion, and
* input_tab were taken from busybox 0.46 (cmdedit.c). Here is the notice
* from that file:
*
* Termios command line History and Editting, originally
* intended for NetBSD sh (ash)
* Copyright (c) 1999
* Main code: Adam Rogoyski <rogoyski@cs.utexas.edu>
* Etc: Dave Cinege <dcinege@psychosis.com>
* Majorly adjusted/re-written for busybox:
* Erik Andersen <andersee@debian.org>
*
* You may use this code as you wish, so long as the original author(s)
* are attributed in any redistributions of the source code.
* This code is 'as is' with no warranty.
* This code may safely be consumed by a BSD or GPL license.
*/
#if 0
char **username_tab_completion(char *buf, int *num_matches)
{
char **matches = (char **) NULL;
*num_matches = 0;
#ifdef DEBUG
fprintf(stderr, "\nin username_tab_completion\n");
#endif
return (matches);
}
#endif
/* This was originally called exe_n_cwd_tab_completion, but we're not
worried about executables, only filenames :> */
char **cwd_tab_completion(char *buf, int *num_matches)
{
char *dirName, *tmp = NULL, *tmp2 = NULL;
char **matches = (char **) NULL;
DIR *dir;
struct dirent *next;
matches = nmalloc(BUFSIZ);
/* Stick a wildcard onto the buf, for later use */
strcat(buf, "*");
/* Okie, if there's a / in the buffer, strip out the directory part */
if (strcmp(buf, "") && strstr(buf, "/")) {
dirName = malloc(strlen(buf) + 1);
tmp = buf + strlen(buf);
while (*tmp != '/' && tmp != buf)
tmp--;
tmp++;
strncpy(dirName, buf, tmp - buf + 1);
dirName[tmp - buf] = 0;
} else {
if ((dirName = getcwd(NULL, 0)) == NULL)
return matches;
else
tmp = buf;
}
#ifdef DEBUG
fprintf(stderr, "\nDir = %s\n", dirName);
fprintf(stderr, "\nbuf = %s\n", buf);
fprintf(stderr, "\ntmp = %s\n", tmp);
#endif
dir = opendir(dirName);
if (!dir) {
/* Don't print an error, just shut up and return */
*num_matches = 0;
beep();
return (matches);
}
while ((next = readdir(dir)) != NULL) {
/* Some quick sanity checks */
if ((strcmp(next->d_name, "..") == 0)
|| (strcmp(next->d_name, ".") == 0)) {
continue;
}
#ifdef DEBUG
fprintf(stderr, "Comparing \'%s\'\n", next->d_name);
#endif
/* See if this matches */
if (check_wildcard_match(next->d_name, tmp) == TRUE) {
/* Cool, found a match. Add it to the list
* This makes a lot more sense to me (Chris) this way...
*/
tmp2 = NULL;
tmp2 = nmalloc(strlen(next->d_name) + 1);
strcpy(tmp2, next->d_name);
matches[*num_matches] = tmp2;
++*num_matches;
/* If there's no more room, bail out */
if (*num_matches == BUFSIZ)
break;
}
}
return (matches);
}
/* This function now has an arg which refers to how much the
* statusbar (place) should be advanced, i.e. the new cursor pos.
*/
char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
{
/* Do TAB completion */
static int num_matches = 0, match_matches = 0;
static char **matches = (char **) NULL;
int pos = place, i = 0, col = 0, editline = 0;
int longestname = 0;
char *foo;
struct stat fileinfo;
if (*lastWasTab == FALSE) {
char *tmp, *copyto, *matchBuf;
*lastWasTab = 1;
/* Make a local copy of the string -- up to the position of the
cursor */
matchBuf = (char *) calloc(strlen(buf) + 2, sizeof(char));
strncpy(matchBuf, buf, place);
tmp = matchBuf;
/* skip any leading white space */
while (*tmp && isspace((int) *tmp))
++tmp;
/* Free up any memory already allocated */
if (matches != NULL) {
for (i = i; i < num_matches; i++)
free(matches[i]);
free(matches);
matches = (char **) NULL;
num_matches = 0;
}
/* If the word starts with `~' and there is no slash in the word,
* then try completing this word as a username. */
/* FIXME -- this check is broken!
if (*tmp == '~' && !strchr(tmp, '/'))
matches = username_tab_completion(tmp, &num_matches); */
/* Try to match everything in the current working directory that
* matches. */
if (!matches)
matches = cwd_tab_completion(tmp, &num_matches);
/* Don't leak memory */
free(matchBuf);
#ifdef DEBUG
fprintf(stderr, "%d matches found...\n", num_matches);
#endif
/* Did we find exactly one match? */
switch (num_matches) {
case 0:
blank_edit();
wrefresh(edit);
break;
case 1:
buf = nrealloc(buf, strlen(buf) + strlen(matches[0]) + 1);
if (strcmp(buf, "") && strstr(buf, "/")) {
for (tmp = buf + strlen(buf); *tmp != '/' && tmp != buf;
tmp--);
tmp++;
} else
tmp = buf;
if (!strcmp(tmp, matches[0])) {
/* Is it a directory? */
if (stat(buf, &fileinfo) == -1)
break;
else if (S_ISDIR(fileinfo.st_mode)) {
/* Tack on a slash */
strncat(buf, "/", 1);
*newplace += 1;
/* now we start over with 0 tabs so far */
*lastWasTab = 0;
}
break;
}
copyto = tmp;
for (pos = 0; *tmp == matches[0][pos] &&
pos <= strlen(matches[0]); pos++)
tmp++;
/* write out the matched name */
strncpy(copyto, matches[0], strlen(matches[0]) + 1);
*newplace += strlen(matches[0]) - pos;
if (stat(buf, &fileinfo) == -1)
break;
else if (S_ISDIR(fileinfo.st_mode)) {
strncat(buf, "/", 1);
*newplace += 1;
/* now we start over again with # of tabs so far */
*lastWasTab = 0;
}
break;
default:
/* Check to see if all matches share a beginning, and if so
tack it onto buf and then beep */
if (strcmp(buf, "") && strstr(buf, "/")) {
for (tmp = buf + strlen(buf); *tmp != '/' && tmp != buf;
tmp--);
tmp++;
} else
tmp = buf;
for (pos = 0; *tmp == matches[0][pos] && *tmp != 0 &&
pos <= strlen(matches[0]); pos++)
tmp++;
while (1) {
match_matches = 0;
for (i = 0; i < num_matches; i++) {
if (matches[i][pos] == 0)
break;
else if (matches[i][pos] == matches[0][pos])
match_matches++;
}
if (match_matches == num_matches &&
(i == num_matches || matches[i] != 0)) {
/* All the matches have the same character at pos+1,
so paste it into buf... */
buf = nrealloc(buf, strlen(buf) + 2);
strncat(buf, matches[0] + pos, 1);
*newplace += 1;
pos++;
} else {
beep();
break;
}
}
break;
}
} else {
/* Ok -- the last char was a TAB. Since they
* just hit TAB again, print a list of all the
* available choices... */
if (matches && num_matches > 0) {
/* Blank the edit window, and print the matches out there */
blank_edit();
wmove(edit, 0, 0);
editline = 0;
/* Figure out the length of the longest filename */
for (i = 0; i < num_matches; i++)
if (strlen(matches[i]) > longestname)
longestname = strlen(matches[i]);
if (longestname > COLS - 1)
longestname = COLS - 1;
foo = nmalloc(longestname + 5);
/* Print the list of matches */
for (i = 0, col = 0; i < num_matches; i++) {
/* make each filename shown be the same length as the longest
filename, with two spaces at the end */
snprintf(foo, longestname + 1, matches[i]);
while (strlen(foo) < longestname)
strcat(foo, " ");
strcat(foo, " ");
/* Disable el cursor */
curs_set(0);
/* now, put the match on the screen */
waddnstr(edit, foo, strlen(foo));
col += strlen(foo);
/* And if the next match isn't going to fit on the
line, move to the next one */
if (col > (COLS - longestname) && matches[i + 1] != NULL) {
editline++;
wmove(edit, editline, 0);
if (editline == editwinrows - 1) {
waddstr(edit, _("(more)"));
break;
}
col = 0;
}
}
free(foo);
wrefresh(edit);
} else
beep();
}
edit_refresh();
curs_set(1);
return buf;
}

119
global.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* global.c *
* *
@@ -38,7 +39,7 @@ int center_x = 0, center_y = 0; /* Center of screen */
WINDOW *edit; /* The file portion of the editor */
WINDOW *topwin; /* Top line of screen */
WINDOW *bottomwin; /* Bottom buffer */
char *filename; /* Name of the file */
char filename[PATH_MAX]; /* Name of the file */
int editwinrows = 0; /* How many rows long is the edit
window? */
filestruct *current; /* Current buffer pointer */
@@ -53,13 +54,15 @@ filestruct *editbot = NULL; /* Same for the bottom */
filestruct *filebot = NULL; /* Last node in the file struct */
filestruct *cutbuffer = NULL; /* A place to store cut text */
char *answer; /* Answer str to many questions */
char *answer = NULL; /* Answer str to many questions */
int totlines = 0; /* Total number of lines in the file */
int totsize = 0; /* Total number of bytes in the file */
int placewewant = 0; /* The collum we'd like the cursor
to jump to when we go to the
next or previous line */
int tabsize = 8; /* Our internal tabsize variable */
char *hblank; /* A horizontal blank line */
char *help_text; /* The text in the help window */
@@ -71,10 +74,20 @@ int mark_beginx; /* X value in the string to start */
shortcut main_list[MAIN_LIST_LEN];
shortcut whereis_list[WHEREIS_LIST_LEN];
shortcut replace_list[REPLACE_LIST_LEN];
shortcut replace_list_2[REPLACE_LIST_LEN]; /* 2nd half of replace dialog */
shortcut goto_list[GOTO_LIST_LEN];
shortcut writefile_list[WRITEFILE_LIST_LEN];
shortcut help_list[HELP_LIST_LEN];
shortcut spell_list[SPELL_LIST_LEN];
toggle toggles[TOGGLE_LEN];
/* Regular expressions */
#ifdef HAVE_REGEX_H
regex_t search_regexp; /* Global to store compiled search regexp */
regmatch_t regmatches[10]; /* Match positions for parenthetical
subexpressions, max of 10 */
#endif
/* Initialize a struct *without* our lovely braces =( */
void sc_init_one(shortcut * s, int key, char *desc, char *help, int alt,
@@ -90,6 +103,59 @@ void sc_init_one(shortcut * s, int key, char *desc, char *help, int alt,
s->func = func;
}
/* Initialize the toggles in the same manner */
void toggle_init_one(toggle * t, int val, char *desc, int flag)
{
t->val = val;
t->desc = desc;
t->flag = flag;
}
void toggle_init(void)
{
#ifndef NANO_SMALL
char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg,
*toggle_nohelp_msg, *toggle_picomode_msg, *toggle_mouse_msg,
*toggle_cuttoend_msg, *toggle_wrap_msg;
#ifdef HAVE_REGEX_H
char *toggle_regexp_msg;
#endif
toggle_const_msg = _("Constant cursor position");
toggle_autoindent_msg = _("Auto indent");
toggle_suspend_msg = _("Suspend");
toggle_nohelp_msg = _("Help mode");
toggle_picomode_msg = _("Pico mode");
toggle_mouse_msg = _("Mouse support");
toggle_cuttoend_msg = _("Cut to end");
#ifdef HAVE_REGEX_H
toggle_regexp_msg = _("Regular expressions");
#endif
toggle_wrap_msg = _("Auto wrap");
toggle_init_one(&toggles[0], TOGGLE_CONST_KEY, toggle_const_msg,
CONSTUPDATE);
toggle_init_one(&toggles[1], TOGGLE_AUTOINDENT_KEY,
toggle_autoindent_msg, AUTOINDENT);
toggle_init_one(&toggles[2], TOGGLE_SUSPEND_KEY, toggle_suspend_msg,
SUSPEND);
toggle_init_one(&toggles[3], TOGGLE_NOHELP_KEY, toggle_nohelp_msg,
NO_HELP);
toggle_init_one(&toggles[4], TOGGLE_PICOMODE_KEY, toggle_picomode_msg,
PICO_MODE);
toggle_init_one(&toggles[5], TOGGLE_WRAP_KEY, toggle_wrap_msg,
NO_WRAP);
toggle_init_one(&toggles[6], TOGGLE_MOUSE_KEY, toggle_mouse_msg,
USE_MOUSE);
toggle_init_one(&toggles[7], TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg,
CUT_TO_END);
#ifdef HAVE_REGEX_H
toggle_init_one(&toggles[8], TOGGLE_REGEXP_KEY, toggle_regexp_msg,
USE_REGEXP);
#endif
#endif
}
void shortcut_init(void)
{
char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg = "",
@@ -141,10 +207,9 @@ void shortcut_init(void)
nano_cancel_msg = _("Cancel the current function");
#endif
if (ISSET(PICO_MSGS))
if (ISSET(PICO_MODE))
sc_init_one(&main_list[0], NANO_HELP_KEY, _("Get Help"),
nano_help_msg, 0, 0, 0, VIEW, do_help);
nano_help_msg, 0, NANO_HELP_FKEY, 0, VIEW, do_help);
else
sc_init_one(&main_list[0], NANO_WRITEOUT_KEY, _("WriteOut"),
nano_writeout_msg,
@@ -153,7 +218,7 @@ void shortcut_init(void)
sc_init_one(&main_list[1], NANO_EXIT_KEY, _("Exit"),
nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit);
if (ISSET(PICO_MSGS))
if (ISSET(PICO_MODE))
sc_init_one(&main_list[2], NANO_WRITEOUT_KEY, _("WriteOut"),
nano_writeout_msg,
0, NANO_WRITEOUT_FKEY, 0, NOVIEW, do_writeout_void);
@@ -162,9 +227,10 @@ void shortcut_init(void)
nano_goto_msg,
NANO_ALT_G, NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
if (ISSET(PICO_MSGS))
if (ISSET(PICO_MODE))
sc_init_one(&main_list[3], NANO_JUSTIFY_KEY, _("Justify"),
nano_justify_msg, 0, 0, 0, NOVIEW, do_justify);
nano_justify_msg, 0, NANO_JUSTIFY_FKEY, 0,
NOVIEW, do_justify);
else
sc_init_one(&main_list[3], NANO_REPLACE_KEY, _("Replace"),
nano_replace_msg,
@@ -236,25 +302,26 @@ void shortcut_init(void)
sc_init_one(&main_list[22], NANO_TAB_KEY, _("Tab"),
nano_tab_msg, 0, 0, 0, NOVIEW, do_tab);
if (ISSET(PICO_MSGS))
if (ISSET(PICO_MODE))
sc_init_one(&main_list[23], NANO_REPLACE_KEY, _("Replace"),
nano_replace_msg,
NANO_ALT_R, NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
else
sc_init_one(&main_list[23], NANO_JUSTIFY_KEY, _("Justify"),
nano_justify_msg, 0, 0, 0, NOVIEW, do_justify);
nano_justify_msg, 0, NANO_JUSTIFY_FKEY, 0,
NOVIEW, do_justify);
sc_init_one(&main_list[24], NANO_ENTER_KEY, _("Enter"),
nano_enter_msg,
0, KEY_ENTER, NANO_CONTROL_M, NOVIEW, do_enter_void);
if (ISSET(PICO_MSGS))
if (ISSET(PICO_MODE))
sc_init_one(&main_list[25], NANO_GOTO_KEY, _("Goto Line"),
nano_goto_msg,
NANO_ALT_G, NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
else
sc_init_one(&main_list[25], NANO_HELP_KEY, _("Get Help"),
nano_help_msg, 0, 0, 0, VIEW, do_help);
nano_help_msg, 0, NANO_HELP_FKEY, 0, VIEW, do_help);
sc_init_one(&whereis_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
@@ -267,10 +334,14 @@ void shortcut_init(void)
nano_case_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&whereis_list[3], NANO_OTHERSEARCH_KEY, _("To Replace"),
sc_init_one(&whereis_list[3], NANO_OTHERSEARCH_KEY, _("Replace"),
nano_replace_msg, 0, 0, 0, VIEW, do_replace);
sc_init_one(&whereis_list[4], NANO_CANCEL_KEY, _("Cancel"),
sc_init_one(&whereis_list[4], NANO_FROMSEARCHTOGOTO_KEY,
_("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
do_gotoline_void);
sc_init_one(&whereis_list[5], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
@@ -283,10 +354,25 @@ void shortcut_init(void)
sc_init_one(&replace_list[2], NANO_CASE_KEY, _("Case Sens"),
nano_case_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&replace_list[3], NANO_OTHERSEARCH_KEY, _("To Search"),
sc_init_one(&replace_list[3], NANO_OTHERSEARCH_KEY, _("No Replace"),
nano_whereis_msg, 0, 0, 0, VIEW, do_search);
sc_init_one(&replace_list[4], NANO_CANCEL_KEY, _("Cancel"),
sc_init_one(&replace_list[4], NANO_FROMSEARCHTOGOTO_KEY,
_("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
do_gotoline_void);
sc_init_one(&replace_list[5], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&replace_list_2[0], NANO_FIRSTLINE_KEY, _("First Line"),
nano_firstline_msg, 0, 0, 0, VIEW, do_first_line);
sc_init_one(&replace_list_2[1], NANO_LASTLINE_KEY, _("Last Line"),
nano_lastline_msg, 0, 0, 0, VIEW, do_last_line);
sc_init_one(&replace_list_2[2], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
@@ -325,4 +411,5 @@ void shortcut_init(void)
sc_init_one(&spell_list[1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
toggle_init();
}

52
move.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* move.c *
* *
@@ -34,19 +35,15 @@
void page_down_center(void)
{
if (editbot->next != NULL && editbot->next != filebot) {
edit_update(editbot->next);
center_cursor();
} else if (editbot != filebot) {
edit_update(editbot);
if (editbot != filebot) {
edit_update(editbot->next, CENTER);
center_cursor();
} else {
while (current != filebot)
current = current->next;
edit_update(current);
edit_update(current, CENTER);
}
update_cursor();
}
int page_down(void)
@@ -58,16 +55,23 @@ int page_down(void)
if (current == filebot)
return 0;
if (editbot != filebot) {
if (editbot != filebot || edittop == fileage) {
current_y = 0;
current = editbot;
} else
if (current->prev != NULL)
current = current->prev;
if (current->prev != NULL)
current = current->prev;
edit_update(current, TOP);
} else {
while (current != filebot) {
current = current->next;
current_y++;
}
edit_update(edittop, TOP);
}
edit_update_top(current);
update_cursor();
UNSET(KEEP_CUTBUFFER);
check_statblank();
@@ -125,7 +129,7 @@ int do_down(void)
void page_up_center(void)
{
if (edittop != fileage) {
edit_update(edittop);
edit_update(edittop, CENTER);
center_cursor();
} else
current_y = 0;
@@ -134,6 +138,32 @@ void page_up_center(void)
}
int page_up(void)
{
filestruct *fileptr = edittop;
wrap_reset();
current_x = 0;
placewewant = 0;
if (current == fileage)
return 0;
current_y = 0;
if (fileptr->next != NULL)
fileptr = fileptr->next;
if (fileptr->next != NULL)
fileptr = fileptr->next;
current = edittop;
edit_update(fileptr, BOTTOM);
update_cursor();
UNSET(KEEP_CUTBUFFER);
check_statblank();
return 1;
}
int do_up(void)
{
wrap_reset();

15
nano.1
View File

@@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH NANO 1 "January 4, 2000"
.TH NANO 1 "July 28, 2000"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -40,7 +40,11 @@ number".
.SH OPTIONS
.TP
.B \-T (\-\-tabsize)
Set the size (width) of a tab, if supported by your curses library.
Set the size (width) of a tab.
.TP
.B \-R (\-\-regexp)
Enable regular expression matching for search strings, as well as
\\n subexpression replacement for replace strings, if available.
.TP
.B \-V (\-\-version)
Show the current version number and author.
@@ -51,6 +55,9 @@ Display a summary of commandline options.
.B \-c (\-\-const)
Constantly show the cursor position.
.TP
.B \-k (\-\-cut)
Enable cut from cursor to end of line with ^K.
.TP
.B \-i (\-\-autoindent)
Indent new lines to the previous line's indentation. Useful when editing
source code.
@@ -87,13 +94,13 @@ Enable suspend ability.
Places cursor at LINE on startup.
.SH BUGS
Please send any comments or bug reports to
.B nano@asty.org.
.B nano@nano-editor.org.
The nano mailing list is available from
.B nano-devel@lists.sourceforge.net.
To subscribe, email to nano-devel-request@lists.sourceforge.net with a
subject of "subscribe".
.SH HOMEPAGE
http://www.asty.org/nano
http://www.nano-editor.org
.SH AUTHOR
Chris Allegretta <chrisa@asty.org>, et al. This manual page was
originally written by Jordi Mallach <jordi@sindominio.net>, for the Debian

View File

@@ -3,7 +3,7 @@ Content-type: text/html
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
</HEAD><BODY>
<H1>NANO</H1>
Section: User Commands (1)<BR>Updated: January 4, 2000<BR><A HREF="#index">Index</A>
Section: User Commands (1)<BR>Updated: July 28, 2000<BR><A HREF="#index">Index</A>
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
@@ -59,7 +59,12 @@ number&quot;.
<DT><B>-T (--tabsize)</B>
<DD>
Set the size (width) of a tab, if supported by your curses library.
Set the size (width) of a tab.
<DT><B>-R (--regexp)</B>
<DD>
Enable regular expression matching for search strings, as well as
\n subexpression replacement for replace strings, if available.
<DT><B>-V (--version)</B>
<DD>
@@ -72,6 +77,10 @@ Display a summary of commandline options.
<DD>
Constantly show the cursor position.
<DT><B>-k (--cut)</B>
<DD>
Enable cut from cursor to end of line with ^K.
<DT><B>-i (--autoindent)</B>
<DD>
@@ -123,7 +132,7 @@ Places cursor at LINE on startup.
<H2>BUGS</H2>
Please send any comments or bug reports to
<B><A HREF="mailto:nano@asty.org">nano@asty.org</A>.</B>
<B><A HREF="mailto:nano@nano-editor.org">nano@nano-editor.org</A>.</B>
The nano mailing list is available from
<B><A HREF="mailto:nano-devel@lists.sourceforge.net">nano-devel@lists.sourceforge.net</A>.</B>
@@ -133,7 +142,7 @@ subject of &quot;subscribe&quot;.
<A NAME="lbAG">&nbsp;</A>
<H2>HOMEPAGE</H2>
<A HREF="http://www.asty.org/nano">http://www.asty.org/nano</A>
<A HREF="http://www.nano-editor.org">http://www.nano-editor.org</A>
<A NAME="lbAH">&nbsp;</A>
<H2>AUTHOR</H2>
@@ -157,6 +166,6 @@ GNU/Linux system (but may be used by others).
This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 02:19:33 GMT, June 21, 2000
Time: 17:29:02 GMT, July 28, 2000
</BODY>
</HTML>

1123
nano.c

File diff suppressed because it is too large Load Diff

49
nano.h
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* nano.h *
* *
@@ -44,11 +45,6 @@
#include <curses.h>
#endif /* CURSES_H */
#ifndef HAVE_TABSIZE
static int TABSIZE = 8;
#endif
#ifdef HAVE_LIBINTL_H
#include <libintl.h>
#endif
@@ -86,6 +82,14 @@ typedef struct shortcut {
char *help; /* Help file entry text */
} shortcut;
typedef struct toggle {
int val; /* Sequence to toggle the key. Should only need 1 */
char *desc; /* Description for when toggle is, uh, toggled,
e.g. "Pico Messages", we'll append Enabled or
Disabled */
int flag; /* What flag actually gets toggled */
} toggle;
/* Bitwise flags so we can save space (or more correctly, not waste it) */
#define MODIFIED (1<<0)
@@ -94,7 +98,7 @@ typedef struct shortcut {
#define MARK_ISSET (1<<3)
#define CONSTUPDATE (1<<4)
#define NO_HELP (1<<5)
#define PICO_MSGS (1<<6)
#define PICO_MODE (1<<6)
#define FOLLOW_SYMLINKS (1<<7)
#define SUSPEND (1<<8)
#define NO_WRAP (1<<9)
@@ -102,7 +106,11 @@ typedef struct shortcut {
#define SAMELINEWRAP (1<<11)
#define VIEW_MODE (1<<12)
#define USE_MOUSE (1<<13)
#define USE_REGEXP (1<<14)
#define REGEXP_COMPILED (1<<15)
#define TEMP_OPT (1<<16)
#define CUT_TO_END (1<<17)
#define DISABLE_CURPOS (1<<18)
/* Control key sequences, chaning these would be very very bad */
@@ -184,7 +192,7 @@ know what you're doing */
#define NANO_REPLACE_KEY NANO_CONTROL_4
#define NANO_REPLACE_FKEY KEY_F(14)
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
#define NANO_OTHERSEARCH_KEY NANO_CONTROL_T
#define NANO_OTHERSEARCH_KEY NANO_CONTROL_R
#define NANO_PREVPAGE_KEY NANO_CONTROL_Y
#define NANO_PREVPAGE_FKEY KEY_F(7)
#define NANO_NEXTPAGE_KEY NANO_CONTROL_V
@@ -216,17 +224,38 @@ know what you're doing */
#define NANO_TAB_KEY NANO_CONTROL_I
#define NANO_SUSPEND_KEY NANO_CONTROL_Z
#define NANO_ENTER_KEY NANO_CONTROL_M
#define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T
#define TOGGLE_CONST_KEY NANO_ALT_C
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
#define TOGGLE_SUSPEND_KEY NANO_ALT_Z
#define TOGGLE_NOHELP_KEY NANO_ALT_X
#define TOGGLE_PICOMODE_KEY NANO_ALT_P
#define TOGGLE_MOUSE_KEY NANO_ALT_M
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
#define TOGGLE_REGEXP_KEY NANO_ALT_E
#define TOGGLE_WRAP_KEY NANO_ALT_W
#define MAIN_LIST_LEN 26
#define MAIN_VISIBLE 12
#define WHEREIS_LIST_LEN 5
#define REPLACE_LIST_LEN 5
#define WHEREIS_LIST_LEN 6
#define REPLACE_LIST_LEN 6
#define REPLACE_LIST_2_LEN 3
#define GOTO_LIST_LEN 3
#define WRITEFILE_LIST_LEN 1
#define HELP_LIST_LEN 3
#define SPELL_LIST_LEN 3
#ifdef HAVE_REGEX_H
#define TOGGLE_LEN 9
#else
#define TOGGLE_LEN 8
#endif
#define VIEW 1
#define NOVIEW 0
#define TOP 2
#define CENTER 1
#define BOTTOM 0
#endif

View File

@@ -0,0 +1 @@
$Id$

View File

@@ -1,3 +1,4 @@
# $Id$
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
@@ -111,9 +112,9 @@ install-data: install-data-@USE_NLS@
install-data-no: all
install-data-yes: all
if test -r "$(MKINSTALLDIRS)"; then \
$(MKINSTALLDIRS) $(datadir); \
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
else \
$(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
fi
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
@@ -125,27 +126,30 @@ install-data-yes: all
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
dir=$$destdir/$$lang/LC_MESSAGES; \
if test -r "$(MKINSTALLDIRS)"; then \
$(MKINSTALLDIRS) $$dir; \
$(MKINSTALLDIRS) $(DESTDIR)$$dir; \
else \
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$$dir; \
fi; \
if test -r $$cat; then \
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
echo "installing $$cat as" \
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
else \
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
$(INSTALL_DATA) $(srcdir)/$$cat \
$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
echo "installing $(srcdir)/$$cat as" \
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
fi; \
if test -r $$cat.m; then \
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
$(INSTALL_DATA) $$cat.m $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
echo "installing $$cat.m as" \
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
else \
if test -r $(srcdir)/$$cat.m ; then \
$(INSTALL_DATA) $(srcdir)/$$cat.m \
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
echo "installing $(srcdir)/$$cat as" \
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
else \
true; \
fi; \
@@ -153,12 +157,12 @@ install-data-yes: all
done
if test "$(PACKAGE)" = "gettext"; then \
if test -r "$(MKINSTALLDIRS)"; then \
$(MKINSTALLDIRS) $(gettextsrcdir); \
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
else \
$(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
fi; \
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
$(gettextsrcdir)/Makefile.in.in; \
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
else \
: ; \
fi

View File

@@ -1,3 +1,4 @@
# $Id$
# List of source files containing translatable strings.
# Package source files

View File

@@ -28,72 +28,81 @@ const struct _msg_ent _msg_tbl[] = {
{"File Name to write", 19},
{"filename is %s", 20},
{"File exists, OVERWRITE ?", 21},
{"Invoke the help menu", 22},
{"Write the current file to disk", 23},
{"Exit from nano", 24},
{"Goto a specific line number", 25},
{"Justify the current paragraph", 26},
{"Replace text within the editor", 27},
{"Insert another file into the current one", 28},
{"Search for text within the editor", 29},
{"Move to the previous screen", 30},
{"Move to the next screen", 31},
{"Cut the current line and store it in the cutbuffer", 32},
{"Uncut from the cutbuffer into the current line", 33},
{"Show the posititon of the cursor", 34},
{"Invoke the spell checker (if available)", 35},
{"Move up one line", 36},
{"Move down one line", 37},
{"Move forward one character", 38},
{"Move back one character", 39},
{"Move to the beginning of the current line", 40},
{"Move to the end of the current line", 41},
{"Go to the first line of the file", 42},
{"Go to the last line of the file", 43},
{"Refresh (redraw) the current screen", 44},
{"Mark text at the current cursor location", 45},
{"Delete the character under the cursor", 46},
{"Delete the character to the left of the cursor", 47},
{"Insert a tab character", 48},
{"Insert a carriage return at the cursor position", 49},
{"Make the current search or replace case (in)sensitive", 50},
{"Cancel the current function", 51},
{"Get Help", 52},
{"WriteOut", 53},
{"Exit", 54},
{"Goto Line", 55},
{"Justify", 56},
{"Replace", 57},
{"Read File", 58},
{"Where Is", 59},
{"Prev Page", 60},
{"Next Page", 61},
{"Cut Text", 62},
{"UnCut Txt", 63},
{"Cur Pos", 64},
{"To Spell", 65},
{"Up", 66},
{"Down", 67},
{"Forward", 68},
{"Back", 69},
{"Home", 70},
{"End", 71},
{"Refresh", 72},
{"Mark Text", 73},
{"Delete", 74},
{"Backspace", 75},
{"Tab", 76},
{"Enter", 77},
{"First Line", 78},
{"Last Line", 79},
{"Case Sens", 80},
{"To Replace", 81},
{"Cancel", 82},
{"To Search", 83},
{"(more)", 22},
{"Constant cursor position", 23},
{"Auto indent", 24},
{"Suspend", 25},
{"Help mode", 26},
{"Pico mode", 27},
{"Mouse support", 28},
{"Cut to end", 29},
{"Regular expressions", 30},
{"Auto wrap", 31},
{"Invoke the help menu", 32},
{"Write the current file to disk", 33},
{"Exit from nano", 34},
{"Goto a specific line number", 35},
{"Justify the current paragraph", 36},
{"Replace text within the editor", 37},
{"Insert another file into the current one", 38},
{"Search for text within the editor", 39},
{"Move to the previous screen", 40},
{"Move to the next screen", 41},
{"Cut the current line and store it in the cutbuffer", 42},
{"Uncut from the cutbuffer into the current line", 43},
{"Show the posititon of the cursor", 44},
{"Invoke the spell checker (if available)", 45},
{"Move up one line", 46},
{"Move down one line", 47},
{"Move forward one character", 48},
{"Move back one character", 49},
{"Move to the beginning of the current line", 50},
{"Move to the end of the current line", 51},
{"Go to the first line of the file", 52},
{"Go to the last line of the file", 53},
{"Refresh (redraw) the current screen", 54},
{"Mark text at the current cursor location", 55},
{"Delete the character under the cursor", 56},
{"Delete the character to the left of the cursor", 57},
{"Insert a tab character", 58},
{"Insert a carriage return at the cursor position", 59},
{"Make the current search or replace case (in)sensitive", 60},
{"Cancel the current function", 61},
{"Get Help", 62},
{"WriteOut", 63},
{"Exit", 64},
{"Goto Line", 65},
{"Justify", 66},
{"Replace", 67},
{"Read File", 68},
{"Where Is", 69},
{"Prev Page", 70},
{"Next Page", 71},
{"Cut Text", 72},
{"UnCut Txt", 73},
{"Cur Pos", 74},
{"To Spell", 75},
{"Up", 76},
{"Down", 77},
{"Forward", 78},
{"Back", 79},
{"Home", 80},
{"End", 81},
{"Refresh", 82},
{"Mark Text", 83},
{"Delete", 84},
{"Backspace", 85},
{"Tab", 86},
{"Enter", 87},
{"First Line", 88},
{"Last Line", 89},
{"Case Sens", 90},
{"Cancel", 91},
{"No Replace", 92},
{"\
\n\
Buffer written to 'nano.save'\n", 84},
{"Key illegal in VIEW mode", 85},
Buffer written to 'nano.save'\n", 93},
{"Key illegal in VIEW mode", 94},
{"\
nano help text\n\
\n\
@@ -106,111 +115,124 @@ bottom and shows important messages. The bottom two lines show the most \
commonly used shortcuts in the editor.\n\
\n\
The notation for shortcuts is as follows: Control-key sequences are notated \
with a caret (^) symbol. Alt-key sequences are notated with an at (@) \
symbol. The following keystrokes are available in the main editor window. \
Optional keys are shown in parentheses:\n\
\n", 86},
{"free_node(): free'd a node, YAY!\n", 87},
{"free_node(): free'd last node.\n", 88},
with a caret (^) symbol and are entered with the Control (Ctrl) key. \
Escape-key sequences are notated with the Meta (M) symbol and can be entered \
using either the Esc, Alt or Meta key depending on your keyboard setup. The \
following keystrokes are available in the main editor window. Optional keys \
are shown in parentheses:\n\
\n", 95},
{"free_node(): free'd a node, YAY!\n", 96},
{"free_node(): free'd last node.\n", 97},
{"\
Usage: nano [GNU long option] [option] +LINE <file>\n\
\n", 89},
{"Option\t\tLong option\t\tMeaning\n", 90},
{" -T \t\t--tabsize=[num]\t\tSet width of a tab to num\n", 91},
{" -V \t\t--version\t\tPrint version information and exit\n", 92},
{" -c \t\t--const\t\t\tConstantly show cursor position\n", 93},
{" -h \t\t--help\t\t\tShow this message\n", 94},
{" -i \t\t--autoindent\t\tAutomatically indent new lines\n", 95},
{" -l \t\t--nofollow\t\tDon't follow symbolic links, overwrite.\n", 96},
{" -m \t\t--mouse\t\t\tEnable mouse\n", 97},
\n", 98},
{"Option\t\tLong option\t\tMeaning\n", 99},
{" -T \t\t--tabsize=[num]\t\tSet width of a tab to num\n", 100},
{" -R\t\t--regexp\t\tUse regular expressions for search\n", 101},
{" -V \t\t--version\t\tPrint version information and exit\n", 102},
{" -c \t\t--const\t\t\tConstantly show cursor position\n", 103},
{" -h \t\t--help\t\t\tShow this message\n", 104},
{" -k \t\t--cut\t\t\tLet ^K cut from cursor to end of line\n", 105},
{" -i \t\t--autoindent\t\tAutomatically indent new lines\n", 106},
{" -l \t\t--nofollow\t\tDon't follow symbolic links, overwrite\n", 107},
{" -m \t\t--mouse\t\t\tEnable mouse\n", 108},
{"\
-r [#cols] \t--fill=[#cols]\t\tSet fill cols to (wrap lines at) #cols\n", 98},
{" -p\t \t--pico\t\t\tMake bottom 2 lines more Pico-like\n", 99},
{" -s [prog] \t--speller=[prog]\tEnable alternate speller\n", 100},
{" -t \t\t--tempfile\t\tAuto save on exit, don't prompt\n", 101},
{" -v \t\t--view\t\t\tView (read only) mode\n", 102},
{" -w \t\t--nowrap\t\tDon't wrap long lines\n", 103},
{" -x \t\t--nohelp\t\tDon't show help window\n", 104},
{" -z \t\t--suspend\t\tEnable suspend\n", 105},
{" +LINE\t\t\t\t\tStart at line number LINE\n", 106},
-r [#cols] \t--fill=[#cols]\t\tSet fill cols to (wrap lines at) #cols\n", 109},
{" -p\t \t--pico\t\t\tEmulate Pico as closely as possible\n", 110},
{" -s [prog] \t--speller=[prog]\tEnable alternate speller\n", 111},
{" -t \t\t--tempfile\t\tAuto save on exit, don't prompt\n", 112},
{" -v \t\t--view\t\t\tView (read only) mode\n", 113},
{" -w \t\t--nowrap\t\tDon't wrap long lines\n", 114},
{" -x \t\t--nohelp\t\tDon't show help window\n", 115},
{" -z \t\t--suspend\t\tEnable suspend\n", 116},
{" +LINE\t\t\t\t\tStart at line number LINE\n", 117},
{"\
Usage: nano [option] +LINE <file>\n\
\n", 107},
{"Option\t\tMeaning\n", 108},
{" -T [num]\tSet width of a tab to num\n", 109},
{" -V \t\tPrint version information and exit\n", 110},
{" -c \t\tConstantly show cursor position\n", 111},
{" -h \t\tShow this message\n", 112},
{" -i \t\tAutomatically indent new lines\n", 113},
{" -l \t\tDon't follow symbolic links, overwrite.\n", 114},
{" -m \t\tEnable mouse\n", 115},
{" -r [#cols] \tSet fill cols to (wrap lines at) #cols\n", 116},
{" -s [prog] \tEnable alternate speller\n", 117},
{" -p \t\tMake bottom 2 lines more Pico-like\n", 118},
{" -t \t\tAuto save on exit, don't prompt\n", 119},
{" -v \t\tView (read only) mode\n", 120},
{" -w \t\tDon't wrap long lines\n", 121},
{" -x \t\tDon't show help window\n", 122},
{" -z \t\tEnable suspend\n", 123},
{" +LINE\t\tStart at line number LINE\n", 124},
{" nano version %s by Chris Allegretta (compiled %s, %s)\n", 125},
{" Email: nano@asty.org\tWeb: http://www.asty.org/nano\n", 126},
{"Mark Set", 127},
{"Mark UNset", 128},
{"check_wrap called with inptr->data=\"%s\"\n", 129},
{"current->data now = \"%s\"\n", 130},
{"After, data = \"%s\"\n", 131},
{"Error deleting tempfile, ack!", 132},
{"Could not create a temporary filename: %s", 133},
{"Could not invoke spell program \"%s\"", 134},
{"Could not invoke \"ispell\"", 135},
{"Finished checking spelling", 136},
{"Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? ", 137},
{"Cannot resize top win", 138},
{"Cannot move top win", 139},
{"Cannot resize edit win", 140},
{"Cannot move edit win", 141},
{"Cannot resize bottom win", 142},
{"Cannot move bottom win", 143},
{"Main: set up windows\n", 144},
{"Main: bottom win\n", 145},
{"Main: open file\n", 146},
{"I got Alt-[-%c! (%d)\n", 147},
{"I got Alt-%c! (%d)\n", 148},
{"Case Sensitive Search%s", 149},
{"Search%s", 150},
{"Search Cancelled", 151},
{"Search Wrapped", 152},
{"Replaced %d occurences", 153},
{"Replaced 1 occurence", 154},
{"Replace Cancelled", 155},
{"Replace with [%s]", 156},
{"Replace with", 157},
{"Replace this instance?", 158},
{"Enter line number", 159},
{"Aborted", 160},
{"Come on, be reasonable", 161},
{"Only %d lines available, skipping to last line", 162},
{"actual_x_from_start for xplus=%d returned %d\n", 163},
{"input '%c' (%d)\n", 164},
{"New Buffer", 165},
{" File: ...", 166},
{"Modified", 167},
{"Moved to (%d, %d) in edit buffer\n", 168},
{"current->data = \"%s\"\n", 169},
{"I got \"%s\"\n", 170},
{" Y", 171},
{"Yes", 172},
{" A", 173},
{"All", 174},
{" N", 175},
{"No", 176},
{"^C", 177},
{"do_cursorpos: linepct = %f, bytepct = %f\n", 178},
{"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 179},
{"Dumping file buffer to stderr...\n", 180},
{"Dumping cutbuffer to stderr...\n", 181},
{"Dumping a buffer to stderr...\n", 182},
\n", 118},
{"Option\t\tMeaning\n", 119},
{" -T [num]\tSet width of a tab to num\n", 120},
{" -R\t\tUse regular expressions for search\n", 121},
{" -V \t\tPrint version information and exit\n", 122},
{" -c \t\tConstantly show cursor position\n", 123},
{" -h \t\tShow this message\n", 124},
{" -k \t\tLet ^K cut from cursor to end of line\n", 125},
{" -i \t\tAutomatically indent new lines\n", 126},
{" -l \t\tDon't follow symbolic links, overwrite\n", 127},
{" -m \t\tEnable mouse\n", 128},
{" -r [#cols] \tSet fill cols to (wrap lines at) #cols\n", 129},
{" -s [prog] \tEnable alternate speller\n", 130},
{" -p \t\tEmulate Pico as closely as possible\n", 131},
{" -t \t\tAuto save on exit, don't prompt\n", 132},
{" -v \t\tView (read only) mode\n", 133},
{" -w \t\tDon't wrap long lines\n", 134},
{" -x \t\tDon't show help window\n", 135},
{" -z \t\tEnable suspend\n", 136},
{" +LINE\t\tStart at line number LINE\n", 137},
{" nano version %s by Chris Allegretta (compiled %s, %s)\n", 138},
{" Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org\n", 139},
{"Mark Set", 140},
{"Mark UNset", 141},
{"check_wrap called with inptr->data=\"%s\"\n", 142},
{"current->data now = \"%s\"\n", 143},
{"After, data = \"%s\"\n", 144},
{"Edit a replacement", 145},
{"Could not create a temporary filename: %s", 146},
{"Finished checking spelling", 147},
{"Spell checking failed", 148},
{"Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? ", 149},
{"Cannot resize top win", 150},
{"Cannot move top win", 151},
{"Cannot resize edit win", 152},
{"Cannot move edit win", 153},
{"Cannot resize bottom win", 154},
{"Cannot move bottom win", 155},
{"Justify Complete", 156},
{"%s enable/disable", 157},
{"enabled", 158},
{"disabled", 159},
{"Main: set up windows\n", 160},
{"Main: bottom win\n", 161},
{"Main: open file\n", 162},
{"I got Alt-O-%c! (%d)\n", 163},
{"I got Alt-[-1-%c! (%d)\n", 164},
{"I got Alt-[-2-%c! (%d)\n", 165},
{"I got Alt-[-%c! (%d)\n", 166},
{"I got Alt-%c! (%d)\n", 167},
{"Case Sensitive Regexp Search%s%s", 168},
{"Regexp Search%s%s", 169},
{"Case Sensitive Search%s%s", 170},
{"Search%s%s", 171},
{" (to replace)", 172},
{"Search Cancelled", 173},
{"\"%s...\" not found", 174},
{"Search Wrapped", 175},
{"Replaced %d occurences", 176},
{"Replaced 1 occurence", 177},
{"Replace Cancelled", 178},
{"Replace this instance?", 179},
{"Replace failed: unknown subexpression!", 180},
{"Replace with [%s]", 181},
{"Replace with", 182},
{"Enter line number", 183},
{"Aborted", 184},
{"Come on, be reasonable", 185},
{"Only %d lines available, skipping to last line", 186},
{"actual_x_from_start for xplus=%d returned %d\n", 187},
{"input '%c' (%d)\n", 188},
{"New Buffer", 189},
{" File: ...", 190},
{"Modified", 191},
{"Moved to (%d, %d) in edit buffer\n", 192},
{"current->data = \"%s\"\n", 193},
{"I got \"%s\"\n", 194},
{"Yes", 195},
{"All", 196},
{"No", 197},
{"do_cursorpos: linepct = %f, bytepct = %f\n", 198},
{"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 199},
{"Dumping file buffer to stderr...\n", 200},
{"Dumping cutbuffer to stderr...\n", 201},
{"Dumping a buffer to stderr...\n", 202},
};
int _msg_tbl_length = 182;
int _msg_tbl_length = 202;

BIN
po/de.gmo

Binary file not shown.

717
po/de.po

File diff suppressed because it is too large Load Diff

BIN
po/es.gmo

Binary file not shown.

594
po/es.po

File diff suppressed because it is too large Load Diff

BIN
po/fi.gmo Normal file

Binary file not shown.

941
po/fi.po Normal file
View File

@@ -0,0 +1,941 @@
# $Id$
# nano Finnish Translation.
# Copyright (C) 2000 Free Software Foundation, Inc.
# Pauli Virtanen <pauli.virtanen@saunalahti.fi>, 2000.
#
msgid ""
msgstr ""
"Project-Id-Version: nano 0.9.11\n"
"POT-Creation-Date: 2000-11-17 22:07-0500\n"
"PO-Revision-Date: 2000-06-21 23:08+03:00\n"
"Last-Translator: Pauli Virtanen <pauli.virtanen@saunalahti.fi>\n"
"Language-Team: Finnish <fi@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
#: cut.c:44
#, c-format
msgid "add_to_cutbuffer called with inptr->data = %s\n"
msgstr "add_to_cutbuffer funktion parametri inptr->data = %s\n"
#: cut.c:150
msgid "Blew away cutbuffer =)\n"
msgstr "Leiketila katosi =)\n"
#: files.c:122
msgid "read_line: not on first line and prev is NULL"
msgstr "read_line: ei ensimmäisellä rivillä ja prev on NULL"
#: files.c:184 files.c:201
#, c-format
msgid "Read %d lines"
msgstr "%d riviä luettu"
#: files.c:219 search.c:188
#, c-format
msgid "\"%s\" not found"
msgstr "Tiedostoa \"%s\" ei ole"
#. We have a new file
#: files.c:223
msgid "New File"
msgstr "Uusi tiedosto"
#: files.c:232
#, c-format
msgid "File \"%s\" is a directory"
msgstr "\"%s\" on hakemisto"
#: files.c:238
msgid "Reading File"
msgstr "Tiedostoa luetaan"
#: files.c:251
msgid "File to insert [from ./] "
msgstr "Lisättävä tiedosto [hakemistossa ./]"
#: files.c:276 files.c:300 files.c:488 nano.c:1355
msgid "Cancelled"
msgstr "Peruttu"
#: files.c:322 files.c:342 files.c:356 files.c:373 files.c:379
#, c-format
msgid "Could not open file for writing: %s"
msgstr "Tiedostoa ei voitu avata luettavaksi: %s"
#: files.c:330
msgid "Could not open file: Path length exceeded."
msgstr "Tiedostoa ei voitu avata: liian pitkä tiedostonnimi."
#: files.c:361
#, c-format
msgid "Wrote >%s\n"
msgstr "Kirjoitettu: >%s\n"
#: files.c:388
#, c-format
msgid "Could not close %s: %s"
msgstr "Tiedosto %s ei sulkeutunut: %s"
#. Try a rename??
#: files.c:409 files.c:420 files.c:425
#, c-format
msgid "Could not open %s for writing: %s"
msgstr "Tiedostoa %s ei voitu avata kirjoitettavaksi: %s"
#: files.c:431
#, c-format
msgid "Could not set permissions %o on %s: %s"
msgstr "Oikeuksia %o ei voitu asettaa tiedostolle %s: %s"
#: files.c:438
#, c-format
msgid "Wrote %d lines"
msgstr "%d riviä kirjoitettu"
#: files.c:467
msgid "File Name to write"
msgstr "Kirjoitettavan tiedoston nimi"
#: files.c:472
#, c-format
msgid "filename is %s"
msgstr "tiedoston nimi on %s"
#: files.c:477
msgid "File exists, OVERWRITE ?"
msgstr "Tiedosto on jo olemassa, korvataanko?"
#: files.c:801
msgid "(more)"
msgstr ""
#: global.c:124
#, fuzzy
msgid "Constant cursor position"
msgstr " -c \t\tNäytä kohdistimen sijainti jatkuvasti\n"
#: global.c:125
#, fuzzy
msgid "Auto indent"
msgstr "Siirry"
#: global.c:126
msgid "Suspend"
msgstr ""
#: global.c:127
msgid "Help mode"
msgstr ""
#: global.c:128
msgid "Pico mode"
msgstr ""
#: global.c:129
msgid "Mouse support"
msgstr ""
#: global.c:130
msgid "Cut to end"
msgstr ""
#: global.c:132
msgid "Regular expressions"
msgstr ""
#: global.c:134
msgid "Auto wrap"
msgstr ""
#: global.c:176
msgid "Invoke the help menu"
msgstr "Avaa ohjevalikko"
#: global.c:177
msgid "Write the current file to disk"
msgstr "Kirjoita nykyinen tiedosto levylle"
#: global.c:178
msgid "Exit from nano"
msgstr "Poistu nanosta"
#: global.c:179
msgid "Goto a specific line number"
msgstr "Siirry tietylle riville"
#: global.c:180
msgid "Justify the current paragraph"
msgstr "Tasaa nykyinen kappale"
#: global.c:181
msgid "Replace text within the editor"
msgstr "Etsi ja korvaa tekstiä"
#: global.c:182
msgid "Insert another file into the current one"
msgstr "Lisää toinen tiedosto nykyiseen tiedostoon"
#: global.c:183
msgid "Search for text within the editor"
msgstr "Etsi tekstiä"
#: global.c:184
msgid "Move to the previous screen"
msgstr "Siirry edelliseen ruutuun"
#: global.c:185
msgid "Move to the next screen"
msgstr "Siirry seuraavaan ruutuun"
#: global.c:186
msgid "Cut the current line and store it in the cutbuffer"
msgstr "Leikkaa nykyinen rivi leiketilaan"
#: global.c:187
msgid "Uncut from the cutbuffer into the current line"
msgstr "Kopioi rivi leiketilasta nykyiselle riville"
#: global.c:188
msgid "Show the posititon of the cursor"
msgstr "Näytä kohdistimen sijainti"
#: global.c:189
msgid "Invoke the spell checker (if available)"
msgstr "Käynnistä oikoluin (jos saatavilla)"
#: global.c:190
msgid "Move up one line"
msgstr "Siirry yksi rivi ylöspäin"
#: global.c:191
msgid "Move down one line"
msgstr "Siirry yksi rivi alaspäin"
#: global.c:192
msgid "Move forward one character"
msgstr "Siirry yksi merkki eteenpäin"
#: global.c:193
msgid "Move back one character"
msgstr "Siirry yksi merkki taaksepäin"
#: global.c:194
msgid "Move to the beginning of the current line"
msgstr "Siirry nykyisen rivin alkuun"
#: global.c:195
msgid "Move to the end of the current line"
msgstr "Siirry nykyisen rivin loppuun"
#: global.c:196
msgid "Go to the first line of the file"
msgstr "Siirry tiedoston ensimmäiselle riville"
#: global.c:197
msgid "Go to the last line of the file"
msgstr "Siirry tiedoston viimeiselle riville"
#: global.c:198
msgid "Refresh (redraw) the current screen"
msgstr "Piirrä ruutu uudestaan"
#: global.c:199
msgid "Mark text at the current cursor location"
msgstr "Merkitse kohdistimen kohdalla oleva teksti"
#: global.c:200
msgid "Delete the character under the cursor"
msgstr "Poista kohdistimen kohdalla oleva merkki"
#: global.c:202
msgid "Delete the character to the left of the cursor"
msgstr "Poista kohdistimesta vasemmalle oleva merkki"
#: global.c:203
msgid "Insert a tab character"
msgstr "Lisää sarkainmerkki"
#: global.c:204
msgid "Insert a carriage return at the cursor position"
msgstr "Lisää rivinvaihto kohdistimen kohdalle"
#: global.c:206
msgid "Make the current search or replace case (in)sensitive"
msgstr "Muuta etsintä- tai korvaustoiminnon kirjainkoosta piittaamista."
#: global.c:207
msgid "Cancel the current function"
msgstr "Peru nykyinen toiminto."
#: global.c:211 global.c:323 global.c:408
msgid "Get Help"
msgstr "Ohjeita"
#: global.c:214 global.c:222
msgid "WriteOut"
msgstr "Kirjoita"
#: global.c:218 global.c:397
msgid "Exit"
msgstr "Lopeta"
#: global.c:226 global.c:319 global.c:341 global.c:361
msgid "Goto Line"
msgstr "Siirry"
#: global.c:231 global.c:310
msgid "Justify"
msgstr "Tasaa"
#: global.c:235 global.c:306 global.c:337
msgid "Replace"
msgstr "Korvaa"
#: global.c:239
msgid "Read File"
msgstr "Lue tied."
#: global.c:243
msgid "Where Is"
msgstr "Etsi"
#: global.c:247 global.c:389
msgid "Prev Page"
msgstr "Ed. sivu"
#: global.c:251 global.c:393
msgid "Next Page"
msgstr "Seur. sivu"
#: global.c:255
msgid "Cut Text"
msgstr "Leikkaa"
#: global.c:258
msgid "UnCut Txt"
msgstr "Liitä"
#: global.c:262
msgid "Cur Pos"
msgstr "Sijainti"
#: global.c:266
msgid "To Spell"
msgstr "Oikolue"
#: global.c:270
msgid "Up"
msgstr "Ylös"
#: global.c:273
msgid "Down"
msgstr "Alas"
#: global.c:276
msgid "Forward"
msgstr "Eteenpäin"
#: global.c:279
msgid "Back"
msgstr "Takaisin"
#: global.c:282
msgid "Home"
msgstr "Home"
#: global.c:285
msgid "End"
msgstr "End"
#: global.c:288
msgid "Refresh"
msgstr "Piirrä uudelleen"
#: global.c:291
msgid "Mark Text"
msgstr "Merkitse tekstiä"
#: global.c:294
msgid "Delete"
msgstr "Poista"
#: global.c:298
msgid "Backspace"
msgstr "Askelpalautin"
#: global.c:302
msgid "Tab"
msgstr "Sarkain"
#: global.c:314
msgid "Enter"
msgstr "Enter"
#: global.c:327 global.c:348 global.c:369 global.c:379
msgid "First Line"
msgstr "1. rivi"
#: global.c:330 global.c:351 global.c:372 global.c:382
msgid "Last Line"
msgstr "Viim. rivi"
#: global.c:333 global.c:354
msgid "Case Sens"
msgstr "Kirj. koko"
#: global.c:344 global.c:364 global.c:375 global.c:385 global.c:401
#: global.c:405 global.c:411 winio.c:1020
msgid "Cancel"
msgstr "Peru"
#: global.c:357
msgid "No Replace"
msgstr ""
#: nano.c:131
msgid ""
"\n"
"Buffer written to 'nano.save'\n"
msgstr ""
"\n"
"Teksti kirjoitettu tiedostoon 'nano.save'\n"
#: nano.c:138
msgid "Key illegal in VIEW mode"
msgstr "Virheellinen näppäin katselutilassa"
#: nano.c:175
#, fuzzy
msgid ""
" nano help text\n"
"\n"
" The nano editor is designed to emulate the functionality and ease-of-use of "
"the UW Pico text editor. There are four main sections of the editor: The "
"top line shows the program version, the current filename being edited, and "
"whether or not the file has been modified. Next is the main editor window "
"showing the file being edited. The status line is the third line from the "
"bottom and shows important messages. The bottom two lines show the most "
"commonly used shortcuts in the editor.\n"
"\n"
" The notation for shortcuts is as follows: Control-key sequences are notated "
"with a caret (^) symbol and are entered with the Control (Ctrl) key. "
"Escape-key sequences are notated with the Meta (M) symbol and can be entered "
"using either the Esc, Alt or Meta key depending on your keyboard setup. The "
"following keystrokes are available in the main editor window. Optional keys "
"are shown in parentheses:\n"
"\n"
msgstr ""
" nanon ohje\n"
"\n"
" nano-editori on suunniteltu vastaamaan UW Pico-editorin toiminnallisuutta "
"ja helppokäyttöisyyttä. Editorin näytöllä näkyy neljä osaa. Ylin rivi "
"näyttää ohjelman versionumeron, nykyisen tiedoston nimen sekä sen että onko "
"tiedostoa muutettu. Tilarivi on kolmas rivi alhaalta. Se näyttää tärkeät "
"viestit. Alimmilla kahdella rivillä on lueteltu useimmin tarvitut "
"pikanäppäimet.\n"
"\n"
" Näppäinohjeissa Control-näppäimen komentoja on merkitty hatulla (^). "
"Alt-näppäimen komentoja on merkitty at-merkillä (@). Seuraavia "
"näppäinkomentoja voi käyttää editorin pääikkunassa. Valinnaiset näppäimet "
"ovat sulkeissa:\n"
"\n"
#: nano.c:278
msgid "free_node(): free'd a node, YAY!\n"
msgstr "free_node(): node vapautettu, YAY!\n"
#: nano.c:283
msgid "free_node(): free'd last node.\n"
msgstr "free_node(): viimeinen node vapautettu.\n"
#: nano.c:335
msgid ""
"Usage: nano [GNU long option] [option] +LINE <file>\n"
"\n"
msgstr ""
"Käyttö: nano [GNU pitkät komentoriviasetukset] [asetukset] +RIVI <tiedosto>\n"
#: nano.c:336
msgid "Option\t\tLong option\t\tMeaning\n"
msgstr "Asetus\t\tPitkä asetus\t\tMerkitys\n"
#: nano.c:338
msgid " -T \t\t--tabsize=[num]\t\tSet width of a tab to num\n"
msgstr " -T \t\t--tabsize=[leveys]\tAseta sarkaimen leveys\n"
#: nano.c:341
msgid " -R\t\t--regexp\t\tUse regular expressions for search\n"
msgstr ""
#: nano.c:345
msgid " -V \t\t--version\t\tPrint version information and exit\n"
msgstr " -V \t\t--version\t\tTulosta versiotiedot ja lopeta\n"
#: nano.c:347
msgid " -c \t\t--const\t\t\tConstantly show cursor position\n"
msgstr " -c \t\t--const\t\t\tNäytä kohdistimen sijainti jatkuvasti\n"
#: nano.c:349
msgid " -h \t\t--help\t\t\tShow this message\n"
msgstr " -h \t\t--help\t\t\tNäytä tämä ohje\n"
#: nano.c:352
msgid " -k \t\t--cut\t\t\tLet ^K cut from cursor to end of line\n"
msgstr ""
#: nano.c:355
msgid " -i \t\t--autoindent\t\tAutomatically indent new lines\n"
msgstr " -i \t\t--autoindent\t\tSisennä uudet rivit automaattisesti\n"
#: nano.c:357
msgid " -l \t\t--nofollow\t\tDon't follow symbolic links, overwrite\n"
msgstr ""
" -l \t\t--nofollow\t\tÄlä seuraa symbolisia linkkejä, vaan\n"
"\t\t\t\t\tkorvaa ne tiedostoilla.\n"
#: nano.c:360
msgid " -m \t\t--mouse\t\t\tEnable mouse\n"
msgstr " -m \t\t--mouse\t\t\tKäytä hiirtä\n"
#: nano.c:365
msgid ""
" -r [#cols] \t--fill=[#cols]\t\tSet fill cols to (wrap lines at) #cols\n"
msgstr " -r [#lkm] \t--fill=[#lkm]\t\tRivitä annettua pidemmät rivit\n"
#: nano.c:367
msgid " -p\t \t--pico\t\t\tEmulate Pico as closely as possible\n"
msgstr ""
#: nano.c:369
msgid " -s [prog] \t--speller=[prog]\tEnable alternate speller\n"
msgstr " -s [ohjelma] \t--speller=[ohjelma]\tKäytä annettua oikolukuohjelmaa\n"
#: nano.c:371
msgid " -t \t\t--tempfile\t\tAuto save on exit, don't prompt\n"
msgstr ""
" -t \t\t--tempfile\t\tTallenna tiedosto kysymättä\n"
"\t\t\t\t\tpoistettaessa \n"
#: nano.c:373
msgid " -v \t\t--view\t\t\tView (read only) mode\n"
msgstr " -v \t\t--view\t\t\tKatselutila (vain luku)\n"
#: nano.c:375
msgid " -w \t\t--nowrap\t\tDon't wrap long lines\n"
msgstr " -w \t\t--nowrap\t\tÄlä rivitä pitkiä rivejä\n"
#: nano.c:377
msgid " -x \t\t--nohelp\t\tDon't show help window\n"
msgstr " -x \t\t--nohelp\t\tÄlä näytä ohjeikkunaa\n"
#: nano.c:379
msgid " -z \t\t--suspend\t\tEnable suspend\n"
msgstr " -z \t\t--suspend\t\tMahdollista keskeyttäminen\n"
#: nano.c:381
msgid " +LINE\t\t\t\t\tStart at line number LINE\n"
msgstr " +RIVI\t\t\t\t\tSiirry riville RIVI\n"
#: nano.c:383
msgid ""
"Usage: nano [option] +LINE <file>\n"
"\n"
msgstr ""
"Käyttö: nano [asetukset] +RIVI <tiedosto>\n"
"\n"
#: nano.c:384
msgid "Option\t\tMeaning\n"
msgstr "Asetus\t\tMerkitys\n"
#: nano.c:385
msgid " -T [num]\tSet width of a tab to num\n"
msgstr " -T [leveys]\tAseta sarkaimen leveys\n"
#: nano.c:386
msgid " -R\t\tUse regular expressions for search\n"
msgstr ""
#: nano.c:387
msgid " -V \t\tPrint version information and exit\n"
msgstr " -V \t\tTulosta versiotiedot ja lopeta\n"
#: nano.c:388
msgid " -c \t\tConstantly show cursor position\n"
msgstr " -c \t\tNäytä kohdistimen sijainti jatkuvasti\n"
#: nano.c:389
msgid " -h \t\tShow this message\n"
msgstr " -h \t\tNäytä tämä ohje\n"
#: nano.c:391
msgid " -k \t\tLet ^K cut from cursor to end of line\n"
msgstr ""
#: nano.c:393
msgid " -i \t\tAutomatically indent new lines\n"
msgstr " -i \t\tSisennä uudet rivit automaattisesti\n"
#: nano.c:395
msgid " -l \t\tDon't follow symbolic links, overwrite\n"
msgstr " -l \t\tÄlä seuraa symbolisia linkkejä, vaan korvaa ne tiedostoilla\n"
#: nano.c:398
msgid " -m \t\tEnable mouse\n"
msgstr " -m \t\tKäytä hiirtä\n"
#: nano.c:402
msgid " -r [#cols] \tSet fill cols to (wrap lines at) #cols\n"
msgstr " -r [#lkm] \tRivitä annettua pidemmät rivit\n"
#: nano.c:403
msgid " -s [prog] \tEnable alternate speller\n"
msgstr " -s [ohjelma] \tKäytä annettua oikolukuohjelmaa\n"
#: nano.c:404
msgid " -p \t\tEmulate Pico as closely as possible\n"
msgstr ""
#: nano.c:405
msgid " -t \t\tAuto save on exit, don't prompt\n"
msgstr " -t \t\tTallenna tiedosto kysymättä poistettaessa\n"
#: nano.c:406
msgid " -v \t\tView (read only) mode\n"
msgstr " -v \t\tKatselutila (vain luku)\n"
#: nano.c:407
msgid " -w \t\tDon't wrap long lines\n"
msgstr " -w \t\tÄlä rivitä pitkiä rivejä\n"
#: nano.c:408
msgid " -x \t\tDon't show help window\n"
msgstr " -x \t\tÄlä näytä ohjeikkunaa\n"
#: nano.c:409
msgid " -z \t\tEnable suspend\n"
msgstr " -z \t\tMahdollista keskeyttäminen\n"
#: nano.c:410
msgid " +LINE\t\tStart at line number LINE\n"
msgstr " +RIVI\t\tSiirry riville RIVI\n"
#: nano.c:417
#, c-format
msgid " nano version %s by Chris Allegretta (compiled %s, %s)\n"
msgstr " nano, versio %s. Chris Allegretta (käännetty %s, %s)\n"
#: nano.c:420
msgid " Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org\n"
msgstr " Maili: nano@nano-editor.org\tNetti: http://www.nano-editor.org\n"
#: nano.c:455
msgid "Mark Set"
msgstr "Teksti merkitty"
#: nano.c:460
msgid "Mark UNset"
msgstr "Merkintä poistettu"
#: nano.c:887
#, c-format
msgid "check_wrap called with inptr->data=\"%s\"\n"
msgstr "check_wrap -funktion parametri inptr->data=\"%s\"\n"
#: nano.c:938
#, c-format
msgid "current->data now = \"%s\"\n"
msgstr "current->data nyt = \"%s\"\n"
#: nano.c:991
#, c-format
msgid "After, data = \"%s\"\n"
msgstr "Jälkeenpäin, data = \"%s\"\n"
#: nano.c:1093
msgid "Edit a replacement"
msgstr ""
#: nano.c:1304
#, c-format
msgid "Could not create a temporary filename: %s"
msgstr "Väliaikaista tiedostonnimeä ei voitu luoda: %s"
#: nano.c:1320
msgid "Finished checking spelling"
msgstr "Oikoluku on valmis"
#: nano.c:1322
msgid "Spell checking failed"
msgstr ""
#: nano.c:1342
msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? "
msgstr "Tallenna muutettu teksti (Muutokset häviävät, jos vastaat \"ei\") ? "
#: nano.c:1505
msgid "Cannot resize top win"
msgstr "Yläikkunan kokoa ei voi muuttaa"
#: nano.c:1507
msgid "Cannot move top win"
msgstr "Yläikkunaa ei voi siirtää"
#: nano.c:1509
msgid "Cannot resize edit win"
msgstr "Muokkausikkunan kokoa ei voi muuttaa"
#: nano.c:1511
msgid "Cannot move edit win"
msgstr "Muokkausikkunaa ei voi siirtää"
#: nano.c:1513
msgid "Cannot resize bottom win"
msgstr "Alaikkunan kokoa ei voi muuttaa"
#: nano.c:1515
msgid "Cannot move bottom win"
msgstr "Alaikkunaa ei voi siirtää"
#: nano.c:1786
#, fuzzy
msgid "Justify Complete"
msgstr "Tasaa"
#: nano.c:1854
#, c-format
msgid "%s enable/disable"
msgstr ""
#: nano.c:1866
msgid "enabled"
msgstr ""
#: nano.c:1867
msgid "disabled"
msgstr ""
#: nano.c:2097
msgid "Main: set up windows\n"
msgstr "Päätila: ikkunoiden asettelu\n"
#: nano.c:2110
msgid "Main: bottom win\n"
msgstr "Päätila: alaikkuna\n"
#: nano.c:2116
msgid "Main: open file\n"
msgstr "Päätila: avaa tiedosto\n"
#: nano.c:2150
#, fuzzy, c-format
msgid "I got Alt-O-%c! (%d)\n"
msgstr "Vastaanotettu Alt-[-%c! (%d)\n"
#: nano.c:2172
#, fuzzy, c-format
msgid "I got Alt-[-1-%c! (%d)\n"
msgstr "Vastaanotettu Alt-[-%c! (%d)\n"
#: nano.c:2205
#, fuzzy, c-format
msgid "I got Alt-[-2-%c! (%d)\n"
msgstr "Vastaanotettu Alt-[-%c! (%d)\n"
#: nano.c:2253
#, c-format
msgid "I got Alt-[-%c! (%d)\n"
msgstr "Vastaanotettu Alt-[-%c! (%d)\n"
#: nano.c:2279
#, c-format
msgid "I got Alt-%c! (%d)\n"
msgstr "Vastaanotettu Alt-%c! (%d)\n"
#: search.c:118
#, fuzzy, c-format
msgid "Case Sensitive Regexp Search%s%s"
msgstr "Kirjainkoosta välittävä etsintä%s%s"
#: search.c:120
#, fuzzy, c-format
msgid "Regexp Search%s%s"
msgstr "Etsintä%s%s"
#: search.c:122
#, fuzzy, c-format
msgid "Case Sensitive Search%s%s"
msgstr "Kirjainkoosta välittävä etsintä%s%s"
#: search.c:124
#, fuzzy, c-format
msgid "Search%s%s"
msgstr "Etsintä%s%s"
#: search.c:127
#, fuzzy
msgid " (to replace)"
msgstr " (korvaa)"
#: search.c:136 search.c:318
msgid "Search Cancelled"
msgstr "Etsintä peruttu"
#: search.c:194
#, fuzzy, c-format
msgid "\"%s...\" not found"
msgstr "Tiedostoa \"%s\" ei ole"
#: search.c:243
msgid "Search Wrapped"
msgstr "Etsintä jatkuu"
#: search.c:340
#, c-format
msgid "Replaced %d occurences"
msgstr "%d kohtaa korvattu"
#: search.c:342
msgid "Replaced 1 occurence"
msgstr "1 kohta korvattu"
#: search.c:479 search.c:572 search.c:588
msgid "Replace Cancelled"
msgstr "Korvaus peruttu"
#: search.c:522
msgid "Replace this instance?"
msgstr "Korvataanko tämä kohta?"
#: search.c:530
msgid "Replace failed: unknown subexpression!"
msgstr ""
#: search.c:613
#, c-format
msgid "Replace with [%s]"
msgstr "Korvaa merkkijonolla [%s]"
#: search.c:617 search.c:621
msgid "Replace with"
msgstr "Korvaa merkkijonolla"
#. Ask for it
#: search.c:656
msgid "Enter line number"
msgstr "Kirjoita rivin numero"
#: search.c:658
msgid "Aborted"
msgstr "Keskeytetty"
#: search.c:678
msgid "Come on, be reasonable"
msgstr "Jotakin järkevää, kiitos?"
#: search.c:683
#, c-format
msgid "Only %d lines available, skipping to last line"
msgstr "Vain %d riviä olemassa, siirrytään viimeiselle riville"
#: winio.c:120
#, c-format
msgid "actual_x_from_start for xplus=%d returned %d\n"
msgstr "actual_x_from_start parametrilla xplus=%d palautti %d\n"
#: winio.c:433
#, c-format
msgid "input '%c' (%d)\n"
msgstr "syöte '%c' (%d)\n"
#: winio.c:471
msgid "New Buffer"
msgstr "Uusi teksti"
#: winio.c:474
msgid " File: ..."
msgstr " Tiedosto: ..."
#: winio.c:482
msgid "Modified"
msgstr "Muokattu"
#: winio.c:934
#, c-format
msgid "Moved to (%d, %d) in edit buffer\n"
msgstr "Kohtaan (%d,%d) siirrytty muokkausruudussa\n"
#: winio.c:945
#, c-format
msgid "current->data = \"%s\"\n"
msgstr "current->data = \"%s\"\n"
#: winio.c:990
#, c-format
msgid "I got \"%s\"\n"
msgstr "Saatiin \"%s\"\n"
#: winio.c:1015
msgid "Yes"
msgstr "Kyllä"
#: winio.c:1017
msgid "All"
msgstr "Kaikki"
#: winio.c:1019
msgid "No"
msgstr "Ei"
#: winio.c:1156
#, c-format
msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
msgstr "do_cursorpos: linepct = %f, bytepct = %f\n"
#: winio.c:1160
msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)"
msgstr "rivi %d/%d (%.0f%%), merkki %d/%d (%.0f%%)"
#: winio.c:1288
msgid "Dumping file buffer to stderr...\n"
msgstr "Syötetään tiedosto stderriin...\n"
#: winio.c:1290
msgid "Dumping cutbuffer to stderr...\n"
msgstr "Syötetään leiketila stderriin...\n"
#: winio.c:1292
msgid "Dumping a buffer to stderr...\n"
msgstr "Syötetään teksti stderriin...\n"
#~ msgid " -p\t \t--pico\t\t\tMake bottom 2 lines more Pico-like\n"
#~ msgstr " -p\t \t--pico\t\t\tNäytä 2 alinta riviä kuin Pico\n"
#~ msgid " -p \t\tMake bottom 2 lines more Pico-like\n"
#~ msgstr " -p \t\tNäytä 2 alinta riviä kuin Pico\n"
#~ msgid "Error deleting tempfile, ack!"
#~ msgstr "Väliaikaistiedostoa poistettaessa tapahtui virhe."
#~ msgid "Could not invoke spell program \"%s\""
#~ msgstr "Oikoluinta \"%s\" ei voitu käynnistää"
#~ msgid "Could not invoke \"ispell\""
#~ msgstr "\"ispell\" -ohjelmaa ei voitu käynnistää"
#~ msgid "To Search"
#~ msgstr "Etsittävä"
#~ msgid " Y"
#~ msgstr " Y"
#~ msgid " A"
#~ msgstr " A"
#~ msgid " N"
#~ msgstr " N"
#~ msgid "^C"
#~ msgstr "^C"

BIN
po/fr.gmo

Binary file not shown.

840
po/fr.po

File diff suppressed because it is too large Load Diff

BIN
po/id.gmo

Binary file not shown.

588
po/id.po

File diff suppressed because it is too large Load Diff

BIN
po/it.gmo

Binary file not shown.

592
po/it.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

51
proto.h
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* proto.h *
* *
@@ -21,6 +22,11 @@
/* Externs */
#include <sys/stat.h>
#ifdef HAVE_REGEX_H
#include <regex.h>
#endif
#include "nano.h"
extern int center_x, center_y, editwinrows;
@@ -28,11 +34,15 @@ extern int current_x, current_y, posible_max, totlines;
extern int placewewant;
extern int mark_beginx, samelinewrap;
extern int totsize, temp_opt;
extern int fill, flags;
extern int fill, flags,tabsize;
extern int search_last_line;
extern WINDOW *edit, *topwin, *bottomwin;
extern char *filename, *answer, *last_search, *last_replace;
extern char filename[PATH_MAX];
extern char *answer;
extern char *hblank, *help_text;
extern char *last_search;
extern char *last_replace;
extern struct stat fileinfo;
extern filestruct *current, *fileage, *edittop, *editbot, *filebot;
extern filestruct *cutbuffer, *mark_beginbuf;
@@ -40,7 +50,15 @@ extern shortcut *shortcut_list;
extern shortcut main_list[MAIN_LIST_LEN], whereis_list[WHEREIS_LIST_LEN];
extern shortcut replace_list[REPLACE_LIST_LEN], goto_list[GOTO_LIST_LEN];
extern shortcut writefile_list[WRITEFILE_LIST_LEN], help_list[HELP_LIST_LEN];
extern shortcut spell_list[SPELL_LIST_LEN];
extern shortcut spell_list[SPELL_LIST_LEN], replace_list_2[REPLACE_LIST_LEN];
#ifdef HAVE_REGEX_H
extern int use_regexp, regexp_compiled;
extern regex_t search_regexp;
extern regmatch_t regmatches[10];
#endif
extern toggle toggles[TOGGLE_LEN];
/* Programs we want available */
@@ -53,7 +71,7 @@ int xplustabs(void);
int do_yesno(int all, int leavecursor, char *msg, ...);
int actual_x(filestruct * fileptr, int xplus);
int strlenpt(char *buf);
int statusq(shortcut s[], int slen, char *def, char *msg, ...);
int statusq(int allowtabs, shortcut s[], int slen, char *def, char *msg, ...);
int write_file(char *name, int tmpfile);
int do_cut_text(void);
int do_uncut_text(void);
@@ -62,12 +80,15 @@ int renumber_all(void);
int open_file(char *filename, int insert, int quiet);
int do_writeout(int exiting);
int do_gotoline(long defline);
int do_replace_loop(char *prevanswer, filestruct *begin, int *beginx,
int wholewords, int *i);
/* Now in move.c */
int do_up(void);
int do_down(void);
int do_left(void);
int do_right(void);
int check_wildcard_match(const char *text, const char *pattern);
char *input_tab(char *buf, int place, int *lastWasTab, int *newplace);
void shortcut_init(void);
void lowercase(char *src);
@@ -75,10 +96,8 @@ void blank_bottombars(void);
void check_wrap(filestruct * inptr, char ch);
void dump_buffer(filestruct * inptr);
void align(char **strp);
void edit_refresh(void);
void edit_update(filestruct * fileptr);
void edit_update_top(filestruct * fileptr);
void edit_update_bot(filestruct * fileptr);
void edit_refresh(void), edit_refresh_clearok(void);
void edit_update(filestruct * fileptr, int topmidbot);
void update_cursor(void);
void delete_node(filestruct * fileptr);
void set_modified(void);
@@ -86,6 +105,7 @@ void dump_buffer_reverse(filestruct * inptr);
void reset_cursor(void);
void check_statblank(void);
void update_line(filestruct * fileptr, int index);
void fix_editbot(void);
void statusbar(char *msg, ...);
void titlebar(void);
void previous_line(void);
@@ -93,6 +113,7 @@ void center_cursor(void);
void bottombars(shortcut s[], int slen);
void blank_statusbar_refresh(void);
void *nmalloc (size_t howmuch);
void *mallocstrcpy(void *dest, void *src);
void wrap_reset(void);
void display_main_list(void);
void nano_small_msg(void);
@@ -101,7 +122,13 @@ void *nmalloc(size_t howmuch);
void *nrealloc(void *ptr, size_t howmuch);
void die(char *msg, ...);
void new_file(void);
void new_magicline(void);
void splice_node(filestruct *begin, filestruct *new, filestruct *end);
void null_at(char *data, int index);
void page_up_center(void);
void blank_edit(void);
void search_init_globals(void);
void replace_abort(void);
int do_writeout_void(void), do_exit(void), do_gotoline_void(void);
int do_insertfile(void), do_search(void), page_up(void), page_down(void);
@@ -115,5 +142,5 @@ int do_replace(void), do_help(void), do_enter_void(void);
filestruct *copy_node(filestruct * src);
filestruct *copy_filestruct(filestruct * src);
filestruct *make_new_node(filestruct * prevnode);
filestruct *findnextstr(int quiet, filestruct * begin,
int beginx, char *needle);

635
search.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* search.c *
* *
@@ -20,7 +21,9 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
#include "config.h"
#include "proto.h"
#include "nano.h"
@@ -32,6 +35,34 @@
#define _(string) (string)
#endif
/* Regular expression helper functions */
#ifdef HAVE_REGEX_H
void regexp_init(const char *regexp)
{
regcomp(&search_regexp, regexp, ISSET(CASE_SENSITIVE) ? 0 : REG_ICASE);
SET(REGEXP_COMPILED);
}
void regexp_cleanup()
{
UNSET(REGEXP_COMPILED);
regfree(&search_regexp);
}
#endif
void search_init_globals(void)
{
if (last_search == NULL) {
last_search = nmalloc(1);
last_search[0] = 0;
}
if (last_replace == NULL) {
last_replace = nmalloc(1);
last_replace[0] = 0;
}
}
/* Set up the system variables for a search or replace. Returns -1 on
abort, 0 on success, and 1 on rerun calling program
Return -2 to run opposite program (searchg -> replace, replace -> search)
@@ -40,34 +71,93 @@
*/
int search_init(int replacing)
{
int i;
char buf[135];
int i = 0;
char *buf;
char *prompt, *reprompt = "";
static char *backupstring = NULL;
if (last_search[0]) {
sprintf(buf, " [%s]", last_search);
} else {
buf[0] = '\0';
search_init_globals();
buf = nmalloc(strlen(last_search) + 5);
buf[0] = 0;
/* Okay, fun time. backupstring is our holder for what is being
returned from the statusq call. Using answer for this would be tricky.
Here, if we're using PICO_MODE, we only want nano to put the
old string back up as editable if it's not the same as last_search.
Otherwise, if we don't already have a backupstring, set it to
last_search. */
if (ISSET(PICO_MODE)) {
if (backupstring == NULL || !strcmp(backupstring, last_search))
backupstring = mallocstrcpy(backupstring, "");
}
else if (backupstring == NULL)
backupstring = mallocstrcpy(backupstring, last_search);
i = statusq(replacing ? replace_list : whereis_list,
replacing ? REPLACE_LIST_LEN : WHEREIS_LIST_LEN, "",
ISSET(CASE_SENSITIVE) ? _("Case Sensitive Search%s") :
_("Search%s"), buf);
/* If using Pico messages, we do things the old fashioned way... */
if (ISSET(PICO_MODE)) {
if (last_search[0]) {
/* We use COLS / 3 here because we need to see more on the line */
if (strlen(last_search) > COLS / 3) {
snprintf(buf, COLS / 3 + 3, " [%s", last_search);
sprintf(&buf[COLS / 3 + 2], "...]");
} else
sprintf(buf, " [%s]", last_search);
} else {
buf[0] = '\0';
}
}
else
strcpy(buf, "");
if (ISSET(USE_REGEXP) && ISSET(CASE_SENSITIVE))
prompt = _("Case Sensitive Regexp Search%s%s");
else if (ISSET(USE_REGEXP))
prompt = _("Regexp Search%s%s");
else if (ISSET(CASE_SENSITIVE))
prompt = _("Case Sensitive Search%s%s");
else
prompt = _("Search%s%s");
if (replacing)
reprompt = _(" (to replace)");
/* This is now one simple call. It just does a lot */
i = statusq(0, replacing ? replace_list : whereis_list,
replacing ? REPLACE_LIST_LEN : WHEREIS_LIST_LEN, backupstring,
prompt, reprompt, "");
/* Cancel any search, or just return with no previous search */
if ((i == -1) || (i < 0 && !last_search[0])) {
statusbar(_("Search Cancelled"));
reset_cursor();
free(backupstring);
backupstring = NULL;
return -1;
} else if (i == -2) { /* Same string */
strncpy(answer, last_search, 132);
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP))
regexp_init(answer);
#else
;
#endif
} else if (i == 0) { /* They entered something new */
strncpy(last_search, answer, 132);
/* Blow away last_replace because they entered a new search
string....uh, right? =) */
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP))
regexp_init(answer);
#endif
free(backupstring);
backupstring = NULL;
last_replace[0] = '\0';
} else if (i == NANO_CASE_KEY) { /* They want it case sensitive */
free(backupstring);
backupstring = NULL;
backupstring = mallocstrcpy(backupstring, answer);
if (ISSET(CASE_SENSITIVE))
UNSET(CASE_SENSITIVE);
else
@@ -75,77 +165,112 @@ int search_init(int replacing)
return 1;
} else if (i == NANO_OTHERSEARCH_KEY) {
backupstring = mallocstrcpy(backupstring, answer);
return -2; /* Call the opposite search function */
} else if (i == NANO_FROMSEARCHTOGOTO_KEY) {
free(backupstring);
backupstring = NULL;
do_gotoline_void();
return -3;
} else { /* First line key, etc. */
do_early_abort();
free(backupstring);
backupstring = NULL;
return -3;
}
return 0;
}
filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
void not_found_msg(char *str)
{
if (strlen(str) <= COLS / 2)
statusbar(_("\"%s\" not found"), str);
else {
char *foo = NULL;
foo = mallocstrcpy(foo, str);
foo[COLS / 2] = 0;
statusbar(_("\"%s...\" not found"), foo);
free(foo);
}
}
filestruct *findnextstr(int quiet, filestruct * begin, int beginx,
char *needle)
{
filestruct *fileptr;
char *searchstr, *found = NULL, *tmp;
int past_editbot = 0;
fileptr = current;
searchstr = &current->data[current_x + 1];
/* Look for searchstr until EOF */
while (fileptr != NULL &&
(found = strstrwrapper(searchstr, needle)) == NULL) {
fileptr = fileptr->next;
current_x++;
if (fileptr == begin)
return NULL;
/* Are we searching the last line? (i.e. the line where search started) */
if ((fileptr == begin) && (current_x < beginx))
search_last_line = 1;
if (fileptr != NULL)
searchstr = fileptr->data;
}
/* Make sure we haven't passed the end of the string */
if (strlen(fileptr->data) < current_x)
current_x--;
/* If we're not at EOF, we found an instance */
if (fileptr != NULL) {
current = fileptr;
current_x = 0;
for (tmp = fileptr->data; tmp != found; tmp++)
current_x++;
searchstr = &fileptr->data[current_x];
edit_update(current);
reset_cursor();
} else { /* We're at EOF, go back to the top, once */
/* Look for needle in searchstr */
while ((found = strstrwrapper(searchstr, needle)) == NULL) {
fileptr = fileage;
while (fileptr != current && fileptr != begin &&
(found = strstrwrapper(fileptr->data, needle)) == NULL)
fileptr = fileptr->next;
if (fileptr == begin) {
/* finished processing file, get out */
if (search_last_line) {
if (!quiet)
statusbar(_("\"%s\" not found"), needle);
not_found_msg(needle);
return NULL;
}
if (fileptr != current) { /* We found something */
current = fileptr;
current_x = 0;
for (tmp = fileptr->data; tmp != found; tmp++)
current_x++;
edit_update(current);
reset_cursor();
fileptr = fileptr->next;
if (!past_editbot && (fileptr == editbot))
past_editbot = 1;
/* EOF reached, wrap around once */
if (fileptr == NULL) {
fileptr = fileage;
past_editbot = 1;
if (!quiet)
statusbar(_("Search Wrapped"));
} else { /* Nada */
if (!quiet)
statusbar(_("\"%s\" not found"), needle);
return NULL;
}
/* Original start line reached */
if (fileptr == begin)
search_last_line = 1;
searchstr = fileptr->data;
}
/* We found an instance */
current = fileptr;
current_x = 0;
for (tmp = fileptr->data; tmp != found; tmp++)
current_x++;
/* Ensure we haven't wrap around again! */
if ((search_last_line) && (current_x >= beginx)) {
if (!quiet)
not_found_msg(needle);
return NULL;
}
if (past_editbot)
edit_update(fileptr, CENTER);
else
update_line(current, current_x);
placewewant = xplustabs();
reset_cursor();
return fileptr;
}
@@ -154,6 +279,13 @@ void search_abort(void)
UNSET(KEEP_CUTBUFFER);
display_main_list();
wrefresh(bottomwin);
if (ISSET(MARK_ISSET))
edit_refresh_clearok();
#ifdef HAVE_REGEX_H
if (ISSET(REGEXP_COMPILED))
regexp_cleanup();
#endif
}
/* Search for a string */
@@ -163,23 +295,41 @@ int do_search(void)
filestruct *fileptr = current;
wrap_reset();
if ((i = search_init(0)) == -1) {
i = search_init(0);
switch (i) {
case -1:
current = fileptr;
search_abort();
return 0;
} else if (i == -3) {
case -3:
search_abort();
return 0;
} else if (i == -2) {
search_abort();
case -2:
do_replace();
return 0;
} else if (i == 1) {
case 1:
do_search();
search_abort();
return 1;
}
findnextstr(0, current, answer);
/* The sneaky user deleted the previous search string */
if (!ISSET(PICO_MODE) && !strcmp(answer, "")) {
statusbar(_("Search Cancelled"));
search_abort();
return 0;
}
/* If answer is now == "", then PICO_MODE is set. So, copy
last_search into answer... */
if (!strcmp(answer, ""))
answer = mallocstrcpy(answer, last_search);
else
last_search = mallocstrcpy(last_search, answer);
search_last_line = 0;
findnextstr(0, current, current_x, answer);
search_abort();
return 1;
}
@@ -194,148 +344,295 @@ void print_replaced(int num)
void replace_abort(void)
{
UNSET(KEEP_CUTBUFFER);
display_main_list();
reset_cursor();
/* Identicle to search_abort, so we'll call it here. If it
does something different later, we can change it back. For now
it's just a waste to duplicat code */
search_abort();
placewewant = xplustabs();
}
/* Search for a string */
int do_replace(void)
#ifdef HAVE_REGEX_H
int replace_regexp(char *string, int create_flag)
{
int i, replaceall = 0, numreplaced = 0, beginx;
filestruct *fileptr, *begin;
char *tmp, *copy, prevanswer[132] = "";
/* split personality here - if create_flag is null, just calculate
* the size of the replacement line (necessary because of
* subexpressions like \1 \2 \3 in the replaced text) */
if ((i = search_init(1)) == -1) {
char *c;
int new_size = strlen(current->data) + 1;
int search_match_count = regmatches[0].rm_eo - regmatches[0].rm_so;
new_size -= search_match_count;
/* Iterate through the replacement text to handle
* subexpression replacement using \1, \2, \3, etc */
c = last_replace;
while (*c) {
if (*c != '\\') {
if (create_flag)
*string++ = *c;
c++;
new_size++;
} else {
int num = (int) *(c + 1) - (int) '0';
if (num >= 1 && num <= 9) {
int i = regmatches[num].rm_so;
if (num > search_regexp.re_nsub) {
/* Ugh, they specified a subexpression that doesn't
exist. */
return -1;
}
/* Skip over the replacement expression */
c += 2;
/* But add the length of the subexpression to new_size */
new_size += regmatches[num].rm_eo - regmatches[num].rm_so;
/* And if create_flag is set, append the result of the
* subexpression match to the new line */
while (create_flag && i < regmatches[num].rm_eo)
*string++ = *(current->data + i++);
} else {
if (create_flag)
*string++ = *c;
c++;
new_size++;
}
}
}
if (create_flag)
*string = 0;
return new_size;
}
#endif
char *replace_line(void)
{
char *copy, *tmp;
int new_line_size;
int search_match_count;
/* Calculate size of new line */
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP)) {
search_match_count = regmatches[0].rm_eo - regmatches[0].rm_so;
new_line_size = replace_regexp(NULL, 0);
/* If they specified an invalid subexpression in the replace
* text, return NULL indicating an error */
if (new_line_size < 0)
return NULL;
} else {
#else
{
#endif
search_match_count = strlen(last_search);
new_line_size = strlen(current->data) - strlen(last_search) +
strlen(last_replace) + 1;
}
/* Create buffer */
copy = nmalloc(new_line_size);
/* Head of Original Line */
strncpy(copy, current->data, current_x);
copy[current_x] = 0;
/* Replacement Text */
if (!ISSET(USE_REGEXP))
strcat(copy, last_replace);
#ifdef HAVE_REGEX_H
else
(void) replace_regexp(copy + current_x, 1);
#endif
/* The tail of the original line */
/* This may expose other bugs, because it no longer
goes through each character on the string
and tests for string goodness. But because
we can assume the invariant that current->data
is less than current_x + strlen(last_search) long,
this should be safe. Or it will expose bugs ;-) */
tmp = current->data + current_x + search_match_count;
strcat(copy, tmp);
return copy;
}
int do_replace_loop(char *prevanswer, filestruct *begin, int *beginx,
int wholewords, int *i)
{
int replaceall = 0, numreplaced = 0;
filestruct *fileptr;
char *copy;
switch (*i) {
case -1: /* Aborted enter */
if (strcmp(last_replace, ""))
answer = mallocstrcpy(answer, last_replace);
statusbar(_("Replace Cancelled"));
replace_abort();
return 0;
} else if (i == 1) {
do_replace();
return 1;
} else if (i == -2) {
replace_abort();
do_search();
return 0;
} else if (i == -3) {
replace_abort();
return 0;
}
strncpy(prevanswer, answer, 132);
if (strcmp(last_replace, "")) { /* There's a previous replace str */
i = statusq(replace_list, REPLACE_LIST_LEN, "",
_("Replace with [%s]"), last_replace);
if (i == -1) { /* Aborted enter */
strncpy(answer, last_replace, 132);
statusbar(_("Replace Cancelled"));
replace_abort();
return 0;
} else if (i == 0) /* They actually entered something */
strncpy(last_replace, answer, 132);
else if (i == NANO_CASE_KEY) { /* They asked for case sensitivity */
if (ISSET(CASE_SENSITIVE))
UNSET(CASE_SENSITIVE);
else
SET(CASE_SENSITIVE);
do_replace();
return 0;
} else { /* First page, last page, for example could get here */
case 0: /* They actually entered something */
break;
default:
if (*i != -2) { /* First page, last page, for example
could get here */
do_early_abort();
replace_abort();
return 0;
}
} else { /* last_search is empty */
i = statusq(replace_list, REPLACE_LIST_LEN, "", _("Replace with"));
if (i == -1) {
statusbar(_("Replace Cancelled"));
reset_cursor();
replace_abort();
return 0;
} else if (i == 0) /* They entered something new */
strncpy(last_replace, answer, 132);
else if (i == NANO_CASE_KEY) { /* They want it case sensitive */
if (ISSET(CASE_SENSITIVE))
UNSET(CASE_SENSITIVE);
else
SET(CASE_SENSITIVE);
do_replace();
return 1;
} else { /* First line key, etc. */
do_early_abort();
replace_abort();
return 0;
}
}
}
/* save where we are */
begin = current;
beginx = current_x;
last_replace = mallocstrcpy(last_replace, answer);
while (1) {
if (replaceall)
fileptr = findnextstr(1, begin, prevanswer);
else
fileptr = findnextstr(0, begin, prevanswer);
/* Sweet optimization by Rocco here */
fileptr = findnextstr(replaceall, begin, *beginx, prevanswer);
/* No more matches. Done! */
if (!fileptr)
break;
/* Make sure only wholewords are found */
if (wholewords)
{
/* start of line or previous character not a letter */
if ((current_x == 0) || (!isalpha((int) fileptr->data[current_x-1])))
{
/* end of line or next character not a letter */
if (((current_x + strlen(prevanswer)) == strlen(fileptr->data))
|| (!isalpha((int) fileptr->data[current_x + strlen(prevanswer)])))
;
else
continue;
}
else
continue;
}
/* If we're here, we've found the search string */
if (!replaceall)
i = do_yesno(1, 1, _("Replace this instance?"));
*i = do_yesno(1, 1, _("Replace this instance?"));
if (i > 0 || replaceall) { /* Yes, replace it!!!! */
if (i == 2)
if (*i > 0 || replaceall) { /* Yes, replace it!!!! */
if (*i == 2)
replaceall = 1;
/* Create buffer */
copy = nmalloc(strlen(current->data) - strlen(last_search) +
strlen(last_replace) + 1);
/* Head of Original Line */
strncpy(copy, current->data, current_x);
copy[current_x] = 0;
/* Replacement Text */
strcat(copy, last_replace);
/* The tail of the original line */
/* This may expose other bugs, because it no longer
goes through each character on the string
and tests for string goodness. But because
we can assume the invariant that current->data
is less than current_x + strlen(last_search) long,
this should be safe. Or it will expose bugs ;-) */
tmp = current->data + current_x + strlen(last_search);
strcat(copy, tmp);
copy = replace_line();
if (!copy) {
statusbar(_("Replace failed: unknown subexpression!"));
replace_abort();
return 0;
}
/* Cleanup */
free(current->data);
current->data = copy;
/* Stop bug where we replace a substring of the replacement text */
current_x += strlen(last_replace);
current_x += strlen(last_replace) - 1;
/* Adjust the original cursor position - COULD BE IMPROVED */
if (search_last_line) {
*beginx += strlen(last_replace) - strlen(last_search);
/* For strings that cross the search start/end boundary */
/* Don't go outside of allocated memory */
if (*beginx < 1)
*beginx = 1;
}
edit_refresh();
set_modified();
numreplaced++;
} else if (i == -1) /* Abort, else do nothing and continue loop */
} else if (*i == -1) /* Abort, else do nothing and continue loop */
break;
}
return numreplaced;
}
/* Replace a string */
int do_replace(void)
{
int i, numreplaced, beginx;
filestruct *begin;
char *prevanswer = NULL, *buf = NULL;
i = search_init(1);
switch (i) {
case -1:
statusbar(_("Replace Cancelled"));
replace_abort();
return 0;
case 1:
do_replace();
return 1;
case -2:
do_search();
return 0;
case -3:
replace_abort();
return 0;
}
/* Again, there was a previous string but they deleted it and hit enter */
if (!ISSET(PICO_MODE) && !strcmp(answer, "")) {
statusbar(_("Replace Cancelled"));
replace_abort();
return 0;
}
/* If answer is now == "", then PICO_MODE is set. So, copy
last_search into answer (and prevanswer)... */
if (!strcmp(answer, "")) {
answer = mallocstrcpy(answer, last_search);
prevanswer = mallocstrcpy(prevanswer, last_search);
} else {
last_search = mallocstrcpy(last_search, answer);
prevanswer = mallocstrcpy(prevanswer, answer);
}
if (ISSET(PICO_MODE)) {
buf = nmalloc(strlen(last_replace) + 5);
if (strcmp(last_replace, "")) {
if (strlen(last_replace) > (COLS / 3)) {
strncpy(buf, last_replace, COLS / 3);
sprintf(&buf[COLS / 3 - 1], "...");
} else
sprintf(buf, "%s", last_replace);
i = statusq(0, replace_list_2, REPLACE_LIST_2_LEN, "",
_("Replace with [%s]"), buf);
}
else
i = statusq(0, replace_list_2, REPLACE_LIST_2_LEN, "",
_("Replace with"));
}
else
i = statusq(0, replace_list_2, REPLACE_LIST_2_LEN, last_replace,
_("Replace with"));
/* save where we are */
begin = current;
beginx = current_x + 1;
search_last_line = 0;
numreplaced = do_replace_loop(prevanswer, begin, &beginx, FALSE, &i);
/* restore where we were */
current = begin;
current_x = beginx;
current_x = beginx - 1;
renumber_all();
edit_update(current);
edit_update(current, CENTER);
print_replaced(numreplaced);
replace_abort();
return 1;
@@ -356,7 +653,7 @@ int do_gotoline(long defline)
line = defline;
else { /* Ask for it */
j = statusq(goto_list, GOTO_LIST_LEN, "", _("Enter line number"));
j = statusq(0, goto_list, GOTO_LIST_LEN, "", _("Enter line number"));
if (j == -1) {
statusbar(_("Aborted"));
goto_abort();
@@ -369,7 +666,7 @@ int do_gotoline(long defline)
if (!strcmp(answer, "$")) {
current = filebot;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
goto_abort();
return 1;
}
@@ -387,14 +684,14 @@ int do_gotoline(long defline)
filebot->lineno);
current = filebot;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
} else {
for (fileptr = fileage; fileptr != NULL && i < line; i++)
fileptr = fileptr->next;
current = fileptr;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
}
goto_abort();

148
utils.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* utils.c *
* *
@@ -18,6 +19,7 @@
* *
**************************************************************************/
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -80,7 +82,14 @@ char *strcasestr(char *haystack, char *needle)
char *strstrwrapper(char *haystack, char *needle)
{
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP)) {
int result = regexec(&search_regexp, haystack, 10, regmatches, 0);
if (!result)
return haystack + regmatches[0].rm_so;
return 0;
}
#endif
if (ISSET(CASE_SENSITIVE))
return strstr(haystack, needle);
else
@@ -105,7 +114,142 @@ void *nrealloc(void *ptr, size_t howmuch)
void *r;
if (!(r = realloc(ptr, howmuch)))
die("nano: realloc: out of memory!");
die(_("nano: realloc: out of memory!"));
return r;
}
/* Copy one malloced string to another pointer.
Should be used as dest = mallocstrcpy(dest, src);
*/
void *mallocstrcpy(void *dest, void *src)
{
if (dest != NULL)
free(dest);
if (src == NULL) {
dest = NULL;
return(dest);
}
dest = nmalloc(strlen(src) + 1);
strcpy(dest, src);
return dest;
}
/* Append a new magic-line to filebot */
void new_magicline(void)
{
filebot->next = nmalloc(sizeof(filestruct));
filebot->next->data = nmalloc(1);
filebot->next->data[0] = '\0';
filebot->next->prev = filebot;
filebot->next->next = NULL;
filebot->next->lineno = filebot->lineno + 1;
filebot = filebot->next;
totlines++;
}
/*
* Routine to see if a text string is matched by a wildcard pattern.
* Returns TRUE if the text is matched, or FALSE if it is not matched
* or if the pattern is invalid.
* * matches zero or more characters
* ? matches a single character
* [abc] matches 'a', 'b' or 'c'
* \c quotes character c
* Adapted from code written by Ingo Wilken, and
* then taken from sash, Copyright (c) 1999 by David I. Bell
* Permission is granted to use, distribute, or modify this source,
* provided that this copyright notice remains intact.
* Permission to distribute this code under the GPL has been granted.
*/
int check_wildcard_match(const char *text, const char *pattern)
{
const char *retryPat;
const char *retryText;
int ch;
int found;
int len;
retryPat = NULL;
retryText = NULL;
while (*text || *pattern) {
ch = *pattern++;
switch (ch) {
case '*':
retryPat = pattern;
retryText = text;
break;
case '[':
found = FALSE;
while ((ch = *pattern++) != ']') {
if (ch == '\\')
ch = *pattern++;
if (ch == '\0')
return FALSE;
if (*text == ch)
found = TRUE;
}
len = strlen(text);
if (found == FALSE && len != 0) {
return FALSE;
}
if (found == TRUE) {
if (strlen(pattern) == 0 && len == 1) {
return TRUE;
}
if (len != 0) {
text++;
continue;
}
}
/* fall into next case */
case '?':
if (*text++ == '\0')
return FALSE;
break;
case '\\':
ch = *pattern++;
if (ch == '\0')
return FALSE;
/* fall into next case */
default:
if (*text == ch) {
if (*text)
text++;
break;
}
if (*text) {
pattern = retryPat;
text = ++retryText;
break;
}
return FALSE;
}
if (pattern == NULL)
return FALSE;
}
return TRUE;
}

539
winio.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* winio.c *
* *
@@ -20,6 +21,7 @@
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include "config.h"
#include "proto.h"
#include "nano.h"
@@ -47,7 +49,7 @@ int do_first_line(void)
current = fileage;
placewewant = 0;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
return 1;
}
@@ -56,7 +58,7 @@ int do_last_line(void)
current = filebot;
placewewant = 0;
current_x = 0;
edit_update(current);
edit_update(current, CENTER);
return 1;
}
@@ -72,9 +74,9 @@ int xpt(filestruct * fileptr, int index)
tabs++;
if (fileptr->data[i] == NANO_CONTROL_I) {
if (tabs % TABSIZE == 0);
if (tabs % tabsize == 0);
else
tabs += TABSIZE - (tabs % TABSIZE);
tabs += tabsize - (tabs % tabsize);
} else if (fileptr->data[i] & 0x80)
/* Make 8 bit chars only 1 collumn! */
;
@@ -105,10 +107,10 @@ int actual_x_from_start(filestruct * fileptr, int xplus, int start)
for (i = start; tot <= xplus && fileptr->data[i] != 0; i++, tot++)
if (fileptr->data[i] == NANO_CONTROL_I) {
if (tot % TABSIZE == 0)
if (tot % tabsize == 0)
tot++;
else
tot += TABSIZE - (tot % TABSIZE);
tot += tabsize - (tot % tabsize);
} else if (fileptr->data[i] & 0x80)
tot++; /* Make 8 bit chars only 1 column (again) */
else if (fileptr->data[i] < 32)
@@ -139,9 +141,9 @@ int strlenpt(char *buf)
tabs++;
if (buf[i] == NANO_CONTROL_I) {
if (tabs % TABSIZE == 0);
if (tabs % tabsize == 0);
else
tabs += TABSIZE - (tabs % TABSIZE);
tabs += tabsize - (tabs % tabsize);
} else if (buf[i] & 0x80)
/* Make 8 bit chars only 1 collumn! */
;
@@ -190,7 +192,6 @@ void blank_edit(void)
int i;
for (i = 0; i <= editwinrows - 1; i++)
mvwaddstr(edit, i, 0, hblank);
wrefresh(edit);
}
@@ -216,55 +217,89 @@ void check_statblank(void)
}
}
/* Get the input from the kb, this should only be called from statusq */
int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
/* Repaint the statusbar when getting a character in nanogetstr */
void nanoget_repaint(char *buf, char *inputbuf, int x)
{
int kbinput = 0, j = 0, x = 0, xend;
int x_left = 0;
char inputstr[132], inputbuf[132] = "";
int len = strlen(buf);
int wid = COLS - len;
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
if (strlen(def) > 0)
waddstr(bottomwin, def);
wrefresh(bottomwin);
if (x <= COLS - 1) {
/* Black magic */
buf[len - 1] = ' ';
mvwaddstr(bottomwin, 0, 0, buf);
waddnstr(bottomwin, inputbuf, wid);
wmove(bottomwin, 0, (x % COLS));
}
else {
/* Black magic */
buf[len - 1] = '$';
mvwaddstr(bottomwin, 0, 0, buf);
waddnstr(bottomwin, &inputbuf[wid * ((x - len) / (wid))], wid);
wmove(bottomwin, 0, ((x - len) % wid) + len);
}
}
/* Get the input from the kb, this should only be called from statusq */
int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
int start_x)
{
int kbinput = 0, j = 0, x = 0, xend;
int x_left = 0, inputlen, tabbed = 0, shift = 0;
char *inputbuf;
inputbuf = nmalloc(strlen(def) + 1);
inputbuf[0] = 0;
x_left = strlen(buf);
x = strlen(def) + x_left;
/* Get the input! */
if (strlen(def) > 0) {
strcpy(answer, def);
if (strlen(def) > 0)
strcpy(inputbuf, def);
}
/* Go into raw mode so we can actually get ^C, for example */
raw();
nanoget_repaint(buf, inputbuf, x);
/* Make sure any editor screen updates are displayed before getting input */
wrefresh(edit);
while ((kbinput = wgetch(bottomwin)) != 13) {
for (j = 0; j <= slen - 1; j++) {
if (kbinput == s[j].val) {
noraw();
cbreak();
strcpy(answer, "");
/* We shouldn't discard the answer it gave, just because
we hit a keystroke, GEEZ! */
answer = mallocstrcpy(answer, inputbuf);
free(inputbuf);
return s[j].val;
}
}
xend = strlen(buf) + strlen(inputbuf);
if (kbinput != '\t')
tabbed = 0;
switch (kbinput) {
/* Stuff we want to equate with <enter>, ASCII 13 */
case 343:
ungetch(13); /* Enter on iris-ansi $TERM, sometimes */
break;
#ifdef PDCURSES
/* Stuff we want to ignore with PDCURSES */
case 541:
case 542:
case 544:
break;
#endif
case KEY_HOME:
x = x_left;
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
break;
case KEY_END:
x = x_left + strlen(inputbuf);
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
break;
case KEY_RIGHT:
@@ -279,19 +314,13 @@ int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
strlen(inputbuf) - (x - x_left) - 1);
inputbuf[strlen(inputbuf) - 1] = 0;
}
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
break;
case NANO_CONTROL_K:
case NANO_CONTROL_U:
*inputbuf = 0;
x = x_left;
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
break;
case KEY_BACKSPACE:
case KEY_DC:
@@ -307,9 +336,19 @@ int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
inputbuf[strlen(inputbuf) - 1] = 0;
}
}
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
if (x > strlen(buf))
x--;
nanoget_repaint(buf, inputbuf, x);
break;
case NANO_CONTROL_I:
if (allowtabs) {
shift = 0;
inputbuf = input_tab(inputbuf, (x - x_left),
&tabbed, &shift);
x += shift;
nanoget_repaint(buf, inputbuf, x);
}
break;
case KEY_LEFT:
if (x > strlen(buf))
x--;
@@ -325,17 +364,11 @@ int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
switch (kbinput = wgetch(edit)) {
case 70:
x = x_left + strlen(inputbuf);
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
break;
case 72:
x = x_left;
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
break;
}
break;
@@ -353,10 +386,7 @@ int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
break;
case 49:
x = x_left;
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
goto skip_126;
case 51:
if (strlen(inputbuf) > 0
@@ -366,17 +396,11 @@ int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
strlen(inputbuf) - (x - x_left) - 1);
inputbuf[strlen(inputbuf) - 1] = 0;
}
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
goto skip_126;
case 52:
x = x_left + strlen(inputbuf);
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
goto skip_126;
skip_126:
nodelay(edit, TRUE);
@@ -387,27 +411,24 @@ int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
break;
}
}
blank_statusbar();
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
break;
default:
if (kbinput < 32)
break;
strcpy(inputstr, inputbuf);
inputstr[x - strlen(buf)] = kbinput;
strcpy(&inputstr[x - strlen(buf) + 1],
&inputbuf[x - strlen(buf)]);
strcpy(inputbuf, inputstr);
inputlen = strlen(inputbuf);
inputbuf = nrealloc(inputbuf, inputlen + 2);
memmove(&inputbuf[x - x_left + 1],
&inputbuf[x - x_left],
inputlen - (x - x_left) + 1);
inputbuf[x - x_left] = kbinput;
x++;
mvwaddstr(bottomwin, 0, 0, buf);
waddstr(bottomwin, inputbuf);
wmove(bottomwin, 0, x);
nanoget_repaint(buf, inputbuf, x);
#ifdef DEBUG
fprintf(stderr, _("input \'%c\' (%d)\n"), kbinput, kbinput);
#endif
@@ -415,11 +436,13 @@ int nanogetstr(char *buf, char *def, shortcut s[], int slen, int start_x)
wrefresh(bottomwin);
}
strncpy(answer, inputbuf, 132);
answer = mallocstrcpy(answer, inputbuf);
free(inputbuf);
noraw();
cbreak();
if (!strcmp(answer, ""))
/* Now that the text is editable instead of bracketed, we have to
check for answer == def, instead of answer == "" */
if (((ISSET(PICO_MODE)) && !strcmp(answer, "")) ||
((!ISSET(PICO_MODE)) && !strcmp(answer, def)))
return -2;
else
return 0;
@@ -466,7 +489,7 @@ void onekey(char *keystroke, char *desc)
{
char description[80];
snprintf(description, 12, " %-11s", desc);
snprintf(description, 12, " %-10s", desc);
wattron(bottomwin, A_REVERSE);
waddstr(bottomwin, keystroke);
wattroff(bottomwin, A_REVERSE);
@@ -480,7 +503,6 @@ void clear_bottomwin(void)
mvwaddstr(bottomwin, 1, 0, hblank);
mvwaddstr(bottomwin, 2, 0, hblank);
wrefresh(bottomwin);
}
void bottombars(shortcut s[], int slen)
@@ -497,7 +519,7 @@ void bottombars(shortcut s[], int slen)
clear_bottomwin();
wmove(bottomwin, 1, 0);
for (i = 0; i <= slen - 1; i += 2) {
sprintf(keystr, "^%c", s[i].val + 64);
snprintf(keystr, 10, "^%c", s[i].val + 64);
onekey(keystr, s[i].desc);
for (j = 0; j < k; j++)
@@ -506,7 +528,7 @@ void bottombars(shortcut s[], int slen)
wmove(bottomwin, 2, 0);
for (i = 1; i <= slen - 1; i += 2) {
sprintf(keystr, "^%c", s[i].val + 64);
snprintf(keystr, 10, "^%c", s[i].val + 64);
onekey(keystr, s[i].desc);
for (j = 0; j < k; j++)
@@ -527,6 +549,10 @@ void set_modified(void)
}
}
/* And so start the display update routines */
/* Given a column, this returns the "page" it is on */
/* "page" in the case of the display columns, means which set of 80 */
/* characters is viewable (ie: page 1 shows from 1 to COLS) */
inline int get_page_from_virtual(int virtual)
{
int page = 2;
@@ -543,6 +569,7 @@ inline int get_page_from_virtual(int virtual)
return page;
}
/* The inverse of the above function */
inline int get_page_start_virtual(int page)
{
int virtual;
@@ -558,16 +585,25 @@ inline int get_page_end_virtual(int page)
}
#ifndef NANO_SMALL
/* Called only from edit_add, and therefore expects a
* converted-to-only-spaces line */
/* This takes care of the case where there is a mark that covers only */
/* the current line. */
/* It expects a line with no tab characers (ie: the type that edit_add */
/* deals with */
void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
int virt_cur_x, int this_page)
{
/*
* The general idea is to break the line up into 3 sections: before
* the mark, the mark, and after the mark. We then paint each in
* turn (for those that are currently visible, of course
*
* 3 start points: 0 -> begin, begin->end, end->strlen(data)
* in data : pre sel post
*/
int this_page_start = get_page_start_virtual(this_page),
this_page_end = get_page_end_virtual(this_page);
/* 3 start points: 0 -> begin, begin->end, end->strlen(data) */
/* in data : pre sel post */
/* likewise, 3 data lengths */
int pre_data_len = begin, sel_data_len = end - begin, post_data_len = 0; /* Determined from the other two */
@@ -584,17 +620,17 @@ void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
if (end < this_page_start)
end = this_page_start;
/* we don't care about end, because it will just get cropped
* due to length */
if (begin > this_page_end)
begin = this_page_end;
if (end > this_page_end)
end = this_page_end;
/* Now calculate the lengths */
sel_data_len = end - begin;
post_data_len = this_page_end - end;
/* Paint this line! */
mvwaddnstr(edit, y, 0, &fileptr->data[this_page_start], pre_data_len);
wattron(edit, A_REVERSE);
mvwaddnstr(edit, y, begin - this_page_start,
@@ -605,109 +641,124 @@ void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
}
#endif
/* Called only from update_line. Expects a converted-to-not-have-tabs
/* edit_add takes care of the job of actually painting a line into the
* edit window.
*
* Called only from update_line. Expects a converted-to-not-have-tabs
* line */
void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
int virt_mark_beginx, int this_page)
{
#ifndef NANO_SMALL
if (ISSET(MARK_ISSET)) {
if ((fileptr->lineno > mark_beginbuf->lineno
&& fileptr->lineno > current->lineno)
|| (fileptr->lineno < mark_beginbuf->lineno
&& fileptr->lineno < current->lineno)) {
/* We're on a normal, unselected line */
/* There are quite a few cases that could take place, we'll deal
* with them each in turn */
if (ISSET(MARK_ISSET)
&& !((fileptr->lineno > mark_beginbuf->lineno
&& fileptr->lineno > current->lineno)
|| (fileptr->lineno < mark_beginbuf->lineno
&& fileptr->lineno < current->lineno))) {
/* If we get here we are on a line that is atleast
* partially selected. The lineno checks above determined
* that */
if (fileptr != mark_beginbuf && fileptr != current) {
/* We are on a completely marked line, paint it all
* inverse */
wattron(edit, A_REVERSE);
mvwaddnstr(edit, yval, 0, fileptr->data, COLS);
} else {
if (fileptr != mark_beginbuf && fileptr != current) {
/* We're on selected text */
wattron(edit, A_REVERSE);
mvwaddnstr(edit, yval, 0, fileptr->data, COLS);
wattroff(edit, A_REVERSE);
} else if (fileptr == mark_beginbuf && fileptr == current) {
/* Special case, we're still on the same line we started
* marking */
if (virt_cur_x < virt_mark_beginx)
add_marked_sameline(virt_cur_x, virt_mark_beginx,
fileptr, yval, virt_cur_x,
this_page);
else
add_marked_sameline(virt_mark_beginx, virt_cur_x,
fileptr, yval, virt_cur_x,
this_page);
} else if (fileptr == mark_beginbuf) {
/* we're updating the line that was first marked */
int target;
if (mark_beginbuf->lineno > current->lineno)
wattron(edit, A_REVERSE);
target =
(virt_mark_beginx <
COLS - 1) ? virt_mark_beginx : COLS - 1;
mvwaddnstr(edit, yval, 0, fileptr->data, target);
if (mark_beginbuf->lineno < current->lineno)
wattron(edit, A_REVERSE);
else
wattroff(edit, A_REVERSE);
target = (COLS - 1) - virt_mark_beginx;
if (target < 0)
target = 0;
mvwaddnstr(edit, yval, virt_mark_beginx,
&fileptr->data[virt_mark_beginx], target);
if (mark_beginbuf->lineno < current->lineno)
wattroff(edit, A_REVERSE);
} else if (fileptr == current) {
/* we're on the cursors line, but it's not the first
* one we marked... */
int this_page_start = get_page_start_virtual(this_page),
this_page_end = get_page_end_virtual(this_page);
if (mark_beginbuf->lineno < current->lineno)
wattron(edit, A_REVERSE);
if (virt_cur_x > COLS - 2) {
mvwaddnstr(edit, yval, 0,
&fileptr->data[this_page_start],
virt_cur_x - this_page_start);
} else {
mvwaddnstr(edit, yval, 0, fileptr->data, virt_cur_x);
}
if (mark_beginbuf->lineno > current->lineno)
wattron(edit, A_REVERSE);
else
wattroff(edit, A_REVERSE);
if (virt_cur_x > COLS - 2)
mvwaddnstr(edit, yval, virt_cur_x - this_page_start,
&fileptr->data[virt_cur_x],
this_page_end - virt_cur_x);
else
mvwaddnstr(edit, yval, virt_cur_x,
&fileptr->data[virt_cur_x],
COLS - virt_cur_x);
if (mark_beginbuf->lineno > current->lineno)
wattroff(edit, A_REVERSE);
wattroff(edit, A_REVERSE);
} else if (fileptr == mark_beginbuf && fileptr == current) {
/* Special case, we're still on the same line we started
* marking -- so we call our helper function */
if (virt_cur_x < virt_mark_beginx) {
/* To the right of us is marked */
add_marked_sameline(virt_cur_x, virt_mark_beginx,
fileptr, yval, virt_cur_x, this_page);
} else {
/* To the left of us is marked */
add_marked_sameline(virt_mark_beginx, virt_cur_x,
fileptr, yval, virt_cur_x, this_page);
}
} else if (fileptr == mark_beginbuf) {
/*
* we're updating the line that was first marked
* but we're not currently on it. So we want to
* figur out which half to invert based on our
* relative line numbers.
*
* i.e. If we're above the "beginbuf" line, we want to
* mark the left side. Otherwise we're below, so we
* mark the right
*/
int target;
if (mark_beginbuf->lineno > current->lineno)
wattron(edit, A_REVERSE);
target =
(virt_mark_beginx <
COLS - 1) ? virt_mark_beginx : COLS - 1;
mvwaddnstr(edit, yval, 0, fileptr->data, target);
if (mark_beginbuf->lineno < current->lineno)
wattron(edit, A_REVERSE);
else
wattroff(edit, A_REVERSE);
target = (COLS - 1) - virt_mark_beginx;
if (target < 0)
target = 0;
mvwaddnstr(edit, yval, virt_mark_beginx,
&fileptr->data[virt_mark_beginx], target);
if (mark_beginbuf->lineno < current->lineno)
wattroff(edit, A_REVERSE);
} else if (fileptr == current) {
/* we're on the cursors line, but it's not the first
* one we marked. Similar to the previous logic. */
int this_page_start = get_page_start_virtual(this_page),
this_page_end = get_page_end_virtual(this_page);
if (mark_beginbuf->lineno < current->lineno)
wattron(edit, A_REVERSE);
if (virt_cur_x > COLS - 2) {
mvwaddnstr(edit, yval, 0,
&fileptr->data[this_page_start],
virt_cur_x - this_page_start);
} else {
mvwaddnstr(edit, yval, 0, fileptr->data, virt_cur_x);
}
if (mark_beginbuf->lineno > current->lineno)
wattron(edit, A_REVERSE);
else
wattroff(edit, A_REVERSE);
if (virt_cur_x > COLS - 2)
mvwaddnstr(edit, yval, virt_cur_x - this_page_start,
&fileptr->data[virt_cur_x],
this_page_end - virt_cur_x);
else
mvwaddnstr(edit, yval, virt_cur_x,
&fileptr->data[virt_cur_x], COLS - virt_cur_x);
if (mark_beginbuf->lineno > current->lineno)
wattroff(edit, A_REVERSE);
}
} else
#endif
/* Just paint the string (no mark on this line) */
mvwaddnstr(edit, yval, 0, &fileptr->data[start],
get_page_end_virtual(this_page) - start);
}
/*
* Just update one line in the edit buffer
* Just update one line in the edit buffer. Basically a wrapper for
* edit_add
*
* index gives is a place in the string to update starting from.
* Likely args are current_x or 0.
@@ -746,12 +797,16 @@ void update_line(filestruct * fileptr, int index)
virt_cur_x++;
if (i < mark_beginx)
virt_mark_beginx++;
} while (pos % TABSIZE);
} while (pos % tabsize);
/* must decrement once to account for tab-is-one-character */
if (i < current_x)
virt_cur_x--;
if (i < mark_beginx)
virt_mark_beginx--;
} else if (realdata[i] >= 1 && realdata[i] <= 26) {
/* Treat control characters as ^letter */
fileptr->data[pos++] = '^';
fileptr->data[pos++] = realdata[i] + 64;
} else {
fileptr->data[pos++] = realdata[i];
}
@@ -795,7 +850,8 @@ void center_cursor(void)
/* Refresh the screen without changing the position of lines */
void edit_refresh(void)
{
int lines = 0, i = 0;
static int noloop = 0;
int lines = 0, i = 0, currentcheck = 0;
filestruct *temp, *hold = current;
if (current == NULL)
@@ -806,9 +862,19 @@ void edit_refresh(void)
while (lines <= editwinrows - 1 && lines <= totlines && temp != NULL) {
hold = temp;
update_line(temp, current_x);
if (temp == current)
currentcheck = 1;
temp = temp->next;
lines++;
}
/* If noloop == 1, then we already did an edit_update without finishing
this function. So we don't run edit_update again */
if (!currentcheck && !noloop) { /* Then current has run off the screen... */
edit_update(current, CENTER);
noloop = 1;
} else if (noloop)
noloop = 0;
if (lines <= editwinrows - 1)
while (lines <= editwinrows - 1) {
@@ -821,67 +887,43 @@ void edit_refresh(void)
editbot = temp;
}
/*
* Same as above, but touch the window first so everything is redrawn.
*/
void edit_refresh_clearok(void)
{
clearok(edit, TRUE);
edit_refresh();
clearok(edit, FALSE);
}
/*
* Nice generic routine to update the edit buffer given a pointer to the
* file struct =)
*/
void edit_update(filestruct * fileptr)
void edit_update(filestruct * fileptr, int topmidbot)
{
int lines = 0, i = 0;
int i = 0;
filestruct *temp;
if (fileptr == NULL)
return;
temp = fileptr;
while (i <= editwinrows / 2 && temp->prev != NULL) {
i++;
temp = temp->prev;
}
edittop = temp;
if (topmidbot == 2);
else if (topmidbot == 0)
for (i = 0; i <= editwinrows - 1 && temp->prev != NULL; i++)
temp = temp->prev;
else
for (i = 0; i <= editwinrows / 2 && temp->prev != NULL; i++)
temp = temp->prev;
while (lines <= editwinrows - 1 && lines <= totlines && temp != NULL
&& temp != filebot) {
temp = temp->next;
lines++;
}
editbot = temp;
edittop = temp;
fix_editbot();
edit_refresh();
}
/* Now we want to update the screen using this struct as the top of the edit buffer */
void edit_update_top(filestruct * fileptr)
{
int i;
filestruct *temp = fileptr;
if (fileptr->next == NULL || fileptr == NULL)
return;
i = 0;
while (i <= editwinrows / 2 && temp->next != NULL) {
i++;
temp = temp->next;
}
edit_update(temp);
}
/* And also for the bottom... */
void edit_update_bot(filestruct * fileptr)
{
int i;
filestruct *temp = fileptr;
i = 0;
while (i <= editwinrows / 2 - 1 && temp->prev != NULL) {
i++;
temp = temp->prev;
}
edit_update(temp);
}
/* This function updates current based on where current_y is, reset_cursor
does the opposite */
void update_cursor(void)
@@ -910,8 +952,10 @@ void update_cursor(void)
* global. Returns -1 on aborted enter, -2 on a blank string, and 0
* otherwise, the valid shortcut key caught, Def is any editable text we
* want to put up by default.
*
* New arg tabs tells whether or not to allow tab completion.
*/
int statusq(shortcut s[], int slen, char *def, char *msg, ...)
int statusq(int tabs, shortcut s[], int slen, char *def, char *msg, ...)
{
va_list ap;
char foo[133];
@@ -921,11 +965,11 @@ int statusq(shortcut s[], int slen, char *def, char *msg, ...)
va_start(ap, msg);
vsnprintf(foo, 132, msg, ap);
strncat(foo, ": ", 132);
va_end(ap);
strncat(foo, ": ", 132);
wattron(bottomwin, A_REVERSE);
ret = nanogetstr(foo, def, s, slen, (strlen(foo) + 3));
ret = nanogetstr(tabs, foo, def, s, slen, (strlen(foo) + 3));
wattroff(bottomwin, A_REVERSE);
switch (ret) {
@@ -939,7 +983,7 @@ int statusq(shortcut s[], int slen, char *def, char *msg, ...)
case NANO_CANCEL_KEY:
return -1;
default:
blank_statusbar_refresh();
blank_statusbar();
}
#ifdef DEBUG
@@ -965,14 +1009,15 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
blank_statusbar_refresh();
wattroff(bottomwin, A_REVERSE);
/* Remove gettext call for keybindings until we clear the thing up */
if (!ISSET(NO_HELP)) {
wmove(bottomwin, 1, 0);
onekey(_(" Y"), _("Yes"));
onekey(" Y", _("Yes"));
if (all)
onekey(_(" A"), _("All"));
onekey(" A", _("All"));
wmove(bottomwin, 2, 0);
onekey(_(" N"), _("No"));
onekey(_("^C"), _("Cancel"));
onekey(" N", _("No"));
onekey("^C", _("Cancel"));
}
va_start(ap, msg);
vsnprintf(foo, 132, msg, ap);
@@ -985,8 +1030,6 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
if (leavecursor == 1)
reset_cursor();
raw();
while (ok == -1) {
kbinput = wgetch(edit);
@@ -1009,8 +1052,6 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
break;
}
}
noraw();
cbreak();
/* Then blank the screen */
blank_statusbar_refresh();
@@ -1069,7 +1110,8 @@ int total_refresh(void)
clearok(edit, FALSE);
clearok(topwin, FALSE);
clearok(bottomwin, FALSE);
edit_refresh();
titlebar();
return 1;
}
@@ -1173,7 +1215,8 @@ int do_help(void)
for (i = 1; i < page; i++) {
row = 0;
j = 0;
while (row < editwinrows && *ptr != '\0') {
while (row < editwinrows - 2 && *ptr != '\0') {
if (*ptr == '\n' || j == COLS - 5) {
j = 0;
row++;
@@ -1183,6 +1226,10 @@ int do_help(void)
}
}
if (i > 1) {
}
i = 0;
j = 0;
while (i < editwinrows && *ptr != '\0') {
@@ -1211,7 +1258,6 @@ int do_help(void)
continue;
}
} while ((kbinput = wgetch(edit)) != NANO_EXIT_KEY);
if (no_help_flag) {
werase(bottomwin);
wrefresh(bottomwin);
@@ -1267,3 +1313,12 @@ void dump_buffer_reverse(filestruct * inptr)
}
#endif /* DEBUG */
}
/* Fix editbot based on the assumption that edittop is correct */
void fix_editbot(void)
{
int i;
editbot = edittop;
for (i = 0; (i <= editwinrows - 1) && (editbot->next != NULL)
&& (editbot != filebot); i++, editbot = editbot->next);
}