Compare commits

...

232 Commits

Author SHA1 Message Date
Chris Allegretta
a4a222d1d7 Nano 0.9.99pre3 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@549 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-20 03:52:13 +00:00
Chris Allegretta
a18d7978e2 Fixed garbage in po, I hope this doesn't screw up anything Jordi
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@548 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-20 02:41:13 +00:00
Jordi Mallach
a7b2ed0cac Updated ca.po with changes from Miquel Vidal.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@547 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-20 02:04:43 +00:00
Chris Allegretta
78aac9113d Finnish update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@546 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-19 19:37:05 +00:00
Chris Allegretta
f4a986465a NEWS for impending 0.9.99pre3 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@545 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-19 05:28:00 +00:00
Chris Allegretta
a57fcb044c Taking a wild guess with people's Y/N/A keys, sure to get me into trouble
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@544 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-18 05:55:47 +00:00
Chris Allegretta
ea620fe88b Yeah, so how about make the yes key == yes instead of no
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@543 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-18 05:39:41 +00:00
Chris Allegretta
0d9109acf6 Add ac to the actual configure script
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@542 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-18 05:26:18 +00:00
Chris Allegretta
2d6f1bc896 Slight update of FAQ for advocacy
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@541 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-17 02:42:03 +00:00
Jordi Mallach
6aec0d6363 Fixed some errors in Spanish
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@540 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-17 01:32:58 +00:00
Jordi Mallach
82b182986b Initial Catalan translation
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@539 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-17 01:31:32 +00:00
Jordi Mallach
8119765cbd Tiny es.po updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@538 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-16 20:00:03 +00:00
Chris Allegretta
618f5d788c configure.in: - Added separate check for resizeterm()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@537 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-16 04:48:30 +00:00
Chris Allegretta
4ce8e3b863 Internationalize yes, no and all *sigh*
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@536 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-16 01:49:31 +00:00
Chris Allegretta
35ac99d0d4 Use code instead of command in man page *shrug*. Add GNUish stuff
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@535 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-15 00:25:17 +00:00
Chris Allegretta
c46dd8123c Nano is now a GNU package
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@534 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-14 14:28:27 +00:00
Chris Allegretta
9560bb51ab Update status in README
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@533 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-13 05:18:57 +00:00
Chris Allegretta
882e145ebb Manual fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@532 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-12 06:52:50 +00:00
Chris Allegretta
fb9cffe268 Manual fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@531 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-12 06:42:43 +00:00
Chris Allegretta
8546fa016e Added Bug #55
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@530 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-12 05:01:05 +00:00
Chris Allegretta
7e7bcf8a46 Nano texi manual
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@529 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-12 03:48:53 +00:00
Chris Allegretta
4de7b95511 Delete commented out stuff that isn't going to happen now
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@528 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-12 03:26:10 +00:00
Chris Allegretta
1bf501c236 GNU compliance issues: - Added texinfo manual nano.texi. Added texi options to Makefile.am
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@527 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-12 03:24:46 +00:00
Chris Allegretta
af6414ac37 Reworked main menu list, added help to default list, aligned ^R with ^O, ^\ with ^W
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@526 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-11 19:05:05 +00:00
Chris Allegretta
4ed131510e do_delete() - Added check for current->next == fileptr, as we have a magic line code again, fixes sillyness at the end of the last line before the magic line (reported by J.A. Neitzel)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@525 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-10 17:50:50 +00:00
Chris Allegretta
8bc03b6fdc main() - Added ENABLE_NLS check around gettext stuff
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@524 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-09 02:57:52 +00:00
Chris Allegretta
b55999ebcb de,fi,id translation updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@523 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-09 02:49:46 +00:00
Chris Allegretta
3362cae2f6 FAQ updates and fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@522 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-06 22:21:25 +00:00
Chris Allegretta
af7fc3dbc1 Oops, actually add hu.po :-)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@521 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-06 05:16:59 +00:00
Chris Allegretta
00ae5dfa27 do_justify - If the keystroke after the justify is not the unjustify key, blank the statsubar (bug reported by Neil Parks)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@520 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-05 18:24:33 +00:00
Chris Allegretta
d096f68966 hu.po: - Hungarian translation by Horvath Szabolcs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@519 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-05 13:51:31 +00:00
Chris Allegretta
09f39cbec6 Fix for bugu #54
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@518 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-05 13:43:23 +00:00
Chris Allegretta
a8785e0793 Added BUG #54
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@517 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-04 22:21:12 +00:00
Jordi Mallach
37388ee91e Updated for latest CVS.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@516 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-04 00:11:02 +00:00
Chris Allegretta
de48b41b61 configure.in: - Autoconf compatibility fixes (Pavel Roskin)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@515 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-02-01 22:56:44 +00:00
Chris Allegretta
7c1fee7868 Back to CVS version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@514 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-31 23:24:54 +00:00
Chris Allegretta
34318edba2 Nano 0.9.99pre2 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@512 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-31 23:22:36 +00:00
Chris Allegretta
90e040455d Update NEWS for upcoming release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@511 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-31 18:01:24 +00:00
Chris Allegretta
4e90c40e72 Fix cursor not on after resize
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@510 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-29 23:40:43 +00:00
Chris Allegretta
08020889d3 Fix for resizing the window in modes other than normal edit mode Changes to handle_sigwinch(), main(). Fixes bug #52 (Rocco)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@509 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-29 23:37:54 +00:00
Chris Allegretta
e434b45148 do_alt_speller and nanogetstr fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@508 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-27 19:25:00 +00:00
Robert Siemborski
221a46e271 updated bugs as discussed on the list
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@507 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-26 16:23:39 +00:00
Chris Allegretta
169ee8498e Fixed Bug #53
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@506 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-26 01:57:32 +00:00
Chris Allegretta
12de5ca7cf Added bug #53
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@505 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-25 22:16:12 +00:00
Chris Allegretta
a711f7e638 username_tab_completion() - Removed redundant conditional (Rocco)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@504 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-23 04:16:31 +00:00
Chris Allegretta
2c2c5f2156 username_tab_completion: rewritten using getpwent
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@503 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-23 03:27:31 +00:00
Chris Allegretta
e5e4d49316 Rocco's groovy fixes to real_dir_from_tilde
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@502 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-23 03:09:15 +00:00
Chris Allegretta
0a06e07831 replace for loop for hline init with memset in init functions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@501 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-23 02:35:04 +00:00
Chris Allegretta
17276e506e Oops, Rob not Rocco :>
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@500 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-23 01:22:32 +00:00
Chris Allegretta
d4ddd014a3 Oops, center_x and y, not current. Thx Rocco
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@499 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-23 01:17:07 +00:00
Chris Allegretta
ee733e6d4c real_dir_from_tilde() - Rewritten using getpwent (suggected by Adam)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@498 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-22 22:17:08 +00:00
Robert Siemborski
60cd6aa04f totsize fix in do_justify
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@497 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-21 23:23:48 +00:00
Chris Allegretta
7f7ce56e4e Oops, make that usage()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@496 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-21 16:35:49 +00:00
Chris Allegretta
e9a2d03497 version() - Add arg to -T help (Rocco).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@495 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-21 16:08:21 +00:00
Chris Allegretta
9d6f3f3f60 Removed - from version in NEWS and ChangeLog
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@494 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-21 02:35:03 +00:00
Chris Allegretta
f0b26df170 global.c: Don't define toggles global or toggle_init_one if using --tiny
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@493 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-20 22:18:18 +00:00
Chris Allegretta
17dcb7212f Get rid of center_x and center_y, removed redundant free_node, added restore of totsize when unjustifying
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@492 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-20 21:40:07 +00:00
Chris Allegretta
8d9b11a847 username_tab_completion(): - Optimization and removal of useless vars (Rocco).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@491 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-19 04:17:24 +00:00
Chris Allegretta
0fc2b81df8 write_file(): Don't free() realname on write error
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@490 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-18 15:04:20 +00:00
Chris Allegretta
76745fbe5f Back to CVS version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@489 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-18 04:40:06 +00:00
Chris Allegretta
9faa3f13e2 Nano 0.9.99pre1 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@487 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-18 04:37:09 +00:00
Chris Allegretta
3c10ec016c Added bug #51
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@486 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-17 19:27:55 +00:00
Robert Siemborski
c2eeb4e585 small fix for do_justify totsize calculations
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@485 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-17 03:29:02 +00:00
Chris Allegretta
4058709e0b input_tab(): Added memset() to matchBuf to ensure sanity (Rocco, Adam).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@484 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-16 04:45:38 +00:00
Chris Allegretta
51dd32fb4e Changed null out at end of matchBuf from NULL to 0
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@483 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-16 04:20:08 +00:00
Chris Allegretta
ae4318dab0 Get rid of unneeded call to usage() in main() when calling a flag for a function that hasn't been compiled in (Rocco)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@482 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-16 04:18:26 +00:00
Chris Allegretta
3693944492 main(): Initialized kbinput to get around stupid compiler warning.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@481 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-15 20:26:38 +00:00
Chris Allegretta
4097379a26 Changed 'without NumLock on' to 'with NumLock off', more easy to understand?
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@480 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-15 20:25:24 +00:00
Chris Allegretta
b4c43683a5 input_tab(): - Added null end of matchBuf for sanity (Rocco).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@479 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-15 17:22:27 +00:00
Chris Allegretta
a35ec048d7 files.c:cwd_tab_completion(), input_tab(): Changed bare malloc/calloc calls to nmalloc (found by Rocco).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@478 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-15 02:26:12 +00:00
Chris Allegretta
2be96d00b9 Oops, forgot to credit Rocco in one place
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@477 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-14 05:22:43 +00:00
Chris Allegretta
e61e830010 Rocco's source code cleanups and #defines for magic values in global_init(). Added die_too_small() function
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@476 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-14 05:18:27 +00:00
Chris Allegretta
201d9bf467 Added print_numlock_warning(), code to figure out when numlock makes the keypad go bad.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@475 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-14 03:17:53 +00:00
Chris Allegretta
1748cd1d0f Added function ABCD(), better support for default settings
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@474 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-13 17:22:54 +00:00
Chris Allegretta
d9742c69c0 fi.po updates by Pauli Virtanen
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@473 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-12 15:51:53 +00:00
Rocco Corsi
af5c302b48 Move #ifndef cleanups. Some HELP and SPELLER #ifndef additions.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@472 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-12 07:51:05 +00:00
Chris Allegretta
4ee0b41b41 Moved ChangeLog entries for configure.in to configure.in section
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@471 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-11 15:11:00 +00:00
Chris Allegretta
cd6f12d53e Moved code to define all disabled when --tiny is used from nano.h to configure.in
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@470 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-11 15:08:06 +00:00
Rocco Corsi
06aca1cc9e Rolled back DISABLE_TABCOMP and NANO_SMALL changes from earlier today
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@469 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-11 05:30:31 +00:00
Chris Allegretta
a4d6d1df37 Add check for tiny option in #ifdefs for DISABLE_TABCOMP code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@468 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-10 23:44:10 +00:00
Chris Allegretta
7db63a5b65 Change Linux to GNU/Linux in the faq
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@467 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-10 22:05:40 +00:00
Chris Allegretta
2c4feca17f faq.html: Added section 3.6, reducing binary size
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@466 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-09 17:40:56 +00:00
Chris Allegretta
bbebec6871 configure.in: - Fix for _use_keypad check breaking slang support (Christian Weisgerber)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@465 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-09 00:37:32 +00:00
Chris Allegretta
8eac3b5069 do_browser() - added space and - keys for page down and up
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@464 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-08 21:14:04 +00:00
Chris Allegretta
bf69261597 real_dir_from_tilde(): ops, fix case where buf =~, silly crash
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@463 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-08 16:59:19 +00:00
Chris Allegretta
7e08082ffe Back to CVS ver
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@462 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-08 02:31:03 +00:00
Chris Allegretta
4ca160f784 0.9.25 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@460 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-08 02:29:20 +00:00
Chris Allegretta
155d620a14 Add and fix Bug #51 :-)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@459 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-08 01:50:37 +00:00
Chris Allegretta
2a2e2be0c4 Added and fixed bug #50
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@458 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-08 01:32:58 +00:00
Chris Allegretta
7044489c76 do_help: Do the bottom window the right wrong way if NO_HELP is set
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@457 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-07 23:02:02 +00:00
Chris Allegretta
1699144136 Update docs for upcoming 0.9.25 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@456 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-07 22:06:11 +00:00
Chris Allegretta
19b9e2be94 Oops, restore keypad() call when using PDCURSES
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@455 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-07 07:31:12 +00:00
Chris Allegretta
3f583165c4 Oops, take out my debugging code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@454 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-07 05:51:28 +00:00
Chris Allegretta
e1ebaf3821 do_writeout() takes an arg now, and mallocstrcpy now gives up if src == dest
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@453 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-07 05:50:36 +00:00
Chris Allegretta
c08f50d9de Back to the drawing board, old keypad code, dont slightly better
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@452 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-06 18:12:43 +00:00
Chris Allegretta
816a165b4b Fixes for dir crash by rocco and exit called on insert file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@451 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-06 17:43:56 +00:00
Chris Allegretta
150469a646 Added do_browse_from(), called from do_writeout and do_insert, changed mallocstrcpy to *char
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@450 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-05 21:13:14 +00:00
Chris Allegretta
544347c08a Oops, stop freeing stuff we can't necessarily free
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@449 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-05 14:31:52 +00:00
Chris Allegretta
6636dc3181 Changed ENABLE_BROWSER to DISABLE_BROWSER, tiny build now doesn't build browser either
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@448 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-05 05:41:07 +00:00
Chris Allegretta
90661b2def Updated README with snazzy one line desc of nano
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@447 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 23:25:18 +00:00
Chris Allegretta
123e5e66d3 Don't free realname when exiting do_browser in insert_file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@446 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 22:05:47 +00:00
Chris Allegretta
f4f7e04c5b Work around gnome-terminal, I'm tired of this
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@445 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 16:56:15 +00:00
Jordi Mallach
75ef81bc42 Browser Spanish translations
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@444 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 16:48:59 +00:00
Chris Allegretta
ba8edea860 Accept s and S silently to selected a file/dir
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@443 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 05:22:46 +00:00
Chris Allegretta
b0f5282de2 Fix segfault when width == 0
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@442 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 05:20:23 +00:00
Chris Allegretta
fe41584102 Make functions return themselves when do_browser() aborts
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@441 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 05:08:37 +00:00
Chris Allegretta
0e9d3c6c28 Commented file browser code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@440 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 04:59:17 +00:00
Chris Allegretta
6e82741931 Added fkey equivs to browser
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@439 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 04:41:08 +00:00
Chris Allegretta
f0999a18f0 use lstat instead of stat in filestat, so we can check for if the file is a symlink in the browser
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@438 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 02:49:56 +00:00
Chris Allegretta
63c8ab94fb Tadaa. Keypad issue fixed. It was the stupid timeout(0) call. UGH
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@437 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-04 02:33:52 +00:00
Chris Allegretta
85b444137b Added --enable-browser to version()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@436 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-03 20:13:28 +00:00
Chris Allegretta
425a266a92 Some better page up/down fixes, added keypad_on() call for now
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@435 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-03 15:09:27 +00:00
Chris Allegretta
f4b9601c1b First try at browser
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@434 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-03 07:11:47 +00:00
Chris Allegretta
827b15fdc0 credits spelling fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@433 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-03 02:09:04 +00:00
Rocco Corsi
8b6cccc5cc TAB-TAB completion segfaulting with more than 2048 files fixed. (Rocco)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@432 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-01-02 06:21:07 +00:00
Chris Allegretta
ee289d7a2b Don't skip . and .. in cwd_tab_completion()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@431 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-27 16:12:47 +00:00
Chris Allegretta
1e6fb08d15 Finally got rid of TIP from README and updated the Overview which people always quote from
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@430 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-27 15:46:22 +00:00
Chris Allegretta
66795ecbe1 do_cursorpos cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@429 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-27 04:47:28 +00:00
Chris Allegretta
d55655f23a Reordered --help usage listing by alpha
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@428 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-27 03:36:47 +00:00
Jordi Mallach
e34f96dec2 Add request for backup saves.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@427 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-20 01:06:39 +00:00
Jordi Mallach
5b89a14514 Added configure and Makefile.in. Yell at me :)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@426 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-19 23:01:24 +00:00
Jordi Mallach
56e6d72282 Corrected some typos and small errors in the faq.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@425 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-19 22:59:55 +00:00
Jordi Mallach
79ea7dd883 Corrected some typos and small errors.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@424 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-19 22:58:00 +00:00
Chris Allegretta
e47e4edf7f Back to CVS version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@423 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-19 03:01:00 +00:00
Chris Allegretta
c7ccb873f1 nano 0.9.24 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@421 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-19 02:59:43 +00:00
Chris Allegretta
66149e7aee Update docs for .24 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@420 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-19 02:51:06 +00:00
Chris Allegretta
07b9c2b90c Give the read file error segfault a bug # in BUGS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@419 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 20:18:37 +00:00
Chris Allegretta
651216388c Fix lots of compiler warnings
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@418 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 07:05:27 +00:00
Chris Allegretta
b7d00efd6d Added --disable-help string to version()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@417 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 05:36:51 +00:00
Chris Allegretta
d1627cffd0 Fix help menu keypad issues
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@416 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 05:03:16 +00:00
Chris Allegretta
7492cecc27 main(): - Added --view option to getopt_long()call . Bug discovered by Rocco Corsi.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@415 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 04:55:21 +00:00
Chris Allegretta
affeda817e do_toggle(): - Added fix_editbot() call to fix improper redisplay of edit window when using nohelp toggle (bug discovered by Rocco Corsi).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@414 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 04:03:48 +00:00
Chris Allegretta
92325e74b9 Oops, credit Rocco
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@413 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 03:44:22 +00:00
Chris Allegretta
220ba692e6 help_init(): - Fix off by one error that was making ^G help in normal mode and ^_ in pico mode not be displayed in the help.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@412 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 03:40:00 +00:00
Chris Allegretta
51b3eec536 Added -b, -e and -f compatibility flags, updated man pages, added Alt-Alt-x functionality
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@411 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 02:23:50 +00:00
Chris Allegretta
3a7c0bee6b Fix segfault when read_file encounters an error opening the file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@410 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-18 01:09:07 +00:00
Chris Allegretta
1a6e904583 Rid nano of PATH_MAX\!
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@409 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-14 13:56:28 +00:00
Chris Allegretta
b04a98dc86 Use MAX_PATH in write_file strncpy (for now) instead of 132
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@408 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-14 13:24:08 +00:00
Chris Allegretta
7960dcf919 Removed unneeded st2 var, don't open device files in open_file()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@407 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-13 15:01:29 +00:00
Chris Allegretta
544d9b0210 Update comment in write_file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@406 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-11 02:47:13 +00:00
Chris Allegretta
1cd506612d Remove useless fstat call
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@405 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-11 02:47:12 +00:00
Chris Allegretta
3bc8c72c8b Added --disable-help, moved hold pointer declaration
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@404 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-10 17:03:25 +00:00
Chris Allegretta
c130297a79 More totsize :P
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@403 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-10 06:07:01 +00:00
Chris Allegretta
321590a59d More totsize fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@402 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-10 06:03:40 +00:00
Chris Allegretta
e51c95fa7b uncutting at filebot magic line fix and new_magicline totsize increment
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@401 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-10 05:54:27 +00:00
Chris Allegretta
5146fec04c Cut and renumber fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@400 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-10 05:44:02 +00:00
Chris Allegretta
ef12311948 Update ChangeLog
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@399 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-10 00:04:13 +00:00
Chris Allegretta
f597777323 Remove the append check we just added :>
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@398 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-09 23:58:41 +00:00
Chris Allegretta
d62614cbc4 Let's just copy joe word for word and just change the name to nano!!!!
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@397 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-09 23:37:00 +00:00
Chris Allegretta
33084397dd More fun security crap
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@396 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-09 22:50:38 +00:00
Chris Allegretta
38552ee7a8 Back to CVS version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@395 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-09 03:35:49 +00:00
Chris Allegretta
b29550e58d Nano 0.9.23 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@393 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-09 03:34:12 +00:00
Chris Allegretta
8816760ea1 Updated NEWS for release tonight
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@392 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-09 00:07:06 +00:00
Chris Allegretta
da13f0b45c Oops, misplaced comment
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@391 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-06 05:59:31 +00:00
Chris Allegretta
1bd0ce2832 Okay, now the permissions should be fixed too
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@390 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-06 05:56:08 +00:00
Chris Allegretta
7b36c52efc Changed --disable-spell to --disable-speller
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@389 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-06 01:08:10 +00:00
Chris Allegretta
b5bb24c949 Commented the code that got us into this mess in the first place 9 releases ago
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@388 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-06 00:57:54 +00:00
Chris Allegretta
71e464034d Line up link/unlink/rename check if conditional with top if conditional
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@387 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-06 00:40:26 +00:00
Chris Allegretta
21e3c28af2 Oops, get rid of my debugging code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@386 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-05 12:04:16 +00:00
Chris Allegretta
fb62f73a9a Rocco fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@385 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-05 11:36:41 +00:00
Chris Allegretta
928a7f535c Added anyexists and realexists documentation
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@384 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-04 05:31:34 +00:00
Chris Allegretta
fb2226a9ae Okay, we'll use O_EXCL also
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@383 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-04 05:25:47 +00:00
Chris Allegretta
37f627f2f8 Oops, we didn't want the latter check because if this is a new file there wont be any previous inodes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@382 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-04 05:19:25 +00:00
Chris Allegretta
07f9ee059f Okay, forget O_EXCL, do lots of other obscure checks instead =)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@381 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-04 05:15:39 +00:00
Chris Allegretta
908805a2e8 Rocco's edit_add off by one fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@380 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-04 04:42:56 +00:00
Chris Allegretta
20c131cf67 Added tmp check to TMP_OPT section (how apropriate).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@379 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-04 04:20:09 +00:00
Chris Allegretta
5982849325 Added O_EXCL call to open is tmp == 1
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@378 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-04 03:31:39 +00:00
Chris Allegretta
4a938e137a Back to CVS version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@377 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 03:45:35 +00:00
Chris Allegretta
d2cd65c967 Nano 0.9.22 release sync
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@375 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 03:43:17 +00:00
Chris Allegretta
90941714d2 Updated html version of man page
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@374 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 03:23:16 +00:00
Jordi Mallach
cb7fa25d3d Updated for new nano.save behaviour
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@373 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 03:16:47 +00:00
Chris Allegretta
fedd724086 Updating ChangeLog for 0.9.22 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@372 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 03:15:38 +00:00
Jordi Mallach
d87b34121f Updated for final nano.save behaviour
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@371 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 03:15:19 +00:00
Jordi Mallach
b998483369 Added nano to the list
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@370 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 03:10:44 +00:00
Chris Allegretta
9756d62d93 Okay, NOW tell what the file is we didn't write if we didn't write it
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@369 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 03:06:45 +00:00
Chris Allegretta
581bc60d0c Okay last time, now if there's any file at all, dont save the .save file. (foolproof? :)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@368 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 03:01:12 +00:00
Jordi Mallach
d7ad75adb3 Documented nano.saves and other small changes to manpage.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@367 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-03 02:46:02 +00:00
Chris Allegretta
9ee2a0d0bc Updated NEWS for 0.9.22 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@366 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-02 21:50:57 +00:00
Chris Allegretta
ac139dd6a6 Updated NEWS for 0.9.22 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@365 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-02 21:31:17 +00:00
Chris Allegretta
f7ee9e6996 Okay, now abort if the symlink isn't owned by the user, and some mode fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@364 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-02 21:13:50 +00:00
Jordi Mallach
3ea0a8f1d6 .save changes.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@363 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-02 16:57:48 +00:00
Chris Allegretta
8c36f8876c Silly newline fix in die()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@362 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-02 05:33:00 +00:00
Chris Allegretta
3dbb2783d3 Okay, so if the .save file is a symlink, don't write to it, abort
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@361 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-02 04:36:50 +00:00
Chris Allegretta
331fc7a6f4 Okay, now write_file never trusts symlinks at all, no chance of spelling symlink attack :)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@360 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-02 03:06:37 +00:00
Chris Allegretta
c5174aaef3 Oops, manually turn off FOLLOW_SYMLINKS if it's on
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@359 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-02 02:38:54 +00:00
Chris Allegretta
e7a5893245 Changs to die() and handle_sighup() for security
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@358 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-02 02:36:22 +00:00
Chris Allegretta
9e2934fd27 Fix for do_next_word and screen updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@357 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-01 23:49:48 +00:00
Chris Allegretta
4eb7aa04f3 Okay, don't define nano_small_msg or nano_disabled_msg id not needed
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@356 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-01 18:57:11 +00:00
Chris Allegretta
ff269f8873 Added --disable-justify and --disable-spell options, code cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@355 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-12-01 18:46:01 +00:00
Chris Allegretta
09a8084943 DISABLE_TABCOMP checks - #ifdef around check_wildchar_match and don't call real_dir_from_tilde in do_insertfile() if set
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@354 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-30 02:31:13 +00:00
Chris Allegretta
56b24b5909 Took out help from spell_list and changed SPELL_LIST_LEN to 1
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@353 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-29 23:57:20 +00:00
Chris Allegretta
7262358381 Oops, I guess that's MY right alt key also =). And right control is ASCII 543
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@352 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-29 23:43:28 +00:00
Jordi Mallach
28fdf444e5 nano.pot survived the masacre.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@351 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-29 10:16:36 +00:00
Chris Allegretta
d00e6dfacd Rocco's changes to spell checking and my alterations
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@350 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-29 04:33:26 +00:00
Chris Allegretta
75155dff51 Ignore key sequence 545, Alt-Gr key on german keyboard
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@349 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 23:04:24 +00:00
Jordi Mallach
9200544269 .cvsignore for src/
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@348 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 17:13:41 +00:00
Jordi Mallach
acf2ac244d Ick, I left out libintl.h.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@347 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 17:04:51 +00:00
Jordi Mallach
556b3a0028 .cvsignore for intl/.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@346 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 17:01:26 +00:00
Jordi Mallach
24ccaf1e0f Kill kill kill
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@345 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 16:53:33 +00:00
Jordi Mallach
2ddb841940 Delete even more!
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@344 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 16:52:31 +00:00
Jordi Mallach
ce478115e4 Revoving gmo's.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@343 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 16:48:51 +00:00
Jordi Mallach
40a24b7372 Added files now.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@342 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 16:47:22 +00:00
Jordi Mallach
90b780b5d7 Silly me, I hope.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@341 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 16:38:29 +00:00
Jordi Mallach
19ed700690 Let's get rid of some stuff :)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@340 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 16:30:32 +00:00
Chris Allegretta
2773184d92 Handle ~~ in tab comp without segfaulting =)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@339 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 05:53:41 +00:00
Chris Allegretta
184e1a6a4e Update the TODO, YAY
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@338 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 04:09:39 +00:00
Chris Allegretta
8be8ce2086 Various ChangeLog cleanups and additions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@337 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 02:15:30 +00:00
Jordi Mallach
7e0e29d3bb Justify updates. Hopefully, this is the po in .22 :)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@336 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 01:56:12 +00:00
Chris Allegretta
8a646adec4 Updated faq about automatically running strip
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@335 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-28 00:15:54 +00:00
Chris Allegretta
984b5366cd Oops\! Must update the date on the man page when we change i
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@334 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-27 23:12:27 +00:00
Chris Allegretta
4a9c8589b2 Oops, do it in either case, whether we did unjustify or not
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@333 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-27 22:59:40 +00:00
Chris Allegretta
0779835ce4 Okay, now make the shortcut list reflect the unjustify availability
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@332 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-27 22:58:23 +00:00
Chris Allegretta
d022eace15 Fix for justift at top of file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@331 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-27 02:50:49 +00:00
Chris Allegretta
2ff25693f3 Oops, get rid of silly debugging code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@330 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-27 00:24:42 +00:00
Chris Allegretta
9149e610b3 Implemented Unjustify, HAHAHA
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@329 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-27 00:23:41 +00:00
Chris Allegretta
24946bd77a read_file() - - Added check for fileptr == NULL
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@328 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-26 21:34:47 +00:00
Chris Allegretta
35788ff48c I hereby retract bug #48, as Pico does the exact same thing, oops
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@327 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-26 04:39:49 +00:00
Chris Allegretta
9956e530d0 Make nano at least not crash on weird binary data
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@326 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-26 02:09:53 +00:00
Chris Allegretta
7ffc01f00c Added bug #48
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@325 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-25 20:52:28 +00:00
Chris Allegretta
e106a87841 Added Christian Weisgerber too...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@324 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-25 20:17:43 +00:00
Chris Allegretta
7cd9f74b51 Added Christian Weisgerber too...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@323 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-25 20:17:28 +00:00
Chris Allegretta
150c50d512 Oops, forgot Bill Soudan
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@322 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-25 20:00:02 +00:00
Chris Allegretta
a131c7c029 Oops, forgot Bill Soudan
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@321 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-25 19:59:41 +00:00
Chris Allegretta
8b4ca4a30b Make credits less jumpy
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@320 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-25 18:21:37 +00:00
Chris Allegretta
25f4e58ff4 do_insertfile(): - Added call to real_name_from tilde, oops.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@319 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-25 05:03:20 +00:00
Jordi Mallach
d819a4cf06 Destroyed any chance of getting a surprise with viewing credits. Because I translated them, of course.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@318 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-25 04:50:25 +00:00
Chris Allegretta
04fec91362 Oops, how about we actually make username completion work if they didn't complete before
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@317 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-25 04:43:43 +00:00
Chris Allegretta
8a0de3bb3f New arg --enable-extra, checks for ./configure options, oher stuff :-)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@316 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-24 20:45:14 +00:00
Chris Allegretta
650e8a406b Rocco's unset modified on tmp file write fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@315 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-24 14:15:17 +00:00
Chris Allegretta
0f5dfef8b0 Oops, better free realname in write_file if we're done using it
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@314 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-24 14:02:57 +00:00
Chris Allegretta
be77c6119f Implemented username tab completion, cleaned up existing tabcomp code, added --disable-tabcomp option
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@313 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-24 14:00:16 +00:00
Chris Allegretta
1866609311 Back to CVS version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@312 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-11-24 01:37:14 +00:00
47 changed files with 14215 additions and 2802 deletions

10
.cvsignore Normal file
View File

@@ -0,0 +1,10 @@
Makefile
Makefile.in
confdefs.h
config.cache
config.h
config.log
config.status
configure
nano
stamp-h

30
BUGS
View File

@@ -1,3 +1,6 @@
- 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) [FIXED/IRRELEVANT]
- 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
@@ -49,6 +52,7 @@
[FIXED]
- Using nano -t, user can not exit until a filename is given via ^O. (30)
[FIXED]
- totsize problems still abound in do_justify (33) [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]
@@ -76,12 +80,28 @@
- 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]
- If nano fails to open a file when it starts up,doing almost anything
causes a segfault (discovered by Ben Roberts) (48). [FIXED]
- In certain terminals, nano would not work properly with keypad().
Turned out to be the silly timeout(0) call which is completely
unneeded anyway. (49) [FIXED]
- With less than a page of text, doing a page down will move the
current line to the top of the screen, which it shouldn't do. (50)
[FIXED]
- with PDCURSES, running meta-X turns off the keypad. (51) [FIXED]
- Resizing the window completely screws up the display if in any other
mode than normal editing (help screen, search and replace, file
browser..) (52) [FIXED]
- Alt speller argument (-s, --speller) does not take a string argument of
more than one word. (53) [FIXED].
- Cut to end cutting (-k) causes segfaults (try cutting "- Backup making
(filename~)?" line in TODO file) (discovered by
higuita@cadernoverde.com) (54) [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$
- When using autoindent (-i), wrapped text does not get auto-indented
(55, discovered by Mark Senior).

367
ChangeLog
View File

@@ -1,3 +1,370 @@
nano-0.9.99pre3 - 02/19/2001
- General
GNU compliance issues:
- Reworked shortcut list, put "Get Help" into default list,
removed "Goto Line", aligned "Read File" with "Write Out" and
"Replace" with "Where is" for consistency.
- Added texinfo manual nano.texi. Added texi options to
Makefile.am.
- configure.in:
- Autoconf compatibility fixes (Pavel Roskin)
- Added separate check for resizeterm().
- ALL_LINGUAS: added hu and ca.
- cut.c:
do_cut_text()
- marked text cut fixes (Rocco) (Fixes bug #54).
- nano.c:
do_delete()
- Added check for current->next == fileptr, as we have a magic
line code again, fixes sillyness at the end of the last line
before the magic line (reported by J.A. Neitzel).
do_justify()
- If the keystroke after the justify is not the unjustify key,
blank the statsubar (bug reported by Neil Parks).
main()
- Added ENABLE_NLS check around gettext stuff.
- winio.c:
do_yesno()
- Added localized yes, no and all strings to function and rewrote
handler for the new format.
- de.po:
- Translation updates by Florian König.
- fi.po:
- Translation updates by Pauli Virtanen.
- hu.po:
- Hungarian translation by Horvath Szabolcs.
- id.po:
- Translation updates by Tedi Heriyanto.
- es.po:
- Translation updates and grammatical/typo fixes (Jordi).
- ca.po:
- Catalan translation by Jordi Mallach :)
- Miquel Vidal <miquel@sindominio.net> went over it and corrected
many typos and completed bits that remained untranslated by error.
nano-0.9.99pre2 - 01/31/2001
General
- Removed center_x and center_y globals. center_y was
completely unused and center_x was only used a few places,
easily replaced with COLS / 2 (oops, not current_x & y (Rob)).
- Deleted free_node, duplicate of delete_node, and changed all
free_node calls to delete_node.
- Fix for resizing the window in modes other than normal edit mode
Changes to handle_sigwinch(), main(). Fixes bug #52 (Rocco).
- files.c:
write_file()
- Don't free() realname on error, if it needs to be free()d later
it will be (fixes crash on successful write after failed write,
discovered by David Sobon).
username_tab_completion()
- Optimization and removal of useless vars (Rocco).
- Rewritten using getpwent (suggested by Rocco).
- Removed redundant conditional (Rocco).
real_dir_from_tilde()
- Rewritten using getpwent (suggested by Adam, much optimized by Rocco).
- global.c:
- Don't define toggles global or toggle_init_one if using --tiny.
- nano.c:
do_justify()
- Added restoration of totsize after unjustify command.
usage()
- Add arg to -T help (Rocco).
global_init(), handle_sigwinch()
- Messy loops replaced with memset calls (Rocco).
do_alt_speller()
- Added code to parse multi-word alt_speller strings.
- Fix initialization before fork() (Rocco).
- proto.h:
- Fix do_credits() proto (oops!)
- winio.c:
nanogetstr()
- Sanity check for x overrunning the string buffer len.
nano 0.9.99pre1 - 01/17/2001
General
- Changed #ifdefs to check for both DISABLE_TABCOMP and
NANO_SMALL, makes tiny option leave out tab completion, which
should be left out in that circumstance. Saves at least 5k.
- Previous change to #ifdefs DISABLE_TABCOMP and NANO_SMALL rolled
back. (Rocco)
- Various #ifdef & #ifndef cleanups. (Rocco)
- Added message for when keypad goes awry. Added code in main and
function print_numlock_warning() to notify user, and added an
apropriate section in the faq to refer to this brokenness.
- Added macros in nano.h for magic values that might be unclear in
nano.c:global_init(). (Rocco)
- configure.in:
- Fix for _use_keypad check breaking slang support (Christian
Weisgerber).
- Changed to automatically define the 5 DISABLE varibles when
NANO_SMALL (enable-tiny) is requested at configure.
- faq.html:
- Added some info on making the binary smaller with the configure
script.
- Added section on keypad bugginess.
- files.c:
real_dir_from_tilde()
- Oops, fix case where buf ="~", silly crash (bug discovered by
Neil Parks).
do_browser()
- Added space and - keys to do page up and down.
cwd_tab_completion(), input_tab()
- Changed bare malloc/calloc calls to nmalloc (found by Rocco).
- Added memset() to matchBuf to ensure sanity (Rocco, Adam).
- nano.c:
ABCD()
- New function, figures out what kbinput to return given
input common to several switch statements, allows us to
support the default Konsole key settings.
main()
- Alternate speller option no longer valid if DISABLE_SPELLER is
active. (Rocco)
- Removed direct calls to usage() (#else) for -k (cut) or -s (speller)
options when these have been disabled. (Rocco)
- Initialized kbinput to get around stupid compiler warning.
nano_small_msg()
- This function has been removed. All references now call
nano_disabled_msg. (Rocco)
version()
- When NANO_SMALL (enable-tiny) is defined, the 5 main DISABLE
variables (SPELLER, HELP, JUSTIFY, BROWSER, TABCOMP) are not
reported as enabled when Nano is called with -V (--version)
command-line option. (Rocco)
usage()
- Alternate speller option no longer valid if DISABLE_SPELLER is
active. (Rocco)
window_init(), handle_sigwinch()
- Added check for not having enough LINES to do anything useful,
if so die with an error. (Rocco)
die_too_small()
- Function to print the window too small error message, avoids
repeated string defs and globals.
do_justify()
- Small fix for totsize calculation (Rob)
- fi.po:
- Update by Pauli Virtanen.
nano 0.9.25 - 01/07/2001
General -
- New file browser code. New functions in files.c:do_browser(),
helper functions browser_init(), tail(), striponedir(),
filestat(). New shortcut list browser_list. Some new
strings to translate. Added function do_browse_from().
- Keypad code has been changed slightly. Now checks for
_use_keypad flag in window to see whether or not to turn
the keypad() back off when finished (taken from aumix). Moved
to winio.c where it should probably be anyway. New confgure
check for _use_keypad in window sstruct. This will have to do
for now.
- Moved keypad() calls for PDCURSES from main() to window_init()
so the keypad continues to work after a Meta-X, for example.
Fixed bug #51.
- faq.html:
- Fix typos and small mistakes (Jordi).
- files.c:
username_tab_completion()
- Added the (char *) sizeof when allocating memory for the filename
array (Rocco).
cwd_tab_completion()
- removed skipping . and .. when tabulating matches.
- Added the (char *) sizeof when allocating memory for the filename
array (Rocco).
do_writeout()
- Now takes an argument so the string typed in can be retained
when calling the browser.
do_browser()
- Don't decrement longest by the length of path. Fixes crashes
on entering various dirs (Rocco).
- Don't ungetch() the exit key, unneeded, fixes inerting a file
causes exit code.
- move.c:
page_down()
- Don't do an edit_update when there is only one page of text
(fileage == edittop && filebot == editbot). Fixes Bug #50.
- nano.c:
main()
- Reorder the getopt options to be more or less alphabetical
(suggested by Sven Guckes).
- winio.c:
do_cursorpos()
- Optimizations and cleanups by Rocco Corsi.
do_credits()
- Spell Erik Andersen's name right.
titlebar()
- Now takes an arg, needed for browser function.
do_help()
- Changed way of temporarily bringing up shortcuts at the
bottom in the help screen (actually works).
- utils.c:
mallocstrcpy()
- Takes char pointers now instead of void (makes debugging a
helluva lot easier)
- Duh, don't do anything if src == dest!
- es.po:
- Updates for file browser (Jordi).
nano 0.9.24 - 12/18/2000
General
- Added --disable-help option, affects acconfig.h, configure(.in),
winio.c:do_help, nano.c:help_init,help_text_init,version.
- Changed filename to no longer use PATH_MAX, so it can work on the
HURD. Changes in files.c:write_file(), new function
nano.c:clear_filename(), many changed in main(), a few other
places. Please test this!
- Added -b, -e, and -f flags, which we ignore as nano provides
their functionality already.
- cut.c:
do_uncut_text()
- Fix renumbering bug when uncutting marked text at filebot.
- Fix screen not being displayed when we are uncutting marked
text at editbot (Bug discovered by Ken Tyler).
- Fix magic line not getting created when (you guessed it)
uncutting marked text at filebot (Ryan Krebs).
- files.c:
read_file()
- If we encounter an error and insert is not set, run new_file().
(bug discovered by Ben Roberts).
write_file()
- Change open call flags, basically copy joe's way of doing it so
a more recent version will actually be included in (un)stable.
- Remove useless fstat call.
open_file()
- Added check for S_ISBLK and S_ISCHR, don't open device files!
- nano.c:
renumber()
- Dont stupidly assign the value of prev->lineno if prev == NULL!
main()
- Added code to check for Alt-Alt (27-27) keystrokes and set the
next keystroke as a control sequence. New variable
modify_control_key. Removed #ifdef _POSIX_VDISABLE check
around Control-S,Q,Z handlers because we need it now for
the Alt-Alt-x code.
- Added --view option to getopt_long()call . Bug discovered
by Rocco Corsi.
help_init()
- Fix off by one error that was making ^G help in normal mode and
^_ in pico mode not be displayed in the help (bug discovered by
Rocco Corsi).
do_toggle()
- Added fix_editbot() call to fix improper redisplay of edit
window when using nohelp toggle (bug discovered by Rocco Corsi).
- nano.1, nano.1.html:
- Updated man page for -b, -e, -f and expanded explanation for -p.
- winio.c
do_help()
- Force keypad on so F-keys and PageUp/Down will work properly.
Added check for NANO_EXIT_FKEY to loop.
- utils.c:
new_magicline()
- Increment totsize!! We decrement it when we've read a file,
everywhere else it should automatically be incremented
nano 0.9.23 - 12/08/2000
General
- Changed --disable-spell to --disable speller. The term is
"speller" for -s, so it should be --disable-speller.
- files.c:
write_file()
- Added tmp check to TMP_OPT section (how apropriate).
- Added new consistency checking code from securityfocus
article by Oliver Friedrichs, and use O_EXCL if tmp == 1.
- We now run check on result of lstat(), not stat(), to be
safer. New variable anyexists, we use still use realexists
later in the program.
- OOPS, line up link/unlink/rename check if conditional with
top if conditional. Option -l has been broken for 9 versions,
no one noticed?!
- Added saving perms at end of link so we can apply them to the
new file if --nofollow is used.
- winio.c:
edit_add()
- Off by one display error (fix by Rocco Corsi).
do_replace_highlight()
- New code to handle being past COLS (Roco Corsi).
- Moved from search.c, as it's definitely a winio function now =)
update_line()
- More '$' display fixes (Rocco Corsi).
nano 0.9.22 - 12/02/2000
- General
- Username tab completion code, and cleaned up existing tabcomp
code. New functions real_dir_from_tide(), append_slash_if_dir(),
username_tab_completion is more than a stub now =-).
- Ignore key sequence 543 & 545, right control and alt keys in
windows. Affects main() and winio.c:nanogetstr().
- Took out help from spell_list and changed SPELL_LIST_LEN to 1.
Is using a spell checker THAT difficult? =-)
- New function nano_disabled_msg(), to alert that certain
functions have been disabled, similaer to nano_tiny feature.
- New configure options:
- Added configure argument --disable-tabcomp. Affects
bottom of files.c and write_file, utils.c:check_wildcard_match()
and winio.c:nanogettsr().
- New options --enable-extra. New code in nano.c:version() to
print out various options from ./configure, function do_credits().
- Added --disable-spell option for those who want to just disable
the spell check feature. Affects the spellinf fucntions
do_spell, do_int_speller and do_alt_speller.
- Added --disable-justify to get rid of the justify function.
Affects do_justify() (not surprisingly).
- files.c:
write_file()
- Unsetting modified on temp files bug fixed (Rocco Corsi).
- Okay, if tmp == 1 and the file exists, we abort.
do_insertfile()
- Added call to real_name_from tilde, oops. Added check for
DISABLE_TABCOMP.
read_file()
- Added check for fileptr == NULL.
- global.c:
shortcut_init()
- Now takes an argument as to whether to display the unjustify
shortcut or the normal uncut text one. Needed to accomodate
the klugey unjustify code.
- nano.1, nano.1.html:
- Updated date on pages because of -p changes.
- Added "NOTES" section, where I explain what nano.save & friends
are.
- Added a copyright notice for the manpage, under the GPL.
- Other minor changes.
- nano.c:
do_justify()
- Wrote unjustify code. Borrows cutbuffer and stores the unjustified
text there, then grabs the next keystroke and, if the unjustify
key, gets rid of the justified text and calls do_uncut_text.
Added macro NANO_UNJUSTIFY_KEY.
do_int_spell*
- Various fixes (Rocco Corsi).
- Changed abort of program to aborting based on value of "edit a
replacement" question, and not caring about the replace loop
return value. That way the user can get out of the replace loop
and continue spell checking (very important to me anyway).
version()
- Took out huge check for the various --disabled macros,
eventually there will be too many to reasonably check for.
nano_small_msg(), nano_disabled_msg()
- Added checks for disabled functions to see whether or not to
declare them.
do_next_word()
- Update the previous line as well as the current one in case we
have moved beyond COLS or back from COLS, patch submitted
by Ryan Krebs.
die()
- Now creates .save file using variable-length strings. Also
calls write_file with tmp == 1, which happens to do exactly what
we want (abort on save file exists and use mode 0600).
handle_sighup()
- Now calls die instead of writing on its own and exiting normally.
- search.c:
do_replace_hilight()
- New function, displays the currently selected word as hilighted
in the spell check. Called from do_replace_loop (Rocco Corsi).
- Added calls to curs_set(0) and (1) to diable the cursor when
hilighting, looks much better.
- es.po:
- Traditional Spanish strings updates.
nano 0.9.21 - 11/23/2000
- AUTHORS
- Added Rocco Corsi.

View File

@@ -14,6 +14,9 @@ nano_SOURCES = cut.c \
man_MANS = nano.1
nano_LDADD = @INTLLIBS@
info_TEXINFOS = nano.texi
MAKEINFO = makeinfo --no-split
EXTRA_DIST = AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README \
TODO install-sh missing mkinstalldirs nano.1 nano.1.html \
faq.html

View File

@@ -75,7 +75,6 @@ INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
@@ -94,6 +93,9 @@ nano_SOURCES = cut.c files.c global.c move.c nano.c nano.h proto.h
man_MANS = nano.1
nano_LDADD = @INTLLIBS@
info_TEXINFOS = nano.texi
MAKEINFO = makeinfo --no-split
EXTRA_DIST = AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README TODO install-sh missing mkinstalldirs nano.1 nano.1.html faq.html
@@ -120,13 +122,18 @@ CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
TEXI2DVI = texi2dvi
INFO_DEPS = nano.info
DVIS = nano.dvi
TEXINFOS = nano.texi
man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \
INSTALL Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 \
config.h.in configure configure.in install-sh missing mkinstalldirs
config.h.in configure configure.in install-sh missing mkinstalldirs \
texinfo.tex
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -138,7 +145,7 @@ OBJECTS = $(nano_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
@@ -230,6 +237,122 @@ nano: $(nano_OBJECTS) $(nano_DEPENDENCIES)
@rm -f nano
$(LINK) $(nano_LDFLAGS) $(nano_OBJECTS) $(nano_LDADD) $(LIBS)
nano.info: nano.texi
nano.dvi: nano.texi
DVIPS = dvips
.texi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texi.dvi:
TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.dvi:
TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.txi.dvi:
TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.dvi.ps:
$(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(infodir)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
d=$(srcdir); \
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
uninstall-info:
$(PRE_UNINSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
ii=yes; \
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
test -z "$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
list='$(INFO_DEPS)'; \
for file in $$list; do \
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done
dist-info: $(INFO_DEPS)
list='$(INFO_DEPS)'; \
for base in $$list; do \
d=$(srcdir); \
for file in `cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done; \
done
mostlyclean-aminfo:
-rm -f nano.aux nano.cp nano.cps nano.dvi nano.fn nano.fns nano.ky \
nano.kys nano.ps nano.log nano.pg nano.toc nano.tp nano.tps \
nano.vr nano.vrs nano.op nano.tr nano.cv nano.cn
clean-aminfo:
distclean-aminfo:
maintainer-clean-aminfo:
cd $(srcdir) && for i in $(INFO_DEPS); do \
rm -f $$i; \
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
rm -f $$i-[0-9]*; \
fi; \
done
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@list='$(man1_MANS)'; \
@@ -416,9 +539,10 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
info-am:
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
info-am: $(INFO_DEPS)
info: info-recursive
dvi-am:
dvi-am: $(DVIS)
dvi: dvi-recursive
check-am: all-am
check: check-recursive
@@ -430,21 +554,22 @@ all-recursive-am: config.h
install-exec-am: install-binPROGRAMS
install-exec: install-exec-recursive
install-data-am: install-man
install-data-am: install-info-am install-man
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-am: uninstall-binPROGRAMS uninstall-info uninstall-man
uninstall: uninstall-recursive
all-am: Makefile $(PROGRAMS) $(MANS) config.h
all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h
all-redirect: all-recursive-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) \
$(DESTDIR)$(mandir)/man1
mostlyclean-generic:
@@ -457,25 +582,27 @@ distclean-generic:
maintainer-clean-generic:
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
mostlyclean-compile mostlyclean-tags \
mostlyclean-compile mostlyclean-aminfo mostlyclean-tags \
mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \
clean-generic mostlyclean-am
clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo \
clean-tags clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \
distclean-tags distclean-generic clean-am
distclean-aminfo distclean-tags distclean-generic \
clean-am
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-generic distclean-am
maintainer-clean-compile maintainer-clean-aminfo \
maintainer-clean-tags maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -486,7 +613,9 @@ maintainer-clean: maintainer-clean-recursive
mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile install-man1 uninstall-man1 install-man \
maintainer-clean-compile install-info-am uninstall-info \
mostlyclean-aminfo distclean-aminfo clean-aminfo \
maintainer-clean-aminfo install-man1 uninstall-man1 install-man \
uninstall-man install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \

79
NEWS
View File

@@ -1,3 +1,82 @@
02/19/2001 - Nano 0.9.99pre3 brings a lot of changes! The most important
being that nano is now officially a GNU program. Some
changes have been made for GNU compatibility (like the
default list of shortcuts, "^G Get Help" is now Listed and
"^_ Goto Line" is not). The Yes/No/All keys have
finally been internationalized also. All in all, quite
a few changes considering nano is supposed to be in a code
freeze. But there are the usual helping of bugfixes, a
nasty bug when cutting text in -k mode and some
compatibility with older ncurses libraries have also been
fixed. All in all, a lot to see.
01/31/2001 - Nano 0.9.99pre2 is released. Not surprisingly, all that is
new is bugfixes, bugfixes, bugfixes. There were a few
cleanups in unneeded global variables and duplicate
functions, but most is just fixing. Specifically, there
is now a preliminary (read: needs testing) fix for
resizing the editor in any mode other than normal edit
mode. Other fixes include some more tab completion
segfaults, and an silly segfault that occurred when
successfully writing a file on the 2nd try (i.e. after an
initial write error). Slowly but surely, on toward 1.0 we
travel.
01/17/2001 - Nano 0.9.99pre1 is released. This is the first pre-1.0
release of nano, and is also the first release since the
code freeze for nano 1.0. Don't expect (or request) any
new features between now and nano 1.0, only bugfixes,
optimizations and doc/translation updates. For fixes, a
nasty segfault when trying to insert one's home directory
(~), some checks for the NumLock key making the keypad
go awry, window size sanity checks, many autoconf fixes,
and support for the KDE konsole keypad layout. Have fun.
01/07/2001 - Nano 0.9.25 is the "Just one more feature I swear!" release.
It includes one new feature that Pico has had forever, a
built-in file browser. Since not everyone may want this
option, there is a --disable-browser option to the
configure script as well. Other changes include slightly
different keypad handling, and a bugfix for crashes when
tab completion in certain instances. Have fun and Happy
New Year!
12/18/2000 - Nano 0.9.24 is released. This versions contains the last of
the security fixes for writing files, as well as for a
nasty segfault when nano is unable to open a file for
reading, among other fixes. Nano also now cowardly
refuses to open device files, to stop silly things like
trying to open /dev/zero. New features include being
Able to use Meta-Meta-<key> as Control-<key>, better
HURD support, and some new flags have been added for Pico
compatibility. Upgrading to this version is highly
recommended.
12/08/2000 - Nano 0.9.23 is the "race conditions bite" release. The
main reason for this release is the less-than-optimal
fix for the security issue in nano with following symbolic
links. Hopefully this will fix the probelm permanently.
The --nofollow option also works again for those who
are real security nuts. There are also some display and
search fixes, and the --disable-spell function was renamed
to --disable-speller to be in line with nano and pico's
"speller" term.
12/02/2000 - Nano 0.9.22 is released, with many more changes and
additions than imaginable. The most important change is
a fix for unsafe handling of symbolic links which could
lead to symlink attacks if nano were to exit because
of an error or signal. Also there are better checks when
saving files.
As for new features, username tab completion is
now working well, the internal spell checker code has been
tweaked, you can now unjustify if you don't like how the
justify formatted your text, and there are more
options for configure, including --disable-spell and
--disable-justify and --enable-extra (for those who like
surprises). All in all, a whole lot of changes in
a little over a week.
11/23/2000 - Happy Thanksgiving! Nano 0.9.21 is our "last version was
a big turkey" release. It fixes several bugs introduced
by the previous version, as well as a few long-

57
README
View File

@@ -1,29 +1,24 @@
The nano editor (Nano's ANOther editor) by Chris Allegretta
GNU nano - an enhanced clone of the Pico text editor.
Manifesto
Overview
The nano project was started because of a few "problems" with the
wonderfully easy-to-use and friendly Pico text editor.
First and foremost is its license: the Pine suite does not use the
GPL or a GPL-friendly license, and has unclear restrictions on
redistribution. Because of this, Pine and Pico are not included with
many GNU/Linux distributions. Also, other features (like goto line
number or search and replace) were unavailable until recently or
require a command-line flag. Yuck.
Nano is the editor formerly known as TIP (TIP Isn't Pico).
The nano project was started because of three main problems with the
wonderfully easy-to-use and friendly Pico text editor:
- It's license is not the GNU GPL, and hence some Linux
distributions, including Debian (my favorite) don't always
include it/don't include binaries. This is not necessarily a
problem, but an issue nonetheless.
- Until recently, it had no ability to go to a line # from within
the editor. There was the +number command line option, but who wants
to exit a file to go to a specific line number? When I want to go to
a line, since I have to exit anyway, I just call up vi temporarily.
- No search and replace feature. Well, apparently there is a flag
that lets you do a search and replace (-b in newer versions) but,
well, I still dont like it.
nano aims to solve these problems by emulating the functionality of
Pico as closely as possible while adressing the problems above and
perhaps providing other extra functionality.
The nano editor is now an official GNU package. For more information
on GNU and the Free Software Foundation please see http://www.gnu.org.
How to compile and install nano
@@ -34,8 +29,8 @@ How to compile and install nano
make
make install
It's that simple. Use --prefix to override the default installation
directory of /usr/local.
It's that simple. Use --prefix with configutr to override the
default installation directory of /usr/local.
Web Page
@@ -58,16 +53,11 @@ Mailing List and Bug Reports
Current Status
nano is currently at version 0.9.x, and it will probably remain there
for awhile. This reflects the adage that the last 10% of a project
takes 90% of the time. Version 1.0 will be released when there are
no unresolved bugs, and not before. I am also currently looking for
patches for all things listed in the TODO file. If you have a
comment or suggestion, please let me know, all help is appreciated.
Warning: This program can and possibly will corrupt your data in
its current form! It is beta software, so treat it as such!
Thank you.
nano is currently at the 1.0 prerelease level. This mean it has all
features that the 1.0 version will have and only bug fixes and updates
will be added before the official 1.0 is released. There are still a
few lingering bugs, but for the most part your data should be safe.
Backups are still your friend though.
Note that the primary aim of nano is to emulate Pico while adding a
few key "missing" features. I do NOT want just a GPL'ed Pico clone,
@@ -76,8 +66,7 @@ Current Status
fork my code at any time, but please call your editor something
else, believe it or not I struggled awhile before coming up with
the name nano (and before that TIP), and it would be much easier for
everyone if there weren't five versions of the same program. As you
can guess, I'm not much of an emacs fan ;)
everyone if there weren't five versions of the same program.
Chris Allegretta (chrisa@asty.org)

9
TODO
View File

@@ -15,15 +15,14 @@ Current Version:
- Better statusbar interaction (scrolling, tab completion for filename)
[needed for version 1.0] [DONE]
- Now do username completion [DONE].
Needed for version 1.0:
- Unjustify command (^U after ^J)
- Username completion (~user).
- Unjustify command (^U after ^J) [DONE =-].
- Username completion (~user) [DONE =-].
For Next Version:
- Undo/Redo key?
- single line scroll up/down?
- Single line scroll up/down?
- Color syntax highlighting? (certainly seems like there's a demand for it.)
- .nanorc ?????
- Backup making (filename~)?
$Id$

View File

@@ -3,6 +3,12 @@
/* Define this if you have the wresize function in your ncurses-type library */
#undef HAVE_WRESIZE
/* Define this if you have the resizeterm function in your ncurses-type library */
#undef HAVE_RESIZETERM
/* Define this if your curses lib has the _use_keypad flag */
#undef HAVE_USEKEYPAD
/* Define this if you have NLS */
#undef ENABLE_NLS
@@ -24,3 +30,20 @@
/* Define to use the slang wrappers for curses instead of native curses */
#undef USE_SLANG
/* Define this to enable the extra stuff */
#undef NANO_EXTRA
/* Define to disable the tab completion code Chris worked so hard on! */
#undef DISABLE_TABCOMP
/* Define this to disable the justify routine */
#undef DISABLE_JUSTIFY
/* Define this to disable the use(full|less) spelling functions */
#undef DISABLE_SPELLER
/* Define this to disable the ^G help menu */
#undef DISABLE_HELP
/* Define this to disable the built-in (crappy) file browser */
#undef DISABLE_BROWSER

View File

@@ -55,6 +55,12 @@
/* Define this if you have the wresize function in your ncurses-type library */
#undef HAVE_WRESIZE
/* Define this if you have the resizeterm function in your ncurses-type library */
#undef HAVE_RESIZETERM
/* Define this if your curses lib has the _use_keypad flag */
#undef HAVE_USEKEYPAD
/* Define this if you have NLS */
#undef ENABLE_NLS
@@ -76,6 +82,24 @@
/* Define to use the slang wrappers for curses instead of native curses */
#undef USE_SLANG
/* Define this to enable the extra stuff */
#undef NANO_EXTRA
/* Define to disable the tab completion code Chris worked so hard on! */
#undef DISABLE_TABCOMP
/* Define this to disable the justify routine */
#undef DISABLE_JUSTIFY
/* Define this to disable the use(full|less) spelling functions */
#undef DISABLE_SPELLER
/* Define this to disable the ^G help menu */
#undef DISABLE_HELP
/* Define this to disable the built-in (crappy) file browser */
#undef DISABLE_BROWSER
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT

552
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
# $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(nano.c)
AM_INIT_AUTOMAKE(nano, 0.9.21)
AM_INIT_AUTOMAKE(nano, 0.9.99pre3)
AM_CONFIG_HEADER(config.h:config.h.in)
ALL_LINGUAS="es de fr it id fi"
ALL_LINGUAS="es de fr it id fi hu ca"
dnl Checks for programs.
AC_PROG_CC
@@ -19,9 +19,50 @@ AC_ARG_ENABLE(tiny,
(currently disables detailed help and i18n)],
[if test x$enableval = xyes; then
AC_DEFINE(NANO_SMALL) tiny_support=yes
AC_DEFINE(DISABLE_TABCOMP)
AC_DEFINE(DISABLE_SPELLER)
AC_DEFINE(DISABLE_HELP)
AC_DEFINE(DISABLE_JUSTIFY)
AC_DEFINE(DISABLE_BROWSER)
fi])
AC_MSG_CHECKING(whether to use slang)
AC_ARG_ENABLE(extra,
[ --enable-extra Enable extra (optional) functions, including easter eggs],
[if test x$enableval = xyes; then
AC_DEFINE(NANO_EXTRA) extra_support=yes
fi])
AC_ARG_ENABLE(tabcomp,
[ --disable-tabcomp Disables tab completion code for a smaller binary],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_TABCOMP)
fi])
AC_ARG_ENABLE(justify,
[ --disable-justify Disable justify/unjustify function],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_JUSTIFY)
fi])
AC_ARG_ENABLE(speller,
[ --disable-speller Disables spell checker function],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_SPELLER)
fi])
AC_ARG_ENABLE(help,
[ --disable-help Disables help function (^G)],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_HELP)
fi])
AC_ARG_ENABLE(browser,
[ --disable-browser Disables mini file browser],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_BROWSER)
fi])
AC_MSG_CHECKING([whether to use slang])
CURSES_LIB_NAME=""
AC_ARG_WITH(slang,
[ --with-slang[=DIR] Use the slang library instead of curses],
@@ -39,7 +80,7 @@ AC_ARG_WITH(slang,
fi
AC_CHECK_HEADER(slcurses.h,
AC_MSG_CHECKING(for SLtt_initialize in -lslang)
AC_MSG_CHECKING([for SLtt_initialize in -lslang])
_libs=$LIBS
LIBS="$LIBS -lslang"
AC_TRY_RUN([
@@ -58,11 +99,11 @@ int main () { SLtt_initialize (NULL); return 0; }],
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"])
AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
test -n "$tcap" && break
done
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap)
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap])
LIBS="$LIBS $tcap"
AC_TRY_RUN([
#include <stdio.h>
@@ -79,7 +120,7 @@ int main () { SLtt_initialize (NULL); return 0; }],
CURSES_LIB_NAME=slang], [
AC_MSG_RESULT(no)
# We might need the math library
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap -lm)
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
LIBS="$LIBS -lm"
AC_TRY_RUN([
#include <stdio.h>
@@ -111,17 +152,17 @@ AC_MSG_WARN([*** Can not use slang when cross-compiling])),
LDFLAGS=${_ldflags}
fi
;;
esac], AC_MSG_RESULT(no))
esac], [AC_MSG_RESULT(no)])
dnl Checks for functions
AC_CHECK_FUNCS(snprintf vsnprintf)
if test "x$ac_cv_func_snprintf" = "xno" -o "xac_cv_func_vsnprintf" = "xno"
then
AM_PATH_GLIB(1.2.4,,
AC_MSG_ERROR([
[AC_MSG_ERROR([
*** snprintf() and/or vsnprintf() not found. GLIB not found either.
*** You need both snprintf() and vsnprintf(). Alternatively you can
*** install the GLIB library which can be found at ftp://ftp.gtk.org/.]),
*** install the GLIB library which can be found at ftp://ftp.gtk.org/.])],
glib)
glib_cflags=`$GLIB_CONFIG --cflags glib`
glib_libs=`$GLIB_CONFIG --libs glib`
@@ -140,23 +181,23 @@ 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)
AC_CHECK_LIB(ncurses, tgetent, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses])
fi
if eval "test x$CURSES_LIB_NAME = x"
then
AC_CHECK_LIB(curses, tgetent, CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses)
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)
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)
AC_CHECK_LIB(termcap, tgetent, [CURSES_LIB="-ltermcap" CURSES_LIB_NAME=termcap])
fi
if eval "test x$CURSES_LIB_NAME = x"
@@ -166,11 +207,28 @@ then
*** distribution from ftp://ftp.gnu.org/pub/gnu/ncurses if you get
*** errors compiling nano.])
else
AC_MSG_RESULT("Using $CURSES_LIB_NAME as the termcap library")
AC_MSG_RESULT([Using $CURSES_LIB_NAME as the termcap library])
fi
AC_CHECK_LIB($CURSES_LIB_NAME, wresize, AC_DEFINE(HAVE_WRESIZE))
if test x$slang_support != xyes; then
AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, [AC_DEFINE(HAVE_WRESIZE)])
AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [AC_DEFINE(HAVE_RESIZETERM)])
# Taken from aumix (can't tell form the variable name?)
AC_CACHE_CHECK([for private member _use_keypad in WINDOW],
aumix_cv_struct_window_usekeypad,
[AC_TRY_COMPILE([#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else
#include <curses.h>
#endif], [WINDOW w; w._use_keypad;],
aumix_cv_struct_window_usekeypad=yes, aumix_cv_struct_window_usekeypad=no)])
if test $aumix_cv_struct_window_usekeypad = yes; then
AC_DEFINE(HAVE_USEKEYPAD)
fi
fi
dnl Parse any configure options

23
cut.c
View File

@@ -174,24 +174,23 @@ int do_cut_text(void)
if (ISSET(MARK_ISSET)) {
if (current->lineno == mark_beginbuf->lineno) {
tmp = copy_node(current);
newsize = abs(strlen(&current->data[mark_beginx]) -
strlen(&current->data[current_x]));
newsize = abs(mark_beginx - current_x) + 1;
tmpstr = nmalloc(newsize);
tmpstr = nmalloc(newsize + 1);
if (current_x < mark_beginx) {
strncpy(tmpstr, &current->data[current_x], newsize);
memmove(&current->data[current_x],
&current->data[mark_beginx],
strlen(&current->data[mark_beginx] - newsize));
strlen(&current->data[mark_beginx]) + 1);
} else {
strncpy(tmpstr, &current->data[mark_beginx], newsize);
memmove(&current->data[mark_beginx],
&current->data[current_x],
strlen(&current->data[current_x] - newsize));
strlen(&current->data[current_x]) + 1);
current_x = mark_beginx;
update_cursor();
}
tmpstr[newsize] = 0;
tmpstr[newsize - 1] = 0;
tmp->data = tmpstr;
add_to_cutbuffer(tmp);
dump_buffer(cutbuffer);
@@ -274,6 +273,7 @@ int do_uncut_text(void)
filestruct *tmp = current, *fileptr = current, *newbuf, *newend;
#ifndef NANO_SMALL
char *tmpstr, *tmpstr2;
filestruct *hold = current;
#endif
int i;
@@ -339,8 +339,13 @@ int do_uncut_text(void)
if (tmp != NULL)
tmp->prev = newend;
else
else {
/* Fix the editbot pointer too */
if (editbot == filebot)
editbot = newend;
filebot = newend;
new_magicline();
}
/* Now why don't we update the totsize also */
for (tmp = current->next; tmp != newend; tmp = tmp->next)
@@ -368,7 +373,9 @@ int do_uncut_text(void)
current_x = 0;
placewewant = 0;
}
renumber(current->prev);
/* Renumber from BEFORE where we pasted ;) */
renumber(hold);
dump_buffer(fileage);
dump_buffer(cutbuffer);
set_modified();

151
faq.html
View File

@@ -1,5 +1,6 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<title>The GNU nano editor FAQ</title>
<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]">
@@ -16,18 +17,19 @@
<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.3">1.3. What is GNU 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
<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>
<font color="#330000"><a href="#2">2. Where to get GNU
nano</a></font></h2>
<blockquote><font color="#330000"><a href="#2.1">2.1. FTP and WWW sites
that carry nano.</a></font>
@@ -46,7 +48,11 @@ 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>
'gettext' and/or 'gettextdomain'.&nbsp; What can I do about it?</a></font>
<br><font color="#330000"><a href="#3.5">3.5. Nano should automatically
run strip on the binary when installing it!</a></font>
<br><font color="#330000"><a href="#3.6">3.6. How can I make the
executable smaller? This is too bloated!</a></font></blockquote>
<h2>
<font color="#330000"><a href="#4">4. Running</a></font></h2>
@@ -62,8 +68,11 @@ my window.&nbsp;&nbsp; How can I fix that?</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>
<br><font color="#330000"><a href="#4.6">4.6. I get the message "NumLock
glitch detected. Keypad will malfunction with NumLock off." What
gives?</a></font>
<br><font color="#330000"><a href="#4.7">4.7. How do I make nano my
default editor (in Pine, mutt, etc.)?</a></font></blockquote>
<h2>
<font color="#330000"><a href="#5">5. Internationalization</a></font></h2>
@@ -126,13 +135,13 @@ 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>
<a NAME="1.3"></a><font color="#330000">1.3. What is GNU 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>
<blockquote><font color="#330000">GNU 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.</font></blockquote>
<h2>
<a NAME="1.4"></a><font color="#330000">1.4. What is the history behind
@@ -144,7 +153,7 @@ nano?</font></h2>
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
to use interfaces.&nbsp; With the proliferation of GNU/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>
@@ -169,7 +178,11 @@ and hacked like a madman for many hours straight one weekend to make a
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>
state it is today.
<p><font color="#330000">In February 2001, nano has been declared an
official GNU program by Richard Stallman. Nano is also nearing its 1.0
release as of this writing (Valentine's Day 2001).
</font></blockquote>
<h2>
<a NAME="1.5"></a><font color="#330000">1.5. Why the name change from TIP?</font></h2>
@@ -179,7 +192,7 @@ 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
there is no 'tip' utility included with most GNU/Linux distributions (where
nano was developed).</font></blockquote>
<h2>
@@ -187,7 +200,7 @@ nano was developed).</font></blockquote>
of nano?</font></h2>
<blockquote><font color="#330000">The current version of nano *should*
be 0.9.21.&nbsp; Of course you should always check the nano hompage to
be 0.9.99pre3.&nbsp; Of course you should always check the nano hompage to
see what the latest and greatest version is.</font></blockquote>
<h2>
@@ -199,7 +212,7 @@ Okay, look <a href="http://www.nano-editor.org/dist/nano.1.html">here</a>.</font
<hr WIDTH="100%">
<h1>
<a NAME="2"></a><font color="#330000">2. Where to get nano</font></h1>
<a NAME="2"></a><font color="#330000">2. Where to get GNU nano</font></h1>
<h2>
<a NAME="2.1"></a><font color="#330000">2.1. FTP and WWW sites that carry
@@ -292,7 +305,7 @@ DEB package?</font></h2>
<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,
is the release of nano.&nbsp; There are other programs to install packages,
and if you wish to use those, knock yourself out.</font></blockquote>
<h2>
@@ -308,7 +321,8 @@ try this:</font>
<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>
<p><b><font color="#330000">cd nano-x.y.z/</font></b>
<br><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>
@@ -330,8 +344,39 @@ install</b>.</font></blockquote>
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>
<h2>
<a NAME="3.5"></a><font color="#330000">3.5. Nano should automatically
run strip on the binary when installing it!</font></h2>
<blockquote><font color="#330000">Actually, it does, but you have to use
<b>make install-strip</b>. The default make install does not, and will
not, run strip automatically.</font></blockquote>
<h2>
<a NAME="3.6"></a><font color="#330000">
3.6. How can I make the executable smaller? This is too
bloated!</font></h2>
<blockquote><font color="#330000">Actually, there are several parts of the
editor that can be disabled. You can pass arguments to the
<b>configure</b> script that disable certain features. Here's a brief
list:
<pre>
<b>--disable-tabcomp</b> Disables tab completion code for a smaller binary
<b>--disable-justify</b> Disable justify/unjustify function
<b>--disable-speller</b> Disables spell checker function
<b>--disable-help</b> Disables help function (^G)
<b>--disable-browser</b> Disables mini file browser
</pre><br>
There's also the <b>--enable-tiny</b> option which disables everything
above, as well as some larger chunks of the program (like the marker code
that you use Control-^ to select with). Also, if you know you aren't
going to be using other languages you can use <b>--disable-nls</b> to
disable internationalization and save a few K to a few dozen K depending
on if you have locale support on your system. And finally there's always
good old <b>strip</b> to strip all debugging code and code that exists in
libraries on your system.
</font></blockquote> <hr WIDTH="100%"> <h1>
<a NAME="4"></a><font color="#330000">4. Running</font></h1>
<h2>
@@ -358,8 +403,8 @@ to <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.</font></block
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>
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
@@ -376,7 +421,7 @@ will get the same shortcuts at the bottom as Pico.</font></blockquote>
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.21, the default is
<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
@@ -386,7 +431,26 @@ 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,
<a NAME="4.6"></a>I get the message "NumLock glitch detected. Keypad
will malfunction with NumLock off." What gives?</h2>
<blockquote>
Nano (actually almost all console editors do) has issues when cycling
the NumLock key in certain X terminals (rxvt, aterm, wterm, etc...). When
you switch NumLock on to off, you put the terminal into an "application
mode" that changes what sequences are sent by the keypad. These sequences
vary sufficiently from terminal to terminal that it is nearly impossible
to work around them from within nano.
<br><br>
In a nutshell, if you want to be able to use the keypad with the arrow and
page up/down functionality, you have to exit nano and reset your terminal
(presumably with "reset" or "stty sane" or similar) and then run nano
again with NumLock off. If you know an easier way to restore "normal
mode", please mail <A href="mailto:nano@nano-editor.org">nano@nano-editor.org</A>.
<br>&nbsp;</blockquote>
<h2>
<a NAME="4.7"></a>4.7. 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
@@ -457,34 +521,33 @@ 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>
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>
<blockquote><font color="#330000">The U of W license for Pine and
Pico is not considered truly Free Software according to both the Free
Software Foundation and the the <a
href="http://www.debian.org/social_contract#guidelines">Debian
Free Software Guidelines</a>.&nbsp; The main problem regards the
limitations on distributing derived works: according to UW, you can
distribute their software, and you can modfify it, but you can not do
both, i.e. distribute modified binaries.</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>
<blockquote><font color="#330000"> If you are looking to use a Free
Software program similar to PINE and emacs is not your things, you should
definitely take a look at <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
@@ -516,7 +579,7 @@ any changes in the past few years in a positive direction.</font></blockquote>
<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
versions of nano are announced (surprise!)&nbsp; Nano-devel is a normally
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>

763
files.c
View File

@@ -29,6 +29,7 @@
#include <errno.h>
#include <ctype.h>
#include <dirent.h>
#include <pwd.h>
#include "config.h"
#include "proto.h"
@@ -179,7 +180,7 @@ int read_file(int fd, char *filename)
buf[0] = 0;
}
/* Did we even GET a file? */
if (totsize == 0) {
if (totsize == 0 || fileptr == NULL) {
new_file();
statusbar(_("Read %d lines"), num_lines);
return 1;
@@ -194,6 +195,7 @@ int read_file(int fd, char *filename)
} else if (fileptr->next == NULL) {
filebot = fileptr;
new_magicline();
totsize--;
/* Update the edit buffer */
load_file();
@@ -226,10 +228,18 @@ int open_file(char *filename, int insert, int quiet)
} else if ((fd = open(filename, O_RDONLY)) == -1) {
if (!quiet)
statusbar("%s: %s", strerror(errno), filename);
if (!insert)
new_file();
return -1;
} else { /* File is A-OK */
if (S_ISDIR(fileinfo.st_mode)) {
statusbar(_("File \"%s\" is a directory"), filename);
if (S_ISDIR(fileinfo.st_mode) || S_ISCHR(fileinfo.st_mode) ||
S_ISBLK(fileinfo.st_mode)) {
if (S_ISDIR(fileinfo.st_mode))
statusbar(_("File \"%s\" is a directory"), filename);
else
/* Don't open character or block files. Sorry, /dev/sndstat! */
statusbar(_("File \"%s\" is a device file"), filename);
if (!insert)
new_file();
return -1;
@@ -245,6 +255,7 @@ int open_file(char *filename, int insert, int quiet)
int do_insertfile(void)
{
int i;
char *realname = NULL;
wrap_reset();
i = statusq(1, writefile_list, WRITEFILE_LIST_LEN, "",
@@ -255,7 +266,29 @@ int do_insertfile(void)
fprintf(stderr, "filename is %s", answer);
#endif
i = open_file(answer, 1, 0);
#ifndef DISABLE_TABCOMP
realname = real_dir_from_tilde(answer);
#else
realname = mallocstrcpy(realname, answer);
#endif
#ifndef DISABLE_BROWSER
if (i == NANO_TOFILES_KEY) {
char *tmp = do_browse_from(realname);
#ifdef DISABLE_TABCOMP
realname = NULL;
#endif
if (tmp != NULL)
realname = mallocstrcpy(realname, tmp);
else
return do_insertfile();
}
#endif
i = open_file(realname, 1, 0);
free(realname);
dump_buffer(fileage);
set_modified();
@@ -285,59 +318,80 @@ int do_insertfile(void)
* we don't set the global variable filename to it's name, and don't
* 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.
* tmp means we are writing a tmp file in a secute fashion. We use
* it when spell checking or dumping the file on an error.
*/
int write_file(char *name, int tmp)
{
long size, lineswritten = 0;
char buf[PATH_MAX + 1];
static char *buf = NULL;
filestruct *fileptr;
int fd, mask = 0;
struct stat st;
int fd, mask = 0, realexists, anyexists;
struct stat st, lst;
static char *realname = NULL;
if (!strcmp(name, "")) {
statusbar(_("Cancelled"));
return -1;
}
titlebar();
titlebar(NULL);
fileptr = fileage;
if (realname != NULL)
free(realname);
/* 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);
if (buf != NULL)
free(buf);
/* Open the file and truncate it. Trust the symlink. */
if ((ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(st.st_mode)) && !tmp) {
#ifndef DISABLE_TABCOMP
realname = real_dir_from_tilde(name);
#else
realname = mallocstrcpy(realname, name);
#endif
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)) {
/* Save the state of file at the end of the symlink (if there is one) */
realexists = stat(realname, &st);
/* Stat the link itself for the check... */
anyexists = lstat(realname, &lst);
/* New case: if the file exists, just give up */
if (tmp && anyexists != -1)
return -1;
/* NOTE: If you change this statement, you MUST CHANGE the if
statement below (that says:
if (realexists == -1 || tmp || (!ISSET(FOLLOW_SYMLINKS) &&
S_ISLNK(lst.st_mode))) {
to reflect whether or not to link/unlink/rename the file */
else if (ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(lst.st_mode) || tmp) {
/* Use O_EXCL if tmp == 1. This is now copied from joe, because
wiggy says so *shrug*. */
if (tmp)
fd = open(realname, O_WRONLY | O_CREAT | O_EXCL, (S_IRUSR|S_IWUSR));
else
fd = open(realname, O_WRONLY | O_CREAT | O_TRUNC, (S_IRUSR|S_IWUSR));
/* First, just give up if we couldn't even open the file */
if (fd == -1) {
if (!tmp && ISSET(TEMP_OPT)) {
UNSET(TEMP_OPT);
return do_writeout(1);
return do_writeout(filename, 1);
}
statusbar(_("Could not open file for writing: %s"),
strerror(errno));
return -1;
}
}
/* Don't follow symlink. Create new file. */
else {
if (strlen(name) > (PATH_MAX - 7)) {
statusbar(_("Could not open file: Path length exceeded."));
return -1;
}
memset(buf, 0x00, PATH_MAX + 1);
strcat(buf, name);
buf = nmalloc(strlen(realname) + 8);
strncpy(buf, realname, strlen(realname)+1);
strcat(buf, ".XXXXXX");
if ((fd = mkstemp(buf)) == -1) {
if (ISSET(TEMP_OPT)) {
UNSET(TEMP_OPT);
return do_writeout(1);
return do_writeout(filename, 1);
}
statusbar(_("Could not open file for writing: %s"),
strerror(errno));
@@ -385,68 +439,71 @@ int write_file(char *name, int tmp)
if (close(fd) == -1) {
statusbar(_("Could not close %s: %s"), name, strerror(errno));
statusbar(_("Could not close %s: %s"), realname, strerror(errno));
unlink(buf);
return -1;
}
if (!ISSET(FOLLOW_SYMLINKS) || tmp) {
if (stat(name, &st) == -1) {
/* Use default umask as file permisions if file is a new file. */
mask = umask(0);
umask(mask);
if (realexists == -1 || tmp ||
(!ISSET(FOLLOW_SYMLINKS) && S_ISLNK(lst.st_mode))) {
if (tmp) /* We don't want anyone reading our temporary file! */
mask = 0600;
else
mask = 0666 & ~mask;
/* Use default umask as file permisions if file is a new file. */
mask = umask(0);
umask(mask);
} else {
/* Use permissions from file we are overwriting. */
mask = st.st_mode;
if (unlink(name) == -1) {
if (errno != ENOENT) {
statusbar(_("Could not open %s for writing: %s"),
name, strerror(errno));
unlink(buf);
return -1;
}
if (tmp) /* We don't want anyone reading our temporary file! */
mask = 0600;
else
mask = 0666 & ~mask;
} else
/* Use permissions from file we are overwriting. */
mask = st.st_mode;
if (!tmp && (!ISSET(FOLLOW_SYMLINKS) && S_ISLNK(lst.st_mode))) {
if (unlink(realname) == -1) {
if (errno != ENOENT) {
statusbar(_("Could not open %s for writing: %s"),
realname, strerror(errno));
unlink(buf);
return -1;
}
}
if (link(buf, name) != -1)
if (link(buf, realname) != -1)
unlink(buf);
else if (errno != EPERM) {
statusbar(_("Could not open %s for writing: %s"),
name, strerror(errno));
unlink(buf);
return -1;
} else if (rename(buf, name) == -1) { /* Try a rename?? */
} else if (rename(buf, realname) == -1) { /* Try a rename?? */
statusbar(_("Could not open %s for writing: %s"),
name, strerror(errno));
realname, strerror(errno));
unlink(buf);
return -1;
}
if (chmod(name, mask) == -1) {
statusbar(_("Could not set permissions %o on %s: %s"),
mask, name, strerror(errno));
}
}
if (chmod(realname, mask) == -1)
statusbar(_("Could not set permissions %o on %s: %s"),
mask, realname, strerror(errno));
}
if (!tmp) {
strncpy(filename, name, 132);
filename = mallocstrcpy(filename, realname);
statusbar(_("Wrote %d lines"), lineswritten);
UNSET(MODIFIED);
titlebar(NULL);
}
UNSET(MODIFIED);
titlebar();
return 1;
}
int do_writeout(int exiting)
int do_writeout(char *path, int exiting)
{
int i = 0;
answer = mallocstrcpy(answer, filename);
#ifdef NANO_EXTRA
static int did_cred = 0;
#endif
answer = mallocstrcpy(answer, path);
if ((exiting) && (ISSET(TEMP_OPT))) {
if (filename[0]) {
@@ -468,9 +525,30 @@ int do_writeout(int exiting)
if (i != -1) {
#ifndef DISABLE_BROWSER
if (i == NANO_TOFILES_KEY) {
char *tmp = do_browse_from(answer);
if (tmp != NULL)
answer = mallocstrcpy(answer, tmp);
else
return do_writeout(answer, exiting);
}
#endif
#ifdef DEBUG
fprintf(stderr, _("filename is %s"), answer);
#endif
#ifdef NANO_EXTRA
if (exiting && !ISSET(TEMP_OPT) && !strcasecmp(answer, "zzy")
&& !did_cred) {
do_credits();
did_cred = 1;
return -1;
}
#endif
if (strcmp(answer, filename)) {
struct stat st;
if (!stat(answer, &st)) {
@@ -494,9 +572,88 @@ int do_writeout(int exiting)
int do_writeout_void(void)
{
return do_writeout(0);
return do_writeout(filename, 0);
}
#ifndef DISABLE_TABCOMP
/* Return a malloc()ed string containing the actual directory, used
* to convert ~user and ~/ notation...
*/
char *real_dir_from_tilde(char *buf)
{
char *dirtmp = NULL, *find_user = NULL;
int i = 1;
struct passwd *userdata;
/* set a default value for dirtmp, in the case user home dir not found */
dirtmp = mallocstrcpy(dirtmp, buf);
if (buf[0] == '~') {
if (buf[1] == 0 || buf[1] == '/') {
if (getenv("HOME") != NULL) {
free(dirtmp);
dirtmp = nmalloc(strlen(buf) + 2 + strlen(getenv("HOME")));
sprintf(dirtmp, "%s%s", getenv("HOME"), &buf[1]);
}
}
else {
/* Figure how how much of of the str we need to compare */
for (i = 1; buf[i] != '/' && buf[i] != 0; i++)
;
find_user = mallocstrcpy(find_user, &buf[1]);
find_user[i - 1] = 0;
for (userdata = getpwent(); userdata != NULL &&
strcmp(userdata->pw_name, find_user);
userdata = getpwent());
free(find_user);
if (userdata != NULL) { /* User found */
free(dirtmp);
dirtmp = nmalloc(strlen(buf) + 2 + strlen(userdata->pw_dir));
sprintf(dirtmp, "%s%s", userdata->pw_dir, &buf[i]);
}
endpwent();
}
}
return dirtmp;
}
/* Tack a slash onto the string we're completing if it's a directory */
int append_slash_if_dir(char *buf, int *lastWasTab, int *place)
{
char *dirptr;
struct stat fileinfo;
int ret = 0;
dirptr = real_dir_from_tilde(buf);
if (stat(dirptr, &fileinfo) == -1)
ret = 0;
else if (S_ISDIR(fileinfo.st_mode)) {
strncat(buf, "/", 1);
*place += 1;
/* now we start over again with # of tabs so far */
*lastWasTab = 0;
ret = 1;
}
if (dirptr != buf)
free(dirptr);
return ret;
}
/*
* These functions (username_tab_completion, cwd_tab_completion, and
@@ -517,36 +674,58 @@ int do_writeout_void(void)
* 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;
char *matchline = NULL;
struct passwd *userdata;
*num_matches = 0;
#ifdef DEBUG
fprintf(stderr, "\nin username_tab_completion\n");
#endif
matches = nmalloc(BUFSIZ * sizeof(char *));
strcat(buf, "*");
while ((userdata = getpwent()) != NULL) {
if (check_wildcard_match(userdata->pw_name, &buf[1]) == TRUE) {
/* Cool, found a match. Add it to the list
* This makes a lot more sense to me (Chris) this way...
*/
matchline = nmalloc(strlen(userdata->pw_name) + 2);
sprintf(matchline, "~%s", userdata->pw_name);
matches[*num_matches] = matchline;
++*num_matches;
/* If there's no more room, bail out */
if (*num_matches == BUFSIZ)
break;
}
}
endpwent();
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 *dirName, *dirtmp = NULL, *tmp = NULL, *tmp2 = NULL;
char **matches = (char **) NULL;
DIR *dir;
struct dirent *next;
matches = nmalloc(BUFSIZ);
matches = nmalloc(BUFSIZ * sizeof(char *));
/* 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);
dirName = nmalloc(strlen(buf) + 1);
tmp = buf + strlen(buf);
while (*tmp != '/' && tmp != buf)
tmp--;
@@ -569,6 +748,17 @@ char **cwd_tab_completion(char *buf, int *num_matches)
fprintf(stderr, "\ntmp = %s\n", tmp);
#endif
dirtmp = real_dir_from_tilde(dirName);
free(dirName);
dirName = dirtmp;
#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 */
@@ -578,11 +768,6 @@ char **cwd_tab_completion(char *buf, int *num_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
@@ -616,9 +801,8 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
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;
int longestname = 0, is_dir = 0;
char *foo;
struct stat fileinfo;
if (*lastWasTab == FALSE) {
char *tmp, *copyto, *matchBuf;
@@ -627,7 +811,8 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
/* Make a local copy of the string -- up to the position of the
cursor */
matchBuf = (char *) calloc(strlen(buf) + 2, sizeof(char));
matchBuf = (char *) nmalloc((strlen(buf) + 2) * sizeof(char));
memset(matchBuf, '\0', (strlen(buf) + 2));
strncpy(matchBuf, buf, place);
tmp = matchBuf;
@@ -648,9 +833,9 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
/* 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); */
/* 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. */
@@ -680,21 +865,11 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
} else
tmp = buf;
if (!strcmp(tmp, matches[0])) {
if (!strcmp(tmp, matches[0]))
is_dir = append_slash_if_dir(buf, lastWasTab, newplace);
/* 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;
}
if (is_dir)
break;
}
copyto = tmp;
for (pos = 0; *tmp == matches[0][pos] &&
@@ -705,14 +880,9 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
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;
}
/* Is it a directory? */
append_slash_if_dir(buf, lastWasTab, newplace);
break;
default:
/* Check to see if all matches share a beginning, and if so
@@ -815,3 +985,388 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
curs_set(1);
return buf;
}
#endif
#ifndef DISABLE_BROWSER
/* Return the stat of the file pointed to by path */
struct stat filestat(const char *path) {
struct stat st;
lstat(path, &st);
return st;
}
/* Our sort routine for file listings - sort directories before
* files, and then alphabetically
*/
int diralphasort(const void *va, const void *vb) {
struct stat file1info, file2info;
char *a = *(char **)va, *b = *(char **)vb;
int answer = 0;
if (stat(a, &file1info) == -1)
answer = 1;
else if (stat(b, &file2info) == -1)
answer = 1;
else {
/* If is a is a dir and b isn't, return -1.
Else if b is a dir and a isn't, return 0.
Else return a < b */
if (S_ISDIR(file1info.st_mode) && !S_ISDIR(file2info.st_mode))
return -1;
else if (!S_ISDIR(file1info.st_mode) && S_ISDIR(file2info.st_mode))
return 1;
else
answer = strcmp(a, b);
}
return(answer);
}
/* Initialize the browser code, including the list of files in *path */
char **browser_init(char *path, int *longest, int *numents)
{
DIR *dir;
struct dirent *next;
char **filelist = (char **) NULL;
int i = 0;
dir = opendir(path);
if (!dir)
return NULL;
*numents = 0;
while ((next = readdir(dir)) != NULL) {
if (!strcmp(next->d_name, "."))
continue;
(*numents)++;
if (strlen(next->d_name) > *longest)
*longest = strlen(next->d_name);
}
rewinddir(dir);
*longest += 10;
filelist = nmalloc(*numents * sizeof (char *));
while ((next = readdir(dir)) != NULL) {
if (!strcmp(next->d_name, "."))
continue;
filelist[i] = nmalloc(strlen(next->d_name) + strlen(path) + 2);
if (!strcmp(path, "/"))
snprintf(filelist[i], strlen(next->d_name) + strlen(path) + 1,
"%s%s", path, next->d_name);
else
snprintf(filelist[i], strlen(next->d_name) + strlen(path) + 2,
"%s/%s", path, next->d_name);
i++;
}
if (*longest > COLS - 1)
*longest = COLS - 1;
return filelist;
}
/* Free our malloced memory */
void free_charptrarray(char **array, int len)
{
int i;
for (i = 0; i < len - 1; i++)
free(array[i]);
free(array);
}
/* only print the last part of a path, isn't there a shell
command for this? */
char *tail(char *foo)
{
char *tmp = NULL;
tmp = foo + strlen(foo);
while (*tmp != '/' && tmp != foo)
tmp--;
tmp++;
return tmp;
}
/* Strip one dir from the end of a string */
void striponedir(char *foo)
{
char *tmp = NULL;
/* Don't strip the root dir */
if (!strcmp(foo, "/"))
return;
tmp = foo + strlen(foo);
if (*tmp == '/')
tmp--;
while (*tmp != '/' && tmp != foo)
tmp--;
if (tmp != foo)
*tmp = 0;
else
*(tmp+1) = 0;
return;
}
/* Our browser function. inpath is the path to start browsing from */
char *do_browser(char *inpath)
{
struct stat st;
char *foo, *retval = NULL;
static char *path = NULL;
int numents = 0, i = 0, j = 0, kbinput = 0, longest = 0, abort = 0;
int col = 0, selected = 0, editline = 0, width = 0, filecols = 0;
int lineno = 0, kb;
char **filelist = (char **) NULL;
/* If path isn't the same as inpath, we are being passed a new
dir as an arg. We free it here so it will be copied from
inpath below */
if (path != NULL && strcmp(path, inpath)) {
free(path);
path = NULL;
}
/* if path doesn't exist, make it so */
if (path == NULL)
path = mallocstrcpy(path, inpath);
filelist = browser_init(path, &longest, &numents);
foo = nmalloc(longest + 8);
/* Sort the list by directory first then alphabetically */
qsort(filelist, numents, sizeof(char *), diralphasort);
kb = keypad_on(edit, 1);
titlebar(path);
bottombars(browser_list, BROWSER_LIST_LEN);
curs_set(0);
wmove(edit, 0, 0);
i = 0;
width = 0;
filecols = 0;
/* Loop invariant: Microsoft sucks. */
do {
blank_edit();
blank_statusbar();
editline = 0;
col = 0;
/* Compute line number we're on now so we don't divide by zero later */
if (width == 0)
lineno = selected;
else
lineno = selected / width;
switch (kbinput) {
case KEY_UP:
case 'u':
if (selected - width >= 0)
selected -= width;
break;
case KEY_LEFT:
case 'l':
if (selected > 0)
selected--;
break;
case KEY_DOWN:
case 'd':
if (selected + width <= numents - 1)
selected += width;
break;
case KEY_RIGHT:
case 'r':
if (selected < numents - 1)
selected++;
break;
case NANO_PREVPAGE_KEY:
case NANO_PREVPAGE_FKEY:
case KEY_PPAGE:
case '-':
if (lineno % editwinrows == 0) {
if (selected - (editwinrows * width) >= 0)
selected -= editwinrows * width;
else
selected = 0;
}
else if (selected - (editwinrows +
lineno % editwinrows) * width >= 0)
selected -= (editwinrows + lineno % editwinrows) * width;
else
selected = 0;
break;
case NANO_NEXTPAGE_KEY:
case NANO_NEXTPAGE_FKEY:
case KEY_NPAGE:
case ' ':
if (lineno % editwinrows == 0) {
if (selected + (editwinrows * width) <= numents - 1)
selected += editwinrows * width;
else
selected = numents - 1;
}
else if (selected + (editwinrows -
lineno % editwinrows) * width <= numents - 1)
selected += (editwinrows - lineno % editwinrows) * width;
else
selected = numents - 1;
break;
case KEY_ENTER:
case NANO_CONTROL_M:
case 's': /* More Pico compatibility */
case 'S':
/* You can't cd up from / */
if (!strcmp(filelist[selected], "/..") && !strcmp(path, "/"))
statusbar(_("Can't move up a directory"));
else
path = mallocstrcpy(path, filelist[selected]);
st = filestat(path);
if (S_ISDIR(st.st_mode)) {
if (opendir(path) == NULL) {
/* We can't open this dir for some reason. Complain */
statusbar(_("Can't open \"%s\": %s"), path, strerror(errno));
striponedir(path);
align(&path);
break;
}
if (!strcmp("..", tail(path))) {
/* They want to go up a level, so strip off .. and the
current dir */
striponedir(path);
striponedir(path);
align(&path);
}
/* Start over again with the new path value */
return do_browser(path);
} else {
retval = path;
abort = 1;
}
break;
/* Stuff we want to abort the browser */
case 'q':
case 'Q':
case 'e': /* Pico compatibility, yeech */
case 'E':
case NANO_EXIT_FKEY:
abort = 1;
break;
}
if (abort)
break;
if (width)
i = width * editwinrows * ((selected / width) / editwinrows);
else
i = 0;
wmove(edit, 0, 0);
for (j = i; j < numents && editline <= editwinrows - 1; j++) {
filecols++;
strncpy(foo, tail(filelist[j]), strlen(tail(filelist[j])) + 1);
while (strlen(foo) < longest)
strcat(foo, " ");
col += strlen(foo);
/* Put file info in the string also */
st = filestat(filelist[j]);
if (S_ISDIR(st.st_mode))
strcpy(foo + longest - 5, "(dir)");
else {
if (S_ISLNK(st.st_mode))
strcpy(foo + longest - 2, "--");
else if (st.st_size < 1024) /* less than 1 K */
sprintf(foo + longest - 7, "%4d B", (int) st.st_size);
else if (st.st_size > 1073741824) /* at least 1 gig */
sprintf(foo + longest - 7, "%4d GB", (int) st.st_size / 1073741824);
else if (st.st_size > 1048576) /* at least 1 meg */
sprintf(foo + longest - 7, "%4d MB", (int) st.st_size / 1048576);
else /* Its more than 1 k and less than a meg */
sprintf(foo + longest - 7, "%4d KB", (int) st.st_size / 1024);
}
/* Hilight the currently selected file/dir */
if (j == selected)
wattron(edit, A_REVERSE);
waddnstr(edit, foo, strlen(foo));
if (j == selected)
wattroff(edit, A_REVERSE);
/* And add some space between the cols */
waddstr(edit, " ");
col += 2;
/* And if the next entry isn't going to fit on the
line, move to the next one */
if (col > (COLS - longest)) {
editline++;
wmove(edit, editline, 0);
col = 0;
if (width == 0)
width = filecols;
}
}
wrefresh(edit);
} while ((kbinput = wgetch(edit)) != NANO_EXIT_KEY);
curs_set(1);
blank_edit();
titlebar(NULL);
edit_refresh();
kb = keypad_on(edit, kb);
/* cleanup */
free_charptrarray(filelist, numents);
free(foo);
return retval;
}
/* Browser fron't end, checks to see if inpath has a dir in it and if so
starts do_browser from there, else from the current dir */
char *do_browse_from(char *inpath)
{
struct stat st;
char *tmp = NULL;
tmp = mallocstrcpy(tmp, inpath);
/* If there's no / in the string, we may was well start from . */
if (tmp == NULL || !strstr(tmp, "/"))
return do_browser(getcwd(NULL, 0));
/* If the string is a directory, pass do_browser that */
st = filestat(tmp);
if (S_ISDIR(st.st_mode))
return do_browser(tmp);
/* Okay, there's a dir in there, but not at the end of the string...
try stripping it off */
striponedir(tmp);
align(&tmp);
return do_browser(tmp);
}
#endif

View File

@@ -35,11 +35,10 @@
* Global variables
*/
int flags = 0; /* Our new flag containig many options */
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[PATH_MAX]; /* Name of the file */
char *filename = NULL; /* Name of the file */
int editwinrows = 0; /* How many rows long is the edit
window? */
filestruct *current; /* Current buffer pointer */
@@ -79,7 +78,13 @@ shortcut goto_list[GOTO_LIST_LEN];
shortcut writefile_list[WRITEFILE_LIST_LEN];
shortcut help_list[HELP_LIST_LEN];
shortcut spell_list[SPELL_LIST_LEN];
#ifndef DISABLE_BROWSER
shortcut browser_list[BROWSER_LIST_LEN];
#endif
#ifndef NANO_SMALL
toggle toggles[TOGGLE_LEN];
#endif
/* Regular expressions */
@@ -103,6 +108,7 @@ void sc_init_one(shortcut * s, int key, char *desc, char *help, int alt,
s->func = func;
}
#ifndef NANO_SMALL
/* Initialize the toggles in the same manner */
void toggle_init_one(toggle * t, int val, char *desc, int flag)
{
@@ -110,6 +116,7 @@ void toggle_init_one(toggle * t, int val, char *desc, int flag)
t->desc = desc;
t->flag = flag;
}
#endif
void toggle_init(void)
{
@@ -156,7 +163,7 @@ void toggle_init(void)
#endif
}
void shortcut_init(void)
void shortcut_init(int unjustify)
{
char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg = "",
*nano_goto_msg = "", *nano_justify_msg = "", *nano_replace_msg =
@@ -170,14 +177,17 @@ void shortcut_init(void)
"", *nano_mark_msg = "", *nano_delete_msg =
"", *nano_backspace_msg = "", *nano_tab_msg =
"", *nano_enter_msg = "", *nano_case_msg =
"", *nano_cancel_msg = "";
"", *nano_cancel_msg = "", *nano_unjustify_msg = "";
#ifndef NANO_SMALL
char *nano_tofiles_msg = "";
nano_help_msg = _("Invoke the help menu");
nano_writeout_msg = _("Write the current file to disk");
nano_exit_msg = _("Exit from nano");
nano_goto_msg = _("Goto a specific line number");
nano_justify_msg = _("Justify the current paragraph");
nano_unjustify_msg = _("Unjustify after a justify");
nano_replace_msg = _("Replace text within the editor");
nano_insert_msg = _("Insert another file into the current one");
nano_whereis_msg = _("Search for text within the editor");
@@ -204,42 +214,39 @@ void shortcut_init(void)
nano_enter_msg = _("Insert a carriage return at the cursor position");
nano_case_msg =
_("Make the current search or replace case (in)sensitive");
nano_tofiles_msg = _("Go to file browser");
nano_cancel_msg = _("Cancel the current function");
#endif
if (ISSET(PICO_MODE))
sc_init_one(&main_list[0], NANO_HELP_KEY, _("Get 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,
0, NANO_WRITEOUT_FKEY, 0, NOVIEW, do_writeout_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_MODE))
sc_init_one(&main_list[2], NANO_WRITEOUT_KEY, _("WriteOut"),
sc_init_one(&main_list[2], NANO_WRITEOUT_KEY, _("WriteOut"),
nano_writeout_msg,
0, NANO_WRITEOUT_FKEY, 0, NOVIEW, do_writeout_void);
else
sc_init_one(&main_list[2], NANO_GOTO_KEY, _("Goto Line"),
nano_goto_msg,
NANO_ALT_G, NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
if (ISSET(PICO_MODE))
sc_init_one(&main_list[3], NANO_JUSTIFY_KEY, _("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,
NANO_ALT_R, NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
sc_init_one(&main_list[4], NANO_INSERTFILE_KEY, _("Read File"),
sc_init_one(&main_list[3], NANO_INSERTFILE_KEY, _("Read File"),
nano_insert_msg,
0, NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile);
if (ISSET(PICO_MODE))
sc_init_one(&main_list[4], NANO_INSERTFILE_KEY, _("Read File"),
nano_insert_msg,
0, NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile);
else
sc_init_one(&main_list[4], NANO_REPLACE_KEY, _("Replace"),
nano_replace_msg,
NANO_ALT_R, NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
sc_init_one(&main_list[5], NANO_WHEREIS_KEY, _("Where Is"),
nano_whereis_msg,
0, NANO_WHEREIS_FKEY, 0, VIEW, do_search);
@@ -255,7 +262,11 @@ void shortcut_init(void)
sc_init_one(&main_list[8], NANO_CUT_KEY, _("Cut Text"),
nano_cut_msg, 0, NANO_CUT_FKEY, 0, NOVIEW, do_cut_text);
sc_init_one(&main_list[9], NANO_UNCUT_KEY, _("UnCut Txt"),
if (unjustify)
sc_init_one(&main_list[9], NANO_UNJUSTIFY_KEY, _("UnJustify"),
nano_unjustify_msg, 0, 0, 0, NOVIEW, do_uncut_text);
else
sc_init_one(&main_list[9], NANO_UNCUT_KEY, _("UnCut Txt"),
nano_uncut_msg,
0, NANO_UNCUT_FKEY, 0, NOVIEW, do_uncut_text);
@@ -315,13 +326,10 @@ void shortcut_init(void)
nano_enter_msg,
0, KEY_ENTER, NANO_CONTROL_M, NOVIEW, do_enter_void);
if (ISSET(PICO_MODE))
sc_init_one(&main_list[25], NANO_GOTO_KEY, _("Goto Line"),
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, NANO_HELP_FKEY, 0, VIEW, do_help);
sc_init_one(&whereis_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
@@ -398,18 +406,31 @@ void shortcut_init(void)
nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit);
sc_init_one(&writefile_list[0], NANO_CANCEL_KEY, _("Cancel"),
#ifndef DISABLE_BROWSER
sc_init_one(&writefile_list[0], NANO_TOFILES_KEY, _("To Files"),
nano_tofiles_msg, 0, 0, 0, NOVIEW, 0);
#endif
sc_init_one(&writefile_list[WRITEFILE_LIST_LEN - 1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&writefile_list[0], NANO_CANCEL_KEY, _("Cancel"),
sc_init_one(&spell_list[0], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&spell_list[0], NANO_HELP_KEY, _("Get Help"),
nano_help_msg, 0, 0, 0, VIEW, do_help);
#ifndef DISABLE_BROWSER
sc_init_one(&browser_list[0], NANO_PREVPAGE_KEY, _("Prev Page"),
nano_prevpage_msg,
0, NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, 0);
sc_init_one(&browser_list[1], NANO_NEXTPAGE_KEY, _("Next Page"),
nano_nextpage_msg,
0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, 0);
sc_init_one(&browser_list[2], NANO_EXIT_KEY, _("Exit"),
nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, 0);
#endif
sc_init_one(&spell_list[1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
toggle_init();
}

3
intl/.cvsignore Normal file
View File

@@ -0,0 +1,3 @@
Makefile
libintl.h
po2tbl.sed

7
move.c
View File

@@ -55,7 +55,12 @@ int page_down(void)
if (current == filebot)
return 0;
if (editbot != filebot || edittop == fileage) {
/* AHEM, if we only have a screen or less of text, DONT do an
edit_update, just move the cursor to editbot! */
if (edittop == fileage && editbot == filebot) {
current = editbot;
reset_cursor();
} else if (editbot != filebot || edittop == fileage) {
current_y = 0;
current = editbot;

56
nano.1
View File

@@ -1,20 +1,16 @@
.\" Hey, EMACS: -*- nroff -*-
.\" Hey, EMACS: -*- nroff -*-
.\" nano.1 is copyright 1999-2000 by
.\" Chris Allegretta <chrisa@asty.org>
.\"
.\" This is free documentation, see the latest version of the GNU General
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" 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 "July 28, 2000"
.TH NANO 1 "December 2, 2000"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
nano \- Nano's ANOther editor, an enhanced free Pico Clone
.SH SYNOPSIS
@@ -29,14 +25,12 @@ command.
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBnano\fP was originally known as TIP (TIP Isn't Pico). It is a small,
free and friendly editor which aims to replace Pico, the default editor
included in the non-free Pine package. Rather than just copying Pico's
look and feel,
\fBnano\fP is a small, free and friendly editor which aims to replace
Pico, the default editor included in the non-free Pine package. Rather
than just copying Pico's look and feel,
.B nano
also implements some missing (or disabled by
default) features in Pico, such as "search and replace" and "goto line
number".
also implements some missing (or disabled by default) features in Pico,
such as "search and replace" and "goto line number".
.SH OPTIONS
.TP
.B \-T (\-\-tabsize)
@@ -70,7 +64,9 @@ a new file, do not follow it. Good for editing files in /tmp perhaps?
Enable mouse support (if available for your system).
.TP
.B \-p (\-\-pico)
Emulate Pico as closely as possible.
Emulate Pico as closely as possible. This affects both the "shortcut list"
at the bottom of the screen, as well as the display and entry of previous
search and replace strings.
.TP
.B \-s (\-\-speller)
Enable alternative spell checker command.
@@ -90,18 +86,32 @@ Disable help screen at bottom of editor.
.B \-z (\-\-suspend)
Enable suspend ability.
.TP
.B \-b, \-e, \-f
Ignored, for compatibility with Pico.
.TP
.B \+LINE
Places cursor at LINE on startup.
.SH NOTES
Nano will try to dump the buffer into an emergency file in some cases.
Mainly, this will happen if Nano recieves a SIGHUP or runs out of
memory, when it will write the buffer into a file named "nano.save" if the
buffer didn't have a name already, or will add a ".save" suffix to the
current finename. Nano will \fBnot\fP write this file if a previous one
exists in the current directory.
.SH BUGS
Please send any comments or bug reports to
.br
.B nano@nano-editor.org.
.br
The nano mailing list is available from
.br
.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.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
GNU/Linux system (but may be used by others).
Chris Allegretta <chrisa@asty.org>, et al (see AUTHORS for details).
This manual page was originally written by Jordi Mallach
<jordi@sindominio.net>, for the Debian GNU/Linux system (but may be
used by others).

View File

@@ -3,21 +3,11 @@ Content-type: text/html
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
</HEAD><BODY>
<H1>NANO</H1>
Section: User Commands (1)<BR>Updated: July 28, 2000<BR><A HREF="#index">Index</A>
Section: User Commands (1)<BR>Updated: December 2, 2000<BR><A HREF="#index">Index</A>
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
@@ -43,15 +33,13 @@ command.
<B>nano</B> was originally known as TIP (TIP Isn't Pico). It is a small,
free and friendly editor which aims to replace Pico, the default editor
included in the non-free Pine package. Rather than just copying Pico's
look and feel,
<B>nano</B> is a small, free and friendly editor which aims to replace
Pico, the default editor included in the non-free Pine package. Rather
than just copying Pico's look and feel,
<B>nano</B>
also implements some missing (or disabled by
default) features in Pico, such as &quot;search and replace&quot; and &quot;goto line
number&quot;.
also implements some missing (or disabled by default) features in Pico,
such as &quot;search and replace&quot; and &quot;goto line number&quot;.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
@@ -98,7 +86,9 @@ Enable mouse support (if available for your system).
<DT><B>-p (--pico)</B>
<DD>
Emulate Pico as closely as possible.
Emulate Pico as closely as possible. This affects both the &quot;shortcut list&quot;
at the bottom of the screen, as well as the display and entry of previous
search and replace strings.
<DT><B>-s (--speller)</B>
<DD>
@@ -123,32 +113,52 @@ Disable help screen at bottom of editor.
<DD>
Enable suspend ability.
<DT><B>-b, -e, -f</B>
<DD>
Ignored, for compatibility with Pico.
<DT><B>+LINE</B>
<DD>
Places cursor at LINE on startup.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>NOTES</H2>
Nano will try to dump the buffer into an emergency file in some cases.
Mainly, this will happen if Nano recieves a SIGHUP or runs out of
memory, when it will write the buffer into a file named &quot;nano.save&quot; if the
buffer didn't have a name already, or will add a &quot;.save&quot; suffix to the
current finename. Nano will <B>not</B> write this file if a previous one
exists in the current directory.
<A NAME="lbAG">&nbsp;</A>
<H2>BUGS</H2>
Please send any comments or bug reports to
<BR>
<B><A HREF="mailto:nano@nano-editor.org">nano@nano-editor.org</A>.</B>
<BR>
The nano mailing list is available from
<BR>
<B><A HREF="mailto:nano-devel@lists.sourceforge.net">nano-devel@lists.sourceforge.net</A>.</B>
To subscribe, email to <A HREF="mailto:nano-devel-request@lists.sourceforge.net">nano-devel-request@lists.sourceforge.net</A> with a
subject of &quot;subscribe&quot;.
<A NAME="lbAG">&nbsp;</A>
<A NAME="lbAH">&nbsp;</A>
<H2>HOMEPAGE</H2>
<A HREF="http://www.nano-editor.org">http://www.nano-editor.org</A>
<A NAME="lbAH">&nbsp;</A>
<A NAME="lbAI">&nbsp;</A>
<H2>AUTHOR</H2>
Chris Allegretta &lt;<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>&gt;, et al. This manual page was
originally written by Jordi Mallach &lt;<A HREF="mailto:jordi@sindominio.net">jordi@sindominio.net</A>&gt;, for the Debian
GNU/Linux system (but may be used by others).
Chris Allegretta &lt;<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>&gt;, et al (see AUTHORS for details).
This manual page was originally written by Jordi Mallach
&lt;<A HREF="mailto:jordi@sindominio.net">jordi@sindominio.net</A>&gt;, for the Debian GNU/Linux system (but may be
used by others).
<P>
<HR>
@@ -158,14 +168,15 @@ GNU/Linux system (but may be used by others).
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT><A HREF="#lbAE">OPTIONS</A><DD>
<DT><A HREF="#lbAF">BUGS</A><DD>
<DT><A HREF="#lbAG">HOMEPAGE</A><DD>
<DT><A HREF="#lbAH">AUTHOR</A><DD>
<DT><A HREF="#lbAF">NOTES</A><DD>
<DT><A HREF="#lbAG">BUGS</A><DD>
<DT><A HREF="#lbAH">HOMEPAGE</A><DD>
<DT><A HREF="#lbAI">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 21:33:46 GMT, November 19, 2000
Time: 02:16:52 GMT, December 18, 2000
</BODY>
</HTML>

548
nano.c

File diff suppressed because it is too large Load Diff

26
nano.h
View File

@@ -61,7 +61,7 @@
# endif
#endif
#define VERMSG "nano " VERSION
#define VERMSG "GNU nano " VERSION
/* Structure types */
typedef struct filestruct {
@@ -212,6 +212,7 @@ know what you're doing */
#define NANO_REFRESH_KEY NANO_CONTROL_L
#define NANO_JUSTIFY_KEY NANO_CONTROL_J
#define NANO_JUSTIFY_FKEY KEY_F(4)
#define NANO_UNJUSTIFY_KEY NANO_CONTROL_U
#define NANO_UP_KEY NANO_CONTROL_P
#define NANO_DOWN_KEY NANO_CONTROL_N
#define NANO_FORWARD_KEY NANO_CONTROL_F
@@ -225,6 +226,7 @@ know what you're doing */
#define NANO_SUSPEND_KEY NANO_CONTROL_Z
#define NANO_ENTER_KEY NANO_CONTROL_M
#define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T
#define NANO_TOFILES_KEY NANO_CONTROL_T
#define TOGGLE_CONST_KEY NANO_ALT_C
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
@@ -242,9 +244,15 @@ know what you're doing */
#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
#define SPELL_LIST_LEN 1
#ifndef DISABLE_BROWSER
#define WRITEFILE_LIST_LEN 2
#define BROWSER_LIST_LEN 3
#else
#define WRITEFILE_LIST_LEN 1
#endif
#ifdef HAVE_REGEX_H
#define TOGGLE_LEN 9
@@ -258,4 +266,14 @@ know what you're doing */
#define TOP 2
#define CENTER 1
#define BOTTOM 0
#endif
/* Minimum editor window rows required for Nano to work correctly */
#define MIN_EDITOR_ROWS 3
/* Default number of characters from end-of-line where text wrapping occurs */
#define CHARS_FROM_EOL 8
/* Minimum fill length (space available for text before wrapping occurs) */
#define MIN_FILL_LENGTH 10
#endif /* ifndef NANO_H */

396
nano.info Normal file
View File

@@ -0,0 +1,396 @@
This is nano.info, produced by makeinfo version 4.0 from nano.texi.

File: nano.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
This manual documents GNU nano, a small and friendly text editor.
* Menu:
* Introduction::
* Editor Basics::
* Online Help::
* Feature Toggles::
* The File Browser::
* Pico Compatibility::
* Building and Configure Options::

File: nano.info, Node: Introduction, Next: Editor Basics, Prev: Top, Up: Top
Introduction
************
GNU `nano' is a small and friendly text editor. Besides basic text
editing, `nano' offers many extra features like an interactive search
and replace, goto line number, auto-indentation, feature toggles,
internationalization support, and filename tab completion.
* Menu:
* Overview::
* Command Line Options::

File: nano.info, Node: Overview, Next: Command Line Options, Prev: Introduction, Up: Introduction
Overview
========
`nano' [GNU long option] [option] +LINE [ FILE ... ]
The original goal for `nano' was a complete bug-for-bug compatible
emulation of Pico, but consistency is now a slightly higher priority.
There is a flag to implement (nearly) complete Pico emulation, (option
-p or GNU long option -pico). This can also be toggled from within
`nano' by typing Meta-P. *Note Pico Compatibility::, for more info.
Email bug reports to <nano@nano-editor.org>.

File: nano.info, Node: Command Line Options, Prev: Overview, Up: Introduction
Command Line Options
====================
`nano' takes the following options from the command line:
`-T [num, --tabsize=[num]'
Set the displayed tab length to [num] columns.
`-R, --regexp'
Turns on regular expression search and search/replace.
`-V, --version'
Print the version number and copyright and quit.
`-c, --const'
Constantly display the cursor posititon and line number on the
statusbar.
`-h, --help'
Print the usage and exit.
`-i, --autoindent'
Automatically indent new lines to the same number of spaces and
tabs as the previous line.
`-k, --cut'
Makes ^K cut from the current cursor position to the end of the
current line.
`-l, --nofollow'
When writing files, if the given file is a symbolic link it is
removed and a new file is created.
`-m, --mouse'
Enables the use of the mouse to select text (currently only useful
for running under the X window system).
`-p, --pico'
Emulate Pico as closely as possible, sacrificing consistency for
correct emulation. *Note Pico Compatibility::, for more info.
`-r [#cols], --fill=[#cols].'
Wrap lines at column #cols. By default this is the width of the
screen, less eight.
`-s [prog], --speller=[prog]'
Invoke [prog] as the spell checker. By default, `nano' uses its
own interactive spell checker that requires the `spell' program be
installed on your system.
`-t, --tempfile'
Do not ask whether or not to save the current contents of the file
when exiting, assume yes. This is most useful when using `nano'
as the composer of a mailer program.
`-x, --nohelp'
In Expert Mode, the Shortcut Lists will not appear at the bottom
of the screen. This affects the location of the statusbar as
well, as in Expert Mode it is located at the very bottom of the
editor.
Note: When accesing the help system, Expert Mode is temporarily
disabled to display the help system navigation keys.
`-v, --view'
Do not allow the contents of the file to be altered. Note that
this flag should NOT be used in place of correct file permissions
to implement a read-only file.
`-w, --nowrap'
Do not wrap long lines at any length. This option overrides any
value for -r.
`-z, --suspend'
Enable suspend ability of `nano' using the system's suspend
keystroke (usually ^Z).
`+LINE'
Start at line number LINE instead of the default of line 1.

File: nano.info, Node: Editor Basics, Next: Online Help, Prev: Introduction, Up: Top
Editor Basics
*************
* Menu:
* Entering Text::
* Special Functions::
* The Titlebar::
* The Statusbar::
* Shortcut Lists::

File: nano.info, Node: Entering Text, Next: Special Functions, Prev: Editor Basics, Up: Editor Basics
Entering Text
=============
All key sequences in `nano' are entered using the keyboard. `nano'
is a "modeless" editor, all keys with the exception of Control and Meta
key sequences will enter text into the file being edited.

File: nano.info, Node: Special Functions, Next: The Titlebar, Prev: Entering Text, Up: Editor Basics
Special Functions
=================
Special functions use the Control key (displayed in the help and
shotcut lists as ^) or the Meta key (displayed as M).
* Control key sequences are entered by holding down the Control key
and pressing the desired letter.
* Meta key sequences can be entered in a number of possible ways:
Pressing the Escape key, then releasing it and pressing the
desired key, or holding down the Alt key while pressing the desired
key. This varies from keyboard to keyboard, and certain commercial
operating systems "swallow" the Alt key so that it never reaches
the application. If your operating system does this, you should
use the Escape key to generate Meta key sequences.

File: nano.info, Node: The Titlebar, Next: The Statusbar, Prev: Special Functions, Up: Editor Basics
The Titlebar
============
The titlebar is the line displayed at the top of the editor. There
are three sections: left, center and right. The section on the left
displays the version of `nano' being used. The center section displays
the current file name, or "New Buffer" if the file has not yet been
named. The section on the right will display "Modified" if the file
has been modified since it ws last saved or opened.
Special modes: When nano is in "File browser" mode, the center
section will display the current directory instead of the filename.
*Note The File Browser::.

File: nano.info, Node: The Statusbar, Next: Shortcut Lists, Prev: The Titlebar, Up: Editor Basics
The Statusbar
=============
The statusbar is located three lines from the bottom of the screen
(or the bottom line in Expert Mode. *Note Expert Mode::, for more info.
The Statusbar shows important and informational messages. Any error
messages that occur from using the editor will appear on the statusbar.
Any questions that are asked of the user will be asked on the statusbar,
and any user input (serch strings, file names, etc) will be input on the
statusbar.

File: nano.info, Node: Shortcut Lists, Prev: The Statusbar, Up: Editor Basics
Shortcut Lists
==============
The Shorcut Lists are the two lines at the bottom of the screen
which show some of the more commonly used functions in the editor. The
exact functions which are displayed depend on whether Pico
Compatibility Mode mode is enabled. *Note Pico Compatibility::, for
more info.

File: nano.info, Node: Online Help, Next: Feature Toggles, Prev: Editor Basics, Up: Top
Online Help
***********
The online help system in `nano' is available by pressing ^G. It is
fairly self explanatory, documenting the various parts of the editor
and available keystrokes. Navigation is via the ^Y (Page Up) and ^V
(Page Down) keys. ^X exits the help system.

File: nano.info, Node: Feature Toggles, Next: The File Browser, Prev: Online Help, Up: Top
Feature Toggles
***************
Toggles allow you to change certain aspects of the editor that would
normally be done via command line flags. They are invoked via certain
Meta key sequenced. *Note Special Functions::, for more info. The
following toggles are available:
`Constant Update Toggle (Meta-C)'
toggles the -c (-const) command line flag.
`Regular Expressions Toggle (Meta-E)'
toggles the -R (-regexp) command line flag.
`AutoIndent Toggle (Meta-I)'
toggles the -i (-autoindent) command line flag.
`Cut To End Toggle (Meta-K)'
toggles the -k (-cut) command line flag.
`Cut To End Toggle (Meta-M)'
toggles the -m (-mouse) command line flag.
`Pico Mode Toggle (Meta-P)'
toggles the -p (-pico) command line flag. *Note Pico
Compatibility::, for more info.
`AutoWrap Toggle (Meta-W)'
toggles the -w (-nowrap) command line flag.
`Expert/Nohelp Toggle (Meta-X)'
toggles the -x (-nohelp) command line flag.
`Suspend Toggle (Meta-Z)'
toggles the -i (-autoindent) command line flag.

File: nano.info, Node: The File Browser, Next: Pico Compatibility, Prev: Feature Toggles, Up: Top
The File Browser
****************
When reading or writilg files, pressing ^T will invoke the file
browser. Here, one can navigate directories in a graphical manner in
order to find the desired file.
Basic movement in the file browser is accomplished with he arrow keys
and page up/down. The behavior of the enter (or 's') key varies by what
is currently selected. If the currently selected object is a directory,
the file browser will enter and display the contects of the directory.
If the object is a file, this filename and path are copied to the
statusbar and the file browser is exited.

File: nano.info, Node: Pico Compatibility, Next: Building and Configure Options, Prev: The File Browser, Up: Top
Pico Compatibility
******************
Nano does not completely emulate Pico by default. The following
differences apply to the default mode and Pico Compatibility mode:
`Displayed Shortcuts'
By default, the following shortcuts are displayed in the Shortcut
Lists:
^G ^O ^\ ^Y ^K ^C
^X ^R ^W ^V ^U ^T
Related functions are listed above or below each other by default.
The Justify function is not listed, instead the "Replace"
function is displayed. Also, he "Read File" and "WriteOut"
functions are aligned for consistency.
In Pico Compatibility mode, the default Pico shortcuts are
displayed:
^G ^O ^R ^Y ^K ^C
^X ^J ^W ^V ^U ^T
`Previous String Text'
By default, previously entered string for a function (search
string, file name) will be placed on the statusbar, and is
editable. This is done so there is consistency across all
functions. For example: even if there is a previous replace
string, it can always be deleted if one wishes to perform an empty
string replace.
In Pico Compatibility Mode, the previously entered text in a
search or replace will appear in brackets, and is not editable.
It is not a simple matter to do an empty string replace when a
previous replace string exists, for example. When writing a file,
the previous filename will be displayed in the editable text
portion of the editor.
`Interactive Replace and Spell Checker'
It is worth noting that the `nano' replace function is interactive,
i.e. it does not stop after one search string is found and
automatically replace it. The `nano' implementation will stop at
each search string found and query whether to replace this
instance or not. The internal spell checker operates similarly.
Note that these is no way to force these functions to behave in
the Pico fashion.

File: nano.info, Node: Building and Configure Options, Prev: Pico Compatibility, Up: Top
Building and Configure Options
******************************
Building nano from source is fairly straightforward if you are
familiar with compiling programs with autoconf support:
tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano) cd
nano-x.y.z/ ./configure make make install
if you are looking to optimize nano for size, you may want to
consider the following command line options:
`--disable-tabcomp'
Disable the tab completion code when reading or writing files.
`--disable-justify'
Disable the justify (^J)/unjustify (^U) functions in the editor.
`--disable-speller'
Disables spell checker abillity.
`--disable-help'
Disables the help function (^G). Disabling this option maks the
binary much smaller, but makes it difficult for new users to learn
more than very basic things about using the editor.
`--disable-browser'
Disables the mini file browser (^O) when reading or writing files.
`--enable-tiny'
This options disables all the above. It also disables some of the
larger internals of the editor, like the marker code (^^) and the
cut to line (-k) option which depends on the it to work properly.
It also disables the function toggles and mouse support.

Tag Table:
Node: Top69
Node: Introduction377
Node: Overview803
Node: Command Line Options1383
Ref: Expert Mode3106
Node: Editor Basics3948
Node: Entering Text4173
Node: Special Functions4513
Node: The Titlebar5367
Node: The Statusbar6064
Node: Shortcut Lists6644
Node: Online Help7036
Node: Feature Toggles7412
Node: The File Browser8558
Node: Pico Compatibility9267
Node: Building and Configure Options11309

End Tag Table

408
nano.texi Normal file
View File

@@ -0,0 +1,408 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename nano.info
@settitle nano Command Manual
@c %**end of header
@c This file has the new style title page commands.
@c Run `makeinfo' rather than `texinfo-format-buffer'.
@smallbook
@set EDITION 0.1
@set VERSION 0.9.99pre3
@set UPDATED 12 Feb 2001
@c tex
@c \overfullrule=0pt
@c end tex
@titlepage
@title GNU @code{nano}
@subtitle a small and friendly text editor.
@subtitle version 0.9.99pre3
@author Chris Allegretta
@page
This manual documents GNU @code{nano}, a small and friendly text
editor.
This manual is part of the GNU @code{nano} distribution.@*
@sp4
Copyright (C) 1999, 2000, 2001 Chris Allegretta.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
@iftex
Permission is granted to process this file through TeX and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).
@end iftex
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.
You may contact the author by:
e-mail: @email{chrisa@@asty.org}@*
@end titlepage
@node Top, Introduction, (dir), (dir)
This manual documents GNU nano, a small and friendly text editor.
@menu
* Introduction::
* Editor Basics::
* Online Help::
* Feature Toggles::
* The File Browser::
* Pico Compatibility::
* Building and Configure Options::
@end menu
@node Introduction, Editor Basics, Top, Top
@chapter Introduction
GNU @code{nano} is a small and friendly text editor. Besides basic
text editing, @code{nano} offers many extra features like an
interactive search and replace, goto line number, auto-indentation,
feature toggles, internationalization support, and filename tab
completion.
@menu
* Overview::
* Command Line Options::
@end menu
@node Overview, Command Line Options, Introduction, Introduction
@section Overview
@code{nano} [GNU long option] [option] +LINE [ @var{ file ...} ]
The original goal for @code{nano} was a complete bug-for-bug compatible
emulation of Pico, but consistency is now a slightly higher priority.
There is a flag to implement (nearly) complete Pico emulation, (option -p
or GNU long option --pico). This can also be toggled from within
@code{nano} by typing Meta-P. @xref{Pico Compatibility}, for more
info.
Email bug reports to @email{nano@@nano-editor.org}.
@node Command Line Options, , Overview, Introduction
@section Command Line Options
@code{nano} takes the following options from the command line:
@table @code
@item -T [num, --tabsize=[num]
Set the displayed tab length to [num] columns.
@item -R, --regexp
Turns on regular expression search and search/replace.
@item -V, --version
Print the version number and copyright and quit.
@item -c, --const
Constantly display the cursor posititon and line number on the statusbar.
@item -h, --help
Print the usage and exit.
@item -i, --autoindent
Automatically indent new lines to the same number of spaces and tabs as
the previous line.
@item -k, --cut
Makes ^K cut from the current cursor position to the end of the current
line.
@item -l, --nofollow
When writing files, if the given file is a symbolic link it is removed
and a new file is created.
@item -m, --mouse
Enables the use of the mouse to select text (currently only useful for
running under the X window system).
@item -p, --pico
Emulate Pico as closely as possible, sacrificing consistency for correct
emulation. @xref{Pico Compatibility}, for more info.
@item -r [#cols], --fill=[#cols].
Wrap lines at column #cols. By default this is the width of the screen,
less eight.
@item -s [prog], --speller=[prog]
Invoke [prog] as the spell checker. By default, @code{nano} uses its
own interactive spell checker that requires the @code{spell} program be
installed on your system.
@item -t, --tempfile
Do not ask whether or not to save the current contents of the file when
exiting, assume yes. This is most useful when using @code{nano} as the
composer of a mailer program.
@anchor{Expert Mode}
@item -x, --nohelp
In Expert Mode, the Shortcut Lists will not appear at the bottom of the
screen. This affects the location of the statusbar as well, as in Expert
Mode it is located at the very bottom of the editor.
Note: When accesing the help system, Expert Mode is temporarily disabled
to display the help system navigation keys.
@item -v, --view
Do not allow the contents of the file to be altered. Note that this
flag should NOT be used in place of correct file permissions to implement
a read-only file.
@item -w, --nowrap
Do not wrap long lines at any length. This option overrides any value for
-r.
@item -z, --suspend
Enable suspend ability of @code{nano} using the system's suspend
keystroke (usually ^Z).
@item +LINE
Start at line number LINE instead of the default of line 1.
@end table
@node Editor Basics, Online Help, Introduction, Top
@chapter Editor Basics
@menu
* Entering Text::
* Special Functions::
* The Titlebar::
* The Statusbar::
* Shortcut Lists::
@end menu
@node Entering Text, Special Functions, Editor Basics, Editor Basics
@section Entering Text
All key sequences in @code{nano} are entered using the keyboard.
@code{nano} is a "modeless" editor, all keys with the exception of
Control and Meta key sequences will enter text into the file being
edited.
@node Special Functions, The Titlebar, Entering Text, Editor Basics
@section Special Functions
Special functions use the Control key (displayed in the help and
shotcut lists as ^) or the Meta key (displayed as M).
@itemize @bullet
@item
Control key sequences are entered by holding down the Control key and
pressing the desired letter.
@item
Meta key sequences can be entered in a number of
possible ways: Pressing the Escape key, then releasing it and pressing
the desired key, or holding down the Alt key while pressing the desired
key. This varies from keyboard to keyboard, and certain commercial
operating systems "swallow" the Alt key so that it never reaches the
application. If your operating system does this, you should use the
Escape key to generate Meta key sequences.
@end itemize
@node The Titlebar, The Statusbar, Special Functions, Editor Basics
@section The Titlebar
The titlebar is the line displayed at the top of the editor. There are
three sections: left, center and right. The section on the left displays
the version of @code{nano} being used. The center section displays the
current file name, or "New Buffer" if the file has not yet been named.
The section on the right will display "Modified" if the file has been
modified since it ws last saved or opened.
Special modes: When nano is in "File browser" mode, the center section
will display the current directory instead of the filename.
@xref{The File Browser}.
@node The Statusbar, Shortcut Lists, The Titlebar, Editor Basics
@section The Statusbar
The statusbar is located three lines from the bottom of the screen (or the
bottom line in Expert Mode. @xref{Expert Mode}, for more info.
The Statusbar shows important and informational messages. Any error
messages that occur from using the editor will appear on the statusbar.
Any questions that are asked of the user will be asked on the statusbar,
and any user input (serch strings, file names, etc) will be input on the
statusbar.
@node Shortcut Lists, , The Statusbar, Editor Basics
@section Shortcut Lists
The Shorcut Lists are the two lines at the bottom of the screen which show
some of the more commonly used functions in the editor. The exact
functions which are displayed depend on whether Pico Compatibility Mode mode
is enabled. @xref{Pico Compatibility}, for more info.
@node Online Help, Feature Toggles, Editor Basics, Top
@chapter Online Help
The online help system in @code{nano} is available by pressing ^G.
It is fairly self explanatory, documenting the various parts of the
editor and available keystrokes. Navigation is via the ^Y (Page Up)
and ^V (Page Down) keys. ^X exits the help system.
@node Feature Toggles, The File Browser, Online Help, Top
@chapter Feature Toggles
Toggles allow you to change certain aspects of the editor that
would normally be done via command line flags. They are invoked via
certain Meta key sequenced. @xref{Special Functions}, for more info.
The following toggles are available:
@table @code
@item Constant Update Toggle (Meta-C)
toggles the -c (--const) command line flag.
@item Regular Expressions Toggle (Meta-E)
toggles the -R (--regexp) command line flag.
@item AutoIndent Toggle (Meta-I)
toggles the -i (--autoindent) command line flag.
@item Cut To End Toggle (Meta-K)
toggles the -k (--cut) command line flag.
@item Cut To End Toggle (Meta-M)
toggles the -m (--mouse) command line flag.
@item Pico Mode Toggle (Meta-P)
toggles the -p (--pico) command line flag.
@xref{Pico Compatibility}, for more info.
@item AutoWrap Toggle (Meta-W)
toggles the -w (--nowrap) command line flag.
@item Expert/Nohelp Toggle (Meta-X)
toggles the -x (--nohelp) command line flag.
@item Suspend Toggle (Meta-Z)
toggles the -i (--autoindent) command line flag.
@end table
@node The File Browser, Pico Compatibility, Feature Toggles, Top
@chapter The File Browser
When reading or writilg files, pressing ^T will invoke the file browser.
Here, one can navigate directories in a graphical manner in order to find
the desired file.
Basic movement in the file browser is accomplished with he arrow keys
and page up/down. The behavior of the enter (or 's') key varies by what
is currently selected. If the currently selected object is a directory,
the file browser will enter and display the contects of the directory. If
the object is a file, this filename and path are copied to the statusbar
and the file browser is exited.
@node Pico Compatibility, Building and Configure Options, The File Browser, Top
@chapter Pico Compatibility
Nano does not completely emulate Pico by default. The following differences
apply to the default mode and Pico Compatibility mode:
@table @code
@item Displayed Shortcuts
By default, the following shortcuts are displayed in the Shortcut Lists:
^G ^O ^\ ^Y ^K ^C@*
^X ^R ^W ^V ^U ^T
Related functions are listed above or below each other by default. The
Justify function is not listed, instead the "Replace" function is
displayed. Also, he "Read File" and "WriteOut" functions are aligned for
consistency.
In Pico Compatibility mode, the default Pico shortcuts are displayed:
^G ^O ^R ^Y ^K ^C@*
^X ^J ^W ^V ^U ^T
@item Previous String Text
By default, previously entered string for a function (search string,
file name) will be placed on the statusbar, and is editable. This is
done so there is consistency across all functions. For example: even if
there is a previous replace string, it can always be deleted if one
wishes to perform an empty string replace.
In Pico Compatibility Mode, the previously entered text in a search or
replace will appear in brackets, and is not editable. It is not a
simple matter to do an empty string replace when a previous replace
string exists, for example. When writing a file, the previous filename
will be displayed in the editable text portion of the editor.
@item Interactive Replace and Spell Checker
It is worth noting that the @code{nano} replace function is interactive,
i.e. it does not stop after one search string is found and automatically
replace it. The @code{nano} implementation will stop at each search
string found and query whether to replace this instance or not. The
internal spell checker operates similarly. Note that these is no way
to force these functions to behave in the Pico fashion.
@end table
@node Building and Configure Options, , Pico Compatibility, Top
@chapter Building and Configure Options
Building nano from source is fairly straightforward if you are familiar
with compiling programs with autoconf support:
tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano)
cd nano-x.y.z/
./configure
make
make install
if you are looking to optimize nano for size, you may want to consider
the following command line options:
@table @code
@item --disable-tabcomp
Disable the tab completion code when reading or writing files.
@item --disable-justify
Disable the justify (^J)/unjustify (^U) functions in the editor.
@item --disable-speller
Disables spell checker abillity.
@item --disable-help
Disables the help function (^G). Disabling this option maks the
binary much smaller, but makes it difficult for new users
to learn more than very basic things about using the editor.
@item --disable-browser
Disables the mini file browser (^O) when reading or writing files.
@item --enable-tiny
This options disables all the above. It also disables some of
the larger internals of the editor, like the marker code (^^) and
the cut to line (-k) option which depends on the it to work properly.
It also disables the function toggles and mouse support.
@end table
@contents
@bye

7
po/.cvsignore Normal file
View File

@@ -0,0 +1,7 @@
Makefile
Makefile.in
POTFILES
*.gmo
*.pot
cat-id*
stamp-cat*

1029
po/ca.po Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,238 +0,0 @@
/* Automatically generated by po2tbl.sed from nano.pot. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "libgettext.h"
const struct _msg_ent _msg_tbl[] = {
{"", 1},
{"add_to_cutbuffer called with inptr->data = %s\n", 2},
{"Blew away cutbuffer =)\n", 3},
{"read_line: not on first line and prev is NULL", 4},
{"Read %d lines", 5},
{"\"%s\" not found", 6},
{"New File", 7},
{"File \"%s\" is a directory", 8},
{"Reading File", 9},
{"File to insert [from ./] ", 10},
{"Cancelled", 11},
{"Could not open file for writing: %s", 12},
{"Could not open file: Path length exceeded.", 13},
{"Wrote >%s\n", 14},
{"Could not close %s: %s", 15},
{"Could not open %s for writing: %s", 16},
{"Could not set permissions %o on %s: %s", 17},
{"Wrote %d lines", 18},
{"File Name to write", 19},
{"filename is %s", 20},
{"File exists, OVERWRITE ?", 21},
{"(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", 93},
{"Key illegal in VIEW mode", 94},
{"\
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", 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", 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", 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", 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 = 202;

BIN
po/de.gmo

Binary file not shown.

675
po/de.po

File diff suppressed because it is too large Load Diff

BIN
po/es.gmo

Binary file not shown.

632
po/es.po

File diff suppressed because it is too large Load Diff

BIN
po/fi.gmo

Binary file not shown.

759
po/fi.po

File diff suppressed because it is too large Load Diff

BIN
po/fr.gmo

Binary file not shown.

582
po/fr.po

File diff suppressed because it is too large Load Diff

1030
po/hu.po Normal file

File diff suppressed because it is too large Load Diff

BIN
po/id.gmo

Binary file not shown.

731
po/id.po

File diff suppressed because it is too large Load Diff

BIN
po/it.gmo

Binary file not shown.

585
po/it.po

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-11-22 20:20-0500\n"
"POT-Creation-Date: 2000-12-02 00:33-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -51,63 +51,63 @@ msgstr ""
msgid "Reading File"
msgstr ""
#: files.c:251
#: files.c:252
msgid "File to insert [from ./] "
msgstr ""
#: files.c:276 files.c:300 files.c:488 nano.c:1355
#: files.c:284 files.c:309 files.c:521 nano.c:1419
msgid "Cancelled"
msgstr ""
#: files.c:322 files.c:342 files.c:356 files.c:373 files.c:379
#: files.c:343 files.c:364 files.c:378 files.c:395 files.c:401
#, c-format
msgid "Could not open file for writing: %s"
msgstr ""
#: files.c:330
#: files.c:352
msgid "Could not open file: Path length exceeded."
msgstr ""
#: files.c:361
#: files.c:383
#, c-format
msgid "Wrote >%s\n"
msgstr ""
#: files.c:388
#: files.c:410
#, c-format
msgid "Could not close %s: %s"
msgstr ""
#. Try a rename??
#: files.c:409 files.c:420 files.c:425
#: files.c:431 files.c:442 files.c:447
#, c-format
msgid "Could not open %s for writing: %s"
msgstr ""
#: files.c:431
#: files.c:453
#, c-format
msgid "Could not set permissions %o on %s: %s"
msgstr ""
#: files.c:438
#: files.c:460
#, c-format
msgid "Wrote %d lines"
msgstr ""
#: files.c:467
#: files.c:492
msgid "File Name to write"
msgstr ""
#: files.c:472
#: files.c:497
#, c-format
msgid "filename is %s"
msgstr ""
#: files.c:477
#: files.c:510
msgid "File exists, OVERWRITE ?"
msgstr ""
#: files.c:801
#: files.c:999
msgid "(more)"
msgstr ""
@@ -168,241 +168,256 @@ msgid "Justify the current paragraph"
msgstr ""
#: global.c:181
msgid "Replace text within the editor"
msgid "Unjustify after a justify"
msgstr ""
#: global.c:182
msgid "Insert another file into the current one"
msgid "Replace text within the editor"
msgstr ""
#: global.c:183
msgid "Search for text within the editor"
msgid "Insert another file into the current one"
msgstr ""
#: global.c:184
msgid "Move to the previous screen"
msgid "Search for text within the editor"
msgstr ""
#: global.c:185
msgid "Move to the next screen"
msgid "Move to the previous screen"
msgstr ""
#: global.c:186
msgid "Cut the current line and store it in the cutbuffer"
msgid "Move to the next screen"
msgstr ""
#: global.c:187
msgid "Uncut from the cutbuffer into the current line"
msgid "Cut the current line and store it in the cutbuffer"
msgstr ""
#: global.c:188
msgid "Show the posititon of the cursor"
msgid "Uncut from the cutbuffer into the current line"
msgstr ""
#: global.c:189
msgid "Invoke the spell checker (if available)"
msgid "Show the posititon of the cursor"
msgstr ""
#: global.c:190
msgid "Move up one line"
msgid "Invoke the spell checker (if available)"
msgstr ""
#: global.c:191
msgid "Move down one line"
msgid "Move up one line"
msgstr ""
#: global.c:192
msgid "Move forward one character"
msgid "Move down one line"
msgstr ""
#: global.c:193
msgid "Move back one character"
msgid "Move forward one character"
msgstr ""
#: global.c:194
msgid "Move to the beginning of the current line"
msgid "Move back one character"
msgstr ""
#: global.c:195
msgid "Move to the end of the current line"
msgid "Move to the beginning of the current line"
msgstr ""
#: global.c:196
msgid "Go to the first line of the file"
msgid "Move to the end of the current line"
msgstr ""
#: global.c:197
msgid "Go to the last line of the file"
msgid "Go to the first line of the file"
msgstr ""
#: global.c:198
msgid "Refresh (redraw) the current screen"
msgid "Go to the last line of the file"
msgstr ""
#: global.c:199
msgid "Mark text at the current cursor location"
msgid "Refresh (redraw) the current screen"
msgstr ""
#: global.c:200
msgid "Mark text at the current cursor location"
msgstr ""
#: global.c:201
msgid "Delete the character under the cursor"
msgstr ""
#: global.c:202
#: global.c:203
msgid "Delete the character to the left of the cursor"
msgstr ""
#: global.c:203
#: global.c:204
msgid "Insert a tab character"
msgstr ""
#: global.c:204
#: global.c:205
msgid "Insert a carriage return at the cursor position"
msgstr ""
#: global.c:206
#: global.c:207
msgid "Make the current search or replace case (in)sensitive"
msgstr ""
#: global.c:207
#: global.c:208
msgid "Cancel the current function"
msgstr ""
#: global.c:211 global.c:323 global.c:408
#: global.c:212 global.c:328
msgid "Get Help"
msgstr ""
#: global.c:214 global.c:222
#: global.c:215 global.c:223
msgid "WriteOut"
msgstr ""
#: global.c:218 global.c:397
#: global.c:219 global.c:402
msgid "Exit"
msgstr ""
#: global.c:226 global.c:319 global.c:341 global.c:361
#: global.c:227 global.c:324 global.c:346 global.c:366
msgid "Goto Line"
msgstr ""
#: global.c:231 global.c:310
#: global.c:232 global.c:315
msgid "Justify"
msgstr ""
#: global.c:235 global.c:306 global.c:337
#: global.c:236 global.c:311 global.c:342
msgid "Replace"
msgstr ""
#: global.c:239
#: global.c:240
msgid "Read File"
msgstr ""
#: global.c:243
#: global.c:244
msgid "Where Is"
msgstr ""
#: global.c:247 global.c:389
#: global.c:248 global.c:394
msgid "Prev Page"
msgstr ""
#: global.c:251 global.c:393
#: global.c:252 global.c:398
msgid "Next Page"
msgstr ""
#: global.c:255
#: global.c:256
msgid "Cut Text"
msgstr ""
#: global.c:258
#: global.c:260
msgid "UnJustify"
msgstr ""
#: global.c:263
msgid "UnCut Txt"
msgstr ""
#: global.c:262
#: global.c:267
msgid "Cur Pos"
msgstr ""
#: global.c:266
#: global.c:271
msgid "To Spell"
msgstr ""
#: global.c:270
#: global.c:275
msgid "Up"
msgstr ""
#: global.c:273
#: global.c:278
msgid "Down"
msgstr ""
#: global.c:276
#: global.c:281
msgid "Forward"
msgstr ""
#: global.c:279
#: global.c:284
msgid "Back"
msgstr ""
#: global.c:282
#: global.c:287
msgid "Home"
msgstr ""
#: global.c:285
#: global.c:290
msgid "End"
msgstr ""
#: global.c:288
#: global.c:293
msgid "Refresh"
msgstr ""
#: global.c:291
#: global.c:296
msgid "Mark Text"
msgstr ""
#: global.c:294
#: global.c:299
msgid "Delete"
msgstr ""
#: global.c:298
#: global.c:303
msgid "Backspace"
msgstr ""
#: global.c:302
#: global.c:307
msgid "Tab"
msgstr ""
#: global.c:314
#: global.c:319
msgid "Enter"
msgstr ""
#: global.c:327 global.c:348 global.c:369 global.c:379
#: global.c:332 global.c:353 global.c:374 global.c:384
msgid "First Line"
msgstr ""
#: global.c:330 global.c:351 global.c:372 global.c:382
#: global.c:335 global.c:356 global.c:377 global.c:387
msgid "Last Line"
msgstr ""
#: global.c:333 global.c:354
#: global.c:338 global.c:359
msgid "Case Sens"
msgstr ""
#: global.c:344 global.c:364 global.c:375 global.c:385 global.c:401
#: global.c:405 global.c:411 winio.c:1020
#: global.c:349 global.c:369 global.c:380 global.c:390 global.c:406
#: global.c:410 global.c:413 winio.c:1028
msgid "Cancel"
msgstr ""
#: global.c:357
#: global.c:362
msgid "No Replace"
msgstr ""
#: nano.c:131
#: nano.c:137
#, c-format
msgid ""
"\n"
"Buffer written to 'nano.save'\n"
"Buffer written to %s\n"
msgstr ""
#: nano.c:138
#: nano.c:139
msgid ""
"\n"
"No .save file written (symlink encountered?)\n"
msgstr ""
#: nano.c:146
msgid "Key illegal in VIEW mode"
msgstr ""
#: nano.c:175
#: nano.c:183
msgid ""
" nano help text\n"
"\n"
@@ -423,306 +438,320 @@ msgid ""
"\n"
msgstr ""
#: nano.c:278
#: nano.c:286
msgid "free_node(): free'd a node, YAY!\n"
msgstr ""
#: nano.c:283
#: nano.c:291
msgid "free_node(): free'd last node.\n"
msgstr ""
#: nano.c:335
#: nano.c:343
msgid ""
"Usage: nano [GNU long option] [option] +LINE <file>\n"
"\n"
msgstr ""
#: nano.c:336
#: nano.c:344
msgid "Option\t\tLong option\t\tMeaning\n"
msgstr ""
#: nano.c:338
#: nano.c:346
msgid " -T \t\t--tabsize=[num]\t\tSet width of a tab to num\n"
msgstr ""
#: nano.c:341
#: nano.c:349
msgid " -R\t\t--regexp\t\tUse regular expressions for search\n"
msgstr ""
#: nano.c:345
#: nano.c:353
msgid " -V \t\t--version\t\tPrint version information and exit\n"
msgstr ""
#: nano.c:347
#: nano.c:355
msgid " -c \t\t--const\t\t\tConstantly show cursor position\n"
msgstr ""
#: nano.c:349
#: nano.c:357
msgid " -h \t\t--help\t\t\tShow this message\n"
msgstr ""
#: nano.c:352
#: nano.c:360
msgid " -k \t\t--cut\t\t\tLet ^K cut from cursor to end of line\n"
msgstr ""
#: nano.c:355
#: nano.c:363
msgid " -i \t\t--autoindent\t\tAutomatically indent new lines\n"
msgstr ""
#: nano.c:357
#: nano.c:365
msgid " -l \t\t--nofollow\t\tDon't follow symbolic links, overwrite\n"
msgstr ""
#: nano.c:360
#: nano.c:368
msgid " -m \t\t--mouse\t\t\tEnable mouse\n"
msgstr ""
#: nano.c:365
#: nano.c:373
msgid ""
" -r [#cols] \t--fill=[#cols]\t\tSet fill cols to (wrap lines at) #cols\n"
msgstr ""
#: nano.c:367
#: nano.c:375
msgid " -p\t \t--pico\t\t\tEmulate Pico as closely as possible\n"
msgstr ""
#: nano.c:369
#: nano.c:377
msgid " -s [prog] \t--speller=[prog]\tEnable alternate speller\n"
msgstr ""
#: nano.c:371
#: nano.c:379
msgid " -t \t\t--tempfile\t\tAuto save on exit, don't prompt\n"
msgstr ""
#: nano.c:373
#: nano.c:381
msgid " -v \t\t--view\t\t\tView (read only) mode\n"
msgstr ""
#: nano.c:375
#: nano.c:383
msgid " -w \t\t--nowrap\t\tDon't wrap long lines\n"
msgstr ""
#: nano.c:377
#: nano.c:385
msgid " -x \t\t--nohelp\t\tDon't show help window\n"
msgstr ""
#: nano.c:379
#: nano.c:387
msgid " -z \t\t--suspend\t\tEnable suspend\n"
msgstr ""
#: nano.c:381
#: nano.c:389
msgid " +LINE\t\t\t\t\tStart at line number LINE\n"
msgstr ""
#: nano.c:383
#: nano.c:391
msgid ""
"Usage: nano [option] +LINE <file>\n"
"\n"
msgstr ""
#: nano.c:384
#: nano.c:392
msgid "Option\t\tMeaning\n"
msgstr ""
#: nano.c:385
#: nano.c:393
msgid " -T [num]\tSet width of a tab to num\n"
msgstr ""
#: nano.c:386
#: nano.c:394
msgid " -R\t\tUse regular expressions for search\n"
msgstr ""
#: nano.c:387
#: nano.c:395
msgid " -V \t\tPrint version information and exit\n"
msgstr ""
#: nano.c:388
#: nano.c:396
msgid " -c \t\tConstantly show cursor position\n"
msgstr ""
#: nano.c:389
#: nano.c:397
msgid " -h \t\tShow this message\n"
msgstr ""
#: nano.c:391
#: nano.c:399
msgid " -k \t\tLet ^K cut from cursor to end of line\n"
msgstr ""
#: nano.c:393
#: nano.c:401
msgid " -i \t\tAutomatically indent new lines\n"
msgstr ""
#: nano.c:395
#: nano.c:403
msgid " -l \t\tDon't follow symbolic links, overwrite\n"
msgstr ""
#: nano.c:398
#: nano.c:406
msgid " -m \t\tEnable mouse\n"
msgstr ""
#: nano.c:402
#: nano.c:410
msgid " -r [#cols] \tSet fill cols to (wrap lines at) #cols\n"
msgstr ""
#: nano.c:403
#: nano.c:411
msgid " -s [prog] \tEnable alternate speller\n"
msgstr ""
#: nano.c:404
#: nano.c:412
msgid " -p \t\tEmulate Pico as closely as possible\n"
msgstr ""
#: nano.c:405
#: nano.c:413
msgid " -t \t\tAuto save on exit, don't prompt\n"
msgstr ""
#: nano.c:406
#: nano.c:414
msgid " -v \t\tView (read only) mode\n"
msgstr ""
#: nano.c:407
#: nano.c:415
msgid " -w \t\tDon't wrap long lines\n"
msgstr ""
#: nano.c:408
#: nano.c:416
msgid " -x \t\tDon't show help window\n"
msgstr ""
#: nano.c:409
#: nano.c:417
msgid " -z \t\tEnable suspend\n"
msgstr ""
#: nano.c:410
#: nano.c:418
msgid " +LINE\t\tStart at line number LINE\n"
msgstr ""
#: nano.c:417
#: nano.c:425
#, c-format
msgid " nano version %s by Chris Allegretta (compiled %s, %s)\n"
msgstr ""
#: nano.c:420
msgid " Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org\n"
#: nano.c:428
msgid " Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org"
msgstr ""
#: nano.c:455
#: nano.c:429
msgid ""
"\n"
" Compiled options:"
msgstr ""
#: nano.c:485
msgid "Mark Set"
msgstr ""
#: nano.c:460
#: nano.c:490
msgid "Mark UNset"
msgstr ""
#: nano.c:887
#, c-format
msgid "check_wrap called with inptr->data=\"%s\"\n"
msgstr ""
#: nano.c:938
#, c-format
msgid "check_wrap called with inptr->data=\"%s\"\n"
msgstr ""
#: nano.c:989
#, c-format
msgid "current->data now = \"%s\"\n"
msgstr ""
#: nano.c:991
#: nano.c:1042
#, c-format
msgid "After, data = \"%s\"\n"
msgstr ""
#: nano.c:1093
#: nano.c:1142
msgid "Edit a replacement"
msgstr ""
#: nano.c:1304
#: nano.c:1366
#, c-format
msgid "Could not create a temporary filename: %s"
msgstr ""
#: nano.c:1320
#: nano.c:1372
msgid "Spell checking failed: unable to write temp file!"
msgstr ""
#: nano.c:1384
msgid "Finished checking spelling"
msgstr ""
#: nano.c:1322
#: nano.c:1386
msgid "Spell checking failed"
msgstr ""
#: nano.c:1342
#: nano.c:1406
msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? "
msgstr ""
#: nano.c:1505
#: nano.c:1502
msgid "Received SIGHUP"
msgstr ""
#: nano.c:1568
msgid "Cannot resize top win"
msgstr ""
#: nano.c:1507
#: nano.c:1570
msgid "Cannot move top win"
msgstr ""
#: nano.c:1509
#: nano.c:1572
msgid "Cannot resize edit win"
msgstr ""
#: nano.c:1511
#: nano.c:1574
msgid "Cannot move edit win"
msgstr ""
#: nano.c:1513
#: nano.c:1576
msgid "Cannot resize bottom win"
msgstr ""
#: nano.c:1515
#: nano.c:1578
msgid "Cannot move bottom win"
msgstr ""
#: nano.c:1786
msgid "Justify Complete"
#: nano.c:1866
msgid "Can now UnJustify!"
msgstr ""
#: nano.c:1854
#: nano.c:1961
#, c-format
msgid "%s enable/disable"
msgstr ""
#: nano.c:1866
#: nano.c:1973
msgid "enabled"
msgstr ""
#: nano.c:1867
#: nano.c:1974
msgid "disabled"
msgstr ""
#: nano.c:2097
#: nano.c:2204
msgid "Main: set up windows\n"
msgstr ""
#: nano.c:2110
#: nano.c:2217
msgid "Main: bottom win\n"
msgstr ""
#: nano.c:2116
#: nano.c:2223
msgid "Main: open file\n"
msgstr ""
#: nano.c:2153
#: nano.c:2260
#, c-format
msgid "I got Alt-O-%c! (%d)\n"
msgstr ""
#: nano.c:2175
#: nano.c:2282
#, c-format
msgid "I got Alt-[-1-%c! (%d)\n"
msgstr ""
#: nano.c:2208
#: nano.c:2315
#, c-format
msgid "I got Alt-[-2-%c! (%d)\n"
msgstr ""
#: nano.c:2256
#: nano.c:2363
#, c-format
msgid "I got Alt-[-%c! (%d)\n"
msgstr ""
#: nano.c:2282
#: nano.c:2389
#, c-format
msgid "I got Alt-%c! (%d)\n"
msgstr ""
@@ -751,7 +780,7 @@ msgstr ""
msgid " (to replace)"
msgstr ""
#: search.c:136 search.c:318
#: search.c:136 search.c:321
msgid "Search Cancelled"
msgstr ""
@@ -764,120 +793,152 @@ msgstr ""
msgid "Search Wrapped"
msgstr ""
#: search.c:340
#: search.c:343
#, c-format
msgid "Replaced %d occurences"
msgstr ""
#: search.c:342
#: search.c:345
msgid "Replaced 1 occurence"
msgstr ""
#: search.c:479 search.c:575 search.c:591
#: search.c:504 search.c:608 search.c:624
msgid "Replace Cancelled"
msgstr ""
#: search.c:525
#: search.c:554
msgid "Replace this instance?"
msgstr ""
#: search.c:533
#: search.c:566
msgid "Replace failed: unknown subexpression!"
msgstr ""
#: search.c:616
#: search.c:649
#, c-format
msgid "Replace with [%s]"
msgstr ""
#: search.c:620 search.c:624
#: search.c:653 search.c:657
msgid "Replace with"
msgstr ""
#. Ask for it
#: search.c:659
#: search.c:692
msgid "Enter line number"
msgstr ""
#: search.c:661
#: search.c:694
msgid "Aborted"
msgstr ""
#: search.c:681
#: search.c:714
msgid "Come on, be reasonable"
msgstr ""
#: search.c:686
#: search.c:719
#, c-format
msgid "Only %d lines available, skipping to last line"
msgstr ""
#: winio.c:120
#: winio.c:121
#, c-format
msgid "actual_x_from_start for xplus=%d returned %d\n"
msgstr ""
#: winio.c:433
#: winio.c:441
#, c-format
msgid "input '%c' (%d)\n"
msgstr ""
#: winio.c:471
#: winio.c:479
msgid "New Buffer"
msgstr ""
#: winio.c:474
#: winio.c:482
msgid " File: ..."
msgstr ""
#: winio.c:482
#: winio.c:490
msgid "Modified"
msgstr ""
#: winio.c:934
#: winio.c:942
#, c-format
msgid "Moved to (%d, %d) in edit buffer\n"
msgstr ""
#: winio.c:945
#: winio.c:953
#, c-format
msgid "current->data = \"%s\"\n"
msgstr ""
#: winio.c:990
#: winio.c:998
#, c-format
msgid "I got \"%s\"\n"
msgstr ""
#: winio.c:1015
#: winio.c:1023
msgid "Yes"
msgstr ""
#: winio.c:1017
#: winio.c:1025
msgid "All"
msgstr ""
#: winio.c:1019
#: winio.c:1027
msgid "No"
msgstr ""
#: winio.c:1156
#: winio.c:1164
#, c-format
msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
msgstr ""
#: winio.c:1160
#: winio.c:1168
msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)"
msgstr ""
#: winio.c:1288
#: winio.c:1296
msgid "Dumping file buffer to stderr...\n"
msgstr ""
#: winio.c:1290
#: winio.c:1298
msgid "Dumping cutbuffer to stderr...\n"
msgstr ""
#: winio.c:1292
#: winio.c:1300
msgid "Dumping a buffer to stderr...\n"
msgstr ""
#: winio.c:1341
msgid "The nano text editor"
msgstr ""
#: winio.c:1342
msgid "version "
msgstr ""
#: winio.c:1343
msgid "Brought to you by:"
msgstr ""
#: winio.c:1344
msgid "Special thanks to:"
msgstr ""
#: winio.c:1345
msgid "The Free Software Foundation"
msgstr ""
#: winio.c:1346
msgid "Pavel Curtis, Zeyd Ben-Halim and Eric S. Raymond for ncurses"
msgstr ""
#: winio.c:1347
msgid "and anyone else we forgot..."
msgstr ""
#: winio.c:1348
msgid "Thank you for using nano!\n"
msgstr ""

View File

@@ -1 +0,0 @@
timestamp

37
proto.h
View File

@@ -29,7 +29,7 @@
#include "nano.h"
extern int center_x, center_y, editwinrows;
extern int editwinrows;
extern int current_x, current_y, posible_max, totlines;
extern int placewewant;
extern int mark_beginx, samelinewrap;
@@ -38,7 +38,7 @@ extern int fill, flags,tabsize;
extern int search_last_line;
extern WINDOW *edit, *topwin, *bottomwin;
extern char filename[PATH_MAX];
extern char *filename;
extern char *answer;
extern char *hblank, *help_text;
extern char *last_search;
@@ -51,6 +51,9 @@ 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], replace_list_2[REPLACE_LIST_LEN];
#ifndef DISABLE_BROWSER
extern shortcut browser_list[BROWSER_LIST_LEN];
#endif
#ifdef HAVE_REGEX_H
extern int use_regexp, regexp_compiled;
@@ -78,7 +81,7 @@ int do_uncut_text(void);
int no_help(void);
int renumber_all(void);
int open_file(char *filename, int insert, int quiet);
int do_writeout(int exiting);
int do_writeout(char *path, int exiting);
int do_gotoline(long defline);
int do_replace_loop(char *prevanswer, filestruct *begin, int *beginx,
int wholewords, int *i);
@@ -88,9 +91,11 @@ 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);
char *input_tab(char *buf, int place, int *lastWasTab, int *newplace);
char *real_dir_from_tilde(char *buf);
void shortcut_init(int unjustify);
void lowercase(char *src);
void blank_bottombars(void);
void check_wrap(filestruct * inptr, char ch);
@@ -107,16 +112,18 @@ void check_statblank(void);
void update_line(filestruct * fileptr, int index);
void fix_editbot(void);
void statusbar(char *msg, ...);
void titlebar(void);
void blank_statusbar(void);
void titlebar(char *path);
void previous_line(void);
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 *mallocstrcpy(char *dest, char *src);
void wrap_reset(void);
void display_main_list(void);
void nano_small_msg(void);
void nano_disable_msg(void);
void do_early_abort(void);
void *nmalloc(size_t howmuch);
void *nrealloc(void *ptr, size_t howmuch);
@@ -129,6 +136,13 @@ void page_up_center(void);
void blank_edit(void);
void search_init_globals(void);
void replace_abort(void);
void add_to_cutbuffer(filestruct * inptr);
void do_replace_highlight(int highlight_flag, char *word);
void nano_disabled_msg(void);
void window_init(void);
#ifdef NANO_EXTRA
void do_credits(void);
#endif
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);
@@ -138,6 +152,15 @@ int do_home(void), do_end(void), total_refresh(void), do_mark(void);
int do_delete(void), do_backspace(void), do_tab(void), do_justify(void);
int do_first_line(void), do_last_line(void);
int do_replace(void), do_help(void), do_enter_void(void);
int keypad_on(WINDOW * win, int new);
#ifndef DISABLE_BROWSER
char *do_browser(char *path);
struct stat filestat(const char *path);
char *do_browse_from(char *inpath);
#endif
RETSIGTYPE main_loop (int junk);
filestruct *copy_node(filestruct * src);
filestruct *copy_filestruct(filestruct * src);

View File

@@ -202,11 +202,11 @@ filestruct *findnextstr(int quiet, filestruct * begin, int beginx,
{
filestruct *fileptr;
char *searchstr, *found = NULL, *tmp;
int past_editbot = 0, current_x_find = current_x;
int past_editbot = 0, current_x_find;
fileptr = current;
current_x_find++;
current_x_find = current_x + 1;
/* Are we searching the last line? (i.e. the line where search started) */
if ((fileptr == begin) && (current_x_find < beginx))
@@ -251,18 +251,21 @@ filestruct *findnextstr(int quiet, filestruct * begin, int beginx,
}
/* We found an instance */
current = fileptr;
current_x = 0;
current_x_find = 0;
for (tmp = fileptr->data; tmp != found; tmp++)
current_x++;
current_x_find++;
/* Ensure we haven't wrap around again! */
if ((search_last_line) && (current_x >= beginx)) {
if ((search_last_line) && (current_x_find >= beginx)) {
if (!quiet)
not_found_msg(needle);
return NULL;
}
/* Set globals now that we are sure we found something */
current = fileptr;
current_x = current_x_find;
if (past_editbot)
edit_update(fileptr, CENTER);
else
@@ -465,6 +468,7 @@ char *replace_line(void)
return copy;
}
/* step through each replace word and prompt user before replacing word */
int do_replace_loop(char *prevanswer, filestruct *begin, int *beginx,
int wholewords, int *i)
{
@@ -521,9 +525,17 @@ int do_replace_loop(char *prevanswer, filestruct *begin, int *beginx,
}
/* If we're here, we've found the search string */
if (!replaceall)
if (!replaceall) {
curs_set(0);
do_replace_highlight(TRUE, prevanswer);
*i = do_yesno(1, 1, _("Replace this instance?"));
do_replace_highlight(FALSE, prevanswer);
curs_set(1);
}
if (*i > 0 || replaceall) { /* Yes, replace it!!!! */
if (*i == 2)
replaceall = 1;

5992
texinfo.tex Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -123,9 +123,13 @@ void *nrealloc(void *ptr, size_t howmuch)
Should be used as dest = mallocstrcpy(dest, src);
*/
void *mallocstrcpy(void *dest, void *src)
void *mallocstrcpy(char *dest, char *src)
{
if (src == dest)
return src;
if (dest != NULL)
free(dest);
@@ -152,8 +156,10 @@ void new_magicline(void)
filebot->next->lineno = filebot->lineno + 1;
filebot = filebot->next;
totlines++;
totsize++;
}
#ifndef DISABLE_TABCOMP
/*
* 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
@@ -253,3 +259,4 @@ int check_wildcard_match(const char *text, const char *pattern)
return TRUE;
}
#endif

325
winio.c
View File

@@ -22,6 +22,7 @@
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "config.h"
#include "proto.h"
#include "nano.h"
@@ -33,6 +34,8 @@
#define _(string) (string)
#endif
/* winio.c statics */
static int statblank = 0; /* Number of keystrokes left after
we call statubar() before we
actually blank the statusbar */
@@ -247,8 +250,11 @@ 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;
int x_left = 0, inputlen, tabbed = 0;
char *inputbuf;
#ifndef DISABLE_TABCOMP
int shift = 0;
#endif
inputbuf = nmalloc(strlen(def) + 1);
inputbuf[0] = 0;
@@ -286,13 +292,15 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
case 343:
ungetch(13); /* Enter on iris-ansi $TERM, sometimes */
break;
/* Stuff we want to ignore */
#ifdef PDCURSES
/* Stuff we want to ignore with PDCURSES */
case 541:
case 542:
case 543: /* Right ctrl again */
case 544:
break;
case 545: /* Right alt again */
#endif
break;
case KEY_HOME:
x = x_left;
nanoget_repaint(buf, inputbuf, x);
@@ -340,15 +348,19 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
x--;
nanoget_repaint(buf, inputbuf, x);
break;
#ifndef DISABLE_TABCOMP
case NANO_CONTROL_I:
if (allowtabs) {
shift = 0;
inputbuf = input_tab(inputbuf, (x - x_left),
&tabbed, &shift);
x += shift;
if (x - x_left > strlen(inputbuf))
x = strlen(inputbuf) + x_left;
nanoget_repaint(buf, inputbuf, x);
}
break;
#endif
case KEY_LEFT:
if (x > strlen(buf))
x--;
@@ -455,9 +467,13 @@ void horizbar(WINDOW * win, int y)
wattroff(win, A_REVERSE);
}
void titlebar(void)
void titlebar(char *path)
{
int namelen, space;
char *what = path;
if (path == NULL)
what = filename;
horizbar(topwin, 0);
wattron(topwin, A_REVERSE);
@@ -465,17 +481,23 @@ void titlebar(void)
space = COLS - strlen(VERMSG) - strlen(VERSION) - 21;
namelen = strlen(filename);
namelen = strlen(what);
if (!strcmp(filename, ""))
mvwaddstr(topwin, 0, center_x - 6, _("New Buffer"));
if (!strcmp(what, ""))
mvwaddstr(topwin, 0, COLS / 2 - 6, _("New Buffer"));
else {
if (namelen > space) {
waddstr(topwin, _(" File: ..."));
waddstr(topwin, &filename[namelen - space]);
if (path == NULL)
waddstr(topwin, _(" File: ..."));
else
waddstr(topwin, _(" DIR: ..."));
waddstr(topwin, &what[namelen - space]);
} else {
mvwaddstr(topwin, 0, center_x - (namelen / 2 + 1), "File: ");
waddstr(topwin, filename);
if (path == NULL)
mvwaddstr(topwin, 0, COLS / 2 - (namelen / 2 + 1), "File: ");
else
mvwaddstr(topwin, 0, COLS / 2 - (namelen / 2 + 1), " DIR: ");
waddstr(topwin, what);
}
}
if (ISSET(MODIFIED))
@@ -544,7 +566,7 @@ void set_modified(void)
{
if (!ISSET(MODIFIED)) {
SET(MODIFIED);
titlebar();
titlebar(NULL);
wrefresh(topwin);
}
}
@@ -753,7 +775,7 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
#endif
/* Just paint the string (no mark on this line) */
mvwaddnstr(edit, yval, 0, &fileptr->data[start],
get_page_end_virtual(this_page) - start);
get_page_end_virtual(this_page) - start + 1);
}
/*
@@ -824,7 +846,7 @@ void update_line(filestruct * fileptr, int index)
edit_add(filetmp, line, col, virt_cur_x, virt_mark_beginx, page);
mvwaddch(edit, line, 0, '$');
if (strlenpt(fileptr->data) > get_page_end_virtual(page))
if (strlenpt(fileptr->data) > get_page_end_virtual(page) + 1)
mvwaddch(edit, line, COLS - 1, '$');
} else {
/* It's not the current line means that it's at x=0 and page=1 */
@@ -1001,7 +1023,18 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
{
va_list ap;
char foo[133];
int kbinput, ok = -1;
int kbinput, ok = -1, i;
char *yesstr; /* String of yes characters accepted */
char *nostr; /* Same for no */
char *allstr; /* And all, surprise! */
char shortstr[5]; /* Temp string for above */
/* Yes, no and all are strings of any length. Each string consists of
all characters accepted as a valid character for that value.
The first value will be the one displayed in the shortcuts. */
yesstr = _("Yy");
nostr = _("Nn");
allstr = _("Aa");
/* Write the bottom of the screen */
clear_bottomwin();
@@ -1012,11 +1045,19 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
/* Remove gettext call for keybindings until we clear the thing up */
if (!ISSET(NO_HELP)) {
wmove(bottomwin, 1, 0);
onekey(" Y", _("Yes"));
if (all)
onekey(" A", _("All"));
snprintf(shortstr, 3, " %c", yesstr[0]);
onekey(shortstr, _("Yes"));
if (all) {
snprintf(shortstr, 3, " %c", allstr[0]);
onekey(shortstr, _("All"));
}
wmove(bottomwin, 2, 0);
onekey(" N", _("No"));
snprintf(shortstr, 3, " %c", nostr[0]);
onekey(shortstr, _("No"));
onekey("^C", _("Cancel"));
}
va_start(ap, msg);
@@ -1034,22 +1075,34 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
kbinput = wgetch(edit);
switch (kbinput) {
case 'Y':
case 'y':
ok = 1;
break;
case 'N':
case 'n':
ok = 0;
break;
case 'A':
case 'a':
if (all)
ok = 2;
break;
case NANO_CONTROL_C:
ok = -2;
break;
default:
/* Look for the kbinput in the yes, no and (optinally) all str */
for (i = 0; yesstr[i] != 0 && yesstr[i] != kbinput; i++)
;
if (yesstr[i] != 0) {
ok = 1;
break;
}
for (i = 0; nostr[i] != 0 && nostr[i] != kbinput; i++)
;
if (nostr[i] != 0) {
ok = 0;
break;
}
if (all) {
for (i = 0; allstr[i] != 0 && allstr[i] != kbinput; i++)
;
if (allstr[i] != 0) {
ok = 2;
break;
}
}
}
}
@@ -1072,7 +1125,7 @@ void statusbar(char *msg, ...)
vsnprintf(foo, 132, msg, ap);
va_end(ap);
start_x = center_x - strlen(foo) / 2 - 1;
start_x = COLS / 2 - strlen(foo) / 2 - 1;
/* Blank out line */
blank_statusbar();
@@ -1111,7 +1164,7 @@ int total_refresh(void)
clearok(topwin, FALSE);
clearok(bottomwin, FALSE);
edit_refresh();
titlebar();
titlebar(NULL);
return 1;
}
@@ -1124,33 +1177,26 @@ void previous_line(void)
int do_cursorpos(void)
{
filestruct *fileptr;
float linepct, bytepct;
int i, tot = 0;
float linepct = 0.0, bytepct = 0.0;
int i = 0;
if (current == NULL || fileage == NULL)
return 0;
for (fileptr = fileage; fileptr != current && fileptr != NULL;
fileptr = fileptr->next)
tot += strlen(fileptr->data) + 1;
i += strlen(fileptr->data) + 1;
if (fileptr == NULL)
return -1;
i = tot + current_x;;
for (fileptr = current->next; fileptr != NULL; fileptr = fileptr->next)
tot += strlen(fileptr->data) + 1;
i += current_x;
if (totlines > 0)
linepct = 100 * current->lineno / totlines;
else
linepct = 0;
if (totsize > 0)
bytepct = 100 * i / totsize;
else
bytepct = 0;
#ifdef DEBUG
fprintf(stderr, _("do_cursorpos: linepct = %f, bytepct = %f\n"),
@@ -1167,25 +1213,26 @@ int do_cursorpos(void)
But hey, it's better than nothing, and it's dynamic! */
int do_help(void)
{
#ifndef NANO_SMALL
#ifndef DISABLE_HELP
char *ptr = help_text, *end;
int i, j, row = 0, page = 1, kbinput = 0, no_more = 0;
int i, j, row = 0, page = 1, kbinput = 0, no_more = 0, kp;
int no_help_flag = 0;
blank_edit();
curs_set(0);
blank_statusbar();
kp = keypad_on(edit, 1);
if (ISSET(NO_HELP)) {
/* Well if we're going to do this, we should at least
do it the right way */
no_help_flag = 1;
delwin(bottomwin);
bottomwin = newwin(3, COLS, LINES - 3, 0);
keypad(bottomwin, TRUE);
editwinrows -= no_help();
UNSET(NO_HELP);
window_init();
bottombars(help_list, HELP_LIST_LEN);
} else
bottombars(help_list, HELP_LIST_LEN);
@@ -1257,22 +1304,23 @@ int do_help(void)
no_more = 1;
continue;
}
} while ((kbinput = wgetch(edit)) != NANO_EXIT_KEY);
} while ((kbinput = wgetch(edit)) != NANO_EXIT_KEY &&
kbinput != NANO_EXIT_FKEY);
if (no_help_flag) {
werase(bottomwin);
blank_bottombars();
wrefresh(bottomwin);
delwin(bottomwin);
SET(NO_HELP);
bottomwin = newwin(3 - no_help(), COLS, LINES - 3 + no_help(), 0);
keypad(bottomwin, TRUE);
editwinrows += no_help();
} else
display_main_list();
window_init();
}
display_main_list();
curs_set(1);
edit_refresh();
#else
nano_small_msg();
kp = keypad_on(edit, kp);
#elif defined(DISABLE_HELP)
nano_disabled_msg();
#endif
return 1;
@@ -1322,3 +1370,156 @@ void fix_editbot(void)
for (i = 0; (i <= editwinrows - 1) && (editbot->next != NULL)
&& (editbot != filebot); i++, editbot = editbot->next);
}
/* highlight the current word being replaced or spell checked */
void do_replace_highlight(int highlight_flag, char *word)
{
char *highlight_word = NULL;
int x, y;
highlight_word = mallocstrcpy(highlight_word, &current->data[current_x]);
highlight_word[strlen(word)] = '\0';
/* adjust output when word extends beyond screen*/
x = xplustabs();
y = get_page_end_virtual(get_page_from_virtual(x)) + 1;
if ((COLS - (y - x) + strlen(word)) > COLS) {
highlight_word[y - x - 1] = '$';
highlight_word[y - x] = '\0';
}
/* OK display the output */
reset_cursor();
if (highlight_flag)
wattron(edit, A_REVERSE);
waddstr(edit, highlight_word);
if (highlight_flag)
wattroff(edit, A_REVERSE);
free(highlight_word);
}
#ifdef NANO_EXTRA
#define CREDIT_LEN 45
void do_credits(void)
{
int i, j = 0, k, place = 0, start_x;
char *what;
char *nanotext = _("The nano text editor");
char *version = _("version ");
char *brought = _("Brought to you by:");
char *specialthx = _("Special thanks to:");
char *fsf = _("The Free Software Foundation");
char *ncurses = _("Pavel Curtis, Zeyd Ben-Halim and Eric S. Raymond for ncurses");
char *anyonelse = _("and anyone else we forgot...");
char *thankyou = _("Thank you for using nano!\n");
char *credits[CREDIT_LEN] = {nanotext,
version,
VERSION,
"",
brought,
"Chris Allegretta",
"Jordi Mallach",
"Adam Rogoyski",
"Rob Siemborski",
"Rocco Corsi",
"Ken Tyler",
"Sven Guckes",
"Florian König",
"Pauli Virtanen",
"Daniele Medri",
"Clement Laforet",
"Tedi Heriyanto",
"Bill Soudan",
"Christian Weisgerber",
"Erik Andersen",
"Big Gaute",
"Joshua Jensen",
"",
specialthx,
"Plattsburgh State University",
"Benet Laboratories",
"Amy Allegretta",
"Linda Young",
"Jeremy Robichaud",
"Richard Kolb II",
fsf,
"Linus Torvalds",
ncurses,
anyonelse,
thankyou,
"", "", "", "",
"(c) 2000 Chris Allegretta",
"", "", "", "",
"www.nano-editor.org"
};
curs_set(0);
nodelay(edit, TRUE);
blank_bottombars();
mvwaddstr(topwin, 0, 0, hblank);
blank_edit();
wrefresh(edit);
wrefresh(bottomwin);
wrefresh(topwin);
while (wgetch(edit) == ERR) {
for (k = 0; k <= 1; k++) {
blank_edit();
for (i = editwinrows / 2 - 1; i >= (editwinrows / 2 - 1 - j); i--) {
mvwaddstr(edit, i * 2 - k, 0, hblank);
if (place - (editwinrows / 2 - 1 - i) < CREDIT_LEN)
what = credits[place - (editwinrows / 2 - 1 - i)];
else
what = "";
start_x = COLS / 2 - strlen(what) / 2 - 1;
mvwaddstr(edit, i * 2 - k, start_x, what);
}
usleep(700000);
wrefresh(edit);
}
if (j < editwinrows / 2 - 1)
j++;
place++;
if (place >= CREDIT_LEN + editwinrows / 2)
break;
}
nodelay(edit, FALSE);
curs_set(1);
display_main_list();
total_refresh();
}
#endif
int keypad_on(WINDOW * win, int new)
{
/* This is taken right from aumix. Don't sue me */
#ifdef HAVE_USEKEYPAD
int old;
old = win->_use_keypad;
keypad(win, new);
return old;
#else
keypad(win, new);
return 1;
#endif /* HAVE_USEKEYPAD */
}