Compare commits

...

386 Commits

Author SHA1 Message Date
Chris Allegretta
566635ec16 GNU nano 2.1.5 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4319 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-30 21:40:33 +00:00
Chris Allegretta
95a9de0d3f Move the wordbounds check down so it will happen if either --enable-all or --enable-color
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4318 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-30 21:32:55 +00:00
Chris Allegretta
1d77823f79 * global.c, help.c, browser.c, files.c, proto.h: Fix several compipation and programmatic
issues with --disable-help, especially that do-writeout was treating ^G the same as ^M.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4317 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-30 21:00:00 +00:00
Chris Allegretta
874969be81 * nano-regress: New perl script to check for some of the more obvious issues with compilation
issues with certain configure options.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4316 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-30 20:33:32 +00:00
Chris Allegretta
6b83e5290c 2008-08-29 Chris Allegretta <chrisa@asty.org>
* configure.ac, color.c, rcfile.c, utils.c: 1st attempt at supporting systems which don't support
          GNU-style word boundaries.  New function fixbounds() to translate from GNU-style to
          BSD-style, autoconf option GNU_WORDBOUNDS.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4315 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-30 05:16:20 +00:00
Chris Allegretta
faeeb5bd7e 2008-08-28 Chris Allegretta <chrisa@asty.org>
* configure.ac, rcfile.c:  Add support for an alternate rcfilename at configure time.  Maybe this
          should become a command line option some day, but I don't see the need currently.  Start of   
          fix for Savannah bug #24128: Add nanorc support to win32 platform.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4314 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-28 06:13:05 +00:00
Chris Allegretta
dc7136a082 * text.c (do_enter): Fix issue when compiled with --enable-debug, fixes Savannah bug 24092.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4309 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-21 04:24:25 +00:00
Chris Allegretta
77bf1b5197 2008-08-21 Chris Allegretta <chrisa@asty.org>
* text.c: Change error messages where we may possibly get into a bad state and urge
          the user to save when this happens.  Originally by Benno Schulenberg <bensberg@justemail.net>



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4308 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-21 04:21:06 +00:00
Chris Allegretta
90ad8e20b9 2008-08-08 Magnus Granberg <zorry@ume.nu> / Adam Conrad <?>
* files.c: (write_file): Add needed flags to open() calls when writing out files.  Fixes Savannah bug
          #23827: Compilation fails with -D_FORTIFY_SOURCE=2



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4306 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-17 16:25:40 +00:00
Chris Allegretta
2cc58882f6 * files.c (write_file): Check exit code of fclose(), since in certain out of space conditions the OS will
happily report successful fwrite()s until you try and close the file.  Fix for Savannah bug
	  #24000: no free space on partition - nano claims successful write - file empty 



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4304 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-16 23:54:15 +00:00
Chris Allegretta
93f2ea1194 Back to svn.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4303 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-09 19:50:34 +00:00
Chris Allegretta
d2780eca94 GNU nano 2.1.4 release.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4301 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-09 10:25:22 +00:00
Chris Allegretta
80ea9c5de9 * text.c (add_undo): Fix check for multi-line cut check skips adding other new legit events.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4300 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-09 10:08:33 +00:00
Chris Allegretta
b08b38680d Re-add the skip_backup label since we do still need it in one case.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4299 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-09 09:31:33 +00:00
Chris Allegretta
5c27d723c9 * text.c (do_redo): Fix improperly restoring the text when redoing a line split.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4298 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-09 09:28:07 +00:00
Chris Allegretta
447f1b4b75 * files.c: Do not go on and attempt to write the main file if writing the backup file failed,
related to Savannah bug 24000.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4297 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-09 03:39:10 +00:00
Chris Allegretta
6f681c1be2 * text.c: Reset openfile-> to OTHER after an undo or redo so we don't mistakenly
mistakenly think this is an update when it's really an add.  Also
          Fix an extra ; after an if statement which makes nano try to free a struct which
          may be NULL 



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4296 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-08 03:02:03 +00:00
Chris Allegretta
a50d0e35f7 Back to SVN version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4295 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-05 02:38:40 +00:00
Chris Allegretta
599c559b3c GNU nano 2.1.3 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4293 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-05 01:35:42 +00:00
Chris Allegretta
ea577874ef - Add redo of an insert
- Fix bug in fsfromlineno
- Tiny cleanups in undo



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4292 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-03 20:19:42 +00:00
Chris Allegretta
14c8620e0b - Change add_undo and current_undo to only take action arg, as openfilestruct arg is always openfile
- Add ability to undo a file/cmd insert, needed to add undoable flag to read_file and open_buffer as a result



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4291 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-03 04:48:05 +00:00
Chris Allegretta
3c1131a5b3 - Add very basic undo for text replace.
- Fix lots of warnings whe using -Wall
- Fix some comments



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4290 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-02 22:31:01 +00:00
Chris Allegretta
015c74093a Allow current undo code to compile with NANO_TINY
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4289 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-02 14:39:42 +00:00
Chris Allegretta
d31ddb789f Allow basic multi-^K cuts to be redone properly. Code getting uglier by the second.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4288 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-01 07:29:06 +00:00
Chris Allegretta
8f76112084 - When undoing a cut, set cutbuffer to NULL after freeing the current one
- When updating a normal consecutive ^K cut, bail from add_undo since it's not an add, and in update_undo free the old cutbuffer before copying it again.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4287 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-01 06:52:15 +00:00
Chris Allegretta
1f37c4514d When redoing a text add, actually copy the beginning of the line back!
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4286 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-01 04:11:57 +00:00
Chris Allegretta
91a1862eed Add undoing argument to do_cut_text as we don't want to be messing around with the undo contents when we're in the
middle of an undo.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4285 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-01 03:50:20 +00:00
Chris Allegretta
e418b694b6 * configure.ac: Add ncursesw dir to include path if lib detected
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4284 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-31 17:01:47 +00:00
Chris Allegretta
12dc8cae80 Commit back some undo/redo rewrites
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4283 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-31 04:24:04 +00:00
Chris Allegretta
0b499d465b Add xflags to undo struct so we can add extra info to the undo process (e.g. backspace vs delete)
Fix redo of a line join.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4282 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-14 07:18:22 +00:00
Chris Allegretta
fa406949ec Allow backspace to be bound to keys in .nanorc
Allow kdel to be rebound
Add note about rebinding kdel to backspace for those using OSX or PuTTY to connect to remote Linux machines in nanorc.sample.in

When undoing text deletes, move current_x to proper location



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4281 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-13 16:44:19 +00:00
Chris Allegretta
70859f4a5b Add ability to rebind the (still unfinished) undo and redo functions in case anyone is interested in testing it out early.
Add to nanorc.5 also.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4280 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-13 01:36:06 +00:00
Chris Allegretta
9fb13fb8f0 2008-07-11 Mike Frysinger <vapier@gentoo.org>
* doc/nanorc.sample.in: Include the updates files in the default sample nanorc.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4279 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-12 02:52:08 +00:00
Chris Allegretta
274142cb10 Clean up some unused variables from old undo implementation.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4278 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-12 02:48:20 +00:00
Chris Allegretta
b8576780bf 2008-07-11 Fabian Groffen <grobian@gentoo.org>
* nano.c: Don't include langinfo.h if not using ENABLE_UTF8
          (Savannah patch 6565)



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4277 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-12 02:32:19 +00:00
Chris Allegretta
a9dea9859d 2008-07-11 Michael Haubenwallner <michael.haubenwallner@salomon.at>
* global.c: include proto.h earlier in file to fix AIX compilation
          (Savannah patch 6559)



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4275 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-12 02:20:16 +00:00
Chris Allegretta
a855fa2acc 2008-07-11 Michael Haubenwallner <michael.haubenwallner@salomon.at>
* global.c: include proto.h earlier in file to fix AIX compilation
          (Savannah patch 6559)



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4274 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-12 02:13:22 +00:00
Chris Allegretta
09b8124859 Savannah bug 23751: Segfault when viewing help using Japanese locale
Fix break_line crashing when using certain locales from Mitsuya Shibata



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4272 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-12 01:54:49 +00:00
Chris Allegretta
07fcc4c973 Add beginning undo feature, since I want to start fixing bugs from savannah and don't want to manager another checking, and the code basically works for some operations.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4271 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-07-10 20:13:04 +00:00
Chris Allegretta
1347f22c95 Fix for 23733: search history broken with nano-2.1.1+
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4270 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-06-29 06:22:31 +00:00
Chris Allegretta
9015f187a5 Back to SVN
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4269 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-06-25 03:42:28 +00:00
Chris Allegretta
2c367bff01 GNU nano 2.1.2 release.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4267 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-06-25 03:35:15 +00:00
Chris Allegretta
47a7ac2313 Add ChangeLog update for previous fix, argh.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4266 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-06-25 03:09:10 +00:00
Chris Allegretta
fb41a0780d Add function check_bad_binding to check ppl arent binding things they shouldn, though currently its only one entry long ('meta-[')
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4265 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-06-25 03:06:11 +00:00
Chris Allegretta
1b6ed07543 Add a fix for bug #23144 that actually works (several bugs in one here)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4264 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-06-03 08:09:05 +00:00
Chris Allegretta
1371fb6326 Tentative fix for bug #23144: using arrow keys in search buffer affects main window
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4263 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-06-03 06:21:31 +00:00
Chris Allegretta
3daeeebf91 Fix for Savannah bug #23442: left/right arrow keys do not work with --enable-tiny
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4262 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-06-03 05:55:04 +00:00
Chris Allegretta
8b6461fc80 files.c,proto.h,text.c: Fix for conflicts with AIX curses variables, from William Jojo <jojowil@hvcc.edu>
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4260 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-05-31 23:09:40 +00:00
Chris Allegretta
506af6fbfb global.c: Fix for compile error when --disable-speller is used (Savannah bug 23227 by Mike Frysinger)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4259 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-05-31 22:49:55 +00:00
Chris Allegretta
f9cf36264c Minor formatting issue and trying to test why my writes are failing to the svn tree in 2.0.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4257 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-05-31 22:33:32 +00:00
Chris Allegretta
e67bf806bd Fix for segfault when window size is too small by Andreas Amann <andreas.amann@tyndall.ie>
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4256 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-05-31 22:23:16 +00:00
Chris Allegretta
ed505f5893 Makefile changes for the included files and updated Changelog
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4255 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-05-31 21:59:53 +00:00
Chris Allegretta
deb34f2779 New syntax highlighting from Mike F. Credits:
awk.nanorc by Donnie Berkholz <dberkholz@gentoo.org>
css.nanorc by Simon Rupf <simon.rupf@int-ag.ch>
xml.nanorc by Josef 'Jupp' Schugt <jupp@rubyforge.org>

Slight tweak by chrisa on the CSS file to make the brightwhite section end on line boundary due to matching too greedily on valid CSS
(see digg's css/111/global.css as an example)



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4254 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-05-31 21:55:21 +00:00
Chris Allegretta
c73d07102b Minor formatting issue in NEWS for 2.1.1
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4253 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-04-02 04:35:39 +00:00
Chris Allegretta
9eb7fc6762 Back to SVN
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4252 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-04-02 04:21:31 +00:00
Chris Allegretta
9ba66065da Add the newa, argh
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4250 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-04-02 04:08:24 +00:00
Chris Allegretta
33a8b4e9ae GNU nano 2.1.1 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4249 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-04-02 04:08:09 +00:00
Chris Allegretta
2cca48380d Fix for bug #22780: build failure with --enable-multibuffer --enable-tiny
Plus make the actual prompt work with --enable-tiny when inserting files.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4248 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-31 06:25:14 +00:00
Chris Allegretta
b04248c548 Benno's latest fixes for help menu translations.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4247 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-20 05:56:46 +00:00
Chris Allegretta
8a59f254ea Wow, I somehow did not run into the "invalid range" error
until after I committed, how does that work?  Anyway, fix
the range error message for debian.nanorc.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4246 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-20 05:52:08 +00:00
Chris Allegretta
cc60c3a767 Add some rc file name debugging
Add debian nanorc example
Fix that previous entries as well as new one need Makefile.am entries



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4245 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-20 05:41:00 +00:00
Chris Allegretta
2ea0b8fa03 Fix default bracket match shortcut
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4244 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-20 04:57:46 +00:00
Chris Allegretta
dcd19c955f Fix for my fix for Mike's fix...dont add menu item refencing nano_exitbrowser_msg
when using DISABLE_BROWSER



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4243 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-20 04:51:26 +00:00
Chris Allegretta
90ee8ee494 Add Mike F's latest patches for 2.1.0 and new syntax configs for tcl, php and gentoo.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4242 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-20 04:45:55 +00:00
Chris Allegretta
690e7df997 Back to svn
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4241 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-19 03:41:48 +00:00
Chris Allegretta
a1941d2a70 Gah, upgrate the translations for 2.1.0
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4240 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-19 03:32:25 +00:00
Chris Allegretta
595d6e0989 Commit for 2.1.0 release.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4238 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-19 03:01:34 +00:00
Chris Allegretta
cc593839aa Fix for 106305: unable to ctrl+c out of save when exiting
Add new YESNO menu for calls to do_yesno_prompt, to enable cancel.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4237 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-19 02:32:48 +00:00
Chris Allegretta
1fb25fd2aa Add Benno's latest translation fixes for shorcut display,
first line message help, and comments to assist translators.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4236 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-18 03:06:27 +00:00
Chris Allegretta
8ded73e758 Add .gitignore files for Mike F, remove .cvsignores which are
not needed.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4235 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-18 02:44:39 +00:00
Chris Allegretta
aa17df0bfd Fix for bug #22632: verbatim input in prompts broken with nano-2.0.99pre1
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4234 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-17 05:50:04 +00:00
Chris Allegretta
d3659f8284 Fixes from Benno Schulenberg.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4233 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-16 23:57:14 +00:00
Chris Allegretta
3b97e76aa5 faq.html: Updates for Alpine, subversion access and Savannah.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4232 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-16 18:25:31 +00:00
Chris Allegretta
cfb45f8214 Fix problems with inserting files using --disable-tabcomp and probably
other --disable type options.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4231 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-16 14:24:28 +00:00
Chris Allegretta
c656e9d737 Fix for bug #22615: nano-2.0.99pre1 fails to build when configured with --disable-justify
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4230 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-16 12:55:41 +00:00
Chris Allegretta
7728f6d36e Hmm. Actually dont want to download the whole tree, update the trunk
checkout instructions.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4229 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-16 02:34:38 +00:00
Chris Allegretta
ee535923da Actually include the updated SVN document, grr.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4228 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-16 02:19:57 +00:00
Chris Allegretta
990567cf86 Update source checkout information now that we are using
svn inetad of cvs.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4227 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-15 23:14:34 +00:00
Chris Allegretta
10f868d33c - Update man page a little bit more
- Change do_prompt and get_prompt_line to pass meta_key and func_key
  so the calling program can DTRT when it calsl get_shortcut.  In
  particular this allows the "new file buffer" toggle on the insert file
  menu to work, and presumably other rebinding stuff should now work also.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4226 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-14 04:08:51 +00:00
Chris Allegretta
d3a1ff6a33 Fix multibuffer mode not showing "Close" string anymore
on buffer open/closer.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4225 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-13 17:48:16 +00:00
Chris Allegretta
0018d8ed6f - Fix tiny mode again after breaking it again
- Resurrect IFSCHELP to get rid of some needless help message stubs
- Add support for rebinding the suspend key
- Fix wrong refresh help message


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4224 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-13 08:23:52 +00:00
Chris Allegretta
eb64314f8b Convert more code to use new backend. Add some more sentinel strings
for enter and backspace keys in case their control key alternates get
rebound.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4223 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-12 04:44:14 +00:00
Chris Allegretta
c0b7872e26 Fix the mouse menus not working with new backend, and
specifically problms in help and browser routines.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4222 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-11 04:52:57 +00:00
Chris Allegretta
17436ce817 Fix bug 79, add sentinels for function keys in case the user
rebinds them to something else.  Fix debug mode crash when the user
typos a menu name.  Add menus for pageup and pagedown bindings and make
rebinding up and down actually do up and down and not page up and page down.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4221 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-11 03:03:53 +00:00
Chris Allegretta
b775c07108 Fix workaround for user assigning a meta sequence to a key which has
a dedicated keyboard equivalent (arrows, home/end, page up/down, etc).
Not fully fixable so document the remaining issue in bug 79.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4220 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-09 05:07:37 +00:00
Chris Allegretta
e34cbdc544 Update BUGS to reflect what got fixed in previous commit.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4219 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-09 02:53:34 +00:00
Chris Allegretta
e347efb9ff More keybinding fixes
- Fix tiny mode compilation problems
- Fix F-keys not working (silly typo)
- Change file browser to use new backend
- global.c - new helper function sc_seq_or, makes logic simpler down in the functions than calling first_sc_for directly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4218 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-09 02:52:40 +00:00
Chris Allegretta
9b422202c1 Fixed bug 77 (make ^space and M-space work)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4217 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-05 17:15:33 +00:00
Chris Allegretta
90218063db New keybindings code and backend. New structs subnfunc for menu functions
and toggles and sc for shortcut keys, old 'shortcut' and 'toggles' structs are
gone.  The current implementation has a bunch of broken stuff (some of which is
documented in BUGS).  Updated nanorc.5 with some mostly complete documentation
on configuring.

Part 2 of commit since I accidentally did it in src/ the first time.  Yeah,
welcome back bonehead.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4216 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-05 07:35:01 +00:00
Chris Allegretta
79a33bb38d New keybindings code and backend. New structs subnfunc for menu functions
and toggles and sc for shortcut keys, old 'shortcut' and 'toggles' structs are
gone.  The current implementation has a bunch of broken stuff (some of which is
documented in BUGS).  Updated nanorc.5 with some mostly complete documentation
on configuring.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-03-05 07:34:01 +00:00
David Lawrence Ramsey
200f0c8c2c resync NEWS with NEWS from the 2.0 branch
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4214 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-20 18:57:41 +00:00
David Lawrence Ramsey
9fff4e1a10 update maintenance information
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4210 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-20 18:41:04 +00:00
David Lawrence Ramsey
512adf60ed cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4209 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-20 17:06:01 +00:00
David Lawrence Ramsey
3fb62b8ac1 in print_opt_full(), use strlenpt() instead of strlen(), so that tabs
are placed properly when displaying translated strings in UTF-8, as
found by Jean-Philippe Guérard


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4208 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-18 22:00:17 +00:00
David Lawrence Ramsey
bc6682638b comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4207 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-18 16:51:48 +00:00
David Lawrence Ramsey
27be74c17e fix breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4206 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-18 16:47:06 +00:00
David Lawrence Ramsey
3334eedb83 fix breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4205 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-18 16:13:37 +00:00
David Lawrence Ramsey
f78bc85db1 revert last changes, but disable all the same features that
--enable-tiny does when --with-slang is used


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4204 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-18 15:55:48 +00:00
David Lawrence Ramsey
c7fa5e1f9e remove slang curses emulation support, as it's hopelessly broken, and it
doesn't make the binary very much smaller, especially when --enable-tiny
is used


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4203 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-18 02:39:25 +00:00
David Lawrence Ramsey
7f6f5a64fb simplify terminal handling by using raw mode instead of cbreak mode
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4202 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-18 02:03:00 +00:00
David Lawrence Ramsey
8b9c91b80d in execute_command(), call terminal_init() instead of just
disable_signals() after executing the command, as the command may have
changed the terminal settings


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4201 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-18 01:28:53 +00:00
David Lawrence Ramsey
75500fd801 resync NEWS with NEWS from the 2.0 branch
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4200 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-17 23:07:49 +00:00
David Lawrence Ramsey
e3a026368f fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4199 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-17 23:05:11 +00:00
David Lawrence Ramsey
e68748a6ee in main(), exit if initscr() fails
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4198 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-10 17:59:26 +00:00
David Lawrence Ramsey
1055c7208f preemptively update the version number
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4197 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-09 18:37:11 +00:00
David Lawrence Ramsey
c63a5c0cfe in faq.html, add minor punctuation and wording fixes, and update various
sections to account for Alpine


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4196 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-09 18:28:36 +00:00
Jordi Mallach
2a438459ec 2007-12-09 Jordi Mallach <jordi@gnu.org>
* LINGUAS: Add zh_CN.
        * es.po, fr.po, it.po, nb.po, nl.po, pt_BR.po: New pull from the TP,
        to fetch the now corrected latest pt_BR file.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4195 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-09 17:12:03 +00:00
Jordi Mallach
435f5d747c 2007-12-08 Jordi Mallach <jordi@gnu.org>
* zh_CN.po: New Simplified Chinese translation by
	LI Daobing <lidaobing@gmail.com>.
	* fr.po, ga.po, ms.po, nl.po, nn.po, vi.po: Translation updates taken
	from the Translation Project.
	* Refreshed the rest of the files from the latest TP archive.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4191 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-08 19:00:04 +00:00
David Lawrence Ramsey
def6091511 fix minor breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4190 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-08 16:59:13 +00:00
David Lawrence Ramsey
281a469442 fix minor display and cursor placement problems when scrolling between
pages at the statusbar prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4189 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-08 07:00:27 +00:00
David Lawrence Ramsey
cd79a81692 in doc/man/rnano.1 and doc/man/fr/rnano.1, update copyright notices, as
Thijs Kinkhorst's copyrights have now been assigned to the Free Software
Foundation


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4188 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-08 04:27:44 +00:00
David Lawrence Ramsey
97a6ecbd62 in get_mouseinput(), gix longstanding problem where mouse clicks on the
statusbar prompt text wouldn't be recognized unless the NO_HELP flag was
turned off


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4187 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-08 04:21:15 +00:00
David Lawrence Ramsey
9bd537fc6c in disable_mouse_support() and enable_mouse_support(), when toggling
mouse support on or off, save and restore the mouse click interval


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4186 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-04 20:49:09 +00:00
David Lawrence Ramsey
98958e83c9 per OBATA Akio's patch with a few tweaks by me, add wnoutrefresh() calls
after reset_(statusbar_)?cursor() calls, to ensure that the cursor is
placed properly when using NetBSD curses


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4185 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-04 16:38:47 +00:00
David Lawrence Ramsey
a9c0000ada still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4184 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-03 20:14:18 +00:00
David Lawrence Ramsey
f3318a9c05 remove unneeded whitespace
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4183 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-12-03 18:40:33 +00:00
David Lawrence Ramsey
38de45b3a3 per Jean-Philippe Guérard's updates, in doc/man/fr/*.1,
doc/man/fr/nanorc.5, fix copyright notices; the copyrights are
disclaimed on these translations, but the copyrights of the untranslated
works also apply


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4181 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-11-29 19:09:21 +00:00
David Lawrence Ramsey
9b5f4634a2 in doc/man/fr/nanorc.5, remove trailing whitespace
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4180 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-11-28 17:09:42 +00:00
David Lawrence Ramsey
cfd4b89f4b in read_file(), improve autodetection of DOS and Mac format files to not
trigger on carriage returns in the middle of files, as found by Kjell
Braden


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4179 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-11-17 20:34:38 +00:00
David Lawrence Ramsey
4510bac41d update copyright notices, as Jordi Mallach's copyrights have now been
assigned to the Free Software Foundation


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4178 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-11-06 22:58:33 +00:00
David Lawrence Ramsey
4fe5edbc11 in do_gotolinecolumn(), use a clearer error message if we enter an
invalid line or column number, per Mike Melanson's suggestion


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4177 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-11-05 17:18:16 +00:00
David Lawrence Ramsey
4821ac645f in input_tab(), disable completion of usernames, directories, and
filenames if the cursor isn't at the end of the line, as it can lead to
odd behavior (e.g. adding a copy of the entire match to the middle of
the line instead of just the uncompleted part of the match)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4176 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-10-11 15:49:08 +00:00
David Lawrence Ramsey
6e6c80b181 in username_tab_completion() and cwd_tab_completion(), rename variable
buflen to buf_len, for consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4175 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-10-11 15:38:32 +00:00
David Lawrence Ramsey
b4b553665c in cwd_tab_completion(), remove unneeded assert
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4174 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-10-11 15:19:45 +00:00
David Lawrence Ramsey
d8a1d37161 update copyright notices, as Chris Allegretta's copyrights have now been
assigned to the Free Software Foundation; also, make copyright notices
consistent in style


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4173 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-10-11 05:01:32 +00:00
David Lawrence Ramsey
c9694b7636 update copyright notices, as my copyrights have now been assigned to the
Free Software Foundation


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4172 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-10-05 16:44:45 +00:00
Jordi Mallach
e4095334c3 Updated Russian translation by Sergey A. Ribalchenko.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4171 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-09-18 11:07:59 +00:00
David Lawrence Ramsey
1072fce453 in edit_scroll(), fix problem where the screen wouldn't be updated
properly if you paged up with the first line of the file onscreen and
the mark on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4170 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-09-16 16:53:20 +00:00
David Lawrence Ramsey
cd7a313f23 in doc/faq.html, update links to the Free Translation Project
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4169 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-26 15:21:05 +00:00
David Lawrence Ramsey
c1f4b9eba1 various documentation updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4168 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-24 00:36:51 +00:00
David Lawrence Ramsey
142e57bb2f cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4167 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-23 17:54:49 +00:00
David Lawrence Ramsey
ac154c3365 in the French manpages, delete translation of old licensing terms, until
it can be updated


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4166 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-23 14:00:58 +00:00
David Lawrence Ramsey
34f20bf603 typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4165 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-23 13:51:06 +00:00
David Lawrence Ramsey
e3eed024a0 convert documentation to GPLv3/GFDLv1.2
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4161 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-23 04:34:35 +00:00
David Lawrence Ramsey
a22b2672a6 in the French manpage translations, make all copyright notices
consistent, and in rnano.1, add missing copyright notice from
nano-tiny.1, which rnano.1 is based on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4160 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-21 17:00:42 +00:00
David Lawrence Ramsey
093a441337 in rnano.1, add missing copyright notice from nano-tiny.1, which rnano.1
is based on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4159 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-21 16:38:43 +00:00
David Lawrence Ramsey
64b8f423b2 properly handle more cases of inserting a file/uncutting text with the
mark on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4158 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-16 14:45:17 +00:00
David Lawrence Ramsey
1b2e77e4ff fix breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4157 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-16 04:05:05 +00:00
David Lawrence Ramsey
ee89418102 more fixes for uncutting text/inserting files with the mark on
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4156 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-16 03:23:30 +00:00
David Lawrence Ramsey
b4e5fc100b still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4155 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-16 03:18:17 +00:00
David Lawrence Ramsey
7f4cf43450 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4154 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-16 02:51:07 +00:00
David Lawrence Ramsey
723cbe3191 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4153 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-16 02:46:26 +00:00
David Lawrence Ramsey
908b127b44 in do_insertfile(), make sure the mark is always properly positioned
after inserting a one-line file with the mark on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4152 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-16 02:34:23 +00:00
David Lawrence Ramsey
bf70087541 in Makefile.am, remove erroneous backslash after ChangeLog.pre-2.1 in
EXTRA_DIST, so that "make dist" works again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4151 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-15 22:40:33 +00:00
David Lawrence Ramsey
d0035b4ab2 convert to GPLv3 or later
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4147 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-11 05:17:36 +00:00
David Lawrence Ramsey
fd21be19fe update the copyright notice on the tab completion code originally from
busybox to account for modifications


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4146 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-10 22:12:39 +00:00
David Lawrence Ramsey
84c6845591 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4145 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-10 22:07:14 +00:00
David Lawrence Ramsey
273c1139c0 simplify ngetdelim(), and update the copyright notice on ngetline() and
ngetdelim() to account for modifications


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4144 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-10 17:03:29 +00:00
David Lawrence Ramsey
d5a9800fb6 still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4143 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-08 00:05:49 +00:00
David Lawrence Ramsey
f03171917f simplify
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4142 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-07 23:51:05 +00:00
David Lawrence Ramsey
d1ab89a929 in copy_from_file(), fix potential segfault after uncutting one line of
text with the mark on by properly preserving the beginning of the mark;
also, make sure the mark is always properly positioned after uncutting
one line of text with the mark on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4141 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-07 20:21:39 +00:00
David Lawrence Ramsey
884ca5373b cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4140 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-07 19:55:06 +00:00
David Lawrence Ramsey
3305c11c7f typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4139 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-07 18:37:39 +00:00
David Lawrence Ramsey
129dfb6323 in version(), display copyright notices
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4138 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-01 12:49:57 +00:00
David Lawrence Ramsey
ec5bcc38fe capitalization fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4137 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-01 12:24:00 +00:00
David Lawrence Ramsey
396f665bb6 fix copyright notice and changelog entries
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4136 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-01 01:28:39 +00:00
David Lawrence Ramsey
cb535630f6 update copyright notices to account for modifications
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4135 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-31 21:20:08 +00:00
David Lawrence Ramsey
1f5c89fd7b in faq.html, update RPM links for nano 2.0.x
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4134 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-29 16:30:27 +00:00
David Lawrence Ramsey
fe1bc66893 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4133 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-14 16:41:40 +00:00
David Lawrence Ramsey
3678477e32 in copy_file(), assert that inn and out don't both point to the same
file


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4132 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-12 03:12:31 +00:00
David Lawrence Ramsey
9276f4d0b1 in nstrcasestr(), mbstrcasestr(), revstrstr(), revstrcasestr(), and
mbrevstrcasestr(), simplify and rewrite to use strncasecmp()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4131 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-10 22:54:58 +00:00
David Lawrence Ramsey
a90e6c3240 in do_replace_loop(), fix problem where replacing e.g. single-byte
characters with multibyte ones could result in openfile->totsize's being
miscalculated


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4130 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-09 23:24:37 +00:00
David Lawrence Ramsey
36536670c8 typo fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4129 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-09 22:57:07 +00:00
David Lawrence Ramsey
bebfd9fbb6 in mbstrncasecmp(), mbstrnlen(), mbstrpbrk(), and has_blank_mbchars(),
simplify by using for loops instead of while loops where possible, to
match the single-byte versions of these functions


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4127 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-09 22:36:32 +00:00
David Lawrence Ramsey
ae46b91b7e in nstrcasestr(), mbstrcasestr(), revstrstr(), revstrcasestr(), and
mbrevstrcasestr(), return char* instead of const char*


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4126 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-06 13:44:13 +00:00
David Lawrence Ramsey
84763ef473 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4125 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-06 13:38:20 +00:00
David Lawrence Ramsey
08077ec59a fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4123 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-02 15:49:05 +00:00
David Lawrence Ramsey
710583064f in nstrcasestr(), mbstrcasestr(), revstrstr(), revstrcasestr(), and
mbrevstrcasestr(), for efficiency, return haystack immediately if needle
is blank


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4122 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-02 15:45:13 +00:00
David Lawrence Ramsey
444f802d58 in nstrncasecmp() and mbstrncasecmp(), for efficiency, return zero
immediately if s1 and s2 point to the same string


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4121 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-01 21:46:00 +00:00
David Lawrence Ramsey
1904f51fb5 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4120 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-01 21:33:17 +00:00
David Lawrence Ramsey
10442330bf cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4119 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-07-01 21:17:05 +00:00
David Lawrence Ramsey
23a4e433bd in do_yesno_prompt(), remove redundant check for NO_HELP's being FALSE
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4118 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-06-30 21:19:42 +00:00
David Lawrence Ramsey
5fcf8bfba9 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4117 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-06-28 18:31:13 +00:00
David Lawrence Ramsey
81acb97c37 add missing changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4116 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-06-28 17:46:04 +00:00
David Lawrence Ramsey
c8bde57d53 fix minor breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4115 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-06-28 16:38:00 +00:00
David Lawrence Ramsey
ebc38fd106 further simplify processing of mouse events by consolidating if clauses
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4113 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-06-28 16:00:50 +00:00
David Lawrence Ramsey
3a504709b7 in do_mouseinput(), deal with clicks of the first mouse button again;
oddly, ncurses built without --enable-ext-mouse needs this, but ncurses
built with --enable-ext-mouse doesn't


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4112 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-05-29 17:01:12 +00:00
David Lawrence Ramsey
14aa37c692 in get_key_buffer(), fix inaccurate comments
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4111 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-05-25 16:54:06 +00:00
David Lawrence Ramsey
a78b4354bb replace the current hackish check for a UTF-8 locale with a proper call
to nl_langinfo()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4110 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-05-25 14:39:40 +00:00
David Lawrence Ramsey
bc65313104 more various mouse support-related simplifications
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4109 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-05-22 17:20:28 +00:00
David Lawrence Ramsey
54fdb75bd8 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4108 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-05-22 17:18:06 +00:00
David Lawrence Ramsey
3a5eaeb401 various mouse support-related simplifications, improvements, and fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4107 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-05-20 23:41:56 +00:00
David Lawrence Ramsey
7f8bfca081 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4106 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-05-15 19:33:56 +00:00
David Lawrence Ramsey
b9fa1b1466 in do_mouseinput(), add mouse wheel support, per Helmut Jarausch's
suggestion


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4105 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-05-15 18:04:25 +00:00
David Lawrence Ramsey
c88556cbb1 in TODO, add entries for fixing limitations with pasting text and
handling bad/incomplete UTF-8 sequences


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4101 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-23 15:39:01 +00:00
David Lawrence Ramsey
be27ba45d5 still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4100 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-23 14:03:28 +00:00
David Lawrence Ramsey
ee43ea6a74 in backup_lines(), avoid a segfault when the mark begins and ends on the
line after the last line of the paragraph


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4099 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-22 15:04:05 +00:00
David Lawrence Ramsey
d4cf1fd0ca one last cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4095 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-21 20:33:56 +00:00
David Lawrence Ramsey
21119126d0 revert erroneous change
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4094 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-21 20:24:16 +00:00
David Lawrence Ramsey
3468784b85 further simplify do_writeout()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4093 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-21 20:13:06 +00:00
David Lawrence Ramsey
7622ca0456 in do_writeout(), if we're in restricted mode, we're not allowed to
write selections to files, so don't display the "Write Selection to
File" prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4092 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-21 18:57:47 +00:00
David Lawrence Ramsey
ea8f3c5271 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4091 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-21 18:53:38 +00:00
David Lawrence Ramsey
462720a166 simplify do_writeout()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4090 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-21 18:23:06 +00:00
David Lawrence Ramsey
5f7686f9b4 formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4089 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-20 04:13:06 +00:00
David Lawrence Ramsey
380a70831a in tail(), remove unneeded if statement
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4088 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-19 04:12:54 +00:00
David Lawrence Ramsey
238df938f0 yet another cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4087 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-19 03:53:23 +00:00
David Lawrence Ramsey
e53c38274f still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4086 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-19 03:23:16 +00:00
David Lawrence Ramsey
b94d51aa7e more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4085 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-19 03:15:04 +00:00
David Lawrence Ramsey
b68cd635bc in doc/faq.html, add a new section 4.14 by John M. Gabriele, with a few
tweaks of mine, to explain how autoindent affects pasted text


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4084 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-18 23:15:30 +00:00
David Lawrence Ramsey
b3d66aab3d another cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4083 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-18 19:25:00 +00:00
David Lawrence Ramsey
60d43339bf cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4082 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-18 19:16:08 +00:00
David Lawrence Ramsey
b8dfcb3896 fix various file-saving bugs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4081 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-18 19:09:44 +00:00
David Lawrence Ramsey
7fc36c77d2 fix various file- and rcfile-opening bugs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4080 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-18 18:22:13 +00:00
David Lawrence Ramsey
dc588aea5d simplify real_dir_from_tilde()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4079 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-18 17:13:36 +00:00
David Lawrence Ramsey
6a8b350a0c in parse_kbinput(), interpret Cancel and Shift-Cancel
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4078 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-18 14:06:34 +00:00
David Lawrence Ramsey
a31d54eebe in get_escape_seq_kbinput(), add missing comments
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4077 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-18 13:48:37 +00:00
David Lawrence Ramsey
88bf487dd0 fix changelog entries
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4076 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-18 13:45:57 +00:00
David Lawrence Ramsey
31023f0f4d in input_tab(), don't bother checking if num_matches is less than zero,
as it's a size_t and hence unsigned


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4075 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-17 18:12:19 +00:00
David Lawrence Ramsey
e93cfd10c0 in real_dir_from_tilde(), fix long-standing problem where directory
names that began with "~", but that weren't users' home directories,
could be erroneously treated as users' home directories (e.g. "~d/"
would be treated as "~daemon/")


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4074 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-17 04:38:30 +00:00
David Lawrence Ramsey
446002bd79 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4073 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-17 04:29:03 +00:00
David Lawrence Ramsey
a1cf6be436 in get_real_dir_from_tilde(), fix segfault when dealing with directory
names that begin with "~", but that aren't users' home directories


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4072 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-17 03:43:59 +00:00
David Lawrence Ramsey
e081fb9d54 per Mike Frysinger's patch with a few tweaks of mine, in
doc/syntax/asm.nanorc, doc/syntax/c.nanorc, and doc/syntax/sh.nanorc,
copy the regex that highlights trailing whitespace from
doc/syntax/java.nanorc to these files, as it's also useful in them


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4071 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-11 22:18:16 +00:00
David Lawrence Ramsey
267daeb381 in get_escape_seq_kbinput(), add escape sequences for Terminal
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4067 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-04 20:36:56 +00:00
David Lawrence Ramsey
a2c4704abb update email address
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4064 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-04-04 20:00:24 +00:00
David Lawrence Ramsey
817cb9e01f per Benno Schulenberg's patch, in usage(), reword the description of the
-S/--smooth command line option in order to differentiate it from the
associated toggle description


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4063 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-02-01 15:25:29 +00:00
David Lawrence Ramsey
9f1db5dddb per Benno Schulenberg's patch, in shortcut_init(), reword the movement
shortcut descriptions so that they use "Go to" instead of "Move to",
since not all of them move the cursor in the same way; and reword the
paragraph movement shortcut descriptions to more accurately describe how
they work


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4062 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-02-01 13:40:59 +00:00
Jordi Mallach
94d8fe67a3 Minor fix.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4061 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-30 19:48:52 +00:00
David Lawrence Ramsey
dd7c9a3679 in Makefile.am, add ChangeLog.pre-2.1 to EXTRA_DIST
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4060 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-29 15:54:21 +00:00
David Lawrence Ramsey
31d623f995 rework the 2.0 and 2.1 branch changelogs to be more readable, per Jordi
Mallach's suggestions


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4059 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-29 15:45:50 +00:00
David Lawrence Ramsey
a7e778ec38 in help_init(), add a missing space to the "Execute Command" help text
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4058 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-29 15:34:45 +00:00
David Lawrence Ramsey
995ebee5e7 fork the 2.1 branch of nano
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4057 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-29 12:40:48 +00:00
David Lawrence Ramsey
914fa163c0 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4056 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-29 12:35:44 +00:00
David Lawrence Ramsey
8a890962f8 GNU nano 2.0.3
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4054 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-29 12:33:45 +00:00
David Lawrence Ramsey
50ee461ff5 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4053 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-29 12:19:24 +00:00
David Lawrence Ramsey
15c9b9a3a2 in ru.po, fix incorrect "Project-Id-Version" entry and misplaced space
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4052 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-29 12:18:36 +00:00
David Lawrence Ramsey
f8770d632e add updated Russian translation
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4051 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-29 12:17:46 +00:00
David Lawrence Ramsey
2ceb858030 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4050 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-28 20:20:30 +00:00
David Lawrence Ramsey
35bd350c03 add missing blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4049 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-28 19:49:05 +00:00
David Lawrence Ramsey
b995263309 update README.CVS for the 2.0 branch of nano
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4048 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-28 19:47:39 +00:00
David Lawrence Ramsey
b1eb0ee20b formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4047 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-28 16:27:04 +00:00
David Lawrence Ramsey
86058fa97f formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4046 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-17 16:24:24 +00:00
David Lawrence Ramsey
ec71964386 in Makefile.am, add README.CVS to EXTRA_DIST, so that nano's CVS
checkout instructions aren't only available in its CVS snapshots


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4045 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-16 19:09:11 +00:00
David Lawrence Ramsey
a4ede3c21e cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4044 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-16 18:59:41 +00:00
David Lawrence Ramsey
99c61e207f fix still more misplaced space
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4043 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-14 15:06:32 +00:00
David Lawrence Ramsey
2aa69bcf27 fix yet more misplaced space
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4042 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-14 01:21:05 +00:00
David Lawrence Ramsey
3c019ef217 fix still more misplaced space
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4041 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-14 01:18:06 +00:00
David Lawrence Ramsey
870dc48ef0 fix more misplaced space
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4040 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-14 01:12:11 +00:00
David Lawrence Ramsey
6dfd398531 fix typos and/or misplaced space
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4039 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-13 20:39:19 +00:00
David Lawrence Ramsey
a9003419e1 fix typos and more misplaced space
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4038 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-13 20:05:23 +00:00
David Lawrence Ramsey
33b0c6874a typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4037 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-13 16:46:17 +00:00
David Lawrence Ramsey
0e1df431a8 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4036 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-12 02:58:12 +00:00
David Lawrence Ramsey
d8d19ba324 add missing changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4035 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 23:12:51 +00:00
David Lawrence Ramsey
5314b8dd8a still more miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4034 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 23:11:46 +00:00
David Lawrence Ramsey
cc91cf41a0 in do_writeout(), when setting retval to the return value of
write_(marked_)?file(), use the "?" operator instead of an if/else
clause


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4033 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 23:10:03 +00:00
David Lawrence Ramsey
e44cd2dfba yet more miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4032 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 22:54:55 +00:00
David Lawrence Ramsey
9e7b2d572c more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4031 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 22:46:22 +00:00
David Lawrence Ramsey
30ca7d5219 still more miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4030 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 21:52:29 +00:00
David Lawrence Ramsey
6e1cd2d2f3 more miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4029 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 21:47:06 +00:00
David Lawrence Ramsey
4154d08362 miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4028 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 21:36:29 +00:00
David Lawrence Ramsey
8310cd3de6 simplify the commands that generate HTML documentation in order to
remove unnecessary usage of cat


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4027 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-11 19:32:32 +00:00
David Lawrence Ramsey
f38b27e0a1 add missing changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4026 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-09 23:42:50 +00:00
David Lawrence Ramsey
9eaa50d69c more miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4025 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-09 23:42:34 +00:00
David Lawrence Ramsey
61848f172a typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4024 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-09 23:40:24 +00:00
David Lawrence Ramsey
0ec34ac28a make regexp_init() return a bool instead of an int
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4023 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-09 23:35:02 +00:00
David Lawrence Ramsey
cb04b56c92 more miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4022 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-09 22:56:56 +00:00
David Lawrence Ramsey
5d7a1017ef don't generate the HTML versions of the nanorc manpages if nano is built
without nanorc support


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4021 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-06 23:21:24 +00:00
David Lawrence Ramsey
9009890726 don't install the nanorc manpages if nano is built without nanorc
support


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4020 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-06 18:06:02 +00:00
David Lawrence Ramsey
4554520805 in doc/man/fr/Makefile.am, set mandir before setting man_MANS, to more
closely match doc/man/Makefile.am


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4019 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-06 16:23:34 +00:00
David Lawrence Ramsey
70afb990b3 typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4018 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-06 13:00:59 +00:00
David Lawrence Ramsey
b5ba9df80f fix misplaced space
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4017 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-06 12:59:03 +00:00
David Lawrence Ramsey
904a510ee1 typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4016 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-02 20:10:11 +00:00
David Lawrence Ramsey
c4592f3a55 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4015 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-01 22:22:34 +00:00
David Lawrence Ramsey
44e671f2de in doc/faq.html, update section 4.1 to describe how to open files with
names beginning with '+' at specified columns as well as lines


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4014 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-01 16:57:57 +00:00
David Lawrence Ramsey
ce270393be import the latest version of glib-2.0.m4
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4013 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-01 14:25:58 +00:00
David Lawrence Ramsey
6335fb54d5 miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4012 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-01 05:15:32 +00:00
David Lawrence Ramsey
4b1c73ee17 more miscellaneous cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4011 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-30 23:24:50 +00:00
David Lawrence Ramsey
bd34da7d1d in README, add another cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4010 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-30 23:23:02 +00:00
David Lawrence Ramsey
0c7e6d7aed preemptively update the version number
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4009 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-30 23:07:22 +00:00
David Lawrence Ramsey
fc77fde448 per Mike Frysinger's patch, in doc/syntax/python.nanorc, improve string
highlighting regexes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4008 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-24 18:17:28 +00:00
David Lawrence Ramsey
e9252c55e2 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4007 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-21 02:48:02 +00:00
David Lawrence Ramsey
518b7fac9d GNU nano 2.0.2
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4005 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-21 02:47:14 +00:00
David Lawrence Ramsey
0c426782c4 still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4004 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-15 05:03:08 +00:00
David Lawrence Ramsey
2aca11e800 more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4003 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-15 04:53:47 +00:00
David Lawrence Ramsey
4078d60d69 fix breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4002 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-15 04:50:57 +00:00
David Lawrence Ramsey
46104dcc8e still more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4001 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-15 02:54:08 +00:00
David Lawrence Ramsey
26b3ead8d2 revert erroneous change
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4000 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-15 02:49:44 +00:00
David Lawrence Ramsey
ad64cd97b8 more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3999 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-14 22:11:44 +00:00
David Lawrence Ramsey
8060d66158 miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3998 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-14 21:57:03 +00:00
David Lawrence Ramsey
4c19415ecf in do_writeout(), fix a segfault when we can't get the full path of
either the filename we want to save under or the original filename


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3997 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-14 20:03:30 +00:00
David Lawrence Ramsey
b513778b56 in update_history(), fix minor memory leak
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3996 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-13 00:27:45 +00:00
David Lawrence Ramsey
6642e88561 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3995 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-12 20:13:13 +00:00
David Lawrence Ramsey
f85a1eb48a fix more problems with strings that contain nulls but shouldn't
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3994 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-11 22:11:32 +00:00
David Lawrence Ramsey
5ab28f2716 update README for the 2.0 branch of nano
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3993 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-11 18:39:35 +00:00
David Lawrence Ramsey
f1982f01d1 still more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3992 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-10 17:57:09 +00:00
David Lawrence Ramsey
e3e3128629 really fixed incorrect "Project-Id-Version" entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3991 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-08 03:54:31 +00:00
David Lawrence Ramsey
4b6a00cb72 fixed incorrect "Project-Id-Version" entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3990 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-07 03:23:13 +00:00
David Lawrence Ramsey
4ef023478c remove unneeded duplicate plural forms again
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3989 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-07 03:22:46 +00:00
Jordi Mallach
cfeebc6055 Hungarian and Malay translation updates from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3988 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-06 21:44:16 +00:00
David Lawrence Ramsey
bd5398050a add missing blank lines
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3987 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-02 23:39:16 +00:00
David Lawrence Ramsey
ad36bdc773 per Itay Perl's patch with a few additions of mine, fix various minor
memory leaks


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3986 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-02 17:22:21 +00:00
David Lawrence Ramsey
916c7c26bf in parse_kbinput(), add missing break
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3985 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-12-02 17:17:09 +00:00
David Lawrence Ramsey
b6fb6884ca still more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3984 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 07:28:52 +00:00
David Lawrence Ramsey
3d267dc323 still more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3983 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 07:13:28 +00:00
David Lawrence Ramsey
9a2d0aff00 simplify
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3982 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 06:02:33 +00:00
David Lawrence Ramsey
f7eef5d04c fix breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3981 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 05:49:58 +00:00
David Lawrence Ramsey
9d4b8fb434 still more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3980 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 05:49:32 +00:00
David Lawrence Ramsey
8ad3b78626 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3979 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 05:40:09 +00:00
David Lawrence Ramsey
6ad82142c0 still more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3978 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 05:25:48 +00:00
David Lawrence Ramsey
0e48bc18be fix breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3977 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 05:19:24 +00:00
David Lawrence Ramsey
4fd1ca07a7 more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3976 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 05:09:16 +00:00
David Lawrence Ramsey
8db126b09d in write_file(), properly handle filenames that contain nulls
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3975 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 05:03:54 +00:00
David Lawrence Ramsey
d97649859d in do_insertfile(), properly handle files that contain nulls
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3974 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 04:57:22 +00:00
David Lawrence Ramsey
81371020bb revert erroneous changes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3973 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 04:56:16 +00:00
David Lawrence Ramsey
013613ec40 in do_insertfile(), properly handle executable commands that contain
nulls


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3972 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 04:35:11 +00:00
David Lawrence Ramsey
50d78a6f9a don't allow filenames entered at the "Write File" prompt or the "Insert
File" prompt to contain nulls


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3971 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-27 02:41:59 +00:00
David Lawrence Ramsey
b6c4dbffdb in do_spell(), when setting i to the return value of
write_(marked_)?file(), use the "?" operator instead of an if/else
clause


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3970 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-25 22:38:17 +00:00
David Lawrence Ramsey
8125e08bfa miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3969 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-25 22:27:22 +00:00
David Lawrence Ramsey
90c5a908ee fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3968 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-25 21:55:25 +00:00
David Lawrence Ramsey
cfc9fd2780 preemptively update the version number
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3967 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-25 18:28:01 +00:00
David Lawrence Ramsey
173bd2f003 typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3966 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-25 18:27:42 +00:00
David Lawrence Ramsey
d21eea02ac more miscellaneous documentation updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3965 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-25 18:26:07 +00:00
David Lawrence Ramsey
1c9dd109bf in edit_draw(), fix potential warnings when assigning -1 to paintlen by
using if/else clauses instead of "?" operators


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3964 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-21 17:05:04 +00:00
David Lawrence Ramsey
5a8182e7df in nano.h, rename NANO_.*ALTKEY to NANO_.*METAKEY, for consistency
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3963 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-21 04:20:53 +00:00
David Lawrence Ramsey
292f7ef414 in nano.h, rename NANO_ALT_.* to NANO_META_.*, for consistency
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3962 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-21 04:15:04 +00:00
David Lawrence Ramsey
b7f6bf794d more miscellaneous cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3961 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-21 04:11:18 +00:00
David Lawrence Ramsey
79f946b682 miscellaneous cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3960 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-21 04:06:13 +00:00
David Lawrence Ramsey
3a2dc3e0a7 remove unneeded blank plural forms, as gettext 0.15 generates errors
upon encountering them


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3959 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-21 03:41:28 +00:00
David Lawrence Ramsey
6b8b3ec105 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3958 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-20 14:40:40 +00:00
David Lawrence Ramsey
16fd49b854 GNU nano 2.0.1
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3956 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-20 14:38:31 +00:00
David Lawrence Ramsey
f3af804378 preemptively update the version number
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3955 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-20 14:37:44 +00:00
David Lawrence Ramsey
21b946e45d in do_replace_highlight(), include the code to display zero-length
matches even when regex.h isn't found, as it can also be used to display
zero-length Unicode characters


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3954 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-10 20:13:38 +00:00
David Lawrence Ramsey
8269ae3cea more cosmetic copyright notice fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3953 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-10 03:40:41 +00:00
David Lawrence Ramsey
606d5a1e22 more cosmetic copyright notice fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3952 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-10 03:01:16 +00:00
David Lawrence Ramsey
458e850b83 more cosmetic copyright notice fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3951 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-10 02:49:07 +00:00
David Lawrence Ramsey
cb801d63a3 cosmetic copyright notice fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3950 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-10 02:47:11 +00:00
David Lawrence Ramsey
6c6d2bc4db in NEWS, add missing entries for nano 1.0.2 and 1.0.3, since 1.1.0
includes their changes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3949 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-08 18:03:53 +00:00
David Lawrence Ramsey
84d22e3f53 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3948 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-08 13:05:50 +00:00
David Lawrence Ramsey
89eb5a96fb simplify still more
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3947 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-08 13:03:37 +00:00
David Lawrence Ramsey
d23dcc5a25 simplify more
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3946 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-08 02:58:42 +00:00
David Lawrence Ramsey
6f751500cc fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3945 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-08 02:52:46 +00:00
David Lawrence Ramsey
a93023f14b in get_full_path(), fix problem where only paths would be returned when
both paths and filenames should have been


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3944 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-08 02:48:15 +00:00
David Lawrence Ramsey
b31b128a78 simplify
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3943 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-08 01:02:13 +00:00
David Lawrence Ramsey
b24cb0cd19 in do_writeout(), fix problem where a file could sometimes be
overwritten without a warning prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3942 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-07 22:57:13 +00:00
David Lawrence Ramsey
2bf7e975eb yet more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3941 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-07 22:56:25 +00:00
David Lawrence Ramsey
ba48aa9743 still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3940 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-07 22:36:44 +00:00
David Lawrence Ramsey
6c3a399817 in get_full_path(), remove unneeded assert
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3939 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-07 21:41:05 +00:00
David Lawrence Ramsey
137694d15b more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3938 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-07 21:32:43 +00:00
David Lawrence Ramsey
8965af5874 in do_writeout(), for consistency, when saving a file with no name,
don't allow overwriting an existing file when in restricted mode


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3937 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-07 21:22:14 +00:00
David Lawrence Ramsey
4967eb8fc0 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3936 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-07 21:08:17 +00:00
David Lawrence Ramsey
366c509304 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3935 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-06 16:04:17 +00:00
David Lawrence Ramsey
f8df4a0fcb GNU nano 2.0.0
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3933 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-06 16:03:12 +00:00
David Lawrence Ramsey
f0c6e78a6e clean up nano.spec.in some more
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3932 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-05 17:13:44 +00:00
David Lawrence Ramsey
e88bc62258 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3931 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-05 17:00:41 +00:00
David Lawrence Ramsey
ca74e42a84 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3930 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-05 03:51:28 +00:00
David Lawrence Ramsey
6b9e7cf5be update nano.spec.in for newer RPM-based distributions, adapted from the
nano 1.3.12-1.1.spec file in Fedora Rawhide


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3929 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-05 03:44:41 +00:00
David Lawrence Ramsey
1bb4db6409 add POV-Ray syntax from Donnie Berkholz, with a few tweaks of mine
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3928 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-02 06:21:43 +00:00
David Lawrence Ramsey
e693023de8 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3927 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-30 17:08:32 +00:00
David Lawrence Ramsey
e54f1c4eaa more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3926 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-29 21:14:53 +00:00
David Lawrence Ramsey
08cf2528e1 update AUTHORS for the 2.0 branch of nano
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3925 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-28 22:55:08 +00:00
Jordi Mallach
40dcea0e2e Update French manpages by Jean-Philippe Guérard.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3924 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-28 22:03:25 +00:00
David Lawrence Ramsey
cb6ad31a8e fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3923 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-28 21:57:24 +00:00
David Lawrence Ramsey
057f239b43 update faq.html for the 2.0 branch of nano
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3922 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-28 21:55:22 +00:00
David Lawrence Ramsey
890eab8270 update nano.spec.in for the 2.0 branch of nano
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3921 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-28 21:51:21 +00:00
David Lawrence Ramsey
32612ddcde preemptively update the version number
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3920 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-28 19:32:47 +00:00
David Lawrence Ramsey
3660bc6a46 in nano.1, nanorc.5, and rnano.1, add minor wording fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3919 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-28 19:21:12 +00:00
David Lawrence Ramsey
cca9bdd177 fix the version number
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3918 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-27 05:01:48 +00:00
David Lawrence Ramsey
9f0fccd713 in nano.texi, add minor punctuation fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3917 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-27 03:07:49 +00:00
David Lawrence Ramsey
65ab1c87b7 in nano.texi, add minor wording fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3916 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-27 02:57:35 +00:00
David Lawrence Ramsey
0c0cafbc19 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3915 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-26 15:55:39 +00:00
David Lawrence Ramsey
76520a8ec4 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3914 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-25 15:28:20 +00:00
David Lawrence Ramsey
1295699d03 GNU nano 1.9.99pre3
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3912 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-25 15:27:08 +00:00
David Lawrence Ramsey
ee8edfc64c preemptively update the version number
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3911 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-25 14:40:49 +00:00
Jordi Mallach
273b9e8d5b French and Norwegian bokmaal updates from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3910 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-24 22:14:50 +00:00
David Lawrence Ramsey
85f9f0f941 simplify
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3909 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-18 20:27:52 +00:00
David Lawrence Ramsey
385e772e54 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3908 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-17 15:28:49 +00:00
David Lawrence Ramsey
ab8c7162d3 in do_cut_text(), when uncutting text in the process of copying it,
always set placewewant, as do_uncut_text() does, so that the current
line is always updated properly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3907 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-16 19:44:13 +00:00
Jordi Mallach
152f57bf9c New Galician update from Fran.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3906 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-16 18:43:03 +00:00
Jordi Mallach
8ee8915c49 Updated Galician translation from Fran.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3905 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-16 09:36:06 +00:00
Jordi Mallach
a447a2d810 Updated Basque from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3904 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-15 22:49:48 +00:00
David Lawrence Ramsey
22066a2cad fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3903 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-14 16:04:44 +00:00
David Lawrence Ramsey
c603fefbf6 import the latest version of ac_define_dir.m4
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3902 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-14 01:13:13 +00:00
David Lawrence Ramsey
b5652a4d56 fix breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3901 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-13 16:35:57 +00:00
David Lawrence Ramsey
98bca94758 in input_tab(), if the tab-completed path is a directory, make sure
enough space is allocated before tacking a slash onto the end of it


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3900 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-13 16:18:40 +00:00
Jordi Mallach
8c9256a731 Updated Galician translation from Fran Tsao, while his paperwork gets to GNU offices.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3899 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-10 08:14:00 +00:00
David Lawrence Ramsey
89ae4a343c miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3898 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-08 15:21:23 +00:00
David Lawrence Ramsey
61525a1e29 add missing line break
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3897 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-06 17:49:53 +00:00
David Lawrence Ramsey
97e0d665de typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3896 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-06 16:00:13 +00:00
David Lawrence Ramsey
e4769dfeab in faq.html, update the question in section 4.13 to match the version of
it in the answer section


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3895 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-06 15:52:41 +00:00
David Lawrence Ramsey
ee35aa3b01 yet one more TODO list entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3894 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-04 14:19:13 +00:00
David Lawrence Ramsey
23b9907048 add missing blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3893 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-03 19:15:01 +00:00
David Lawrence Ramsey
85307fe28e in input_tab(), since the field precision operator used in the sprintf()
uses ints and not size_t's, replace it with two strncpy()s, which use
size_t's


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3892 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-03 18:46:00 +00:00
David Lawrence Ramsey
1755e28ad9 in parse_help_input(), add 'E' and 'e' as aliases for Exit, for
consistency with the file browser


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3891 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-02 21:25:41 +00:00
David Lawrence Ramsey
6db9ebbe04 formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3890 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-02 19:45:34 +00:00
Jordi Mallach
77369f425b Updated pt_BR from the TP, using the correct file.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3889 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-02 17:15:27 +00:00
David Lawrence Ramsey
52804ab8e8 in doc/syntax/c.nanorc, simplify "undef", "ifn?def", "elif", and "else"
in the preprocessor regexes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3888 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-02 17:01:58 +00:00
David Lawrence Ramsey
6e379c254e Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3887 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-10-02 04:09:48 +00:00
104 changed files with 57866 additions and 39557 deletions

View File

@@ -1,25 +0,0 @@
ABOUT-NLS
COPYING
INSTALL
Makefile
Makefile.in
aclocal.m4
autom4te.cache
confdefs.h
config.cache
config.h
config.h.in
config.log
config.status
config.rpath
configure
config.guess
config.sub
depcomp
install-sh
missing
mkinstalldirs
nano.spec
stamp-h
stamp-h.in
stamp-h1

26
.gitignore vendored Normal file
View File

@@ -0,0 +1,26 @@
*.o
.deps
.libs
Makefile
Makefile.in
/ABOUT-NLS
/INSTALL
/aclocal.m4
/autom4te.cache
/config.guess
/config.log
/config.h
/config.h.in
/config.rpath
/config.status
/config.sub
/configure
/depcomp
/install-sh
/missing
/mkinstalldirs
/stamp-h1
/nano.spec
/src/nano

View File

@@ -4,10 +4,10 @@ nano editor. Please see the ChangeLog for specific changes by author.
-------------------------------------------------------------------------
Chris Allegretta <chrisa@asty.org>
* Original program author, stable series maintainer.
* Original program author, former stable series maintainer.
David Lawrence Ramsey <pooka109@cox.net>
* Development series maintainer. Multiple buffer support,
David Lawrence Ramsey <pooka109@gmail.com>
* Former stable series maintainer. Multiple buffer support,
operating dir (-o) option, bug fixes for display routines,
wrapping code, spelling fixes, const mode, parts of the UTF-8
support, and various other fixes.

138
BUGS
View File

@@ -1,4 +1,6 @@
** Open BUGS **
- Cutting the line at the top of the screen recenters to center (71)
- Many menu items are probably missing from the new backend (73)
** Fixed BUGS **
- Marked cutting sometimes leaves a newline in the file unintelligently,
@@ -8,18 +10,18 @@
certain col values. (9) [FIXED]
- edit_refresh() and update_line() do not handle selecting text when the
cursor is beyond COLS (10) [FIXED]
- no way to do a replace with the empty string (11) [FIXED, yay!]
- No way to do a replace with the empty string (11) [FIXED, yay!]
- Spelling support is not elegant like Pico's integration of the 'spell'
program. Nano only uses ispell (for now) (12) [FIXED]
program. nano only uses ispell (for now) (12) [FIXED]
- Moving to the end of a line when close to a multiple of COLS and at
least COLS * 2 does not make the screen jump early like it would for
if we were around COLS (bugs in edit_refresh, update_line) (13)
[FIXED, mostly]
- When at the very bottom of the edit window, do_wrap goes berserk and
- When at the very bottom of the edit window, do_wrap() goes berserk and
puts the cursor somewhere bad; subsequent keystrokes crash the program
(14) [FIXED, mostly]
- Doing a replacement of a substring of the replace string (e.g. replacing
"ed" with "fred" causes an infinite loop). (15) [FIXED]
- Doing a replacement of a substring of the replace string (e.g.
replacing "ed" with "fred" causes an infinite loop). (15) [FIXED]
- Cutting a file with marked text and both marker ends on the same line
causes a random segfault (16) [FIXED]
- Cutting more than one line resets the KEEP_CUTBUFFER flag in 0.9.3.
@@ -27,25 +29,28 @@
- The wrapping code does not work right for lines like the following:
* *
Error is in do_wrap, must be rewritten. (18) [FIXED]
- Nano fails to follow symlinks, even though -l isn't being used (20).
- nano fails to follow symlinks, even though -l isn't being used (20).
[Bug in global flag init, FIXED]
- When using --help or --version, the SIGINT character gets lost. (21) [FIXED]
- When using --help or --version, the SIGINT character gets lost. (21)
[FIXED]
- edit_refresh() and update_line() (and related functions) have
trouble when a tab is the character that is the boundary at COLS (23)
[FIXED]
- There is an off-by-one error in keeping track of totsize. It is caused
by the fact that we count the newline at the end when we read in a file
but we do not, in fact, display this newline. This should go away
implicitly when the "Magic Line" returns, but it is noted here for
documentation's sake. (24) [FIXED]
- There is an off-by-one error in keeping track of totsize. It is
caused by the fact that we count the newline at the end when we read
in a file but we do not, in fact, display this newline. This should
go away implicitly when the "Magic Line" returns, but it is noted here
for documentation's sake. (24) [FIXED]
- In replace with completely adjacent strings, every other search string
will be missed (try replace ':' in a string like ':::::::::') (28) [FIXED]
- If nano opens a read-only file with the --tempfile option, and a change
is made to the buffer, and a write is attempted, nano will not give you
a dialog about not being able to write the file, and it will not let the
user exit (29, discovered by Joshua Jensen) [FIXED]
will be missed (try replace ':' in a string like ':::::::::') (28)
[FIXED]
- If nano opens a read-only file with the --tempfile option, and a
change is made to the buffer, and a write is attempted, nano will not
give you a dialog about not being able to write the file, and it will
not let the user exit (29, discovered by Joshua Jensen) [FIXED]
- Using nano -k, marked text is not cut properly. (31) [FIXED]
- Invoking -t or -k has the effect of invoking both options. (32) [FIXED]
- Invoking -t or -k has the effect of invoking both options. (32)
[FIXED]
- totsize becomes incorrect after word-wrapping (25) [FIXED]
- Wrapping a line with autoindent mode sometimes causes a segfault (19)
[FIXED]
@@ -55,51 +60,52 @@
[FIXED]
- In replace, there is no way to accept the default replace string. (27)
[FIXED]
- Using nano -t, user can not exit until a filename is given via ^O. (30)
[FIXED]
- Using 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]
- Using -k, pasted text is not updated properly if it goes beyond
editbot. (35) [FIXED]
- Doing a cut with -k can screw up the filestruct; fault is in cutting
code. (36) [FIXED]
code. (36) [FIXED]
- Hitting enter on the magic line makes new lines, but they are not
written out to disk when saved..... (37). [FIXED]
- Page up and page down do not work the same way as in Pico (# of lines). (38)
[FIXED]
- Page up and page down do not work the same way as in Pico (# of
lines). (38) [FIXED]
- When doing a search and the marker is set, the screen does not always
properly update the inverted text (39). [FIXED]
- Searches for a string that only exists on one line multiple times will
fail after finding the last occurrence (discovered by Ken Tyler) (40).
[FIXED]
- Alt-Z is currently broken to toggle suspend. I guess I still don't know
signals very well =-) (41) [FIXED].
- Unable to cut the entire file using the marker (discovered by Ken Tyler)
(42). [FIXED]
- The keypad does not work when nano runs in the Gnome terminal (43). [FIXED]
- When reading in a file, if the file is a directory, the contents of the
file being edited are blown away (discovered by Chris Pimlot) (44). [FIXED]
- in certain terms, nano will leave a "ghost" of screen upon exit
when called from inside mutt (among other settings) (45). [FIXED]
- Meta-Z is currently broken to toggle suspend. I guess I still don't
know signals very well =-) (41) [FIXED].
- Unable to cut the entire file using the marker (discovered by Ken
Tyler) (42). [FIXED]
- The keypad does not work when nano runs in the Gnome terminal (43).
[FIXED]
- When reading in a file, if the file is a directory, the contents of
the file being edited are blown away (discovered by Chris Pimlot)
(44). [FIXED]
- In certain terms, nano will leave a "ghost" of screen upon exit when
called from inside mutt (among other settings) (45). [FIXED]
- In replace, hitting the Goto line shortcut key does nothing after a
search string is entered (discovered by Rocco Corsi) (46) [FIXED].
- When typing in a string in search or replace and hitting CASE_SENSITIVE
or the other search string, the current string edit is blown away in
favor of the last stored search (47) [FIXED]
- When typing in a string in search or replace and hitting
CASE_SENSITIVE 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]
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].
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].
@@ -109,31 +115,45 @@
the first fail if no string is entered (56) [FIXED].
- Page down on a file of editwinrows fails (again). Reported by Ryan
Krebs (57) [FIXED].
- File browser aborts on Solaris in qsort() call. (Reported by
Matthias Andree) (58) [FIXED].
- Can modify the current file in view mode with ^W^R (discovered by Rocco
Corsi) (58) [FIXED].
- When page up is used after two page down's, the screen doesn't update
- File browser aborts on Solaris in qsort() call. (Reported by Matthias
Andree) (58) [FIXED].
- Can modify the current file in view mode with ^W^R (discovered by
Rocco Corsi) (58) [FIXED].
- When page up is used after two page downs, the screen doesn't update
properly (discovered by David Lawrence Ramsey) (59) [FIXED].
- On BSD systems, marked cutting sna paste often screws up the
last line in the cutbuffer (discovered by Barry Pederson) (60) [FIXED]
- On BSD systems, marked cutting and paste often screws up the last line
in the cutbuffer (discovered by Barry Pederson) (60) [FIXED]
- Blank lines are not kept when cutting with -k (discovered by Rocco)
(61) [FIXED].
- Nano will not suspend properly inside of mutt (62) [FIXED].
- nano will not suspend properly inside of mutt (62) [FIXED].
- When switching from Pico mode to normal mode, the previous search is
not displayed until cancelling the search (63) [FIXED].
- If you change search options but don't change the search string in
normal mode, hitting enter causes the search/replace to abort (64)
normal mode, hitting Enter causes the search/replace to abort (64)
(Jordi Mallach) [FIXED].
- Cutting one line of text causes the screen to recenter the line
(reported and fixed by David Lawrence Ramsey) (65) [FIXED].
- When cutting marked text including the bottom of the file, a new
"magic line" is not created" (reported by David Lawrence
Ramsey, fixed by David Lawrence Ramsey & Chris) (66) [FIXED].
- ^C does not work after a suspend in tcsh (discovered by
Trevor Cordes) (68) [FIXED].
- When cutting marked text including the bottom of the file, a new
"magic line" is not created" (reported by David Lawrence Ramsey, fixed
by David Lawrence Ramsey & Chris) (66) [FIXED].
- ^C does not work after a suspend in tcsh (discovered by Trevor Cordes)
(68) [FIXED].
- Home and End control keys (^A, ^E) do not always work in filename
prompt (bug found by Ian Turner) (69) [1.0 series only] [FIXED].
- Trying to insert a file of 0 bytes will hang nano (70) [FIXED].
- Meta-space and ^Space are not yet handled in new backend code (77) [FIXED]
- F-keys do not work with new shortcut backend (72) [FIXED]
- Need a 'check-vitals-mapped' function to check that the end used didn't
unbind all the keys for exit or cancel before starting up the editor (74) [FIXED]
- Browser and prompt code still implement old switch on raw key input instead
of new if block for subnfunc values (75) [FIXED]
- New backend code probably does not compile under anything but default options,
if that (76) [FIXED]
- -enable-tiny does not work with new code (78) [FIXED]
- If a user only binds meta sequences to a function like left, right
page up/down, insert, and unbinds all other control and F keys for it,
nano will do the wrong thing when reading the key which is normally
assigned to it (79 - may not be worth fixing) [FIXED]
$Id$

676
COPYING Normal file
View File

@@ -0,0 +1,676 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

397
COPYING.DOC Normal file
View File

@@ -0,0 +1,397 @@
GNU Free Documentation License
Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

8544
ChangeLog

File diff suppressed because it is too large Load Diff

8369
ChangeLog.pre-2.1 Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -3,8 +3,9 @@ AUTOMAKE_OPTIONS = gnu no-dependencies
SUBDIRS = doc m4 po src
EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS \
README THANKS TODO UPGRADE config.rpath install-sh \
missing mkinstalldirs nano.spec
EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING COPYING.DOC ChangeLog \
ChangeLog.pre-2.1 INSTALL NEWS README README.SVN \
THANKS TODO UPGRADE config.rpath install-sh missing \
mkinstalldirs nano.spec
ACLOCAL_AMFLAGS = -I m4

180
NEWS
View File

@@ -1,3 +1,158 @@
2008.08.30 - GNU nano 2.1.5 is ready to lead on day one. This release
contains a better fix for incorrectly reported successful
writes on full filesystems, more helpful messages when
an internal error occurs in the undo code, and fixes for
various combinations of configure-time options and
compiler flags. Also included is new support for
changing the rc file name at configure time, and
using GNU-style regexes for word-boundaries on systems
which do not support them natively, as well as the ever
popular translation updates. Rock the tarball.
2008.08.09 - GNU nano 2.1.4 "I told you so!" is released. This release
includes fixes for several severe issues with the new
undo/redo code. Also the behavior of writing
files when using backup mode has changed as well: if writing
the backup file fails, nano will not attempt to write the
current file. This should help folks who enjoy "extreme
text editing" i.e. editing files on file systems which
are likely to run out of space; see Savannah bug 24000.
Have fun with it!
2008.08.04 - GNY nano 2.1.3 "least stable version ever" is released. This
release includes new (and experimental) undo and redo
functionality for most text operations. The default
key bindings are Meta-U for undo and Meta-E for redo, but
these can be remapped using the new 2.1 keybinding code.
Also included are some fixes for configuring using wide
curses, crashing when invoking the help menu with
certain locales, and not saving the search history when
compiled with configure options.
2008.04.24 - GNU nano 2.1.2 "New York City" is released. This release
contains fixes for binding bad keys, some
configure-specific compilation failures, and more issues
with the new input back end and in particular the status
bar. Also fixed are some long standing issues with
compiling on AIX, and a segfault when making the terminal
window too small. Rest in Peace Tim and George!
2008.04.01 - GNU nano 2.1.1 wont get fooled again. This release contains
fixes for the new user-rebindable keys (in particular
bracket match which was mis-bound), and various
problems with translations and configure-related
compilation problems are now fixed as well.
It also contains new syntax highlighting
definitions for TCL, PHP, Gentoo and Debian-related
files, and some documentation updates as well.
Please continue to send reports with the key
binding code to the Savannah page
(https://savannah.gnu.org/bugs/?group=nano).
2008.03.18 - GNU nano 2.1.0 "under old mismanagement" is released.
This first release in the 2.1 development series
introduces rebinadble keys for most actions inside
the editor. Please see the nanorc(5) page for
more information on configuring key bindings. Please
also report all keybinding bugs (crashes, missing
menu functions) using the Savannah bug tracker URL,
https://savannah.gnu.org/bugs/?group=nano and
thanks for sticking with us!
2007.12.20- GNU nano 2.0.7 keeps its balance. This release fixes
several bugs, among others: a segfault and several
cursor positioning problems when uncutting text or
inserting files into the current buffer; a problem where
the total number of characters would be miscalculated
when replacing single-byte characters with multibyte
ones; several minor issues with the statusbar prompt
involving text display and mouse support; and several
oddities when tab-completing in the middle of a line.
It also improves autodetection of DOS and Mac format
files, properly supports the mouse wheel when using a
version of ncurses built with the --enable-ext-mouse
option, fixes some problems under NetBSD curses, adds a
lot of translation updates, and adds more minor
documentation updates. Slang curses emulation support
has also been changed to turn off all the options that
--enable-tiny does, as it's hopelessly broken otherwise.
Finally, nano is now licensed under the GNU GPL version
3 or later, and its documentation is now dual-licensed
under the GNU GPL version 3 or later and the GNU FDL
version 1.2 or later. Have fun.
2007.04.26- GNU nano 2.0.6 "that was quick" is released. This release
fixes a potential segfault after justifying text marked
from the bottom up. It also adds one more minor
documentation update. Enjoy.
2007.04.22- GNU nano 2.0.5 braces for impact. Among other things, this
release fixes various problems (including a segfault)
when trying to open or save a file in a directory
beginning with "~" that isn't a home directory; fixes a
problem where a file with no name could be saved over an
existing filename with no warning about overwriting it;
properly disallows opening directories or device files
from "include" commands in nanorc files; no longer
displays a misleading prompt when trying to save in
restricted mode with the mark on; and properly supports
the Cancel and Shift-Cancel keys. It also improves
several color syntaxes to highlight trailing whitespace,
just as the Java syntax does, and adds yet more minor
documentation updates. Have fun.
2007.04.06 - GNU nano 2.0.4 heralds the dawn. This release contains
proper support for the Ctrl-[arrow key], Shift-[arrow
key], and F13-F16 keys under Xfce's Terminal. It also
adds still more minor documentation updates. Enjoy.
2007.01.29 - GNU nano 2.0.3 flows toward its ending. This release
contains several minor optimizations to make the
executable a little smaller under some circumstances,
some translation updates, improvements to the color
syntax for Python, and still more minor documentation
updates. Have fun.
2006.12.20 - GNU nano 2.0.2 forges ahead. This release fixes a segfault
when trying to save in a nonexistent directory; fixes
handling of strings containing nulls at the "Write File",
"Insert File", "Execute Command", and "Go to Directory"
prompts; fixes several minor memory leaks; fixes two
more potential compilation warnings; adds a few
translation updates; and adds a few more minor
documentation updates. Enjoy.
2006.11.20 - GNU nano 2.0.1 emerges from its cocoon. This release
contains several bugfixes: saving one file over another
will now always warn about overwriting it, overwriting
a file is no longer possible when saving a new file in
restricted mode, and zero-length Unicode characters are
now highlighted properly when nano is built without
regular expression support. It also adds several minor
documentation updates. Have fun with it.
2006.11.06 - GNU nano 2.0.0 does its little dance. This release adds
documentation updates and a few cosmetic tweaks.
For those who haven't been following nano 1.3
development, there are a ton of new features, including
support for UTF-8, moving to a specified line and column
instead of just a line, improved color syntax
highlighting, inserting previously untypeable characters
using "Verbatim Input" mode, and copying text into the
cutbuffer without cutting it. There are also fixes for
some long-standing bugs, such as the "NumLock glitch"
from nano 1.2.x, and the inability to unjustify text
after resizing. Finally, there are also a ton of
translation updates and new translations, as well as new
color syntaxes. See the UPGRADE file for more
information, and enjoy the new stable release.
2006.10.25 - GNU nano 1.9.99pre3 learns to appreciate life. This
release fixes a bug where the screen sometimes wouldn't
be updated properly after copying text into the
cutbuffer, fixes a potential warning while compiling,
and fixes a few other minor inconsistencies. Have fun.
2006.10.02 - GNU nano 1.9.99pre2 crosses the threshold. This release
fixes a few more bugs: cursor positioning after leaving
the statusbar prompt has been fixed, and verbatim input
@@ -180,8 +335,8 @@
and replacing all text in a file now properly updates
the screen in all cases. New features include sample
regexes for patch files, improvements to the sample
regexes for C files, and support for strings
greater than 1023 characters and/or containing nulls in
regexes for C files, and support for strings greater
than 1023 characters and/or containing nulls in
.nano_history. Additionally, the full justify keystroke
has been changed to match current Pico, and whitespace
display mode is now turned off by default. Enjoy.
@@ -528,6 +683,27 @@
introduce lots of bugs ;-) Have fun with it, but be
careful, unstable means unstable.
07/01/2001 - GNU nano 1.0.3 is the "mutt" release. This release
features oodles of bug fixes with cutting text,
especially with the -k (cut to end) option. There is
also a new suspend handler which should make nano play
better with mutt (the code for which came from mutt
itself; many many thanks to Jordi Mallach and Tom Lear
for working late into the night fixing this). Nano now
also features mutt's case insensitive string compare
function for more speed and less memory usage. Two new
translations are included, Ukrainian and Russian.
05/12/2001 - GNU nano 1.0.2 is the "just the bugfixes ma'am" release.
The most noticeable fixes are for display errors using
page up/down with the marker code, and view mode (-v)
not stopping the replace function. Other fixes include
being able to use the arrow keys while holding down the
ctrl key in certain TERMs, and there are many
documentation updates and spelling tweaks. We also have
a new Galician translation (provided by Jacobo Tarrío).
Have fun with it!
04/06/2001 - GNU nano 1.0.1 is out there. The only new feature is a
configure option for those who want to disable all word
wrapping from nano, --disable-wrapping. Bug fixes this

10
README
View File

@@ -19,7 +19,7 @@ Overview
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.
http://www.gnu.org/.
How to compile and install nano
@@ -65,10 +65,8 @@ Mailing List and Bug Reports
Current Status
GNU nano has reached its second stable milestone, 1.2.x.
Development of new features continues in the 1.3.x branch, while
1.2.x versions are dedicated to bug-fixing and polishing.
Chris Allegretta (chrisa@asty.org)
GNU nano has reached its third stable milestone, 2.0.x.
Development of new features continues in the 2.1.x branch, while
2.0.x versions are dedicated to bug-fixing and polishing.
$Id$

View File

@@ -1,7 +1,7 @@
INSTRUCTIONS TO COMPILE AND INSTALL NANO CVS VERSIONS
=====================================================
GNU nano is available from CVS, but building this needs a bit more care
GNU nano is available from SVN, but building this needs a bit more care
than the official stable and unstable tarballs.
@@ -16,7 +16,7 @@ packages:
- gettext (version >= 0.11.5)
- groff (version >= 1.12)
- texinfo (version >= 4.0)
- cvs
- subversion (aka svn)
- ssh (with support for the SSH version 2 protocol)
- glib 2.x (if your system doesn't have vsnprintf(), which the configure
script will check for)
@@ -30,23 +30,15 @@ to use UTF-8.
Download the source
-------------------
First, you need to set up cvs to download the CVS tree using ssh. If
you're using a Bourne shell (e.g. bash or sh), do
To obtain the current nano development code (called 'trunk'), use the
following command. It will create a copy of the files in a subdirectory
of your current working directory called 'nano':
$ export CVS_RSH=ssh
$ svn co svn://svn.savannah.gnu.org/nano/trunk/nano
If you're using a C shell (e.g. tcsh or csh), do
If you want to download the stable SVN branch instead, use:
$ setenv CVS_RSH ssh
After that's set up, cd to your src directory and use the following
command to download the CVS tree:
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/nano checkout nano
If you want to download the stable CVS branch, add "-r nano_1_2_branch":
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/nano checkout -r nano_1_2_branch nano
$ svn co svn://svn.savannah.gnu.org/nano/branches/nano_2_0_branch/nano
Generate the configure script
@@ -91,4 +83,5 @@ you'll need to run that "make install" command with root privileges.
Problems?
---------
Please submit any bugs in the CVS branch to nano-devel@gnu.org.
Please submit any bugs in the SVN branch using the Savannah project's
bug tracker (https://savannah.gnu.org/bugs/?group=nano)

6
TODO
View File

@@ -34,6 +34,12 @@ For the next version:
keystroke, e.g. M-` (M-~) to go to the top line, M-& (M-7) to go to
the center line, and M-' (M-") to go to the last line.
- Allow searching for and replacing newlines.
- Allow soft wrapping as well as hard wrapping?
- Detect when we're pasting text, so that we can handle it differently
from normal typing?
- Make pasting text work as fast as it does in Pico.
- Fix handling of bad/incomplete UTF-8 sequences to display one Unicode
FFFD (Replacement Character) per sequence instead of one per byte.
Old requests:

View File

@@ -1,10 +1,11 @@
# Configuration for GNU nano - a small and user-friendly text editor
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
# Free Software Foundation, Inc.
#
# GNU nano is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# Free Software Foundation; either version 3, or (at your option) any
# later version.
#
# GNU nano is distributed in the hope that it will be useful, but
@@ -19,7 +20,7 @@
#
# $Id$
AC_INIT([GNU nano], [1.9.99pre2], [nano-devel@gnu.org], [nano])
AC_INIT([GNU nano], [2.1.5], [nano-devel@gnu.org], [nano])
AC_CONFIG_SRCDIR([src/nano.c])
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE
@@ -53,20 +54,20 @@ AC_CHECK_HEADERS(getopt.h libintl.h limits.h regex.h sys/param.h wchar.h wctype.
dnl Checks for options.
AC_ARG_ENABLE(debug,
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debugging (disabled by default)],
[if test x$enableval = xyes; then
AC_DEFINE(DEBUG, 1, [Define this to enable nano debug messages and assert warnings.]) debug_support=yes
AC_DEFINE(DEBUG, 1, [Define this to enable debug messages and assert warnings.]) debug_support=yes
fi])
if test x$debug_support != xyes; then
AC_DEFINE(NDEBUG, 1, [Shut up the assert warnings :-)])
AC_DEFINE(NDEBUG, 1, [Shut up assert warnings :-)])
fi
AC_ARG_ENABLE(extra,
[ --enable-extra Enable extra features, currently only easter eggs],
[if test x$enableval = xyes; then
AC_DEFINE(NANO_EXTRA, 1, [Define this to enable the extra stuff.]) extra_support=yes
AC_DEFINE(NANO_EXTRA, 1, [Define this to enable extra stuff.]) extra_support=yes
fi])
AC_ARG_ENABLE(tiny,
@@ -75,42 +76,42 @@ AC_ARG_ENABLE(tiny,
AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.])
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routine.])
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse functions.])
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable setting of the operating directory (chroot of sorts).])
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.])
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion code Chris worked so hard on!])
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable any and all text wrapping.])
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.])
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
fi])
AC_ARG_ENABLE(browser,
[ --disable-browser Disable mini file browser],
[ --disable-browser Disable built-in file browser],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
fi])
AC_ARG_ENABLE(help,
[ --disable-help Disable help function],
[ --disable-help Disable help functions],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.])
fi])
AC_ARG_ENABLE(justify,
[ --disable-justify Disable justify/unjustify function],
[ --disable-justify Disable justify/unjustify functions],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routine.])
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
fi])
AC_ARG_ENABLE(mouse,
[ --disable-mouse Disable mouse support (and -m flag)],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse functions.])
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
fi])
AC_ARG_ENABLE(operatingdir,
[ --disable-operatingdir Disable setting of operating directory (chroot of sorts)],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable setting of the operating directory (chroot of sorts).])
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
fi])
AC_ARG_ENABLE(speller,
@@ -120,28 +121,28 @@ AC_ARG_ENABLE(speller,
fi])
AC_ARG_ENABLE(tabcomp,
[ --disable-tabcomp Disable tab completion code for a smaller binary],
[ --disable-tabcomp Disable tab completion functions],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion code Chris worked so hard on!])
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.])
fi])
AC_ARG_ENABLE(wrapping,
[ --disable-wrapping Disable all wrapping of text (and -w flag)],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable any and all text wrapping.])
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
fi])
AC_ARG_ENABLE(wrapping-as-root,
[ --disable-wrapping-as-root Disable wrapping of text as root by default],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_ROOTWRAPPING, 1, [Define this to disable wrapping as root by default.])
AC_DEFINE(DISABLE_ROOTWRAPPING, 1, [Define this to disable text wrapping as root by default.])
fi])
AC_ARG_ENABLE(color,
[ --enable-color Enable color and syntax highlighting],
[if test x$enableval = xyes; then
if test x$ac_cv_header_regex_h = xyes; then
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use the .nanorc file.]) nanorc_support=yes
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes
AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting, requires regex.h and ENABLE_NANORC too!]) color_support=yes
else
AC_MSG_ERROR([
@@ -159,20 +160,48 @@ AC_ARG_ENABLE(multibuffer,
fi])
AC_ARG_ENABLE(nanorc,
[ --enable-nanorc Enable use of .nanorc file],
[ --enable-nanorc Enable use of .nanorc files],
[if test x$enableval = xyes; then
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use the .nanorc file.]) nanorc_support=yes
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes
fi])
AC_ARG_ENABLE(all,
[ --enable-all Enable ALL extra nano functionality (kitchen sink option)],
[if test x$enableval = xyes; then
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use the .nanorc file.]) nanorc_support=yes
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes
AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting, requires regex.h and ENABLE_NANORC too!]) color_support=yes
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
AC_DEFINE(NANO_EXTRA, 1, [Define this to enable the extra stuff.]) extra_support=yes
AC_DEFINE(NANO_EXTRA, 1, [Define this to enable extra stuff.]) extra_support=yes
fi])
if test x$color_support = xyes; then
# now check for the end of word boundary support (/< and />)
AC_MSG_CHECKING([for GNU-style word boundary regex support])
AC_TRY_RUN([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <regex.h>
int main(void)
{
regex_t r;
size_t nmatch;
regmatch_t pmatch;
if (regcomp(&r, "\\\\>", REG_EXTENDED|REG_NOSUB))
return 1;
if (regexec(&r, "word boundary", nmatch, &pmatch, 0))
return 1;
return 0;
}],
AC_MSG_RESULT(yes)
AC_DEFINE(GNU_WORDBOUNDS, 1, [Define if the system supports GNU-style word boundaries in regexes.]) gnu_wordbounds=yes,
AC_MSG_RESULT(no),
AC_MSG_WARN([*** Can't check for gnu word boundary support when cross-compiling])
)
fi
AC_MSG_CHECKING([whether to enable UTF-8 support])
AC_ARG_ENABLE(utf8,
[ --enable-utf8 Enable UTF-8 support],
@@ -371,14 +400,33 @@ int main(void)
;;
esac], [AC_MSG_RESULT(no)])
if test x$CURSES_LIB_NAME = xslang; then
AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.])
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.])
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.])
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
fi
AM_CONDITIONAL(USE_COLOR, test x$color_support = xyes)
AM_CONDITIONAL(USE_NANORC, test x$nanorc_support = xyes)
AC_ARG_ENABLE(altrcname,
[ --enable-altrcname Specify alternate rcfile name (default: .nanorc)],
[if test x$enableval != no; then
AC_DEFINE_UNQUOTED(RCFILE_NAME, "$enableval", [Specify alternate rcfile name (default: .nanorc)]) rcfilename=$enableval
fi])
dnl Checks for functions.
AC_CHECK_FUNCS(getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen vsnprintf)
if test x$enable_utf8 != xno; then
AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace mblen mbstowcs mbtowc wctomb wcwidth)
AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace nl_langinfo mblen mbstowcs mbtowc wctomb wcwidth)
fi
if test x$ac_cv_func_vsnprintf = xno; then
@@ -403,7 +451,7 @@ if eval "test x$CURSES_LIB_NAME = x"; then
AC_CHECK_HEADERS(ncurses.h)
if test x$enable_utf8 != xno; then
AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CPPFLAGS="-I/usr/include/ncursesw $CPPFLAGS" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
fi
if eval "test x$CURSES_LIB_NAME = x"; then
@@ -452,12 +500,13 @@ if test x$enable_utf8 != xno && \
test x$ac_cv_func_iswalnum = xyes && \
test x$ac_cv_func_iswpunct = xyes && \
(test x$ac_cv_func_iswblank = xyes || test x$ac_cv_func_iswspace = xyes) && \
test x$ac_cv_func_nl_langinfo = xyes && \
test x$ac_cv_func_mblen = xyes && \
test x$ac_cv_func_mbstowcs = xyes && \
test x$ac_cv_func_mbtowc = xyes && \
test x$ac_cv_func_wctomb = xyes && \
test x$ac_cv_func_wcwidth = xyes; then
AC_DEFINE(ENABLE_UTF8, 1, [Define this if your system has sufficient UTF-8 support (a wide curses library, iswalnum(), iswpunct(), iswblank() or iswspace(), mblen(), mbstowcs(), mbtowc(), wctomb(), and wcwidth()).])
AC_DEFINE(ENABLE_UTF8, 1, [Define this if your system has sufficient UTF-8 support (a wide curses library, iswalnum(), iswpunct(), iswblank() or iswspace(), nl_langinfo, mblen(), mbstowcs(), mbtowc(), wctomb(), and wcwidth()).])
else
if test x$enable_utf8 = xyes; then
AC_MSG_ERROR([

View File

@@ -1,3 +0,0 @@
Makefile
Makefile.in
nanorc.sample

1
doc/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/nanorc.sample

View File

@@ -19,13 +19,13 @@
<blockquote><p><a href="#2.1">2.1. FTP and WWW sites that carry nano.</a><br>
<a href="#2.2">2.2. RedHat and derivatives (.rpm) packages.</a><br>
<a href="#2.3">2.3. Debian (.deb) packages.</a><br>
<a href="#2.4">2.4. By CVS (for the brave).</a></p></blockquote>
<a href="#2.4">2.4. By subversion (for the brave).</a></p></blockquote>
<h2><a href="#3">3. Installation and Configuration</a></h2>
<blockquote><p><a href="#3.1">3.1. How do I install the RPM or DEB package?</a><br>
<a href="#3.2">3.2. Compiling from source: WHAT THE HECK DO I DO NOW?</a><br>
<a href="#3.3">3.3. Why does everything go into /usr/local?</a><br>
<a href="#3.4">3.4. I get errors about 'bindtextdomain','gettext', and/or 'gettextdomain'. What can I do about it?</a><br>
<a href="#3.5">3.5. Nano should automatically run strip on the binary when installing it!</a><br>
<a href="#3.5">3.5. nano should automatically run strip on the binary when installing it!</a><br>
<a href="#3.6">3.6. How can I make the executable smaller? This is too bloated!</a><br>
<a href="#3.7">3.7. Tell me more about this multibuffer stuff!</a><br>
<a href="#3.8">3.8. Tell me more about this verbatim input stuff!</a><br>
@@ -36,15 +36,16 @@
<a href="#4.3">4.3. Ack! My numeric keypad's keys don't work properly when NumLock is off! What can I do?</a><br>
<a href="#4.4">4.4. Ack! When I hold down a Meta key combination for a while, the character of the held key gets inserted now and then. What gives?</a><br>
<a href="#4.5">4.5. How do I type the F13-F16 keys shown in the help browser? My keyboard only has F1-F12!</a><br>
<a href="#4.6">4.6. Nano crashes when I type &lt;insert keystroke here&gt;!</a><br>
<a href="#4.7">4.7. Nano crashes when I resize my window. How can I fix that?</a><br>
<a href="#4.6">4.6. nano crashes when I type &lt;insert keystroke here&gt;!</a><br>
<a href="#4.7">4.7. nano crashes when I resize my window. How can I fix that?</a><br>
<a href="#4.8">4.8. [version 1.3.12 and later] I'm using glibc 2.2.3, and nano crashes when I use color support or do regular expression searches. How can I fix that?</a><br>
<a href="#4.9">4.9. [version 1.1.12 and earlier] Why does nano show ^\ in the shortcut list instead of ^J?</a><br>
<a href="#4.10a">4.10a. [version 1.1.12 and earlier] When I type in a search string, the string I last searched for is already in front of my cursor! What happened?!</a><br>
<a href="#4.10b">4.10b. [version 1.1.99pre1 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</a><br>
<a href="#4.11">4.11. How do I make nano my default editor (in Pine, mutt, etc.)?</a><br>
<a href="#4.12">4.12. I've compiled nano with color support, but I don't see any color when I run it!</a><br>
<a href="#4.13">4.13. How do I select text for the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?</a></p></blockquote>
<a href="#4.13">4.13. How do I select text for or paste text from the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?</a><br>
<a href="#4.14">4.14. When I paste text into a document, each line gets indented further than the last. Why does nano do this, and how can I avoid it?</a></p></blockquote>
<h2><a href="#5">5. Internationalization</a></h2>
<blockquote><p><a href="#5.1">5.1. There's no translation for my language!</a><br>
<a href="#5.2">5.2. I don't like the translation for &lt;x&gt; in my language. How can I fix it?</a><br>
@@ -52,21 +53,19 @@
<h2><a href="#6">6. Advocacy and Licensing</a></h2>
<blockquote><p><a href="#6.1">6.1. Why should I use nano instead of Pico?</a><br>
<a href="#6.2">6.2. Why should I use Pico instead of nano?</a><br>
<a href="#6.3">6.3. What is so bad about the Pine license?</a><br>
<a href="#6.4">6.4. Okay, well what mail program should I use then?</a><br>
<a href="#6.5">6.5. Why doesn't UW simply change their license?</a><br>
<a href="#6.6">6.6. What if tomorrow UW changes the license to be truly Free Software?</a></p></blockquote>
<a href="#6.3">6.3. What is so bad about the older Pine license?</a><br>
<a href="#6.4">6.4. Okay, well, what mail program should I use then?</a></p></blockquote>
<h2><a href="#7">7. Miscellaneous</a></h2>
<blockquote><p><a href="#7.1">7.1. Nano-related mailing lists.</a><br>
<blockquote><p><a href="#7.1">7.1. nano-related mailing lists.</a><br>
<a href="#7.2">7.2. I want to send the development team a big load of cash (or just a thank you).</a><br>
<a href="#7.3">7.3. How do I submit a patch?</a><br>
<a href="#7.3">7.3. How do I submit a bug report or patch?</a><br>
<a href="#7.4">7.4. How do I join the development team?</a><br>
<a href="#7.5">7.5. Can I have CVS write access?</a></p></blockquote>
<a href="#7.5">7.5. Can I have write access to the subversion tree?</a></p></blockquote>
<h2><a href="#8">8. ChangeLog</a></h2>
<hr width="100%">
<h1><a name="1"></a>1. General</h1>
<h2><a name="1.1"></a>1.1 About this FAQ</h2>
<blockquote><p>This FAQ was originally written and maintained by Chris Allegretta &lt;<a href="mailto:chrisa@asty.org">chrisa@asty.org</a>&gt;, who also happens to be the creator of nano. It is currently maintained by David Lawrence Ramsey &lt;<a href="mailto:pooka109@cox.net">pooka109@cox.net</a>&gt;. Maybe someone else will volunteer to maintain this FAQ someday, who knows...</p></blockquote>
<blockquote><p>This FAQ was originally written and maintained by Chris Allegretta &lt;<a href="mailto:chrisa@asty.org">chrisa@asty.org</a>&gt;, who also happens to be the creator of nano. It was then maintained by David Lawrence Ramsey &lt;<a href="mailto:pooka109@gmail.com">pooka109@gmail.com</a>&gt;. Maybe someone else will volunteer to maintain this FAQ someday, who knows...</p></blockquote>
<h2><a name="1.2"></a>1.2. How do I contribute to it?</h2>
<blockquote><p>Your best bet is to send it to the nano email address, <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a> and if it is useful enough it will be included in future versions.</p></blockquote>
<h2><a name="1.3"></a>1.3. What is GNU nano?</h2>
@@ -76,17 +75,17 @@
<p><b>In the beginning...</b></p>
<p>For years Pine was THE program used to read email on a Unix system. The Pico text editor is the portion of the program one would use to compose his or her mail messages. Many beginners to Unix flocked to Pico and Pine because of their well organized, easy to use interfaces. 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.</p>
<p><b>Then came Debian...</b></p>
<p>The <a href="http://www.debian.org/">Debian GNU/Linux</a> distribution, known for its strict standards in distributing truly &quot;free&quot; software (i.e. software with no restrictions on redistribution), would not include a binary package for Pine or Pico. Many people had a serious dilemma: they loved these programs, but they were not truly free software in the <a href="http://www.gnu.org/philosophy/free-sw.html">GNU</a> sense of the word.</p>
<p>The <a href="http://www.debian.org/">Debian GNU/Linux</a> distribution, known for its strict standards in distributing truly &quot;free&quot; software (i.e. software with no restrictions on redistribution), would not include a binary package for Pine or Pico. Many people had a serious dilemma: they loved these programs, but the versions available at the time were not truly free software in the <a href="http://www.gnu.org/philosophy/free-sw.html">GNU</a> sense of the word.</p>
<p><b>The event...</b></p>
<p>It was in late 1999 when Chris Allegretta (our hero) was yet again complaining to himself about the less-than-perfect license Pico was distributed under, the 1000 makefiles that came with it and how just a few small improvements could make it the Best Editor in the World (TM). Having been a convert from Slackware to Debian, he missed having a simple binary package that included Pine and Pico, and had grown tired of downloading them himself.</p>
<p>Finally something snapped inside and Chris coded and hacked like a madman for many hours straight one weekend to make a (barely usable) Pico clone, at the time called TIP (Tip Isn't Pico). The program could not be invoked without a filename, could not save files, had no help text display, spell checker, and so forth. But over time it improved, and with the help of a few great coders it matured to the (hopefully) stable state it is today.</p>
<p>In February 2001, nano was declared an official GNU program by Richard Stallman. Nano also reached its first production release on March 22, 2001.</p></blockquote>
<p>In February 2001, nano was declared an official GNU program by Richard Stallman. nano also reached its first production release on March 22, 2001.</p></blockquote>
<h2><a name="1.5"></a>1.5. Why the name change from TIP?</h2>
<blockquote><p>On January 10, 2000, TIP was officially renamed to nano because of a namespace conflict with another program called 'tip'. The original 'tip' program &quot;establishes a full duplex terminal connection to a remote host&quot;, 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 GNU/Linux distributions (where nano was developed).</p></blockquote>
<h2><a name="1.6"></a>1.6. What is the current version of nano?</h2>
<blockquote><p>The current version of nano *should* be 1.9.99pre2. Of course you should always check the nano homepage to see what the latest and greatest version is.</p></blockquote>
<blockquote><p>The current version of nano *should* be 2.0.7. Of course, you should always check the nano homepage to see what the latest and greatest version is.</p></blockquote>
<h2><a name="1.7"></a>1.7. I want to read the man page without having to download the program!</h2>
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="http://www.nano-editor.org/dist/v1.3/nano.1.html">here</a>.</p></blockquote>
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="http://www.nano-editor.org/dist/v2.0/nano.1.html">here</a>.</p></blockquote>
<hr width="100%">
<h1><a name="2"></a>2. Where to get GNU nano.</h1>
<h2><a name="2.1"></a>2.1. FTP and WWW sites that carry nano.</h2>
@@ -100,8 +99,8 @@
<h2><a name="2.2"></a>2.2. RedHat and derivatives (.rpm) packages.</h2>
<blockquote>
<ul>
<li><a href="http://www.nano-editor.org/dist/v1.2/RPMS/">http://www.nano-editor.org/dist/v1.2/RPMS/</a></li>
<li><a href="http://www.ewtoo.org/~astyanax/nano/dist/v1.2/RPMS/">http://www.ewtoo.org/~astyanax/nano/dist/v1.2/RPMS/</a></li>
<li><a href="http://www.nano-editor.org/dist/v2.0/RPMS/">http://www.nano-editor.org/dist/v2.0/RPMS/</a></li>
<li><a href="http://www.ewtoo.org/~astyanax/nano/dist/v2.0/RPMS/">http://www.ewtoo.org/~astyanax/nano/dist/v2.0/RPMS/</a></li>
</ul>
</blockquote>
<h2><a name="2.3"></a>2.3. Debian (.deb) packages.</h2>
@@ -113,8 +112,8 @@
</ul>
<p>You can also have a look at the <a href="ftp://ftp.debian.org/debian/pool/main/n/nano/">Package Pool</a> to see all the available binary and source packages.</p>
<p>Note that versions &lt; 0.9.10 are probably not for those wanting to get serious work done, so if you are using Debian 2.2, check that you have updated to 2.2r3, which comes with nano 0.9.23. If you're tracking unstable, you probably have the newest version already.</p></blockquote>
<h2><a name="2.4"></a>2.4. By CVS (for the brave).</h2>
<blockquote><p>For the 'bleeding edge' current version of nano, you can use CVS to download the current source code. <b>Note:</b> believe it or not, by downloading code that has not yet stabilized into an official release, there could quite possibly be bugs, in fact the code may not even compile! Anyway, see <a href="http://savannah.gnu.org/cvs/?group=nano">the nano CVS page</a> for info on anonymous CVS access to the nano source.</p></blockquote>
<h2><a name="2.4"></a>2.4. By subversion (for the brave).</h2>
<blockquote><p>For the 'bleeding edge' current version of nano, you can use subversion to download the current source code. <b>Note:</b> believe it or not, by downloading code that has not yet stabilized into an official release, there could quite possibly be bugs, in fact the code may not even compile! Anyway, see <a href="http://svn.savannah.gnu.org/viewvc/trunk/nano/README.SVN?root=nano&view=markup">the nano SVN document</a> for info on anonymous SVN access to the nano source.</p></blockquote>
<hr width="100%">
<h1><a name="3"></a>3. Installation and Configuration</h1>
<h2><a name="3.1"></a>3.1. How do install the RPM or DEB package?</h2>
@@ -136,17 +135,16 @@
<p>to put nano into /usr/bin when you run <b>make install</b>.</p></blockquote>
<h2><a name="3.4"></a>3.4. I get errors about 'bindtextdomain', 'gettext', and/or 'gettextdomain'. What can I do about it?</h2>
<blockquote><p>Try doing a <b>./configure --with-included-gettext</b> and see if that solves your problem. You may need to do a <b>make clean; make</b> to get it to work fully.</p></blockquote>
<h2><a name="3.5"></a>3.5. Nano should automatically run strip on the binary when installing it!</h2>
<h2><a name="3.5"></a>3.5. nano should automatically run strip on the binary when installing it!</h2>
<blockquote><p>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.</p></blockquote>
<h2><a name="3.6"></a>3.6. How can I make the executable smaller? This is too bloated!</h2>
<blockquote><p>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:</p>
<pre>
<b>--disable-tabcomp</b> Disable tab completion code for a smaller
binary
<b>--disable-justify</b> Disable justify/unjustify function
<b>--disable-speller</b> Disable spell checker function
<b>--disable-help</b> Disable help function
<b>--disable-browser</b> Disable mini file browser
<b>--disable-tabcomp</b> Disable tab completion functions
<b>--disable-justify</b> Disable justify/unjustify functions
<b>--disable-speller</b> Disable spell checker functions
<b>--disable-help</b> Disable help functions
<b>--disable-browser</b> Disable built-in file browser
<b>--disable-wrapping</b> Disable all wrapping of text (and -w flag)
<b>--disable-mouse</b> Disable mouse support (and -m flag)
<b>--disable-operatingdir</b> Disable setting of operating directory</pre>
@@ -154,13 +152,13 @@
<p>If, on the other hand, you can't live without bells and whistles, you could try:</p>
<pre>
<b>--enable-extra</b> Enable extra features, currently only easter eggs
<b>--enable-nanorc</b> Enable use of .nanorc file
<b>--enable-nanorc</b> Enable use of .nanorc files
<b>--enable-color</b> Enable color and syntax highlighting
<b>--enable-multibuffer</b> Enable having multiple file buffers open
<b>--enable-all</b> Enable all of the above features
<b>--disable-wrapping-as-root</b>
Turn off wrapping of text by default when the
user is root</pre></blockquote>
Disable text wrapping by default when the user is
root</pre></blockquote>
<h2><a name="3.7"></a>3.7. Tell me more about this multibuffer stuff!</h2>
<blockquote><p>To use multiple file buffers, you must be using nano 1.1.0 or newer, and you must have configured nano with <b>--enable-multibuffer</b> (use nano -V to check). Then when you want to enable inserting a file into its own buffer instead of into the current file, just hit <b>Meta-F</b>, then insert the file as normal with <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>--multibuffer</b> or <b>-F</b> flag when you invoke nano.</p>
<p>You can move between the buffers you have open with the <b>Meta-&lt;</b> and <b>Meta-&gt;</b> keys, or more easily with <b>Meta-,</b> and <b>Meta-.</b> (clear as mud, right? =-). When you have more than one file buffer open, the ^X shortcut will say &quot;Close&quot;, instead of the normal &quot;Exit&quot; when only one buffer is open.</p></blockquote>
@@ -172,12 +170,14 @@
<hr width="100%">
<h1><a name="4"></a>4. Running</h1>
<h2><a name="4.1"></a>4.1. How do I open a file with a name beginning with '+' from the command line?</h2>
<blockquote><p>If a command line option that begins with '+' is followed by another option, the former is always treated as a starting line number and the latter is always treated as a filename. If a command line option that begins with '+' isn't followed by another option, it's always treated as a filename. Examples:</p>
<blockquote><p>If a command line option that begins with '+' is followed by another option, the former is always treated as a starting line and column number and the latter is always treated as a filename. If a command line option that begins with '+' isn't followed by another option, it's always treated as a filename. Examples:</p>
<p>To open '+filename.txt' starting on line 1: <b>nano +filename.txt</b><br>
To open '+filename.txt' starting on line 10: <b>nano +10 +filename.txt</b><br>
To open '+filename.txt' starting on line 1, column 20: <b>nano +,20 +filename.txt</b><br>
To open '+filename.txt' starting on line 10, column 20: <b>nano +10,20 +filename.txt</b><br>
To open '+filename.txt' starting on line 1 and 'filename.txt' starting on line 10 (if nano has been compiled with multibuffer support): <b>nano +1 +filename.txt +20 filename.txt</b></p></blockquote>
<h2><a name="4.2"></a>4.2. Ack! My Backspace/Delete/Enter/Meta/double bucky key doesn't seem to work! What can I do?</h2>
<blockquote><p>Try setting your $TERM variable to 'vt100'. Nano doesn't yet support every term entry under the sun.</p>
<blockquote><p>Try setting your $TERM variable to 'vt100'. nano doesn't yet support every term entry under the sun.</p>
<p>Bourne shell users (bash and sh): <b>export TERM=vt100</b><br>
C Shell users (tcsh and csh): <b>setenv TERM vt100</b></p></blockquote>
<h2><a name="4.3"></a>4.3. Ack! My numeric keypad's keys don't work properly when NumLock is off! What can I do?</h2>
@@ -186,9 +186,9 @@
<blockquote><p>This is a bug in the terminal, not in nano. When a key is repeating faster than nano can process it, the keyboard buffer becomes full and starts dropping incoming keystrokes. Unfortunately, it doesn't just drop whole keystrokes; it can also drop parts of multibyte key combinations, resulting in nano's receiving a wrong key.</p></blockquote>
<h2><a name="4.5"></a>4.5. How do I type the F13-F16 keys shown in the help browser? My keyboard only has F1-F12!</h2>
<blockquote><p>It depends on the terminal type you're using. On some terminals, such as the FreeBSD console, xterm, konsole, and gnome-terminal, Shift-F1 to Shift-F4 will generate F13 to F16. On other terminals, such as the Linux console, rxvt, and Eterm, Shift-F3 to Shift-F6 will generate F13 to F16.</p></blockquote>
<h2><a name="4.6"></a>4.6. Nano crashes when I type &lt;insert keystroke here&gt;!</h2>
<h2><a name="4.6"></a>4.6. nano crashes when I type &lt;insert keystroke here&gt;!</h2>
<blockquote><p>If you aren't trying some bizarre keystroke combination with some bizarre $TERM entry, chances are you have found a bug. You are welcome to submit it to the <a href="mailto:nano-devel@gnu.org">nano-devel</a> list or to <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.</p></blockquote>
<h2><a name="4.7"></a>4.7. Nano crashes when I resize my window. How can I fix that?</h2>
<h2><a name="4.7"></a>4.7. nano crashes when I resize my window. How can I fix that?</h2>
<blockquote><p>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).</p></blockquote>
<h2><a name="4.8"></a>4.8. [version 1.3.12 and later] I'm using glibc 2.2.3, and nano crashes when I use color support or do regular expression searches. How can I fix that?</h2>
<blockquote><p>It's a bug in glibc 2.2.3. You should upgrade to at least glibc 2.2.4.</p></blockquote>
@@ -215,11 +215,13 @@
<blockquote><p>If you want nano to actually use color, you have to specify the color configurations you want it to use in your .nanorc. Some example configurations are in the <b>nanorc.sample</b> that comes with the nano source or your nano package. See Section <a href="#3.9">3.9</a>.</p></blockquote>
<h2><a name="4.13"></a>4.13. How do I select text for or paste text from the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?</h2>
<blockquote><p>Try holding down the Shift key and selecting or pasting the text as you normally would.</p></blockquote>
<h2><a name="4.14"></a>4.14. When I paste text into a document, each line gets indented further than the last. Why does nano do this, and how can I avoid it?</h2>
<blockquote><p>You have the autoindent feature turned on. Hit Meta-I to turn it off, paste your text, and then hit Meta-I again to turn it back on.</p></blockquote>
<hr width="100%">
<h1><a name="5"></a>5. Internationalization</h1>
<h2><a name="5.1"></a>5.1. There's no translation for my language!</h2>
<blockquote><p>On June of 2001, GNU nano entered the <a href="http://www.iro.umontreal.ca/translation/HTML/">Free Translation Project</a> and since then, translations should be managed from there.</p>
<p>If there isn't a translation for your language, you could ask <a href="http://www.iro.umontreal.ca/translation/HTML/teams.html">your language team</a> to translate nano, or better still, join your team and do it yourself. Joining a team is easy. You just need to ask the <a href="mailto:translation@iro.umontreal.ca">TP coordinator</a> to add you to your team, and send a <a href="http://www.iro.umontreal.ca/translation/HTML/disclaim.html">translation disclaimer to the FSF</a> (this is necessary as nano is an official GNU package, but it does <b>not</b> mean that you transfer the rights of your work to the FSF, it's just so the FSF can legally manage them).</p>
<blockquote><p>On June of 2001, GNU nano entered the <a href="http://translationproject.org/html/welcome.html">Free Translation Project</a> and since then, translations should be managed from there.</p>
<p>If there isn't a translation for your language, you could ask <a href="http://translationproject.org/team/">your language team</a> to translate nano, or better still, join your team and do it yourself. Joining a team is easy. You just need to ask the <a href="mailto:coordinator@translationproject.org">TP coordinator</a> to add you to your team, and send a <a href="http://translationproject.org/disclaim.txt">translation disclaimer to the FSF</a> (this is necessary as nano is an official GNU package, but it does <b>not</b> mean that you transfer the rights of your work to the FSF, it's just so the FSF can legally manage them).</p>
<p>In any case, translating nano is very easy. Just grab the <b>nano.pot</b> file from the latest and greatest nano distribution (it's in the <b>po/</b> directory) and translate each line into your native language on the <b>msgstr</b> line. When you're done, you should send it to the TP's central po repository.</p></blockquote>
<h2><a name="5.2"></a>5.2. I don't like the translation for &lt;x&gt; in my language. How can I fix it?</h2>
<blockquote><p>The best way would probably be to e-mail the person listed in the <code>Last-Translator:</code> field in the <b>&lt;your_language&gt;.po</b> file with your suggested corrections and they can make the changes reach the nano-devel list.</p></blockquote>
@@ -228,35 +230,44 @@
<hr width="100%">
<h1><a name="6"></a>6. Advocacy and Licensing</h1>
<h2><a name="6.1"></a>6.1. Why should I use nano instead of Pico?</h2>
<blockquote><p>There are many reasons to use nano instead of Pico, a more complete list can be found at the <a href="http://www.nano-editor.org/">nano homepage</a>.</p></blockquote>
<blockquote><p>There are many reasons to use nano instead of Pico. A more complete list can be found at the <a href="http://www.nano-editor.org/">nano homepage</a>.</p></blockquote>
<h2><a name="6.2"></a>6.2. Why should I use Pico instead of nano?</h2>
<blockquote><p>Again, check out the <a href="http://www.nano-editor.org/">nano homepage</a> for a good summary of reasons. It really is a matter of personal preference as to which editor you should use. If you're the type of person who likes using the original version of a program, then Pico is the editor for you. If you're looking for a few more features and a 'better' license as far as adding your own changes (sacrificing mailer integration with Pine), nano is the way to go.</p></blockquote>
<h2><a name="6.3"></a>6.3. What is so bad about the Pine license?</h2>
<blockquote><p>The U of W license for Pine and Pico is not considered truly Free Software according to both the Free Software Foundation and the <a href="http://www.debian.org/social_contract#guidelines">Debian Free Software Guidelines</a>. The main problem regards the limitations on distributing derived works: according to UW, you can distribute their software, and you can modify it, but you can not do both, i.e. distribute modified binaries.</p></blockquote>
<h2><a name="6.4"></a>6.4. Okay, well what mail program should I use then?</h2>
<blockquote><p>If you are looking to use a Free Software program similar to Pine and emacs is not your thing, you should definitely take a look at <a href="http://www.mutt.org/">mutt</a>. 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. It's also licensed under the GPL.</p></blockquote>
<h2><a name="6.5"></a>6.5. Why doesn't UW simply change their license?</h2>
<blockquote><p>You're really not asking the right person here. I (Chris) waited a long time to see if UW would change their license because of the amount of high quality software being released and developed under the GPL without being taken advantage of by malicious corporate entities or other baddies, but no such luck so far.</p></blockquote>
<h2><a name="6.6"></a>6.6. What if tomorrow UW changes the license to be truly Free Software?</h2>
<blockquote><p>Honestly nothing would make me happier than to see that happen. Nano would continue to be developed independently until such time as Pico had all the features nano did or the projects merged. That just does not seem very likely given that there has been no sign of any changes in the past few years in a positive direction.</p></blockquote>
<blockquote><p>Again, check out the <a href="http://www.nano-editor.org/">nano homepage</a> for a good summary of reasons. It really is a matter of personal preference as to which editor you should use. If you're the type of person who likes using the original version of a program, then Pico is the editor for you. If you don't mind sacrificing mailer integration with Pine, and are looking for a few more features, as well as a 'better' license in terms of adding your own changes, nano is the way to go.</p><p>Note that the last of these no longer applies to the new version of Pine, <a href="http://www.washington.edu/alpine/">Alpine</a>, which is under the Apache License, version 2.0.</p></blockquote>
<h2><a name="6.3"></a>6.3. What is so bad about the older Pine license?</h2>
<blockquote><p>The U of W license for older versions of Pine and Pico is not considered truly Free Software according to both the Free Software Foundation and the <a href="http://www.debian.org/social_contract#guidelines">Debian Free Software Guidelines</a>. The main problem regards the limitations on distributing derived works: according to UW, you can distribute their software, and you can modify it, but you can not do both, i.e. distribute modified binaries.</p></blockquote>
<h2><a name="6.4"></a>6.4. Okay, well, what mail program should I use then?</h2>
<blockquote><p>If you are looking to use a Free Software program similar to Pine, and Emacs is not your thing, you should definitely take a look at <a href="http://www.mutt.org/">mutt</a>. 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. It's also under the GNU General Public License, version 2.0.<P>
Of course, due to the license change you can now use the <A HREF="http://www.washington.edu/alpine/">Alpine distribution</A> of PINE as it is now considered Free Software, but you would be sacrificing many of nano's features to do so.</p></blockquote>
<hr width="100%">
<h1><a name="7"></a>7. Miscellaneous</h1>
<h2><a name="7.1"></a>7.1. Nano-related mailing lists.</h2>
<blockquote><p>There are three mailing lists for nano hosted at <a href="http://savannah.gnu.org/">Savannah</a>, info-nano, help-nano and nano-devel. Info-nano is a very low traffic list where new versions of nano are announced (surprise!) Help-nano is for getting help with the editor without needing to hear all of the development issues surrounding it. Nano-devel is a normally low, sometimes high traffic list for discussing the present and future development of nano. Here are links to where you can sign up for a given list:</p>
<h2><a name="7.1"></a>7.1. nano-related mailing lists.</h2>
<blockquote><p>There are three mailing lists for nano hosted at <a href="http://savannah.gnu.org/">Savannah</a>, info-nano, help-nano and nano-devel. info-nano is a very low traffic list where new versions of nano are announced (surprise!). help-nano is for getting help with the editor without needing to hear all of the development issues surrounding it. nano-devel is a normally low, sometimes high traffic list for discussing the present and future development of nano. Here are links to where you can sign up for a given list:</p>
<p>info-nano - <a href="http://mail.gnu.org/mailman/listinfo/info-nano/">http://mail.gnu.org/mailman/listinfo/info-nano/</a><br>
help-nano - <a href="http://mail.gnu.org/mailman/listinfo/help-nano/">http://mail.gnu.org/mailman/listinfo/help-nano/</a><br>
nano-devel - <a href="http://mail.gnu.org/mailman/listinfo/nano-devel/">http://mail.gnu.org/mailman/listinfo/nano-devel/</a></p></blockquote>
<h2><a name="7.2"></a>7.2. I want to send the development team a big load of cash (or just a thank you).</h2>
<blockquote><p>That's fine. Send it <a href="mailto:nano-devel@gnu.org">our way</a>! Better yet, fix a <a href="http://www.nano-editor.org/dist/v1.3/BUGS">bug</a> in the program or implement a <a href="http://www.nano-editor.org/dist/v1.3/TODO">cool feature</a> and send us that instead (though cash is fine too).</p></blockquote>
<h2><a name="7.3"></a>7.3. How do I submit a patch?</h2>
<blockquote><p>See Section <a href="#7.2">7.2</a>.</p></blockquote>
<blockquote><p>That's fine. Send it <a href="mailto:nano-devel@gnu.org">our way</a>! Better yet, fix a <a href="http://www.nano-editor.org/dist/v2.0/BUGS">bug</a> in the program or implement a <a href="http://www.nano-editor.org/dist/v2.0/TODO">cool feature</a> and send us that instead (though cash is fine too).</p></blockquote>
<h2><a name="7.3"></a>7.3. How do I submit a bug report or patch?</h2>
<blockquote>
<p>The best place to submit bugs is to the <A HREF="https://savannah.gnu.org/bugs/?group=nano">Savannah bug tracker</A> as you can check whether the bug you are submitting has already been submitted.
<p>Please submit patches for nano via the <a href="https://savannah.gnu.org/patch/?group=nano">Savannah project's patch manager</a> for the nano project.</p></blockquote>
<h2><a name="7.4"></a>7.4. How do I join the development team?</h2>
<blockquote><p>The easiest way is to consistently send in good patches that add some needed functionality, fix a bug or two and/or make the program more optimized/efficient. Then ask nicely and you will probably be added to the Savannah development list and be given CVS write access after awhile. There is a lot of responsibility that goes along with being a team member, so don't think it's just something to add to your resume.</p></blockquote>
<h2><a name="7.5"></a>7.5. Can I have CVS write access?</h2>
<blockquote><p>The easiest way is to consistently send in good patches that add some needed functionality, fix a bug or two and/or make the program more optimized/efficient. Then ask nicely and you will probably be added to the Savannah development list and be given SVN write access after awhile. There is a lot of responsibility that goes along with being a team member, so don't think it's just something to add to your resume.</p></blockquote>
<h2><a name="7.5"></a>7.5. Can I have write access to the subversion tree?</h2>
<blockquote><p>Re-read Section <a href="#7.4">7.4</a> and you should know the answer.</p></blockquote>
<h2><a name="8"></a>8. ChangeLog</h2>
<blockquote>
<p>2006/07/25 - Update section 5.3 again to not state &quot;the latest development version&quot; before 1.3.12, as it's no longer accurate. Also add some minor spacing fixes. (DLR)<br>
<blockquote><p>2007/12/21 - Update maintainer information. (DLR)<br>
2008/03/16 - Update docs to refer to subversion instead of CVS, add more words about Apline, and refer to Savannah for bugs and patches. (chrisa)
2007/12/09 - Add minor punctuation and wording fixes, and update various sections to account for Alpine. (DLR)<br>
2007/08/26 - Update links to the Free Translation Project. (DLR)<br>
2007/07/29 - Update RPM links for nano 2.0.x. (DLR)<br>
2007/04/18 - Add a new section 4.14 to explain how autoindent affects pasted text. (John M. Gabriele, minor tweaks by DLR)<br>
2007/04/04 - Update email address. (DLR)<br>
2007/01/01 - Update section 4.1 to describe how to open files with names beginning with '+' at specified columns as well as lines. (DLR)<br>
2006/11/25 - Add miscellaneous wording and capitalization fixes. (DLR)<br>
2006/10/28 - Update various links for the 2.0 branch of nano. (DLR)<br>
2006/10/06 - Update the question in section 4.13 to match the version of it in the answer section. (DLR)<br>
2006/07/25 - Update section 5.3 again to not state &quot;the latest development version&quot; before 1.3.12, as it's no longer accurate. Also add some minor spacing fixes. (DLR)<br>
2006/06/12 - Update section 5.3, due to the display fix for two-column Unicode characters. (DLR)<br>
2006/06/05 - Add a new section 4.8, and move all section 4 entries after it down one number, to explain how to deal with glibc 2.2.3's crashes involving extended regular expressions. (DLR)<br>
2006/06/04 - Add minor punctuation, wording, and typo fixes. (DLR)<br>

View File

@@ -1,5 +0,0 @@
Makefile
Makefile.in
nano.1.html
nanorc.5.html
rnano.1.html

View File

@@ -1,5 +1,3 @@
Makefile
Makefile.in
nano.1.html
nanorc.5.html
rnano.1.html

View File

@@ -4,15 +4,22 @@ else
SUBDIRS =
endif
if USE_NANORC
man_MANS = nano.1 nanorc.5 rnano.1
BUILT_SOURCES = nano.1.html nanorc.5.html rnano.1.html
else
man_MANS = nano.1 rnano.1
BUILT_SOURCES = nano.1.html rnano.1.html
endif
nano_man_mans = nano.1 nanorc.5 rnano.1
nano_built_sources = nano.1.html nanorc.5.html rnano.1.html
nano.1.html: nano.1
cat $< | groff -t -mandoc -Thtml > $@
groff -t -mandoc -Thtml < $< > $@
nanorc.5.html: nanorc.5
cat $< | groff -t -mandoc -Thtml > $@
groff -t -mandoc -Thtml < $< > $@
rnano.1.html: rnano.1
cat $< | groff -t -mandoc -Thtml > $@
groff -t -mandoc -Thtml < $< > $@
EXTRA_DIST = $(man_MANS) $(BUILT_SOURCES)
EXTRA_DIST = $(nano_man_mans) $(nano_built_sources)

View File

@@ -1,14 +1,21 @@
man_MANS = nano.1 nanorc.5 rnano.1
mandir = @mandir@/fr
if USE_NANORC
man_MANS = nano.1 nanorc.5 rnano.1
BUILT_SOURCES = nano.1.html nanorc.5.html rnano.1.html
else
man_MANS = nano.1 rnano.1
BUILT_SOURCES = nano.1.html rnano.1.html
endif
nano_man_mans = nano.1 nanorc.5 rnano.1
nano_built_sources = nano.1.html nanorc.5.html rnano.1.html
nano.1.html: nano.1
cat $< | groff -t -mandoc -Thtml > $@
groff -t -mandoc -Thtml < $< > $@
nanorc.5.html: nanorc.5
cat $< | groff -t -mandoc -Thtml > $@
groff -t -mandoc -Thtml < $< > $@
rnano.1.html: rnano.1
cat $< | groff -t -mandoc -Thtml > $@
groff -t -mandoc -Thtml < $< > $@
EXTRA_DIST = $(man_MANS) $(BUILT_SOURCES)
EXTRA_DIST = $(nano_man_mans) $(nano_built_sources)

View File

@@ -1,21 +1,54 @@
.\" Hey, EMACS: -*- nroff -*-
.\" nano.1 is copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,
.\" 2006 by Chris Allegretta <chrisa@asty.org>
.\" Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
.\" Free Software Foundation, Inc.
.\"
.\" Adaptation française (c) 2003-2006 par
.\" Jean-Philippe Guérard <jean-philippe.guerard@tigreraye.org>.
.\" Le travail d'adaptation française de cette page de manuel a été
.\" réalisé par Jean-Philippe Guérard, en 2003, 2004, 2005, 2006 et 2007.
.\" Ce travail d'adaptation est dans le domaine public. Attention, la
.\" page traduite reste soumise au droit d'auteur de ses auteurs
.\" originaux.
.\"
.\" This is free documentation, see the latest version of the GNU
.\" General Public License for copying conditions. There is NO
.\" warranty.
.\" The French translation of this document is a public domain work of
.\" Jean-Philippe Guérard. This translation work was made in 2003, 2004,
.\" 2005, 2006 and 2007. The translated man page in itself is still
.\" subject to the copyright of its original authors.
.\"
.\" Ce document est libre. Reportez-vous à la dernière version de la
.\" licence publique générale GNU (GNU GPL) pour connaître ses
.\" conditions d'utilisation. Ce document est distribué sans
.\" AUCUNE garantie.
.\" This document is dual-licensed. You may distribute and/or modify it
.\" under the terms of either of the following licenses:
.\"
.\" * The GNU General Public License, as published by the Free Software
.\" Foundation, version 3 or (at your option) any later version. You
.\" should have received a copy of the GNU General Public License
.\" along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" * The GNU Free Documentation License, as published by the Free
.\" Software Foundation, version 1.2 or (at your option) any later
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
.\" Back-Cover Texts. You should have received a copy of the GNU Free
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" Ce document est publié sous une double licence. Vous pouvez
.\" le distribuer et le modifier selon les termes de l'une des deux
.\" licences ci-dessous :
.\"
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
.\" votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation. Vous devriez avoir reçu une copie de la
.\" Licence publique générale GNU avec ce programme. Si ce n'est pas
.\" le cas, consultez <http://www.gnu.org/licenses/>.
.\"
.\" * La Licence de documentation libre GNU (GNU FDL), version 1.2 ou,
.\" à votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation, sans section invariante, ni texte de
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
.\" une copie de la Licence de documentation libre GNU avec ce
.\" programme. Si ce n'est pas le cas, consultez
.\" <http://www.gnu.org/licenses/>.
.\"
.\" $Id$
.TH NANO 1 "version 1.9.99pre1" "28\ août\ 2006"
.TH NANO 1 "version 2.0.0" "29\ novembre\ 2007"
.\" Please adjust this date whenever revising the manpage.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.\"
@@ -39,8 +72,8 @@ Pico, l'
contentant pas de copier l'interface et l'ergonomie de Pico, il offre
également certaines fonctions manquantes (ou désactivées par défaut)
dans Pico. Ces fonctionnalités sont, par exemple, les fonctions de
recherche et de remplacement, et la possibilité de sauter directement à un
numéro de ligne.
recherche et de remplacement, et la possibilité de sauter directement à
une ligne et à une colonne précise.
.SH OPTIONS
.TP
@@ -276,10 +309,10 @@ manuel a
le système Debian (mais elle peut être utilisée par d'autres).
.SH TRADUCTION
Cette adaptation française a été réalisé par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 28\ août\ 2006 à partir
de la version du 12\ juillet\ 2006 de la page de manuel de nano
1.9.99pre1. Cette page a été relue par Gérard Delafond.
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir
de la version 1.54 du 11\ octobre\ 2007 de la page de manuel de nano
2.0.0. Cette page a été relue par Gérard Delafond.
Un maximum de soin a été apporté lors de l'élaboration de cette
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si

View File

@@ -1,21 +1,54 @@
.\" Hey, EMACS: -*- nroff -*-
.\" nanorc.5 is Copyright (C) 2003, 2004, 2005, 2006 by the Free
.\" Software Foundation, Inc.
.\" Copyright (C) 2003, 2004, 2005, 2006, 2007
.\" Free Software Foundation, Inc.
.\"
.\" (c) 2003-2006 Jean-Philippe Guérard <jean-philippe.guerard@tigreraye.org>
.\" pour l'adaptation française.
.\" Le travail d'adaptation française de cette page de manuel a été
.\" réalisé par Jean-Philippe Guérard, en 2003, 2004, 2005, 2006 et 2007.
.\" Ce travail d'adaptation est dans le domaine public. Attention, la
.\" page traduite reste soumise au droit d'auteur de ses auteurs
.\" originaux.
.\"
.\" This is free documentation, see the latest version of the GNU
.\" General Public License for copying conditions. There is NO
.\" warranty.
.\" The French translation of this document is a public domain work of
.\" Jean-Philippe Guérard. This translation work was made in 2003, 2004,
.\" 2005, 2006 and 2007. The translated man page in itself is still
.\" subject to the copyright of its original authors.
.\"
.\" Ce document est libre. Reportez-vous à la dernière version de la
.\" licence publique générale GNU (GNU GPL) pour connaître ses
.\" conditions d'utilisation. Ce document est distribué sans
.\" AUCUNE garantie.
.\" This document is dual-licensed. You may distribute and/or modify it
.\" under the terms of either of the following licenses:
.\"
\" $Id$
.TH NANORC 5 "version 1.9.99pre1" "28\ août\ 2006"
.\" * The GNU General Public License, as published by the Free Software
.\" Foundation, version 3 or (at your option) any later version. You
.\" should have received a copy of the GNU General Public License
.\" along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" * The GNU Free Documentation License, as published by the Free
.\" Software Foundation, version 1.2 or (at your option) any later
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
.\" Back-Cover Texts. You should have received a copy of the GNU Free
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" Ce document est publié sous une double licence. Vous pouvez
.\" le distribuer et le modifier selon les termes de l'une des deux
.\" licences ci-dessous :
.\"
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
.\" votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation. Vous devriez avoir reçu une copie de la
.\" Licence publique générale GNU avec ce programme. Si ce n'est
.\" pas le cas, consultez <http://www.gnu.org/licenses/>.
.\"
.\" * La Licence de documentation libre GNU (GNU FDL), version 1.2
.\" ou, à votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation, sans section invariante, ni texte de
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
.\" une copie de la Licence de documentation libre GNU avec ce
.\" programme. Si ce n'est pas le cas, consultez
.\" <http://www.gnu.org/licenses/>.
.\"
.\" $Id$
.TH NANORC 5 "version 2.0.0" "29\ novembre\ 2007"
.\" Please adjust this date whenever revising the manpage.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
@@ -32,7 +65,7 @@ remplacer Pico, l'
Pico, il offre également certaines fonctionnalités manquantes (ou
désactivées par défaut) de Pico. Ces fonctionnalités sont, par exemple,
les fonctions de recherche et de remplacement et la possibilité de
sauter directement à un numéro de ligne.
sauter directement à une ligne et à une colonne précise.
.PP
Le fichier \fInanorc\fP contient les paramètres par défaut de
\fBnano\fP. Il ne doit pas être au format DOS ou Mac. Lors de son
@@ -89,11 +122,11 @@ justification des paragraphes. Ces caract
d'espaces. Seules les ponctuations terminales, éventuellement suivies
de crochets fermants, peuvent terminer une phrase.
(N.D.T.\ : reportez-vous au paragraphe sur l'option \fBpunct\fR pour
plus d'informations.)
La valeur par défaut de cette option est\ : "\fI"')>]}\fP".
N.D.T.\ : reportez-vous au paragraphe sur l'option \fBpunct\fR pour
plus d'informations.
.TP
.B set/unset casesensitive
Par défaut, les recherches ne tiennent pas compte de la casse.
@@ -172,11 +205,11 @@ inclure de blancs. Seules les ponctuations terminales,
suivies de crochets fermants, peuvent terminer une phrase. La valeur par
défaut de cette option est "\fI!.?\fP".
(N.D.T.\ : ce réglage permet, lors de la justification, de conserver
N.D.T.\ : ce réglage permet, lors de la justification, de conserver
2\ espaces au lieu d'une derrière les ponctuations terminales, ce qui
correspond aux normes typographiques anglo-saxonnes, mais n'a pas lieu
d'être en français. Pour le français, le plus simple est d'indiquer,
dans le fichier nanorc, une chaîne vide pour ce paramètre.)
dans le fichier nanorc, une chaîne vide pour ce paramètre.
.TP
.B set/unset quickblank
Effacement rapide de la ligne d'état. Les messages affichés par la ligne
@@ -325,10 +358,10 @@ manuel a
le système Debian (mais elle peut être utilisée par d'autres).
.SH TRADUCTION
Cette adaptation française a été réalisé par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 28\ août\ 2006 à partir de
la version du 30\ juillet\ 2006 de la page de manuel de nanorc (pour la
version 1.9.99pre1 de nano). Cette page a été relue par Gérard
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir de
la version 1.56 du 11\ octobre\ 2007 de la page de manuel de nanorc
(pour la version 2.0.0 de nano). Cette page a été relue par Gérard
Delafond.
Un maximum de soin a été apporté lors de l'élaboration de cette

View File

@@ -1,22 +1,54 @@
.\" Hey, EMACS: -*- nroff -*-
.\" rnano.1 is Copyright 2005, 2006 by Thijs Kinkhorst
.\" <thijs@kinkhorst.com>; skeleton based on nano-tiny.1 by Jordi
.\" Mallach <jordi@gnu.org>.
.\" Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
.\" Skeleton based on nano-tiny.1:
.\" Copyright (C) 2002 Free Software Foundation, Inc.
.\"
.\" Adaptation française (c) 2006 par
.\" Jean-Philippe Guérard <jean-philippe.guerard@tigreraye.org>.
.\" Le travail d'adaptation française de cette page de manuel a été
.\" réalisé par Jean-Philippe Guérard, en 2006 et 2007. Ce travail
.\" d'adaptation est dans le domaine public. Attention, la page traduite
.\" reste soumise au droit d'auteur de ses auteurs originaux.
.\"
.\" This is free documentation, see the latest version of the GNU
.\" General Public License for copying conditions. There is NO
.\" warranty.
.\" The French translation of this document is a public domain work of
.\" Jean-Philippe Guérard. This translation work was made in 2006 and
.\" 2007. The translated man page in itself is still subject to the
.\" copyright of its original authors.
.\"
.\" Ce document est libre. Reportez-vous à la dernière version de la
.\" licence publique générale GNU (GNU GPL) pour connaître ses
.\" conditions d'utilisation. Ce document est distribué sans
.\" AUCUNE garantie.
.\" This document is dual-licensed. You may distribute and/or modify it
.\" under the terms of either of the following licenses:
.\"
.\" * The GNU General Public License, as published by the Free Software
.\" Foundation, version 3 or (at your option) any later version. You
.\" should have received a copy of the GNU General Public License
.\" along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" * The GNU Free Documentation License, as published by the Free
.\" Software Foundation, version 1.2 or (at your option) any later
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
.\" Back-Cover Texts. You should have received a copy of the GNU Free
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" Ce document est publié sous une double licence. Vous pouvez
.\" le distribuer et le modifier selon les termes de l'une des deux
.\" licences ci-dessous :
.\"
.\" * La Licence publique générale GNU (GNU GPL) version 3 ou, à
.\" votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation. Vous devriez avoir reçu une copie de la
.\" Licence publique générale GNU avec ce programme. Si ce n'est pas
.\" le cas, consultez <http://www.gnu.org/licenses/>.
.\"
.\" * La Licence de documentation libre GNU (GNU FDL), version 1.2 ou,
.\" à votre choix, supérieure, telle que publiée par la Free
.\" Software Foundation, sans section invariante, ni texte de
.\" première ou de quatrième de couverture. Vous devriez avoir reçu
.\" une copie de la Licence de documentation libre GNU avec ce
.\" programme. Si ce n'est pas le cas, consultez
.\" <http://www.gnu.org/licenses/>.
.\"
.\" $Id$
.TH RNANO 1 "version 1.9.99pre1" "28\ août\ 20O6"
.TH RNANO 1 "version 2.0.0" "29\ novembre\ 20O7"
.\" Please adjust this date whenever revising the manpage.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.\"
@@ -41,7 +73,7 @@ remplacer Pico, l'
Pico, il offre également certaines fonctions manquantes (ou désactivées
par défaut) dans Pico. Ces fonctionnalités sont, par exemple, les
fonctions de recherche et de remplacement, et la possibilité de sauter
directement à un numéro de ligne.
directement à une ligne et à une colonne précise..
.PP
\fBrnano\fP est une version de \fBnano\fP fonctionnant en mode
restreint, qui ne permet d'éditer que les fichiers indiqués et qui
@@ -105,10 +137,10 @@ Thijs Kinkhorst <thijs@kinkhorst.com>, pour le syst
elle peut être utilisée par d'autres).
.SH TRADUCTION
Cette adaptation française a été réalisé par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 28\ août\ 2006 à partir
de la version du 12\ juillet\ 2006 de la page de manuel de rnano
(pour la version 1.9.99pre1 de nano).
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 29\ novembre\ 2007 à partir
de la version 1.19 du 6\ novembre\ 2007 de la page de manuel de rnano
(pour la version 2.0.0 de nano).
Un maximum de soin a été apporté lors de l'élaboration de cette
traduction\ ; néanmoins, quelques imperfections peuvent subsister. Si

View File

@@ -1,13 +1,25 @@
.\" Hey, EMACS: -*- nroff -*-
.\" nano.1 is Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,
.\" 2006 by Chris Allegretta <chrisa@asty.org>
.\" Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
.\" Free Software Foundation, Inc.
.\"
.\" This is free documentation, see the latest version of the GNU
.\" General Public License for copying conditions. There is NO
.\" warranty.
.\" This document is dual-licensed. You may distribute and/or modify it
.\" under the terms of either of the following licenses:
.\"
.\" * The GNU General Public License, as published by the Free Software
.\" Foundation, version 3 or (at your option) any later version. You
.\" should have received a copy of the GNU General Public License
.\" along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" * The GNU Free Documentation License, as published by the Free
.\" Software Foundation, version 1.2 or (at your option) any later
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
.\" Back-Cover Texts. You should have received a copy of the GNU Free
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" $Id$
.TH NANO 1 "version 1.9.99pre1" "July 12, 2006"
.TH NANO 1 "version 2.0.0" "August 23, 2007"
.\" Please adjust this date whenever revising the manpage.
.\"
@@ -29,7 +41,7 @@ This manual page briefly documents the \fBnano\fP command.
Pico, the default editor included in the non-free Pine package. Rather
than just copying Pico's look and feel, \fBnano\fP also implements some
missing (or disabled by default) features in Pico, such as "search and
replace" and "go to line number".
replace" and "go to line and column number".
.SH OPTIONS
.TP

View File

@@ -1,13 +1,25 @@
.\" Hey, EMACS: -*- nroff -*-
.\" nanorc.5 is Copyright (C) 2003, 2004, 2005, 2006 by the Free
.\" Software Foundation, Inc.
.\" Copyright (C) 2003, 2004, 2005, 2006, 2007
.\" Free Software Foundation, Inc.
.\"
.\" This is free documentation, see the latest version of the GNU
.\" General Public License for copying conditions. There is NO
.\" warranty.
.\" This document is dual-licensed. You may distribute and/or modify it
.\" under the terms of either of the following licenses:
.\"
.\" * The GNU General Public License, as published by the Free Software
.\" Foundation, version 3 or (at your option) any later version. You
.\" should have received a copy of the GNU General Public License
.\" along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" * The GNU Free Documentation License, as published by the Free
.\" Software Foundation, version 1.2 or (at your option) any later
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
.\" Back-Cover Texts. You should have received a copy of the GNU Free
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" $Id$
.TH NANORC 5 "version 1.9.99pre1" "July 30, 2006"
.TH NANORC 5 "version 2.0.0" "August 23, 2007"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
@@ -19,7 +31,7 @@ This manual page briefly documents GNU \fBnano\fP's rcfile.
Pico, the default editor included in the non-free Pine package. Rather
than just copying Pico's look and feel, \fBnano\fP also implements some
missing (or disabled by default) features in Pico, such as "search and
replace" and "go to line number".
replace" and "go to line and column number".
.PP
The \fInanorc\fP file contains the default settings for \fBnano\fP. It
should not be in DOS or Mac format. During startup, \fBnano\fP will
@@ -238,6 +250,276 @@ Same as above, except that the expression matching is case insensitive.
Read in self-contained color syntaxes from \fIsyntaxfile\fP. Note that
\fIsyntaxfile\fP can only contain \fBsyntax\fP, \fBcolor\fP, and
\fBicolor\fP commands.
.SH KEY BINDINGS
Key bindings may be reassigned via the following commands:
.TP
.B bind \fIkey\fP \fIfunction\fP \fImenu\fP
Rebinds the key \fIkey\fP to a new function named \fIfunction\fP in the
context of menu \fImenu\fP. The format of \fIkey\fP should be one of:
.TP
.B ^
followed by an alpha character or the word "Space".
Example: ^C
.TP
.B M-
followed by a prinable character or the word "Space".
Example: M-C
.TP
.B F
followed by a numeric value from 1 to 16.
Example: F10
.TP
Valid function names to be bound include:
.TP 3
.B help
Invoke the help menu.
.TP
.B cancel
Cancel the current command.
.TP
.B exit
Exit from the program.
.TP
.B writeout
Write the current buffer to disk.
.TP
.B justify
Justify the current text.
.TP
.B insert
Insert a file into the current buffer (or into a new buffer when multibuffer
is enabled).
.TP
.B whereis
Search for text in the current buffer.
.TP
.B searchagain
Repeat the last search command.
.TP
.B up
Move up in the editor or browser.
.TP
.B down
Move down in the editor or browser.
.TP
.B left
Move left in the editor or browser.
.TP
.B right
Move right in the editor or browser.
.TP
.B cut
Cut the current line of text and store it.
.TP
.B uncut
Copy the currently stored text into the current buffer position.
.TP
.B curpos
Show the current line, column, word positions in the file.
.TP
.B firstline
Move to the first line of the file.
.TP
.B lastline
Move to the last line of the file.
.TP
.B gotoline
Move to a specific line (and column if specified).
.TP
.B replace
Interactively replace text within the current buffer.
.TP
.B mark
Begin selecting text for cutting or pasting at the current position.
.TP
.B copytext
Copy the currently marked text without deleting it.
.TP
.B indent
Indent the currently marked text (shift to the right).
.TP
.B unindent
Un-indent the currently marked text (shift to the left).
.TP
.B nextword
Move the cursor to the beginning of the next word.
.TP
.B prevword
Move the cursor to the beginning of the previous word.
.TP
.B home
Move the cursor to the beginning of the current line.
.TP
.B end
Move the cursor to the end of the current line.
.TP
.B beginpara
Move the cursor to the beginning of the current paragraph.
.TP
.B endpara
Move the cursor to the end of the current paragraph.
.TP
.B findbracket
Move the cursor to the matching bracket (brace, parenthesis, etc.) of the one
under the cursor.
.TP
.B scrollup
Scroll up one line of text from the current position.
.TP
.B scrolldown
Scroll down one line of text from the current position.
.TP
.B prevbuf
Switch to editing/viewing the previous buffer when using multibuffer mode.
.TP
.B nextbuf
Switch to editing/viewing the next buffer when using multibuffer mode.
.TP
.B verbatim
Insert the next character verbatim into the file.
.TP
.B tab
Insert a tab at the current cursor location.
.TP
.B enter
Insert a new line below the current one.
.TP
.B delete
Delete the character under the cursor.
.TP
.B fulljustify
Justify the entire current file.
.TP
.B wordcount
Count the number of words in the current buffer.
.TP
.B refresh
Refresh the screen.
.TP
.B undo
Undo the text action peformed (add text, delete text, etc).
.TP
.B suspend
Redo the last action which was undone.
.TP
.B suspend
Suspend the editor (if the suspend function is enabled, see the
"suspendenable" entry below).
.TP
.B casesens
Toggle case sensitivity in searching (search/replace menus only).
.TP
.B regexp
Toggle whether searching/replacing is based on literal strings or regular expressions.
.TP
.B prevhistory
Show the previous history entry in the prompt menus (e.g. search).
.TP
.B nexthistory
Show the next history entry in the prompt menus (e.g. search).
.TP
.B dontreplace
Switch back to searching instead of replacing.
.TP
.B gototext
Search for files matching a string in the file browser (reading or writing files).
.TP
.B dosformat
When writing a file, switch to writing a DOS format (CR/LF).
.TP
.B macformat
When writing a file, switch to writing a Mac format.
.TP
.B append
When writing a file, append to the end instead of overwriting.
.TP
.B prepend
When writing a file, 'prepend' (write at the beginning) instead of overwriting.
.TP
.B backup
When writing a file, create a backup of the current file.
.TP
.B firstfile
Move to the first file when using the file browser (reading or writing files).
.TP
.B lastfile
Move to the last file when using the file browser (reading or writing files).
.TP
.B nohelp
Toggle showing/hiding the two-line list of key bindings at the bottom of the screen.
.TP
.B constupdate
Constantly display the current line, column, word positions.
.TP
.B morespace
Toggle showing/hiding the blank line which 'separates' the 'title' from the file text.
.TP
.B smoothscroll
Toggle smooth scrolling when moving via the arrow keys.
.TP
.B whitespacedisplay
Toggle whether whitespace is shown.
.TP
.B smarthome
Toggle whether the smart home key function is enabled.
.TP
.B autoindent
Toggle whether new lines will contain the same amount of whitespace as the line above.
.TP
.B cuttoend
Toggle whether cutting text will cut the whole line or just from the current cursor
position to the end of the line.
.TP
.B nowrap
Toggle whether long lines will be wrapped to the next line.
.TP
.B suspendenable
Toggle whether the suspend sequence (normally ^Z) will suspend the editor window.
.TP
Valid menu sections are:
.TP
.B main
The main editor window where text is entered.
.TP
.B search
The search menu (AKA whereis).
.TP
.B replace
The 'search to replace' menu.
.TP
.B replacewith
The 'replace with' menu, which comes up after 'search to replace'.
.TP
.B gotoline
The 'goto line (and column)' menu.
.TP
.B writeout
The 'write file' menu.
.TP
.B insert
The 'insert file' menu.
.TP
.B extcmd
The menu for inserting output from an external comman, reached from the insert menu.
.TP
.B help
The help menu.
.TP
.B spell
The interactive spell checker Yes/no menu.
.TP
.B browser
The file browser for inserting or writing a file.
.TP
.B whereisfile
The 'search for a file' menu in the file browser.
.TP
.B gotodir
The 'go to directory' menu.
.TP
.B all
A special name meaning: apply to all menus where this function exists.
.SH FILES
.TP
.I SYSCONFDIR/nanorc

View File

@@ -1,14 +1,26 @@
.\" Hey, EMACS: -*- nroff -*-
.\" rnano.1 is Copyright 2005, 2006 by Thijs Kinkhorst
.\" <thijs@kinkhorst.com>; skeleton based on nano-tiny.1 by Jordi
.\" Mallach <jordi@gnu.org>.
.\" Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
.\" Skeleton based on nano-tiny.1:
.\" Copyright (C) 2002 Free Software Foundation, Inc.
.\"
.\" This is free documentation, see the latest version of the GNU
.\" General Public License for copying conditions. There is NO
.\" warranty.
.\" This document is dual-licensed. You may distribute and/or modify it
.\" under the terms of either of the following licenses:
.\"
.\" * The GNU General Public License, as published by the Free Software
.\" Foundation, version 3 or (at your option) any later version. You
.\" should have received a copy of the GNU General Public License
.\" along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" * The GNU Free Documentation License, as published by the Free
.\" Software Foundation, version 1.2 or (at your option) any later
.\" version, with no Invariant Sections, no Front-Cover Texts, and no
.\" Back-Cover Texts. You should have received a copy of the GNU Free
.\" Documentation License along with this program. If not, see
.\" <http://www.gnu.org/licenses/>.
.\"
.\" $Id$
.TH RNANO 1 "version 1.9.99pre1" "July 12, 2006"
.TH RNANO 1 "version 2.0.0" "August 23, 2007"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
@@ -30,7 +42,7 @@ This manual page briefly documents the \fBrnano\fP command.
Pico, the default editor included in the non-free Pine package. Rather
than just copying Pico's look and feel, \fBnano\fP also implements some
missing (or disabled by default) features in Pico, such as "search and
replace" and "go to line number".
replace" and "go to line and column number".
.PP
\fBrnano\fP is a restricted version of \fBnano\fP, which only edits
specific files and doesn't allow the user access to the filesystem or a

View File

@@ -213,6 +213,18 @@
##
## All regexes should be extended regular expressions.
## Key bindings
## Please see nanorc(5) for more details on this
##
## Here are some samples to get you going
##
# bind M-W nowrap main
# bind M-A casesens search
# bind ^S research main
## Set this if your backspace key sends delete most of the time (2.1.3+)
# bind kdel backspace all
## Nanorc files
# include "@PKGDATADIR@/nanorc.nanorc"
@@ -220,9 +232,24 @@
## C/C++
# include "@PKGDATADIR@/c.nanorc"
## Cascading Style Sheets
# include "@PKGDATADIR@/css.nanorc"
## Debian files
# include "@PKGDATADIR@/debian.nanorc"
## Gentoo files
# include "@PKGDATADIR@/gentoo.nanorc"
## HTML
# include "@PKGDATADIR@/html.nanorc"
## PHP
# include "@PKGDATADIR@/php.nanorc"
## TCL
# include "@PKGDATADIR@/tcl.nanorc"
## TeX
# include "@PKGDATADIR@/tex.nanorc"
@@ -250,8 +277,17 @@
## Java
# include "@PKGDATADIR@/java.nanorc"
## AWK
# include "@PKGDATADIR@/awk.nanorc"
## Assembler
# include "@PKGDATADIR@/asm.nanorc"
## Bourne shell scripts
# include "@PKGDATADIR@/sh.nanorc"
## POV-Ray
# include "@PKGDATADIR@/pov.nanorc"
## XML-type files
# include "@PKGDATADIR@/xml.nanorc"

View File

@@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@@ -8,9 +8,17 @@ pkgdata_DATA = asm.nanorc \
nanorc.nanorc \
patch.nanorc \
perl.nanorc \
pov.nanorc \
python.nanorc \
ruby.nanorc \
sh.nanorc \
tex.nanorc
tex.nanorc \
tcl.nanorc \
php.nanorc \
gentoo.nanorc \
debian.nanorc \
awk.nanorc \
css.nanorc \
xml.nanorc
EXTRA_DIST = $(pkgdata_DATA)

View File

@@ -13,3 +13,5 @@ color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
## Highlight comments
color brightblue "//.*"
color brightblue start="/\*" end="\*/"
## Highlight trailing whitespace
color ,green "[[:space:]]+$"

38
doc/syntax/awk.nanorc Normal file
View File

@@ -0,0 +1,38 @@
## Here is an example for awk.
##
syntax "awk" "\.awk$"
## records
icolor brightred "\$[0-9A-Z_!@#$*?-]+"
## awk-set variables
color red "\<(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\>"
color red "\<(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\>"
color red "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>"
## function declarations and special patterns
color brightgreen "\<(function|extension|BEGIN|END)\>"
## operators
color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)"
## flow control
color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>"
color brightyellow "\<(break|continue|return)\>"
## I/O statements
color brightgreen "\<(close|getline|next|nextfile|print|printf)\>"
color brightgreen "\<(system|fflush)\>"
## standard functions
color magenta "\<(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\>"
color magenta "\<(asort|asorti|gensub|gsub|index|length|match)\>"
color magenta "\<(split|sprintf|strtonum|sub|substr|tolower|toupper)\>"
color magenta "\<(mktime|strftime|systime)\>"
color magenta "\<(and|compl|lshift|or|rshift|xor)\>"
color magenta "\<(bindtextdomain|dcgettext|dcngettext)\>"
##
## String highlighting. You will in general want your comments and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
## Comment highlighting
color brightblue "(^|[[:space:]])#.*$"
## Trailing whitespace
color ,green "[[:space:]]+$"

View File

@@ -8,7 +8,7 @@ color green "\<(class|namespace|template|public|protected|private|typename|this|
color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
color magenta "\<(goto|continue|break|return)\>"
color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
##
## GCC builtins
@@ -25,3 +25,6 @@ color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
## Comment highlighting
color brightblue "//.*"
color brightblue start="/\*" end="\*/"
## Trailing whitespace
color ,green "[[:space:]]+$"

9
doc/syntax/css.nanorc Normal file
View File

@@ -0,0 +1,9 @@
## Here is an example for css files.
##
syntax "css" "\.css$"
color brightred "."
color brightyellow start="\{" end="\}"
color brightwhite start=":" end="([;^\{]|$)"
color brightblue ":active|:focus|:hover|:link|:visited|:link|:after|:before|$"
color brightblue start="\/\*" end="\\*/"
color green ";|:|\{|\}"

20
doc/syntax/debian.nanorc Normal file
View File

@@ -0,0 +1,20 @@
## Here is an exmaple for apt's sources.list
## Adapted from http://milianw.de/blog/Syntax-Highlighting-in-Nano
## (mail@milianw.de).
##
syntax "apt/sources.list" "sources\.list(\.old|~)?$"
# component
color brightmagenta "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+ .+$"
# distribution
color brightred "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+"
# URI
color brightgreen "(http|file|ftp):/[^ ]+"
# cdroms
# [^\]] does not work...
color brightgreen "cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/"
# deb / deb-src
color yellow "^deb"
color yellow "^deb-src"
# comments
color brightblue "#.*"

50
doc/syntax/gentoo.nanorc Normal file
View File

@@ -0,0 +1,50 @@
## Here is an example for Gentoo ebuilds/eclasses
##
syntax "ebuild" "\.e(build|class)$"
## All the standard portage functions
color brightgreen "^src_(unpack|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
## Highlight bash related syntax
color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\>"
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
color green "-(e|d|f|r|g|u|w|x|L)\>"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
## Highlight variables ... official portage ones in red, all others in bright red
color brightred "\$\{?[a-zA-Z_0-9]+\}?"
color red "\<(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\>"
color red "\<(S|D|T|PV|PF|P|PN|A)\>" "\<C(XX)?FLAGS\>" "\<LDFLAGS\>" "\<C(HOST|TARGET|BUILD)\>"
## Highlight portage commands
color magenta "\<use(_(with|enable))?\> [!a-zA-Z0-9_+ -]*" "inherit.*"
color brightblue "\<e(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\>"
color brightblue "\<die\>" "\<use(_(with|enable))?\>" "\<inherit\>" "\<has\>" "\<(has|best)_version\>" "\<unpack\>"
color brightblue "\<(do|new)(ins|s?bin|doc|lib(|\.so|\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\>"
color brightblue "\<do(python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
color brightblue "prepall(|docs|info|man|strip)" "prep(info|lib|lib\.(so|a)|man|strip)"
color brightblue "\<(|doc|ins|exe)into\>" "\<f(owners|perms)\>" "\<(exe|ins|dir)opts\>"
## Highlight common commands used in ebuilds
color blue "\<make\>" "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\>"
## Highlight comments (doesnt work that well)
color yellow "#.*$"
## Highlight strings (doesnt work that well)
color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
## Trailing space is bad!
color ,green "[[:space:]]+$"
## Here is an example for Portage control files
##
syntax "/etc/portage" "\.(keywords|mask|unmask|use)$"
## Base text:
color green "^.+$"
## Use flags:
color brightred "[[:space:]]+\+?[a-zA-Z0-9_-]+"
color brightblue "[[:space:]]+-[a-zA-Z0-9_-]+"
## Likely version numbers:
color magenta "-[[:digit:]].*([[:space:]]|$)"
## Accepted arches:
color white "[~-]?\<(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc|x86|x86-fbsd)\>"
color white "[[:space:]][~-]?\*"
## Categories:
color cyan "^[[:space:]]*.*/"
## Masking regulators:
color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
## Comments:
color yellow "#.*$"

30
doc/syntax/php.nanorc Normal file
View File

@@ -0,0 +1,30 @@
## Here is an example for PHP
##
syntax "php" "\.php[2345s~]?$"
## php markings
color brightgreen "(<\?(php)?|\?>)"
## functions
color white "\<[a-z_]*\("
## types
color green "\<(var|float|global|double|bool|char|int|enum|const)\>"
## structure
color brightyellow "\<(class|new|private|public|function|for|foreach|if|while|do|else|elseif|case|default|switch)\>"
## control flow
color magenta "\<(goto|continue|break|return)\>"
## strings
color brightyellow "<[^= ]*>" ""(\.|[^"])*""
## comments
color brightblue "//.*"
color brightblue start="/\*" end="\*/"
#color blue start="<" end=">"
#color red "&[^;[[:space:]]]*;"
## Trailing whitespace
color ,green "[[:space:]]+$"

15
doc/syntax/pov.nanorc Normal file
View File

@@ -0,0 +1,15 @@
## Here is an example for POV-Ray.
##
syntax "pov" "\.(pov|POV|povray|POVRAY)$"
color brightcyan "^[[:space:]]*#[[:space:]]*(declare)"
color brightyellow "\<(sphere|cylinder|translate|matrix|rotate|scale)\>"
color brightyellow "\<(orthographic|location|up|right|direction|clipped_by)\>"
color brightyellow "\<(fog_type|fog_offset|fog_alt|rgb|distance|transform)\>"
color brightred "^\<(texture)\>"
color brightred "\<(light_source|background)\>"
color brightred "\<(fog|object|camera)\>"
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
color brightmagenta "\<(union|group|subgroup)\>"
## Comment highlighting
color brightblue "//.*"
color brightblue start="/\*" end="\*/"

View File

@@ -3,6 +3,7 @@
syntax "python" "\.py$"
icolor brightblue "def [0-9A-Z_]+"
color brightcyan "\<(and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|map|not|or|pass|print|raise|return|try|while)\>"
color brightgreen "["'].*[^\\]["']" "["']{3}.*[^\\]["']{3}"
color brightgreen "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
color brightgreen "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
color brightgreen start=""""[^"]" end=""""" start="'''[^']" end="'''"
color brightred "#.*$"

View File

@@ -10,3 +10,4 @@ color brightblue "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|m
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
color cyan "(^|[[:space:]])#.*$"
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
color ,green "[[:space:]]+$"

16
doc/syntax/tcl.nanorc Normal file
View File

@@ -0,0 +1,16 @@
syntax "tcl" "\.tcl$"
## Standard Tcl [info commands]
color green "\<(after|append|array|auto_execok|auto_import|auto_load|auto_load_index|auto_qualify|binary|break|case|catch|cd|clock|close|concat|continue|encoding|eof|error|eval|exec|exit|expr|fblocked|fconfigure|fcopy|file|fileevent|flush|for|foreach|format|gets|glob|global|history|if|incr|info|interp|join|lappend|lindex|linsert|list|llength|load|lrange|lreplace|lsearch|lset|lsort|namespace|open|package|pid|puts|pwd|read|regexp|regsub|rename|return|scan|seek|set|socket|source|split|string|subst|switch|tclLog|tell|time|trace|unknown|unset|update|uplevel|upvar|variable|vwait|while)\>"
## Basic Tcl sub commands.
color green "\<(array anymore|array donesearch|array exists|array get|array names|array nextelement|array set|array size|array startsearch|array statistics|array unset)\>"
color green "\<(string bytelength|string compare|string equal|string first|string index|string is|string last|string length|string map|string match|string range|string repeat|string replace|string to|string tolower|string totitle|string toupper|string trim|string trimleft|string trimright|string will|string wordend|string wordstart)\>"
## Extended TclX [info commands]
color green "\<(alarm|auto_load_pkg|bsearch|catclose|catgets|catopen|ccollate|cconcat|cequal|chgrp|chmod|chown|chroot|cindex|clength|cmdtrace|commandloop|crange|csubstr|ctoken|ctype|dup|echo|execl|fcntl|flock|fork|fstat|ftruncate|funlock|host_info|id|infox|keyldel|keylget|keylkeys|keylset|kill|lassign|lcontain|lempty|lgets|link|lmatch|loadlibindex|loop|lvarcat|lvarpop|lvarpush|max|min|nice|pipe|profile|random|readdir|replicate|scancontext|scanfile|scanmatch|select|server_accept|server_create|signal|sleep|sync|system|tclx_findinit|tclx_fork|tclx_load_tndxs|tclx_sleep|tclx_system|tclx_wait|times|translit|try_eval|umask|wait)\>"
## Syntax.
color brightblue "proc[[:space:]]" "(\{|\})"
color green "(\(|\)|\;|`|\\|\$|<|>|!|=|&|\|)"
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
color ,green "[[:space:]]+$"
color ,magenta "^([[:space:]]+|)#.*"

9
doc/syntax/xml.nanorc Normal file
View File

@@ -0,0 +1,9 @@
## Here is an example for xml files.
##
syntax "xml" "\.([jrs]html?|sgml?|xml|xslt?)$"
color green start="<" end=">"
color cyan "<[^> ]+"
color cyan ">"
color yellow start="<!DOCTYPE" end="[/]?>"
color yellow start="<!--" end="-->"
color red "&[^;]*;"

View File

@@ -1,5 +1,3 @@
Makefile
Makefile.in
nano.info
nano.html
texinfo.tex
nano.html
nano.info

View File

@@ -5,6 +5,6 @@ MAKEINFO = makeinfo --no-split
BUILT_SOURCES = nano.html
nano.html: nano.texi
cat $< | makeinfo --no-split --html > $@
makeinfo --no-split --html < $< > $@
EXTRA_DIST = $(info_TEXINFOS) $(BUILT_SOURCES)

View File

@@ -8,8 +8,8 @@
@c Run 'makeinfo' rather than 'texinfo-format-buffer'.
@smallbook
@set EDITION 0.1
@set VERSION 1.9.99pre1
@set UPDATED 30 Jul 2006
@set VERSION 2.0.0
@set UPDATED 17 Dec 2007
@dircategory Editors
@direntry
@@ -23,7 +23,7 @@
@titlepage
@title GNU @code{nano}
@subtitle a small and friendly text editor.
@subtitle version 1.9.99pre1
@subtitle version 2.0.0
@author Chris Allegretta
@page
@@ -33,11 +33,22 @@ editor.
This manual is part of the GNU @code{nano} distribution.@*
@sp4
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by Chris
Allegretta.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This is free documentation, see the latest version of the GNU General
Public License for copying conditions. There is NO warranty.
This document is dual-licensed. You may distribute and/or modify it
under the terms of either of the following licenses:
* The GNU General Public License, as published by the Free Software
Foundation, version 3 or (at your option) any later version. You
should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
* The GNU Free Documentation License, as published by the Free Software
Foundation, version 1.2 or (at your option) any later version, with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
You should have received a copy of the GNU Free Documentation License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You may contact the author by
e-mail: @email{chrisa@@asty.org}@*
@@ -64,8 +75,9 @@ editor.
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, go to line number, auto-indentation, feature
toggles, internationalization support, and filename tab completion.
search and replace, go to line and column number, auto-indentation,
feature toggles, internationalization support, and filename tab
completion.
@menu
* Overview::
@@ -731,7 +743,7 @@ position of the cursor.
@item Interactive Replace and Spell Checker
It is worth noting that @code{nano}'s replace function is interactive,
i.e, it does not stop after one search string is found and automatically
i.e. it does not stop after one search string is found and automatically
replace it. The @code{nano} implementation will pause at each search
string found and query whether to replace this instance or not. The
internal spell checker operates similarly. Note that there is no way to
@@ -792,8 +804,8 @@ line option, which enables long line wrapping.
@item --enable-tiny
This option disables all the above. It also disables some of the larger
internals of the editor, like the marking code and the cut to line code.
It also disables the function toggles.
internals of the editor, like the marking code and the cut to end of
line code. It also disables the function toggles.
@item --enable-debug
Enable support for runtime debug output. This can get pretty messy, so
@@ -830,7 +842,7 @@ Disable long line wrapping by default when nano is run as root.
@item --enable-utf8
Enable support for reading and writing Unicode files. This will require
either the wide version of ncurses, or a UTF-8-enabled version of Slang.
either a wide version of curses, or a UTF-8-enabled version of Slang.
@item --disable-utf8
Disable support for reading and writing Unicode files.

View File

@@ -1,2 +0,0 @@
Makefile.in
Makefile

View File

@@ -13,9 +13,9 @@ dnl
dnl @category Misc
dnl @author Stepan Kasal <kasal@ucw.cz>
dnl @author Andreas Schwab <schwab@suse.de>
dnl @author Guido Draheim <guidod@gmx.de>
dnl @author Guido U. Draheim <guidod@gmx.de>
dnl @author Alexandre Oliva
dnl @version 2005-07-29
dnl @version 2006-10-13
dnl @license AllPermissive
AC_DEFUN([AC_DEFINE_DIR], [

View File

@@ -19,6 +19,9 @@ AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run
gmodule)
pkg_config_args="$pkg_config_args gmodule-2.0"
;;
gmodule-no-export)
pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
;;
gobject)
pkg_config_args="$pkg_config_args gobject-2.0"
;;

27
nano-regress Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/perl
use strict;
sub combinations {
return [] unless @_;
my $first = shift;
my @rest = combinations(@_);
return @rest, map { [$first, @$_] } @rest;
}
my @allargs=("--enable-debug", "--enable-extra", "--enable-tiny", "--disable-browser --disable-help --disable-mouse --disable-operatingdir --disable-operatingdir --disable-speller", "--enable-multibuffer", "--enable-nanorc", "--with-slang");
my @combos = combinations(@allargs);
my $i = 0;
foreach my $name (@combos) {
my @args = @$name;
my $pct = $i / $#combos * 100;
printf "Trying with options: @args, %d%% done...\n", $pct;
if (system "(./configure @args && make clean all) >/dev/null 2>&1") {
print "Build failed for args: @args\n";
print "Try running make to reproduce\n";
exit(1);
}
$i++;
}
print "All options completed successfully!\n";

View File

@@ -1,45 +1,39 @@
%define name @PACKAGE@
%define ver @VERSION@
%define rel 1
%define version @VERSION@
%define release 1
Summary : Pico editor clone with enhancements
Name : %{name}
Version : %{ver}
Release : %{rel}
Copyright : GPL
Group : Console/Editors
Version : %{version}
Release : %{release}
License : GPL
Group : Applications/Editors
URL : http://www.nano-editor.org/
Source : http://www.nano-editor.org/dist/v1.3/%{name}-%{ver}.tar.gz
BuildRoot : /var/tmp/%{name}-buildroot
Requires : ncurses
Source : http://www.nano-editor.org/dist/v2.0/%{name}-%{version}.tar.gz
BuildRoot : %{_tmppath}/%{name}-%{version}-root
BuildRequires : autoconf, automake, gettext-devel, ncurses-devel
%description
GNU nano is a small and friendly text editor. It aims to emulate the Pico
text editor while also offering a few enhancements.
GNU nano is a small and friendly text editor. It aims to emulate the
Pico text editor while also offering a few enhancements.
%prep
%setup -q
%build
%configure --enable-all
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
make
%install
rm -rf "$RPM_BUILD_ROOT"
make DESTDIR="$RPM_BUILD_ROOT" install
rm -rf %{buildroot}
make DESTDIR="%{buildroot}" install
%files
%defattr(-,root,root)
%doc AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS TODO doc/faq.html doc/nanorc.sample
%{_bindir}/*
%{_mandir}/*/*
%{_mandir}/man*/*
%{_mandir}/fr/man*/*
%{_infodir}/nano.info*
%{_datadir}/locale/*/LC_MESSAGES/nano.mo
%{_datadir}/nano/*
%{_infodir}/nano.info*
%changelog
* Sat Mar 30 2002 Chris Allegretta <chrisa@asty.org>
- Accepted into main distribution
- Added Packager and URL tage from original spec file.
* Tue Mar 06 2002 Brett Pemberton <generica@email.com>
- Initial spec-file

View File

@@ -1,18 +0,0 @@
Makefile
Makefile.in
Makefile.in.in
POTFILES
Rules-quot
boldquot.sed
cat-id*
en@boldquot.header
en@quot.header
insert-header.sin
messages
messages.mo
nano.pot
remove-potcdate.sed
remove-potcdate.sin
stamp-cat*
quot.sed
*.gmo

11
po/.gitignore vendored Normal file
View File

@@ -0,0 +1,11 @@
/*.gmo
/Makefile.in.in
/Rules-quot
/boldquot.sed
/en@boldquot.header
/en@quot.header
/insert-header.sin
/POTFILES
/quot.sed
/remove-potcdate.sin

View File

@@ -1,10 +1,97 @@
2007-12-09 Jordi Mallach <jordi@gnu.org>
* LINGUAS: Add zh_CN.
* es.po, fr.po, it.po, nb.po, nl.po, pt_BR.po: New pull from the TP,
to fetch the now corrected latest pt_BR file.
2007-12-08 Jordi Mallach <jordi@gnu.org>
* zh_CN.po: New Simplified Chinese translation by
LI Daobing <lidaobing@gmail.com>.
* fr.po, ga.po, ms.po, nl.po, nn.po, vi.po: Translation updates taken
from the Translation Project.
* Refreshed the rest of the files from the latest TP archive.
2007-09-18 Jordi Mallach <jordi@gnu.org>
* po/ru.po: Updated Russian translation by Sergey A. Ribalchenko.
2007-08-11 David Lawrence Ramsey <pooka109@gmail.com>
* po/update.pl: Relicense to the GNU GPL version 3 or later.
2007-07-31 David Lawrence Ramsey <pooka109@gmail.com>
* po/update.pl: Update copyright notice to account for
modifications.
2007-01-29 David Lawrence Ramsey <pooka109@cox.net>
* ru.po: Updated Russian translation by Dimitriy Ryazantcev.
* ru.po: Fix incorrect "Project-Id-Version" entry and misplaced
space.
2007-01-13 David Lawrence Ramsey <pooka109@cox.net>
* es.po: Fix misplaced space.
* eu.po: Fix typos and misplaced space.
* fr.po: Fix misplaced space.
* gl.po: Fix typos and misplaced space.
* nb.po: Fix typos and more misplaced space.
2007-01-06 David Lawrence Ramsey <pooka109@cox.net>
* nb.po: Fix misplaced space.
2006-12-06 David Lawrence Ramsey <pooka109@cox.net>
* hu.po: Removed unneeded duplicate plural forms again.
* ms.po: Fix incorrect "Project-Id-Version" entry.
2006-12-06 Jordi Mallach <jordi@gnu.org>
* hu.po: Updated Hungarian translation by Gabor Kelemen.
* ms.po: Updated Malay translation by
Sharuzzaman Ahmat Raslan.
2006-11-20 David Lawrence Ramsey <pooka109@cox.net>
* tr.po: Removed unneeded blank plural forms, as gettext 0.15
generates errors upon encountering them.
2006-10-25 Jordi Mallach <jordi@gnu.org>
* fr.po: Updated French translation by Jean-Philippe Guérard.
* nb.po: Updated Norwegian bokmål translation by
Geir Helland.
2006-10-16 Jordi Mallach <jordi@gnu.org>
* gl.po: Updated Galician translation by
Francisco Javier Tsao Santín.
2006-10-16 Jordi Mallach <jordi@gnu.org>
* eu.po: Updated Basque translation by Mikel Olasagasti.
2006-10-10 Jordi Mallach <jordi@gnu.org>
* gl.po: Updated Galician translation by
Francisco Javier Tsao Santín.
2006-10-02 Jordi Mallach <jordi@gnu.org>
* pt_BR.po: Refetch the current nano 1.9.99pre0 pt_BR file from
the TP, as the latest file offered is apparently for 1.3.11pre1.
2006-10-02 David Lawrence Ramsey <pooka109@cox.net>
* pt_BR: Restore previous version of pt_BR, as it was for
* pt_BR.po: Restore previous version of pt_BR, as it was for
nano 1.9.99pre0, and the current version is for 1.3.11pre1.
2006-09-27 Jordi Mallach <jordi@gnu.org>
* pt_BR: Updated Brazilian Portuguese translation by
* pt_BR.po: Updated Brazilian Portuguese translation by
Joao Victor Duarte Martins.
2006-09-10 David Lawrence Ramsey <pooka109@cox.net>
@@ -17,7 +104,7 @@
2006-09-02 Jordi Mallach <jordi@gnu.org>
* pt_BR: Updated Brazilian Portuguese translation by
* pt_BR.po: Updated Brazilian Portuguese translation by
Joao Victor Duarte Martins.
2006-09-01 Benno Schulenberg <bensberg@justemail.net>
@@ -51,9 +138,9 @@
2006-08-15 David Lawrence Ramsey <pooka109@cox.net>
* hu.po: Removed unneeded duplicate plural forms, as gettext
0.15 generates errors upon encountering them.
0.15 generates errors upon encountering them.
* id.po: Removed unneeded duplicate plural forms, as gettext
0.15 generates errors upon encountering them.
0.15 generates errors upon encountering them.
2006-06-20 Jordi Mallach <jordi@gnu.org>
@@ -64,9 +151,9 @@
2006-06-20 David Lawrence Ramsey <pooka109@cox.net>
* fr.po: Fixed incorrect "Project-Id-Version" entry.
* hu.po: Fixed incorrect "Project-Id-Version" entry.
* it.po: Fixed incorrect "Project-Id-Version" entry.
* fr.po: Fix incorrect "Project-Id-Version" entry.
* hu.po: Fix incorrect "Project-Id-Version" entry.
* it.po: Fix incorrect "Project-Id-Version" entry.
2006-06-19 Jordi Mallach <jordi@gnu.org>
@@ -210,7 +297,7 @@
2005-04-22 Jordi Mallach <jordi@gnu.org>
* ca.po: Updated Norwegian bokmål translation by
* nb.po: Updated Norwegian bokmål translation by
Geir Helland.
2005-04-20 Jordi Mallach <jordi@gnu.org>

View File

@@ -1,2 +1,2 @@
# List of available languages.
bg ca cs da de es eu fi fr ga gl hu id it ms nb nl nn pl pt_BR ro ru rw sr sv tr uk vi zh_TW
bg ca cs da de es eu fi fr ga gl hu id it ms nb nl nn pl pt_BR ro ru rw sr sv tr uk vi zh_CN zh_TW

1325
po/bg.po

File diff suppressed because it is too large Load Diff

1368
po/ca.po

File diff suppressed because it is too large Load Diff

3011
po/cs.po

File diff suppressed because it is too large Load Diff

2973
po/da.po

File diff suppressed because it is too large Load Diff

1375
po/de.po

File diff suppressed because it is too large Load Diff

1339
po/es.po

File diff suppressed because it is too large Load Diff

2357
po/eu.po

File diff suppressed because it is too large Load Diff

2879
po/fi.po

File diff suppressed because it is too large Load Diff

1958
po/fr.po

File diff suppressed because it is too large Load Diff

2034
po/ga.po

File diff suppressed because it is too large Load Diff

3300
po/gl.po

File diff suppressed because it is too large Load Diff

1413
po/hu.po

File diff suppressed because it is too large Load Diff

2961
po/id.po

File diff suppressed because it is too large Load Diff

1328
po/it.po

File diff suppressed because it is too large Load Diff

2148
po/ms.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2496
po/nb.po

File diff suppressed because it is too large Load Diff

1437
po/nl.po

File diff suppressed because it is too large Load Diff

3080
po/nn.po

File diff suppressed because it is too large Load Diff

3018
po/pl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2547
po/ro.po

File diff suppressed because it is too large Load Diff

3082
po/ru.po

File diff suppressed because it is too large Load Diff

2702
po/rw.po

File diff suppressed because it is too large Load Diff

3062
po/sr.po

File diff suppressed because it is too large Load Diff

1325
po/sv.po

File diff suppressed because it is too large Load Diff

3301
po/tr.po

File diff suppressed because it is too large Load Diff

2975
po/uk.po

File diff suppressed because it is too large Load Diff

View File

@@ -3,11 +3,11 @@
#
# GNOME PO Update Utility
#
# Copyright (C) 2000 Free Software Foundation.
# Copyright (C) 2000, 2003 Free Software Foundation, Inc.
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# This script is distributed in the hope that it will be useful, but

2231
po/vi.po

File diff suppressed because it is too large Load Diff

1948
po/zh_CN.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +0,0 @@
Makefile
Makefile.in
nano
.deps

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* browser.c *
* *
* Copyright (C) 2001-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -44,7 +44,7 @@ static size_t selected = 0;
static bool search_last_file = FALSE;
/* Have we gone past the last file while searching? */
/* Our main file browser function. path is the tilde-expanded path to
/* Our main file browser function. path is the tilde-expanded path we
* start browsing from. */
char *do_browser(char *path, DIR *dir)
{
@@ -57,16 +57,18 @@ char *do_browser(char *path, DIR *dir)
/* The directory we were in, if any, before backing up via
* browsing to "..". */
char *ans = NULL;
/* The last answer the user typed on the statusbar. */
/* The last answer the user typed at the statusbar prompt. */
size_t old_selected;
/* The selected file we had before the current selected file. */
const sc *s;
const subnfunc *f;
curs_set(0);
blank_statusbar();
#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
currshortcut = browser_list;
currmenu = MBROWSER;
#endif
bottombars(browser_list);
bottombars(MBROWSER);
wnoutrefresh(bottomwin);
UNSET(CONST_UPDATE);
@@ -123,115 +125,109 @@ char *do_browser(char *path, DIR *dir)
old_selected = selected;
kbinput = get_kbinput(edit, &meta_key, &func_key);
parse_browser_input(&kbinput, &meta_key, &func_key);
switch (kbinput) {
#ifndef DISABLE_MOUSE
case KEY_MOUSE:
{
if (kbinput == KEY_MOUSE) {
int mouse_x, mouse_y;
if (!get_mouseinput(&mouse_x, &mouse_y, TRUE)) {
/* We can click in the edit window to select a
* filename. */
if (wenclose(edit, mouse_y, mouse_x)) {
/* Subtract out the size of topwin. */
mouse_y -= 2 - no_more_space();
/* longest is the width of each column.
* There are two spaces between each
* column. */
selected = (fileline / editwinrows) *
/* We can click on the edit window to select a
* filename. */
if (get_mouseinput(&mouse_x, &mouse_y, TRUE) == 0 &&
wmouse_trafo(edit, &mouse_y, &mouse_x, FALSE)) {
/* longest is the width of each column. There
* are two spaces between each column. */
selected = (fileline / editwinrows) *
(editwinrows * width) + (mouse_y *
width) + (mouse_x / (longest + 2));
/* If they clicked beyond the end of a row,
* select the filename at the end of that
* row. */
if (mouse_x > width * (longest + 2))
selected--;
/* If they clicked beyond the end of a row,
* select the filename at the end of that
* row. */
if (mouse_x > width * (longest + 2))
selected--;
/* If we're off the screen, select the last
* filename. */
if (selected > filelist_len - 1)
selected = filelist_len - 1;
/* If we're off the screen, select the last
* filename. */
if (selected > filelist_len - 1)
selected = filelist_len - 1;
/* If we selected the same filename as last
* time, put back the Enter key so that it's
* read in. */
if (old_selected == selected)
unget_kbinput(NANO_ENTER_KEY, FALSE,
FALSE);
}
/* If we selected the same filename as last
* time, put back the Enter key so that it's
* read in. */
if (old_selected == selected)
unget_kbinput(sc_seq_or(do_enter, 0), FALSE, FALSE);
}
}
break;
}
#endif /* !DISABLE_MOUSE */
/* Redraw the screen. */
case NANO_REFRESH_KEY:
parse_browser_input(&kbinput, &meta_key, &func_key);
s = get_shortcut(MBROWSER, &kbinput, &meta_key, &func_key);
if (!s)
continue;
f = sctofunc((sc *) s);
if (!f)
break;
if (f->scfunc == total_refresh) {
total_redraw();
break;
case NANO_HELP_KEY:
} else if (f->scfunc == do_help_void) {
#ifndef DISABLE_HELP
do_browser_help();
curs_set(0);
do_browser_help();
curs_set(0);
#else
nano_disabled_msg();
#endif
break;
/* Search for a filename. */
case NANO_WHEREIS_KEY:
} else if (f->scfunc == do_search) {
curs_set(1);
do_filesearch();
curs_set(0);
break;
/* Search for another filename. */
case NANO_WHEREIS_NEXT_KEY:
} else if (f->scfunc == (void *) whereis_next_msg) {
do_fileresearch();
break;
case NANO_PREVPAGE_KEY:
} else if (f->scfunc == do_page_up) {
if (selected >= (editwinrows + fileline % editwinrows) *
width)
selected -= (editwinrows + fileline % editwinrows) *
width;
else
selected = 0;
break;
case NANO_NEXTPAGE_KEY:
} else if (f->scfunc == do_page_down) {
selected += (editwinrows - fileline % editwinrows) *
width;
if (selected > filelist_len - 1)
selected = filelist_len - 1;
break;
case NANO_FIRSTFILE_ALTKEY:
} else if (f->scfunc == (void *) first_file_msg) {
if (meta_key)
selected = 0;
break;
case NANO_LASTFILE_ALTKEY:
} else if (f->scfunc == (void *) last_file_msg) {
if (meta_key)
selected = filelist_len - 1;
break;
/* Go to a specific directory. */
case NANO_GOTODIR_KEY:
} else if (f->scfunc == (void *) goto_dir_msg) {
curs_set(1);
i = do_prompt(TRUE,
#ifndef DISABLE_TABCOMP
FALSE,
#endif
gotodir_list, ans,
MGOTODIR, ans,
&meta_key, &func_key,
#ifndef NANO_TINY
NULL,
#endif
browser_refresh, _("Go To Directory"));
browser_refresh, N_("Go To Directory"));
curs_set(0);
#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
currshortcut = browser_list;
currmenu = MBROWSER;
#endif
bottombars(browser_list);
bottombars(MBROWSER);
if (i < 0) {
/* If the directory begins with a newline (i.e. an
* encoded null), treat it as though it's blank. */
if (i < 0 || *answer == '\n') {
/* We canceled. Indicate that on the statusbar, and
* blank out ans, since we're done with it. */
statusbar(_("Cancelled"));
@@ -242,7 +238,7 @@ char *do_browser(char *path, DIR *dir)
* answer in ans, so that the file list is displayed
* again, the prompt is displayed again, and what we
* typed before at the prompt is displayed again. */
unget_kbinput(NANO_GOTOLINE_KEY, FALSE, FALSE);
unget_kbinput(sc_seq_or(do_gotolinecolumn_void, 0), FALSE, FALSE);
ans = mallocstrcpy(ans, answer);
break;
}
@@ -251,6 +247,11 @@ char *do_browser(char *path, DIR *dir)
* with it. */
ans = mallocstrcpy(ans, "");
/* Convert newlines to nulls, just before we go to the
* directory. */
sunder(answer);
align(&answer);
new_path = real_dir_from_tilde(answer);
if (new_path[0] != '/') {
@@ -284,23 +285,19 @@ char *do_browser(char *path, DIR *dir)
free(path);
path = new_path;
goto change_browser_directory;
case NANO_PREVLINE_KEY:
} else if (f->scfunc == do_up_void) {
if (selected >= width)
selected -= width;
break;
case NANO_BACK_KEY:
} else if (f->scfunc == do_left) {
if (selected > 0)
selected--;
break;
case NANO_NEXTLINE_KEY:
} else if (f->scfunc == do_down_void) {
if (selected + width <= filelist_len - 1)
selected += width;
break;
case NANO_FORWARD_KEY:
} else if (f->scfunc == do_right) {
if (selected < filelist_len - 1)
selected++;
break;
case NANO_ENTER_KEY:
} else if (f->scfunc == do_enter) {
/* We can't move up from "/". */
if (strcmp(filelist[selected], "/..") == 0) {
statusbar(_("Can't move up a directory"));
@@ -358,12 +355,10 @@ char *do_browser(char *path, DIR *dir)
/* Start over again with the new path value. */
goto change_browser_directory;
/* Abort the file browser. */
case NANO_EXIT_KEY:
} else if (f->scfunc == do_exit) {
abort = TRUE;
break;
}
}
titlebar(NULL);
edit_refresh();
curs_set(1);
@@ -551,37 +546,38 @@ void browser_init(const char *path, DIR *dir)
* shortcut keys. */
void parse_browser_input(int *kbinput, bool *meta_key, bool *func_key)
{
get_shortcut(browser_list, kbinput, meta_key, func_key);
get_shortcut(MBROWSER, kbinput, meta_key, func_key);
/* Pico compatibility. */
if (!*meta_key) {
switch (*kbinput) {
case ' ':
*kbinput = NANO_NEXTPAGE_KEY;
*kbinput = sc_seq_or(do_page_down, 0);
break;
case '-':
*kbinput = NANO_PREVPAGE_KEY;
*kbinput = sc_seq_or(do_page_up, 0);
break;
case '?':
*kbinput = NANO_HELP_KEY;
#ifndef DISABLE_HELP
*kbinput = sc_seq_or(do_help_void, 0);
#endif
break;
/* Cancel is equivalent to Exit here. */
case NANO_CANCEL_KEY:
/* Cancel equivalent to Exit here. */
case 'E':
case 'e':
*kbinput = NANO_EXIT_KEY;
*kbinput = sc_seq_or(do_exit, 0);
break;
case 'G':
case 'g':
*kbinput = NANO_GOTODIR_KEY;
*kbinput = sc_seq_or((void *) goto_dir_msg, 0);
break;
case 'S':
case 's':
*kbinput = NANO_ENTER_KEY;
*kbinput = sc_seq_or(do_enter, 0);
break;
case 'W':
case 'w':
*kbinput = NANO_WHEREIS_KEY;
*kbinput = sc_seq_or(do_search, 0);
break;
}
}
@@ -621,19 +617,20 @@ void browser_refresh(void)
/* The length of the file information in columns. */
int foomaxlen = 7;
/* The maximum length of the file information in
* columns: 7 for "--", "(dir)", or the file size, and
* 12 for "(parent dir)". */
* columns: seven for "--", "(dir)", or the file size,
* and 12 for "(parent dir)". */
bool dots = (COLS >= 15 && filetaillen >= longest -
foomaxlen - 1);
/* Do we put an ellipsis before the filename? Don't set
* this to TRUE if we have fewer than 15 columns (i.e. 1
* column for padding, plus 7 columns for a filename
* other than ".."). */
* this to TRUE if we have fewer than 15 columns (i.e.
* one column for padding, plus seven columns for a
* filename other than ".."). */
char *disp = display_string(filetail, dots ? filetaillen -
longest + foomaxlen + 4 : 0, longest, FALSE);
/* If we put an ellipsis before the filename, reserve 1
* column for padding, plus 7 columns for "--", "(dir)",
* or the file size, plus 3 columns for the ellipsis. */
/* If we put an ellipsis before the filename, reserve
* one column for padding, plus seven columns for "--",
* "(dir)", or the file size, plus three columns for the
* ellipsis. */
/* Start highlighting the currently selected file or
* directory. */
@@ -763,6 +760,8 @@ int filesearch_init(void)
{
int i = 0;
char *buf;
bool meta_key, func_key;
const sc *s;
static char *backupstring = NULL;
/* The search string we'll be using. */
@@ -794,7 +793,8 @@ int filesearch_init(void)
#ifndef DISABLE_TABCOMP
TRUE,
#endif
whereis_file_list, backupstring,
MWHEREISFILE, backupstring,
&meta_key, &func_key,
#ifndef NANO_TINY
&search_history,
#endif
@@ -825,42 +825,40 @@ int filesearch_init(void)
backupstring = NULL;
/* Cancel any search, or just return with no previous search. */
if (i == -1 || (i < 0 && last_search[0] == '\0') ||
(i == 0 && answer[0] == '\0')) {
if (i == -1 || (i < 0 && *last_search == '\0') || (i == 0 &&
*answer == '\0')) {
statusbar(_("Cancelled"));
return -1;
} else {
switch (i) {
case -2: /* It's an empty string. */
case 0: /* It's a new string. */
s = get_shortcut(MBROWSER, &i, &meta_key, &func_key);
if (i == -2 || i == 0) {
#ifdef HAVE_REGEX_H
/* Use last_search if answer is an empty string, or
* answer if it isn't. */
if (ISSET(USE_REGEXP) &&
regexp_init((i == -2) ? last_search :
answer) == 0)
if (ISSET(USE_REGEXP) && !regexp_init((i == -2) ?
last_search : answer))
return -1;
#endif
break;
} else
#ifndef NANO_TINY
case TOGGLE_CASE_KEY:
if (s && s->scfunc == (void *) case_sens_msg) {
TOGGLE(CASE_SENSITIVE);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
case TOGGLE_BACKWARDS_KEY:
} else if (s && s->scfunc == (void *) backwards_msg) {
TOGGLE(BACKWARDS_SEARCH);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
} else
#endif
#ifdef HAVE_REGEX_H
case NANO_REGEXP_KEY:
if (s && s->scfunc == (void *) regexp_msg) {
TOGGLE(USE_REGEXP);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
} else
#endif
default:
return -1;
}
return -1;
}
return 0;
@@ -954,8 +952,8 @@ void findnextfile_wrap_reset(void)
* search, if any. */
void filesearch_abort(void)
{
currshortcut = browser_list;
bottombars(browser_list);
currmenu = MBROWSER;
bottombars(MBROWSER);
#ifdef HAVE_REGEX_H
regexp_cleanup();
#endif
@@ -982,7 +980,7 @@ void do_filesearch(void)
return;
/* If answer is now "", copy last_search into answer. */
if (answer[0] == '\0')
if (*answer == '\0')
answer = mallocstrcpy(answer, last_search);
else
last_search = mallocstrcpy(last_search, answer);
@@ -1022,7 +1020,7 @@ void do_fileresearch(void)
if (last_search[0] != '\0') {
#ifdef HAVE_REGEX_H
/* Since answer is "", use last_search! */
if (ISSET(USE_REGEXP) && regexp_init(last_search) == 0)
if (ISSET(USE_REGEXP) && !regexp_init(last_search))
return;
#endif

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* chars.c *
* *
* Copyright (C) 2001-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -38,9 +38,8 @@ static bool use_utf8 = FALSE;
/* Whether we've enabled UTF-8 support. */
static const wchar_t bad_wchar = 0xFFFD;
/* If we get an invalid multibyte sequence, we treat it as
* Unicode FFFD (Replacement Character), unless we're
* determining if it's a control character or searching for a
* match to it. */
* Unicode FFFD (Replacement Character), unless we're searching
* for a match to it. */
static const char *const bad_mbchar = "\xEF\xBF\xBD";
static const int bad_mbchar_len = 3;
@@ -507,17 +506,17 @@ int mbstrcasecmp(const char *s1, const char *s2)
/* This function is equivalent to strncasecmp(). */
int nstrncasecmp(const char *s1, const char *s2, size_t n)
{
if (s1 == s2)
return 0;
assert(s1 != NULL && s2 != NULL);
for (; n > 0 && *s1 != '\0' && *s2 != '\0'; n--, s1++, s2++) {
for (; *s1 != '\0' && *s2 != '\0' && n > 0; s1++, s2++, n--) {
if (tolower(*s1) != tolower(*s2))
break;
}
if (n > 0)
return tolower(*s1) - tolower(*s2);
else
return 0;
return (n > 0) ? tolower(*s1) - tolower(*s2) : 0;
}
#endif
@@ -530,12 +529,16 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
char *s1_mb, *s2_mb;
wchar_t ws1, ws2;
if (s1 == s2)
return 0;
assert(s1 != NULL && s2 != NULL);
s1_mb = charalloc(MB_CUR_MAX);
s2_mb = charalloc(MB_CUR_MAX);
while (n > 0 && *s1 != '\0' && *s2 != '\0') {
for (; *s1 != '\0' && *s2 != '\0' && n > 0; s1 +=
move_mbright(s1, 0), s2 += move_mbright(s2, 0), n--) {
bool bad_s1_mb = FALSE, bad_s2_mb = FALSE;
int s1_mb_len, s2_mb_len;
@@ -555,62 +558,38 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
bad_s2_mb = TRUE;
}
if (n == 0 || bad_s1_mb != bad_s2_mb ||
towlower(ws1) != towlower(ws2))
if (bad_s1_mb != bad_s2_mb || towlower(ws1) !=
towlower(ws2))
break;
s1 += s1_mb_len;
s2 += s2_mb_len;
n--;
}
free(s1_mb);
free(s2_mb);
return towlower(ws1) - towlower(ws2);
return (n > 0) ? towlower(ws1) - towlower(ws2) : 0;
} else
#endif
return strncasecmp(s1, s2, n);
}
#ifndef HAVE_STRCASESTR
/* This function, nstrcasestr() (originally mutt_stristr()), was adapted
* from mutt 1.2.4i (lib.c). Here is the notice from that file, with
* the Free Software Foundation's address updated:
*
* Copyright (C) 1996-2000 Michael R. Elkins <me@cs.hmc.edu>
* Copyright (C) 1999-2000 Thomas Roessler <roessler@guug.de>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA. */
/* This function is equivalent to strcasestr(). */
const char *nstrcasestr(const char *haystack, const char *needle)
char *nstrcasestr(const char *haystack, const char *needle)
{
size_t haystack_len, needle_len;
assert(haystack != NULL && needle != NULL);
for (; *haystack != '\0'; haystack++) {
const char *r = haystack, *q = needle;
if (*needle == '\0')
return (char *)haystack;
for (; tolower(*r) == tolower(*q) && *q != '\0'; r++, q++)
;
haystack_len = strlen(haystack);
needle_len = strlen(needle);
if (*q == '\0')
return haystack;
for (; *haystack != '\0' && haystack_len >= needle_len; haystack++,
haystack_len--) {
if (strncasecmp(haystack, needle, needle_len) == 0)
return (char *)haystack;
}
return NULL;
@@ -618,62 +597,27 @@ const char *nstrcasestr(const char *haystack, const char *needle)
#endif
/* This function is equivalent to strcasestr() for multibyte strings. */
const char *mbstrcasestr(const char *haystack, const char *needle)
char *mbstrcasestr(const char *haystack, const char *needle)
{
#ifdef ENABLE_UTF8
if (use_utf8) {
char *r_mb, *q_mb;
wchar_t wr, wq;
bool found_needle = FALSE;
size_t haystack_len, needle_len;
assert(haystack != NULL && needle != NULL);
r_mb = charalloc(MB_CUR_MAX);
q_mb = charalloc(MB_CUR_MAX);
if (*needle == '\0')
return (char *)haystack;
while (*haystack != '\0') {
const char *r = haystack, *q = needle;
int r_mb_len, q_mb_len;
haystack_len = mbstrlen(haystack);
needle_len = mbstrlen(needle);
while (*q != '\0') {
bool bad_r_mb = FALSE, bad_q_mb = FALSE;
r_mb_len = parse_mbchar(r, r_mb, NULL);
if (mbtowc(&wr, r_mb, r_mb_len) < 0) {
mbtowc(NULL, NULL, 0);
wr = (unsigned char)*r;
bad_r_mb = TRUE;
}
q_mb_len = parse_mbchar(q, q_mb, NULL);
if (mbtowc(&wq, q_mb, q_mb_len) < 0) {
mbtowc(NULL, NULL, 0);
wq = (unsigned char)*q;
bad_q_mb = TRUE;
}
if (bad_r_mb != bad_q_mb ||
towlower(wr) != towlower(wq))
break;
r += r_mb_len;
q += q_mb_len;
}
if (*q == '\0') {
found_needle = TRUE;
break;
}
haystack += move_mbright(haystack, 0);
for (; *haystack != '\0' && haystack_len >= needle_len;
haystack += move_mbright(haystack, 0), haystack_len--) {
if (mbstrncasecmp(haystack, needle, needle_len) == 0)
return (char *)haystack;
}
free(r_mb);
free(q_mb);
return found_needle ? haystack : NULL;
return NULL;
} else
#endif
return strcasestr(haystack, needle);
@@ -682,19 +626,27 @@ const char *mbstrcasestr(const char *haystack, const char *needle)
#if !defined(NANO_TINY) || !defined(DISABLE_TABCOMP)
/* This function is equivalent to strstr(), except in that it scans the
* string in reverse, starting at rev_start. */
const char *revstrstr(const char *haystack, const char *needle, const
char *rev_start)
char *revstrstr(const char *haystack, const char *needle, const char
*rev_start)
{
size_t rev_start_len, needle_len;
assert(haystack != NULL && needle != NULL && rev_start != NULL);
for (; rev_start >= haystack; rev_start--) {
const char *r, *q;
if (*needle == '\0')
return (char *)rev_start;
for (r = rev_start, q = needle; *r == *q && *q != '\0'; r++, q++)
;
needle_len = strlen(needle);
if (*q == '\0')
return rev_start;
if (strlen(haystack) < needle_len)
return NULL;
rev_start_len = strlen(rev_start);
for (; rev_start >= haystack; rev_start--, rev_start_len++) {
if (rev_start_len >= needle_len && strncmp(rev_start, needle,
needle_len) == 0)
return (char *)rev_start;
}
return NULL;
@@ -704,19 +656,27 @@ const char *revstrstr(const char *haystack, const char *needle, const
#ifndef NANO_TINY
/* This function is equivalent to strcasestr(), except in that it scans
* the string in reverse, starting at rev_start. */
const char *revstrcasestr(const char *haystack, const char *needle,
const char *rev_start)
char *revstrcasestr(const char *haystack, const char *needle, const char
*rev_start)
{
size_t rev_start_len, needle_len;
assert(haystack != NULL && needle != NULL && rev_start != NULL);
for (; rev_start >= haystack; rev_start--) {
const char *r = rev_start, *q = needle;
if (*needle == '\0')
return (char *)rev_start;
for (; tolower(*r) == tolower(*q) && *q != '\0'; r++, q++)
;
needle_len = strlen(needle);
if (*q == '\0')
return rev_start;
if (strlen(haystack) < needle_len)
return NULL;
rev_start_len = strlen(rev_start);
for (; rev_start >= haystack; rev_start--, rev_start_len++) {
if (rev_start_len >= needle_len && strncasecmp(rev_start,
needle, needle_len) == 0)
return (char *)rev_start;
}
return NULL;
@@ -725,67 +685,41 @@ const char *revstrcasestr(const char *haystack, const char *needle,
/* This function is equivalent to strcasestr() for multibyte strings,
* except in that it scans the string in reverse, starting at
* rev_start. */
const char *mbrevstrcasestr(const char *haystack, const char *needle,
const char *rev_start)
char *mbrevstrcasestr(const char *haystack, const char *needle, const
char *rev_start)
{
#ifdef ENABLE_UTF8
if (use_utf8) {
char *r_mb, *q_mb;
wchar_t wr, wq;
bool begin_line = FALSE, found_needle = FALSE;
bool begin_line = FALSE;
size_t rev_start_len, needle_len;
assert(haystack != NULL && needle != NULL && rev_start != NULL);
r_mb = charalloc(MB_CUR_MAX);
q_mb = charalloc(MB_CUR_MAX);
if (*needle == '\0')
return (char *)rev_start;
needle_len = mbstrlen(needle);
if (mbstrlen(haystack) < needle_len)
return NULL;
rev_start_len = mbstrlen(rev_start);
while (!begin_line) {
const char *r = rev_start, *q = needle;
int r_mb_len, q_mb_len;
while (*q != '\0') {
bool bad_r_mb = FALSE, bad_q_mb = FALSE;
r_mb_len = parse_mbchar(r, r_mb, NULL);
if (mbtowc(&wr, r_mb, r_mb_len) < 0) {
mbtowc(NULL, NULL, 0);
wr = (unsigned char)*r;
bad_r_mb = TRUE;
}
q_mb_len = parse_mbchar(q, q_mb, NULL);
if (mbtowc(&wq, q_mb, q_mb_len) < 0) {
mbtowc(NULL, NULL, 0);
wq = (unsigned char)*q;
bad_q_mb = TRUE;
}
if (bad_r_mb != bad_q_mb ||
towlower(wr) != towlower(wq))
break;
r += r_mb_len;
q += q_mb_len;
}
if (*q == '\0') {
found_needle = TRUE;
break;
}
if (rev_start_len >= needle_len && mbstrncasecmp(rev_start,
needle, needle_len) == 0)
return (char *)rev_start;
if (rev_start == haystack)
begin_line = TRUE;
else
else {
rev_start = haystack + move_mbleft(haystack, rev_start -
haystack);
rev_start_len++;
}
}
free(r_mb);
free(q_mb);
return found_needle ? rev_start : NULL;
return NULL;
} else
#endif
return revstrcasestr(haystack, needle, rev_start);
@@ -806,7 +740,7 @@ size_t nstrnlen(const char *s, size_t maxlen)
assert(s != NULL);
for (; maxlen > 0 && *s != '\0'; maxlen--, n++, s++)
for (; *s != '\0' && maxlen > 0; s++, maxlen--, n++)
;
return n;
@@ -821,18 +755,10 @@ size_t mbstrnlen(const char *s, size_t maxlen)
#ifdef ENABLE_UTF8
if (use_utf8) {
size_t n = 0;
int s_mb_len;
while (*s != '\0') {
s_mb_len = parse_mbchar(s, NULL, NULL);
if (maxlen == 0)
break;
maxlen--;
s += s_mb_len;
n++;
}
for (; *s != '\0' && maxlen > 0; s += move_mbright(s, 0),
maxlen--, n++)
;
return n;
} else
@@ -896,11 +822,9 @@ char *mbstrpbrk(const char *s, const char *accept)
#ifdef ENABLE_UTF8
if (use_utf8) {
while (*s != '\0') {
for (; *s != '\0'; s += move_mbright(s, 0)) {
if (mbstrchr(accept, s) != NULL)
return (char *)s;
s += move_mbright(s, 0);
}
return NULL;
@@ -982,20 +906,16 @@ bool has_blank_mbchars(const char *s)
#ifdef ENABLE_UTF8
if (use_utf8) {
char *chr_mb = charalloc(MB_CUR_MAX);
bool retval = FALSE;
char *chr_mb = charalloc(MB_CUR_MAX);
while (*s != '\0') {
int chr_mb_len;
chr_mb_len = parse_mbchar(s, chr_mb, NULL);
for (; *s != '\0'; s += move_mbright(s, 0)) {
parse_mbchar(s, chr_mb, NULL);
if (is_blank_mbchar(chr_mb)) {
retval = TRUE;
break;
}
s += chr_mb_len;
}
free(chr_mb);
@@ -1024,10 +944,9 @@ bool is_valid_mbstring(const char *s)
{
assert(s != NULL);
return
return
#ifdef ENABLE_UTF8
use_utf8 ?
(mbstowcs(NULL, s, 0) != (size_t)-1) :
use_utf8 ? (mbstowcs(NULL, s, 0) != (size_t)-1) :
#endif
TRUE;
}

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* color.c *
* *
* Copyright (C) 2001-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -29,7 +29,7 @@
#ifdef ENABLE_COLOR
/* For each syntax list entry, go through the list of colors and assign
* color pairs. */
* the color pairs. */
void set_colorpairs(void)
{
const syntaxtype *this_syntax = syntaxes;
@@ -153,7 +153,7 @@ void color_update(void)
* already. */
if (not_compiled) {
e->ext = (regex_t *)nmalloc(sizeof(regex_t));
regcomp(e->ext, e->ext_regex, REG_EXTENDED);
regcomp(e->ext, fixbounds(e->ext_regex), REG_EXTENDED);
}
/* Set colorstrings if we matched the extension
@@ -188,13 +188,13 @@ void color_update(void)
* regexes if we haven't already. */
if (tmpcolor->start == NULL) {
tmpcolor->start = (regex_t *)nmalloc(sizeof(regex_t));
regcomp(tmpcolor->start, tmpcolor->start_regex,
regcomp(tmpcolor->start, fixbounds(tmpcolor->start_regex),
REG_EXTENDED | (tmpcolor->icase ? REG_ICASE : 0));
}
if (tmpcolor->end_regex != NULL && tmpcolor->end == NULL) {
tmpcolor->end = (regex_t *)nmalloc(sizeof(regex_t));
regcomp(tmpcolor->end, tmpcolor->end_regex,
regcomp(tmpcolor->end, fixbounds(tmpcolor->end_regex),
REG_EXTENDED | (tmpcolor->icase ? REG_ICASE : 0));
}
}

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* cut.c *
* *
* Copyright (C) 1999-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -28,7 +28,6 @@
static bool keep_cutbuffer = FALSE;
/* Should we keep the contents of the cutbuffer? */
static filestruct *cutbottom = NULL;
/* Pointer to the end of the cutbuffer. */
/* Indicate that we should no longer keep the contents of the
@@ -114,7 +113,7 @@ void cut_to_eof(void)
* position to the end of the file into the cutbuffer. */
void do_cut_text(
#ifndef NANO_TINY
bool copy_text, bool cut_till_end
bool copy_text, bool cut_till_end, bool undoing
#else
void
#endif
@@ -146,7 +145,7 @@ void do_cut_text(
if (copy_text) {
if (cutbuffer != NULL) {
/* If the cutbuffer isn't empty, save where it currently
* ends. This is where the new text will be added. */
* ends. This is where we'll add the new text. */
cb_save = cutbottom;
cb_save_len = strlen(cutbottom->data);
}
@@ -163,6 +162,7 @@ void do_cut_text(
keep_cutbuffer = TRUE;
#ifndef NANO_TINY
if (cut_till_end) {
/* If cut_till_end is TRUE, move all text up to the end of the
* file into the cutbuffer. */
@@ -173,12 +173,12 @@ void do_cut_text(
cut_marked();
openfile->mark_set = FALSE;
} else if (ISSET(CUT_TO_END))
/* Otherwise, if the CUT_TO_END flag is set, move all text up to
* the end of the line into the cutbuffer. */
/* If the CUT_TO_END flag is set, move all text up to the end of
* the line into the cutbuffer. */
cut_to_eol();
else
#endif
/* Otherwise, move the entire line into the cutbuffer. */
/* Move the entire line into the cutbuffer. */
cut_line();
#ifndef NANO_TINY
@@ -194,18 +194,24 @@ void do_cut_text(
cb_save->data -= cb_save_len;
} else
copy_from_filestruct(cutbuffer, cutbottom);
/* Set the current place we want to where the text from the
* cutbuffer ends. */
openfile->placewewant = xplustabs();
}
/* Set NO_NEWLINES back to what it was before, since we're done
* disturbing the text. */
if (!old_no_newlines)
UNSET(NO_NEWLINES);
} else
} else if (!undoing)
update_undo(CUT);
#endif
/* Leave the text in the cutbuffer, and mark the file as
* modified. */
set_modified();
/* Update the screen. */
edit_refresh();
@@ -217,9 +223,12 @@ void do_cut_text(
/* Move text from the current filestruct into the cutbuffer. */
void do_cut_text_void(void)
{
#ifndef NANO_TINY
add_undo(CUT);
#endif
do_cut_text(
#ifndef NANO_TINY
FALSE, FALSE
FALSE, FALSE, FALSE
#endif
);
}
@@ -229,13 +238,16 @@ void do_cut_text_void(void)
* back into the filestruct afterward. */
void do_copy_text(void)
{
do_cut_text(TRUE, FALSE);
do_cut_text(TRUE, FALSE, FALSE);
}
/* Cut from the current cursor position to the end of the file. */
void do_cut_till_end(void)
{
do_cut_text(FALSE, TRUE);
#ifndef NANO_TINY
add_undo(CUTTOEND);
#endif
do_cut_text(FALSE, TRUE, FALSE);
}
#endif /* !NANO_TINY */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* help.c *
* *
* Copyright (C) 2000-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -47,13 +47,15 @@ void do_help(void (*refresh_func)(void))
/* The line number in help_text of the last help line. This
* variable is zero-based. */
#ifndef DISABLE_MOUSE
const shortcut *oldshortcut = currshortcut;
/* The current shortcut list. */
int oldmenu = currmenu;
#endif
const char *ptr;
/* The current line of help text. */
/* The current line of the help text. */
size_t old_line = (size_t)-1;
/* The line we were on before the current line. */
const sc *s;
const subnfunc *f;
curs_set(0);
blank_edit();
@@ -66,9 +68,9 @@ void do_help(void (*refresh_func)(void))
assert(help_text != NULL);
#ifndef DISABLE_MOUSE
/* Set currshortcut to allow clicking on the help screen's shortcut
/* Set currmenu to allow clicking on the help screen's shortcut
* list, after help_init() is called. */
currshortcut = help_list;
currmenu = MHELP;
#endif
if (ISSET(NO_HELP)) {
@@ -78,7 +80,7 @@ void do_help(void (*refresh_func)(void))
window_init();
}
bottombars(help_list);
bottombars(MHELP);
wnoutrefresh(bottomwin);
/* Get the last line of the help text. */
@@ -125,59 +127,60 @@ void do_help(void (*refresh_func)(void))
old_line = line;
kbinput = get_kbinput(edit, &meta_key, &func_key);
parse_help_input(&kbinput, &meta_key, &func_key);
switch (kbinput) {
#ifndef DISABLE_MOUSE
case KEY_MOUSE:
{
int mouse_x, mouse_y;
get_mouseinput(&mouse_x, &mouse_y, TRUE);
}
break;
#endif
if (kbinput == KEY_MOUSE) {
int mouse_x, mouse_y;
get_mouseinput(&mouse_x, &mouse_y, TRUE);
continue;
/* Redraw the screen. */
case NANO_REFRESH_KEY:
}
#endif
parse_help_input(&kbinput, &meta_key, &func_key);
s = get_shortcut(MHELP, &kbinput, &meta_key, &func_key);
if (!s)
continue;
f = sctofunc((sc *) s);
if (!f)
continue;
if (f->scfunc == total_refresh) {
total_redraw();
break;
case NANO_PREVPAGE_KEY:
} else if (f->scfunc == do_page_up) {
if (line > editwinrows - 2)
line -= editwinrows - 2;
else
line = 0;
break;
case NANO_NEXTPAGE_KEY:
} else if (f->scfunc == do_page_down) {
if (line + (editwinrows - 1) < last_line)
line += editwinrows - 2;
break;
case NANO_PREVLINE_KEY:
} else if (f->scfunc == do_up_void) {
if (line > 0)
line--;
break;
case NANO_NEXTLINE_KEY:
} else if (f->scfunc == do_down_void) {
if (line + (editwinrows - 1) < last_line)
line++;
break;
case NANO_FIRSTLINE_ALTKEY:
} else if (f->scfunc == do_first_line) {
if (meta_key)
line = 0;
break;
case NANO_LASTLINE_ALTKEY:
} else if (f->scfunc == do_last_line) {
if (meta_key) {
if (line + (editwinrows - 1) < last_line)
line = last_line - (editwinrows - 1);
}
break;
/* Abort the help browser. */
case NANO_EXIT_KEY:
} else if (f->scfunc == do_exit) {
abort = TRUE;
break;
}
}
#ifndef DISABLE_MOUSE
currshortcut = oldshortcut;
currmenu = oldmenu;
#endif
if (old_no_help) {
@@ -186,24 +189,18 @@ void do_help(void (*refresh_func)(void))
SET(NO_HELP);
window_init();
} else
bottombars(currshortcut);
bottombars(currmenu);
curs_set(1);
refresh_func();
/* The help_init() at the beginning allocated help_text. Since
/* The help_init() at the beginning allocated help_text. Since
* help_text has now been written to the screen, we don't need it
* anymore. */
free(help_text);
help_text = NULL;
}
/* Start the help browser for the edit window. */
void do_help_void(void)
{
do_help(&edit_refresh);
}
#ifndef DISABLE_BROWSER
/* Start the help browser for the file browser. */
void do_browser_help(void)
@@ -212,7 +209,7 @@ void do_browser_help(void)
}
#endif
/* This function allocates help_text, and stores the help string in it.
/* This function allocates help_text, and stores the help string in it.
* help_text should be NULL initially. */
void help_init(void)
{
@@ -222,9 +219,11 @@ void help_init(void)
* full string is too long for the
* compiler to handle. */
char *ptr;
const shortcut *s;
const subnfunc *f;
const sc *s;
int scsfound = 0;
#ifndef NANO_TINY
const toggle *t;
#ifdef ENABLE_NANORC
bool old_whitespace = ISSET(WHITESPACE_DISPLAY);
@@ -233,8 +232,7 @@ void help_init(void)
#endif
/* First, set up the initial help text for the current function. */
if (currshortcut == whereis_list || currshortcut == replace_list ||
currshortcut == replace_list_2) {
if (currmenu == MWHEREIS || currmenu == MREPLACE || currmenu == MREPLACE2) {
htx[0] = N_("Search Command Help Text\n\n "
"Enter the words or characters you would like to "
"search for, and then press Enter. If there is a "
@@ -249,7 +247,7 @@ void help_init(void)
"will be replaced.\n\n The following function keys are "
"available in Search mode:\n\n");
htx[2] = NULL;
} else if (currshortcut == gotoline_list) {
} else if (currmenu == MGOTOLINE) {
htx[0] = N_("Go To Line Help Text\n\n "
"Enter the line number that you wish to go to and hit "
"Enter. If there are fewer lines of text than the "
@@ -258,7 +256,7 @@ void help_init(void)
"available in Go To Line mode:\n\n");
htx[1] = NULL;
htx[2] = NULL;
} else if (currshortcut == insertfile_list) {
} else if (currmenu == MINSERTFILE) {
htx[0] = N_("Insert File Help Text\n\n "
"Type in the name of a file to be inserted into the "
"current file buffer at the current cursor "
@@ -273,7 +271,7 @@ void help_init(void)
"the prompt and press Enter.\n\n The following "
"function keys are available in Insert File mode:\n\n");
htx[2] = NULL;
} else if (currshortcut == writefile_list) {
} else if (currmenu == MWRITEFILE) {
htx[0] = N_("Write File Help Text\n\n "
"Type the name that you wish to save the current file "
"as and press Enter to save the file.\n\n If you have "
@@ -287,7 +285,7 @@ void help_init(void)
htx[2] = NULL;
}
#ifndef DISABLE_BROWSER
else if (currshortcut == browser_list) {
else if (currmenu == MBROWSER) {
htx[0] = N_("File Browser Help Text\n\n "
"The file browser is used to visually browse the "
"directory structure to select a file for reading "
@@ -300,7 +298,7 @@ void help_init(void)
"in the file browser:\n\n");
htx[1] = NULL;
htx[2] = NULL;
} else if (currshortcut == whereis_file_list) {
} else if (currmenu == MWHEREISFILE) {
htx[0] = N_("Browser Search Command Help Text\n\n "
"Enter the words or characters you would like to "
"search for, and then press Enter. If there is a "
@@ -313,7 +311,7 @@ void help_init(void)
htx[1] = N_(" The following function keys are available in "
"Browser Search mode:\n\n");
htx[2] = NULL;
} else if (currshortcut == gotodir_list) {
} else if (currmenu == MGOTODIR) {
htx[0] = N_("Browser Go To Directory Help Text\n\n "
"Enter the name of the directory you would like to "
"browse to.\n\n If tab completion has not been "
@@ -326,7 +324,7 @@ void help_init(void)
}
#endif /* !DISABLE_BROWSER */
#ifndef DISABLE_SPELLER
else if (currshortcut == spell_list) {
else if (currmenu == MSPELL) {
htx[0] = N_("Spell Check Help Text\n\n "
"The spell checker checks the spelling of all text in "
"the current file. When an unknown word is "
@@ -341,11 +339,11 @@ void help_init(void)
}
#endif /* !DISABLE_SPELLER */
#ifndef NANO_TINY
else if (currshortcut == extcmd_list) {
else if (currmenu == MEXTCMD) {
htx[0] = N_("Execute Command Help Text\n\n "
"This mode allows you to insert the output of a "
"command run by the shell into the current buffer (or "
"a new buffer in multiple file buffer mode). If you "
"a new buffer in multiple file buffer mode). If you "
"need another blank buffer, do not enter any "
"command.\n\n The following function keys are "
"available in Execute Command mode:\n\n");
@@ -397,18 +395,21 @@ void help_init(void)
/* Count the shortcut help text. Each entry has up to three keys,
* which fill 24 columns, plus translated text, plus one or two
* \n's. */
for (s = currshortcut; s != NULL; s = s->next)
allocsize += (24 * mb_cur_max()) + strlen(s->help) + 2;
for (f = allfuncs; f != NULL; f = f->next)
if (f->menus & currmenu)
allocsize += (24 * mb_cur_max()) + strlen(f->help) + 2;
#ifndef NANO_TINY
/* If we're on the main list, we also count the toggle help text.
* Each entry has "M-%c\t\t\t", which fills 24 columns, plus a
* space, plus translated text, plus one or two '\n's. */
if (currshortcut == main_list) {
if (currmenu == MMAIN) {
size_t endis_len = strlen(_("enable/disable"));
for (t = toggles; t != NULL; t = t->next)
allocsize += strlen(t->desc) + endis_len + 9;
for (s = sclist; s != NULL; s = s->next)
if (s->scfunc == (void *) do_toggle)
allocsize += strlen(_(flagtostr(s->toggle))) + endis_len + 9;
}
#endif
@@ -429,131 +430,58 @@ void help_init(void)
ptr = help_text + strlen(help_text);
/* Now add our shortcut info. Assume that each shortcut has, at the
* very least, an equivalent control key, an equivalent primary meta
* key sequence, or both. Also assume that the meta key values are
* not control characters. We can display a maximum of three
* shortcut entries. */
for (s = currshortcut; s != NULL; s = s->next) {
int entries = 0;
/* Now add our shortcut info. */
for (f = allfuncs; f != NULL; f = f->next) {
/* Control key. */
if (s->ctrlval != NANO_NO_KEY) {
entries++;
/* Yucky sentinel values that we can't handle a better
* way. */
if (s->ctrlval == NANO_CONTROL_SPACE) {
char *space_ptr = display_string(_("Space"), 0, 14,
FALSE);
if ((f->menus & currmenu) == 0)
continue;
if (s->funcval == NANO_NO_KEY && (s->metaval ==
NANO_NO_KEY || s->miscval == NANO_NO_KEY)) {
/* If we're here, we have at least two entries worth
* of blank space. If this entry takes up more than
* one entry's worth of space, use two to display
* it. */
if (mbstrlen(space_ptr) > 6)
entries++;
} else
/* Otherwise, truncate it so that it takes up only
* one entry's worth of space. */
space_ptr[6] = '\0';
if (!f->desc || !strcmp(f->desc, ""))
continue;
ptr += sprintf(ptr, "^%s", space_ptr);
/* Lets just try and use the first 3 shortcuts
from the new struct... */
for (s = sclist, scsfound = 0; s != NULL; s = s->next) {
free(space_ptr);
} else if (s->ctrlval == NANO_CONTROL_8)
ptr += sprintf(ptr, "^?");
/* Normal values. */
else
ptr += sprintf(ptr, "^%c", s->ctrlval + 64);
*(ptr++) = '\t';
}
if (scsfound == 3)
continue;
/* Function key. */
if (s->funcval != NANO_NO_KEY) {
entries++;
/* If this is the first entry, put it in the middle. */
if (entries == 1) {
entries++;
if (s->type == RAW)
continue;
if ((s->menu & currmenu) == 0)
continue;
if (s->scfunc == f->scfunc) {
scsfound++;
if (scsfound == 1)
ptr += sprintf(ptr, "%s", s->keystr);
else
ptr += sprintf(ptr, "(%s)", s->keystr);
*(ptr++) = '\t';
}
ptr += sprintf(ptr, "(F%d)", s->funcval - KEY_F0);
*(ptr++) = '\t';
}
/* Primary meta key sequence. If it's the first entry, don't
* put parentheses around it. */
if (s->metaval != NANO_NO_KEY) {
entries++;
/* If this is the last entry, put it at the end. */
if (entries == 2 && s->miscval == NANO_NO_KEY) {
entries++;
*(ptr++) = '\t';
}
/* Yucky sentinel values that we can't handle a better
* way. */
if (s->metaval == NANO_ALT_SPACE && entries == 1) {
char *space_ptr = display_string(_("Space"), 0, 13,
FALSE);
/* If we're here, we have at least two entries worth of
* blank space. If this entry takes up more than one
* entry's worth of space, use two to display it. */
if (mbstrlen(space_ptr) > 5)
entries++;
ptr += sprintf(ptr, "M-%s", space_ptr);
free(space_ptr);
} else
/* Normal values. */
ptr += sprintf(ptr, (entries == 1) ? "M-%c" : "(M-%c)",
toupper(s->metaval));
/* Pad with tabs if we didnt find 3 */
for (; scsfound < 3; scsfound++) {
*(ptr++) = '\t';
}
/* Miscellaneous meta key sequence. */
if (entries < 3 && s->miscval != NANO_NO_KEY) {
entries++;
/* If this is the last entry, put it at the end. */
if (entries == 2) {
entries++;
*(ptr++) = '\t';
}
ptr += sprintf(ptr, "(M-%c)", toupper(s->miscval));
*(ptr++) = '\t';
}
/* If this entry isn't blank, make sure all the help text starts
* at the same place. */
if (s->ctrlval != NANO_NO_KEY || s->funcval != NANO_NO_KEY ||
s->metaval != NANO_NO_KEY || s->miscval !=
NANO_NO_KEY) {
while (entries < 3) {
entries++;
*(ptr++) = '\t';
}
}
/* The shortcut's help text. */
ptr += sprintf(ptr, "%s\n", s->help);
ptr += sprintf(ptr, "%s\n", _(f->help));
if (s->blank_after)
if (f->blank_after)
ptr += sprintf(ptr, "\n");
}
#ifndef NANO_TINY
/* And the toggles... */
if (currshortcut == main_list) {
for (t = toggles; t != NULL; t = t->next) {
ptr += sprintf(ptr, "M-%c\t\t\t%s %s\n",
toupper(t->val), t->desc, _("enable/disable"));
if (currmenu == MMAIN)
for (s = sclist; s != NULL; s = s->next)
if (s->scfunc == (void *) do_toggle)
ptr += sprintf(ptr, "(%s)\t\t\t%s %s\n",
s->keystr, _(flagtostr(s->toggle)), _("enable/disable"));
if (t->blank_after)
ptr += sprintf(ptr, "\n");
}
}
#ifdef ENABLE_NANORC
if (old_whitespace)
@@ -573,20 +501,21 @@ void help_init(void)
* shortcut keys. */
void parse_help_input(int *kbinput, bool *meta_key, bool *func_key)
{
get_shortcut(help_list, kbinput, meta_key, func_key);
get_shortcut(MHELP, kbinput, meta_key, func_key);
if (!*meta_key) {
switch (*kbinput) {
/* For consistency with the file browser. */
case ' ':
*kbinput = NANO_NEXTPAGE_KEY;
*kbinput = sc_seq_or(do_page_up, 0);
break;
case '-':
*kbinput = NANO_PREVPAGE_KEY;
*kbinput = sc_seq_or(do_page_down, 0);;
break;
/* Cancel is equivalent to Exit here. */
case NANO_CANCEL_KEY:
*kbinput = NANO_EXIT_KEY;
case 'E':
case 'e':
*kbinput = sc_seq_or(do_exit, 0);;
break;
}
}
@@ -607,8 +536,8 @@ size_t help_line_len(const char *ptr)
while (*(ptr + retval) != '\0' && *(ptr + retval) != '\n')
retval += move_mbright(ptr + retval, 0);
/* If the entire line doesn't go more than 1 column beyond where we
* tried to break it, we should display it as-is. Otherwise, we
/* If the entire line doesn't go more than one column beyond where
* we tried to break it, we should display it as-is. Otherwise, we
* should display it only up to the break. */
if (strnlenpt(ptr, retval) > help_cols + 1)
retval = retval_save;
@@ -617,3 +546,18 @@ size_t help_line_len(const char *ptr)
}
#endif /* !DISABLE_HELP */
/* Start the help browser for the edit window. */
void do_help_void(void)
{
#ifndef DISABLE_HELP
/* Start the help browser for the edit window. */
do_help(&edit_refresh);
#else
if (currmenu == MMAIN)
nano_disabled_msg();
else
beep();
#endif
}

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* move.c *
* *
* Copyright (C) 1999-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -272,8 +272,7 @@ bool do_next_word(bool allow_punct, bool allow_update)
free(char_mb);
/* If we haven't found it, leave the cursor at the end of the
* file. */
/* If we haven't found it, move to the end of the file. */
if (openfile->current == NULL)
openfile->current = openfile->filebot;
@@ -371,8 +370,7 @@ bool do_prev_word(bool allow_punct, bool allow_update)
}
}
/* If we haven't found it, leave the cursor at the beginning of the
* file. */
/* If we haven't found it, move to the beginning of the file. */
if (openfile->current == NULL)
openfile->current = openfile->fileage;
/* If we've found it, move backward until we find the character

View File

@@ -1,12 +1,12 @@
/* $Id$ */
/* $Id$ */
/**************************************************************************
* nano.c *
* *
* Copyright (C) 1999-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -32,6 +32,9 @@
#include <errno.h>
#include <ctype.h>
#include <locale.h>
#ifdef ENABLE_UTF8
#include <langinfo.h>
#endif
#include <termios.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
@@ -40,6 +43,10 @@
#include <sys/ioctl.h>
#endif
#ifndef DISABLE_MOUSE
static int oldinterval = -1;
/* Used to store the user's original mouse click interval. */
#endif
#ifdef ENABLE_NANORC
static bool no_rcfiles = FALSE;
/* Should we ignore all rcfiles? */
@@ -47,7 +54,7 @@ static bool no_rcfiles = FALSE;
static struct termios oldterm;
/* The user's original terminal settings. */
static struct sigaction act;
/* For all our fun signal handlers. */
/* Used to set up all our fun signal handlers. */
/* Create a new filestruct node. Note that we do not set prevnode->next
* to the new line. */
@@ -168,8 +175,8 @@ void renumber(filestruct *fileptr)
fileptr->lineno = ++line;
}
/* Partition a filestruct so it begins at (top, top_x) and ends at (bot,
* bot_x). */
/* Partition a filestruct so that it begins at (top, top_x) and ends at
* (bot, bot_x). */
partition *partition_filestruct(filestruct *top, size_t top_x,
filestruct *bot, size_t bot_x)
{
@@ -221,8 +228,8 @@ partition *partition_filestruct(filestruct *top, size_t top_x,
return p;
}
/* Unpartition a filestruct so it begins at (fileage, 0) and ends at
* (filebot, strlen(filebot->data)) again. */
/* Unpartition a filestruct so that it begins at (fileage, 0) and ends
* at (filebot, strlen(filebot->data)) again. */
void unpartition_filestruct(partition **p)
{
char *tmp;
@@ -343,22 +350,23 @@ void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
renumber(file_bot_save->next);
}
/* Since the text has now been saved, remove it from the filestruct.
* If the mark begins inside the partition, set the beginning of the
* mark to where the saved text used to start. */
/* Since the text has now been saved, remove it from the
* filestruct. */
openfile->fileage = (filestruct *)nmalloc(sizeof(filestruct));
openfile->fileage->data = mallocstrcpy(NULL, "");
openfile->filebot = openfile->fileage;
#ifndef NANO_TINY
if (mark_inside) {
openfile->mark_begin = openfile->fileage;
openfile->mark_begin_x = top_x;
}
#endif
/* Restore the current line and cursor position. */
/* Restore the current line and cursor position. If the mark begins
* inside the partition, set the beginning of the mark to where the
* saved text used to start. */
openfile->current = openfile->fileage;
openfile->current_x = top_x;
#ifndef NANO_TINY
if (mark_inside) {
openfile->mark_begin = openfile->current;
openfile->mark_begin_x = openfile->current_x;
}
#endif
top_save = openfile->fileage;
@@ -391,10 +399,28 @@ void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
void copy_from_filestruct(filestruct *file_top, filestruct *file_bot)
{
filestruct *top_save;
size_t current_x_save = openfile->current_x;
bool edittop_inside;
#ifndef NANO_TINY
bool right_side_up = FALSE, single_line = FALSE;
#endif
assert(file_top != NULL && file_bot != NULL);
#ifndef NANO_TINY
/* Keep track of whether the mark begins inside the partition and
* will need adjustment. */
if (openfile->mark_set) {
filestruct *top, *bot;
size_t top_x, bot_x;
mark_order((const filestruct **)&top, &top_x,
(const filestruct **)&bot, &bot_x, &right_side_up);
single_line = (top == bot);
}
#endif
/* Partition the filestruct so that it contains no text, and keep
* track of whether the top of the edit window is inside the
* partition. */
@@ -409,11 +435,32 @@ void copy_from_filestruct(filestruct *file_top, filestruct *file_bot)
while (openfile->filebot->next != NULL)
openfile->filebot = openfile->filebot->next;
/* Restore the current line and cursor position. */
/* Restore the current line and cursor position. If the mark begins
* inside the partition, adjust the mark coordinates to compensate
* for the change in the current line. */
openfile->current = openfile->filebot;
openfile->current_x = strlen(openfile->filebot->data);
if (openfile->fileage == openfile->filebot)
openfile->current_x += strlen(filepart->top_data);
if (openfile->fileage == openfile->filebot) {
#ifndef NANO_TINY
if (openfile->mark_set) {
openfile->mark_begin = openfile->current;
if (!right_side_up)
openfile->mark_begin_x += openfile->current_x;
}
#endif
openfile->current_x += current_x_save;
}
#ifndef NANO_TINY
else if (openfile->mark_set) {
if (!right_side_up) {
if (single_line) {
openfile->mark_begin = openfile->current;
openfile->mark_begin_x -= current_x_save;
} else
openfile->mark_begin_x -= openfile->current_x;
}
}
#endif
/* Get the number of characters in the copied text, and add it to
* totsize. */
@@ -457,6 +504,9 @@ openfilestruct *make_new_opennode(void)
newnode->filebot = NULL;
newnode->edittop = NULL;
newnode->current = NULL;
#ifndef NANO_TINY
newnode->last_action = OTHER;
#endif
return newnode;
}
@@ -523,7 +573,7 @@ void print_view_warning(void)
statusbar(_("Key invalid in view mode"));
}
/* What we do when we're all set to exit. */
/* Make nano exit gracefully. */
void finish(void)
{
/* Blank the statusbar (and shortcut list, if applicable), and move
@@ -547,10 +597,11 @@ void finish(void)
thanks_for_all_the_fish();
#endif
/* Get out. */
exit(0);
}
/* Die (gracefully?). */
/* Make nano die gracefully. */
void die(const char *msg, ...)
{
va_list ap;
@@ -565,7 +616,7 @@ void die(const char *msg, ...)
va_end(ap);
/* Save the current file buffer if it's been modified. */
if (openfile->modified) {
if (openfile && openfile->modified) {
/* If we've partitioned the filestruct, unpartition it now. */
if (filepart != NULL)
unpartition_filestruct(&filepart);
@@ -605,15 +656,14 @@ void die_save_file(const char *die_filename)
if (ISSET(RESTRICTED))
return;
/* If we can't save, we have REAL bad problems, but we might as well
* TRY. */
if (die_filename[0] == '\0')
/* If we can't save, we have really bad problems, but we might as
* well try. */
if (*die_filename == '\0')
die_filename = "nano";
retval = get_next_filename(die_filename, ".save");
if (retval[0] != '\0')
failed = (write_file(retval, NULL, TRUE, OVERWRITE,
TRUE) == -1);
failed = !write_file(retval, NULL, TRUE, OVERWRITE, TRUE);
if (!failed)
fprintf(stderr, _("\nBuffer written to %s\n"), retval);
@@ -670,13 +720,14 @@ void window_init(void)
void disable_mouse_support(void)
{
mousemask(0, NULL);
mouseinterval(oldinterval);
}
/* Enable mouse support. */
void enable_mouse_support(void)
{
mousemask(ALL_MOUSE_EVENTS, NULL);
mouseinterval(50);
oldinterval = mouseinterval(50);
}
/* Initialize mouse support. Enable it if the USE_MOUSE flag is set,
@@ -698,7 +749,7 @@ void mouse_init(void)
/* Print one usage string to the screen. This cuts down on duplicate
* strings to translate, and leaves out the parts that shouldn't be
* translatable (the flag names). */
* translatable (i.e. the flag names). */
void print_opt_full(const char *shortflag
#ifdef HAVE_GETOPT_LONG
, const char *longflag
@@ -706,14 +757,14 @@ void print_opt_full(const char *shortflag
, const char *desc)
{
printf(" %s\t", shortflag);
if (strlen(shortflag) < 8)
if (strlenpt(shortflag) < 8)
printf("\t");
#ifdef HAVE_GETOPT_LONG
printf("%s\t", longflag);
if (strlen(longflag) < 8)
if (strlenpt(longflag) < 8)
printf("\t\t");
else if (strlen(longflag) < 16)
else if (strlenpt(longflag) < 16)
printf("\t");
#endif
@@ -774,7 +825,8 @@ void usage(void)
#endif
print_opt("-R", "--restricted", N_("Restricted mode"));
#ifndef NANO_TINY
print_opt("-S", "--smooth", N_("Smooth scrolling"));
print_opt("-S", "--smooth",
N_("Scroll by line instead of half-screen"));
#endif
print_opt(_("-T <#cols>"), _("--tabsize=<#cols>"),
N_("Set width of a tab to #cols columns"));
@@ -841,6 +893,8 @@ void version(void)
{
printf(_(" GNU nano version %s (compiled %s, %s)\n"), VERSION,
__TIME__, __DATE__);
printf(" (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007\n");
printf(" Free Software Foundation, Inc.\n");
printf(
_(" Email: nano@nano-editor.org Web: http://www.nano-editor.org/"));
printf(_("\n Compiled options:"));
@@ -924,6 +978,11 @@ void nano_disabled_msg(void)
statusbar(_("Sorry, support for this function has been disabled"));
}
/* If the current file buffer has been modified, and the TEMP_FILE flag
* isn't set, ask whether or not to save the file buffer. If the
* TEMP_FILE flag is set, save it unconditionally. Then, if more than
* one file buffer is open, close the current file buffer and switch to
* the next one. If only one file buffer is open, exit from nano. */
void do_exit(void)
{
int i;
@@ -946,7 +1005,7 @@ void do_exit(void)
/* If the user chose not to save, or if the user chose to save and
* the save succeeded, we're ready to exit. */
if (i == 0 || (i == 1 && do_writeout(TRUE) == 0)) {
if (i == 0 || (i == 1 && do_writeout(TRUE))) {
#ifdef ENABLE_MULTIBUFFER
/* Exit only if there are no more open file buffers. */
if (!close_buffer())
@@ -956,6 +1015,7 @@ void do_exit(void)
} else if (i != 1)
statusbar(_("Cancelled"));
shortcut_init(FALSE);
display_main_list();
}
@@ -1035,6 +1095,13 @@ RETSIGTYPE do_suspend(int signal)
kill(0, SIGSTOP);
}
/* the subnfunc version */
void do_suspend_void(void)
{
if (ISSET(SUSPEND))
do_suspend(0);
}
/* Handler for SIGCONT (continue after suspend). */
RETSIGTYPE do_continue(int signal)
{
@@ -1120,7 +1187,7 @@ RETSIGTYPE handle_sigwinch(int signal)
/* Redraw the contents of the windows that need it. */
blank_statusbar();
wnoutrefresh(bottomwin);
currshortcut = main_list;
currmenu = MMAIN;
total_refresh();
/* Jump back to either main() or the unjustify routine in
@@ -1142,52 +1209,54 @@ void allow_pending_sigwinch(bool allow)
#ifndef NANO_TINY
/* Handle the global toggle specified in which. */
void do_toggle(const toggle *which)
void do_toggle(int flag)
{
bool enabled;
char *desc;
TOGGLE(which->flag);
TOGGLE(flag);
switch (which->val) {
switch (flag) {
#ifndef DISABLE_MOUSE
case TOGGLE_MOUSE_KEY:
case USE_MOUSE:
mouse_init();
break;
#endif
case TOGGLE_MORESPACE_KEY:
case TOGGLE_NOHELP_KEY:
case MORE_SPACE:
case NO_HELP:
window_init();
total_refresh();
break;
case TOGGLE_SUSPEND_KEY:
case SUSPEND:
signal_init();
break;
#ifdef ENABLE_NANORC
case TOGGLE_WHITESPACE_KEY:
case WHITESPACE_DISPLAY:
titlebar(NULL);
edit_refresh();
break;
#endif
#ifdef ENABLE_COLOR
case TOGGLE_SYNTAX_KEY:
case NO_COLOR_SYNTAX:
edit_refresh();
break;
#endif
}
enabled = ISSET(which->flag);
enabled = ISSET(flag);
if (which->val == TOGGLE_NOHELP_KEY
if (flag == NO_HELP
#ifndef DISABLE_WRAPPING
|| which->val == TOGGLE_WRAP_KEY
|| flag == NO_WRAP
#endif
#ifdef ENABLE_COLOR
|| which->val == TOGGLE_SYNTAX_KEY
|| flag == NO_COLOR_SYNTAX
#endif
)
enabled = !enabled;
statusbar("%s %s", which->desc, enabled ? _("enabled") :
desc = _(flagtostr(flag));
statusbar("%s %s", desc, enabled ? _("enabled") :
_("disabled"));
}
#endif /* !NANO_TINY */
@@ -1204,6 +1273,7 @@ void disable_extended_io(void)
tcsetattr(0, TCSANOW, &term);
}
#ifdef USE_SLANG
/* Disable interpretation of the special control keys in our terminal
* settings. */
void disable_signals(void)
@@ -1214,6 +1284,7 @@ void disable_signals(void)
term.c_lflag &= ~ISIG;
tcsetattr(0, TCSANOW, &term);
}
#endif
#ifndef NANO_TINY
/* Enable interpretation of the special control keys in our terminal
@@ -1250,37 +1321,41 @@ void enable_flow_control(void)
tcsetattr(0, TCSANOW, &term);
}
/* Set up the terminal state. Put the terminal in cbreak mode (read one
* character at a time and interpret the special control keys), disable
* translation of carriage return (^M) into newline (^J) so that we can
* tell the difference between the Enter key and Ctrl-J, and disable
* echoing of characters as they're typed. Finally, disable extended
* input and output processing, disable interpretation of the special
* control keys, and if we're not in preserve mode, disable
* interpretation of the flow control characters too. */
/* Set up the terminal state. Put the terminal in raw mode (read one
* character at a time, disable the special control keys, and disable
* the flow control characters), disable translation of carriage return
* (^M) into newline (^J) so that we can tell the difference between the
* Enter key and Ctrl-J, and disable echoing of characters as they're
* typed. Finally, disable extended input and output processing, and,
* if we're not in preserve mode, reenable interpretation of the flow
* control characters. */
void terminal_init(void)
{
#ifdef USE_SLANG
/* Slang curses emulation brain damage, part 2: Slang doesn't
* implement nonl() or noecho() properly, so there's no way to
* properly reinitialize the terminal using them. We have to save
* the terminal state after the first call and restore it on
* subsequent calls. */
* implement raw(), nonl(), or noecho() properly, so there's no way
* to properly reinitialize the terminal using them. We have to
* disable the special control keys and interpretation of the flow
* control characters using termios, save the terminal state after
* the first call, and restore it on subsequent calls. */
static struct termios newterm;
static bool newterm_set = FALSE;
if (!newterm_set) {
#endif
cbreak();
raw();
nonl();
noecho();
disable_extended_io();
if (ISSET(PRESERVE))
enable_flow_control();
#ifdef USE_SLANG
disable_signals();
if (!ISSET(PRESERVE))
disable_flow_control();
#ifdef USE_SLANG
tcgetattr(0, &newterm);
newterm_set = TRUE;
} else
@@ -1308,12 +1383,8 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
/* The length of the input buffer. */
bool cut_copy = FALSE;
/* Are we cutting or copying text? */
const shortcut *s;
const sc *s;
bool have_shortcut;
#ifndef NANO_TINY
const toggle *t;
bool have_toggle;
#endif
*s_or_t = FALSE;
*ran_func = FALSE;
@@ -1327,7 +1398,7 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
/* If we got a mouse click and it was on a shortcut, read in the
* shortcut character. */
if (*func_key && input == KEY_MOUSE) {
if (do_mouse())
if (do_mouse() == 1)
input = get_kbinput(edit, meta_key, func_key);
else {
*meta_key = FALSE;
@@ -1339,32 +1410,15 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
#endif
/* Check for a shortcut in the main list. */
s = get_shortcut(main_list, &input, meta_key, func_key);
s = get_shortcut(MMAIN, &input, meta_key, func_key);
/* If we got a shortcut from the main list, or a "universal"
* edit window shortcut, set have_shortcut to TRUE. */
have_shortcut = (s != NULL || input == NANO_XON_KEY ||
input == NANO_XOFF_KEY || input == NANO_SUSPEND_KEY);
#ifndef NANO_TINY
/* Check for a toggle in the main list. */
t = get_toggle(input, *meta_key);
/* If we got a toggle from the main list, set have_toggle to
* TRUE. */
have_toggle = (t != NULL);
#endif
/* Set s_or_t to TRUE if we got a shortcut or toggle. */
*s_or_t = (have_shortcut
#ifndef NANO_TINY
|| have_toggle
#endif
);
have_shortcut = (s != NULL);
/* If we got a non-high-bit control key, a meta key sequence, or a
* function key, and it's not a shortcut or toggle, throw it out. */
if (!*s_or_t) {
if (!have_shortcut) {
if (is_ascii_cntrl_char(input) || *meta_key || *func_key) {
statusbar(_("Unknown Command"));
beep();
@@ -1379,7 +1433,7 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
* it's a normal text character. Display the warning if we're
* in view mode, or add the character to the input buffer if
* we're not. */
if (input != ERR && !*s_or_t) {
if (input != ERR && !have_shortcut) {
if (ISSET(VIEW_MODE))
print_view_warning();
else {
@@ -1395,12 +1449,12 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
* output all the characters in the input buffer if it isn't
* empty. Note that it should be empty if we're in view
* mode. */
if (*s_or_t || get_key_buffer_len() == 0) {
if (have_shortcut || get_key_buffer_len() == 0) {
#ifndef DISABLE_WRAPPING
/* If we got a shortcut or toggle, and it's not the shortcut
* for verbatim input, turn off prepending of wrapped
* text. */
if (*s_or_t && (!have_shortcut || s == NULL || s->func !=
if (have_shortcut && (!have_shortcut || s == NULL || s->scfunc !=
do_verbatim_input))
wrap_reset();
#endif
@@ -1428,17 +1482,6 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
if (have_shortcut) {
switch (input) {
/* Handle the "universal" edit window shortcuts. */
case NANO_XON_KEY:
statusbar(_("XON ignored, mumble mumble"));
break;
case NANO_XOFF_KEY:
statusbar(_("XOFF ignored, mumble mumble"));
break;
case NANO_SUSPEND_KEY:
if (ISSET(SUSPEND))
do_suspend(0);
break;
/* Handle the normal edit window shortcuts, setting
* ran_func to TRUE if we try to run their associated
* functions and setting finished to TRUE to indicate
@@ -1447,32 +1490,31 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
default:
/* If the function associated with this shortcut is
* cutting or copying text, indicate this. */
if (s->func == do_cut_text_void
if (s->scfunc == do_cut_text_void
#ifndef NANO_TINY
|| s->func == do_copy_text || s->func ==
|| s->scfunc == do_copy_text || s->scfunc ==
do_cut_till_end
#endif
)
cut_copy = TRUE;
if (s->func != NULL) {
if (s->scfunc != NULL) {
const subnfunc *f = sctofunc((sc *) s);
*ran_func = TRUE;
if (ISSET(VIEW_MODE) && !s->viewok)
if (ISSET(VIEW_MODE) && f && !f->viewok)
print_view_warning();
else
s->func();
#ifndef NANO_TINY
if (s->scfunc == (void *) do_toggle)
do_toggle(s->toggle);
else
#endif
s->scfunc();
}
*finished = TRUE;
break;
}
}
#ifndef NANO_TINY
else if (have_toggle) {
/* Toggle the flag associated with this shortcut. */
if (allow_funcs)
do_toggle(t);
}
#endif
}
/* If we aren't cutting or copying text, blow away the text in the
@@ -1483,52 +1525,56 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
return input;
}
void xon_complaint(void)
{
statusbar(_("XON ignored, mumble mumble"));
}
void xoff_complaint(void)
{
statusbar(_("XOFF ignored, mumble mumble"));
}
#ifndef DISABLE_MOUSE
/* Handle a mouse click on the edit window or the shortcut list. */
bool do_mouse(void)
int do_mouse(void)
{
int mouse_x, mouse_y;
bool retval = get_mouseinput(&mouse_x, &mouse_y, TRUE);
int retval = get_mouseinput(&mouse_x, &mouse_y, TRUE);
if (!retval) {
/* We can click in the edit window to move the cursor. */
if (wenclose(edit, mouse_y, mouse_x)) {
bool sameline;
/* Did they click on the line with the cursor? If they
* clicked on the cursor, we set the mark. */
const filestruct *current_save = openfile->current;
size_t current_x_save = openfile->current_x;
size_t pww_save = openfile->placewewant;
/* We can click on the edit window to move the cursor. */
if (retval == 0 && wmouse_trafo(edit, &mouse_y, &mouse_x, FALSE)) {
bool sameline;
/* Did they click on the line with the cursor? If they
* clicked on the cursor, we set the mark. */
const filestruct *current_save = openfile->current;
size_t current_x_save = openfile->current_x;
size_t pww_save = openfile->placewewant;
/* Subtract out the size of topwin. */
mouse_y -= 2 - no_more_space();
sameline = (mouse_y == openfile->current_y);
sameline = (mouse_y == openfile->current_y);
/* Move to where the click occurred. */
for (; openfile->current_y < mouse_y && openfile->current !=
openfile->filebot; openfile->current_y++)
openfile->current = openfile->current->next;
for (; openfile->current_y > mouse_y && openfile->current !=
openfile->fileage; openfile->current_y--)
openfile->current = openfile->current->prev;
/* Move to where the click occurred. */
for (; openfile->current_y < mouse_y &&
openfile->current != openfile->filebot;
openfile->current_y++)
openfile->current = openfile->current->next;
for (; openfile->current_y > mouse_y &&
openfile->current != openfile->fileage;
openfile->current_y--)
openfile->current = openfile->current->prev;
openfile->current_x = actual_x(openfile->current->data,
openfile->current_x = actual_x(openfile->current->data,
get_page_start(xplustabs()) + mouse_x);
openfile->placewewant = xplustabs();
openfile->placewewant = xplustabs();
#ifndef NANO_TINY
/* Clicking where the cursor is toggles the mark, as does
* clicking beyond the line length with the cursor at the
* end of the line. */
if (sameline && openfile->current_x == current_x_save)
do_mark();
/* Clicking where the cursor is toggles the mark, as does
* clicking beyond the line length with the cursor at the end of
* the line. */
if (sameline && openfile->current_x == current_x_save)
do_mark();
#endif
edit_redraw(current_save, pww_save);
}
edit_redraw(current_save, pww_save);
}
return retval;
@@ -1553,8 +1599,8 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
current_len = strlen(openfile->current->data);
while (i < output_len) {
/* If allow_cntrls is FALSE, filter out nulls and newlines,
* since they're ASCII control characters. */
/* If allow_cntrls is TRUE, convert nulls and newlines
* properly. */
if (allow_cntrls) {
/* Null to newline, if needed. */
if (output[i] == '\0')
@@ -1579,7 +1625,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
continue;
/* If the NO_NEWLINES flag isn't set, when a character is
* added to the magicline, it means we need a new magicline! */
* added to the magicline, it means we need a new magicline. */
if (!ISSET(NO_NEWLINES) && openfile->filebot ==
openfile->current)
new_magicline();
@@ -1601,6 +1647,9 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
set_modified();
#ifndef NANO_TINY
update_undo(ADD);
/* Note that current_x has not yet been incremented. */
if (openfile->mark_set && openfile->current ==
openfile->mark_begin && openfile->current_x <
@@ -1722,12 +1771,12 @@ int main(int argc, char **argv)
#ifdef ENABLE_UTF8
{
/* If the locale set exists and includes the case-insensitive
* string "UTF8" or "UTF-8", we should use UTF-8. */
/* If the locale set exists and uses UTF-8, we should use
* UTF-8. */
char *locale = setlocale(LC_ALL, "");
if (locale != NULL && (strcasestr(locale, "UTF8") != NULL ||
strcasestr(locale, "UTF-8") != NULL)) {
if (locale != NULL && (strcmp(nl_langinfo(CODESET),
"UTF-8") == 0)) {
#ifdef USE_SLANG
SLutf8_enable(1);
#endif
@@ -1922,7 +1971,7 @@ int main(int argc, char **argv)
}
}
/* If the executable filename starts with 'r', we use restricted
/* If the executable filename starts with 'r', enable restricted
* mode. */
if (*(tail(argv[0])) == 'r')
SET(RESTRICTED);
@@ -1938,6 +1987,11 @@ int main(int argc, char **argv)
#endif
}
/* Set up the shortcut lists.
Need to do this before the rcfile */
shortcut_init(FALSE);
/* We've read through the command line options. Now back up the flags
* and values that are set, and read the rcfile(s). If the values
* haven't changed afterward, restore the backed-up values. */
@@ -1976,6 +2030,11 @@ int main(int argc, char **argv)
do_rcfile();
#ifdef DEBUG
fprintf(stderr, "After rebinding keys...\n");
print_sclist();
#endif
#ifndef DISABLE_OPERATINGDIR
if (operating_dir_cpy != NULL) {
free(operating_dir);
@@ -1991,7 +2050,7 @@ int main(int argc, char **argv)
free(backup_dir);
backup_dir = backup_dir_cpy;
}
#endif
#endif
#ifndef DISABLE_JUSTIFY
if (quotestr_cpy != NULL) {
free(quotestr);
@@ -2117,8 +2176,9 @@ int main(int argc, char **argv)
/* Back up the old terminal settings so that they can be restored. */
tcgetattr(0, &oldterm);
/* Initialize curses mode. */
initscr();
/* Initialize curses mode. If this fails, get out. */
if (initscr() == NULL)
exit(1);
/* Set up the terminal state. */
terminal_init();
@@ -2137,9 +2197,6 @@ int main(int argc, char **argv)
/* Set up the signal handlers. */
signal_init();
/* Set up the shortcut lists. */
shortcut_init(FALSE);
#ifndef DISABLE_MOUSE
/* Initialize mouse support. */
mouse_init();
@@ -2175,7 +2232,7 @@ int main(int argc, char **argv)
icol == 1)
parse_line_column(&argv[i][1], &iline, &icol);
else {
open_buffer(argv[i]);
open_buffer(argv[i], FALSE);
if (iline > 1 || icol > 1) {
do_gotolinecolumn(iline, icol, FALSE, FALSE, FALSE,
@@ -2192,14 +2249,14 @@ int main(int argc, char **argv)
* buffer or a new buffer, depending on whether multibuffer mode is
* enabled. */
if (optind < argc)
open_buffer(argv[optind]);
open_buffer(argv[optind], FALSE);
/* We didn't open any files if all the command line arguments were
* invalid files like directories or if there were no command line
* arguments given. In this case, we have to load a blank buffer.
* Also, we unset view mode to allow editing. */
if (openfile == NULL) {
open_buffer("");
open_buffer("", FALSE);
UNSET(VIEW_MODE);
}
@@ -2218,13 +2275,14 @@ int main(int argc, char **argv)
display_main_list();
display_buffer();
display_buffer();
while (TRUE) {
bool meta_key, func_key, s_or_t, ran_func, finished;
/* Make sure the cursor is in the edit window. */
reset_cursor();
wnoutrefresh(edit);
#ifndef NANO_TINY
if (!jump_buf_main) {
@@ -2247,7 +2305,7 @@ int main(int argc, char **argv)
if (ISSET(CONST_UPDATE) && get_key_buffer_len() == 0)
do_cursorpos(TRUE);
currshortcut = main_list;
currmenu = MMAIN;
/* Read in and interpret characters. */
do_input(&meta_key, &func_key, &s_or_t, &ran_func, &finished,

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* nano.h *
* *
* Copyright (C) 1999-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -50,7 +50,7 @@
#define ISSET(bit) ((flags & bit) != 0)
#define TOGGLE(bit) flags ^= bit
/* Macros for character allocation, etc. */
/* Macros for character allocation and more. */
#define charalloc(howmuch) (char *)nmalloc((howmuch) * sizeof(char))
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char))
#define charmove(dest, src, n) memmove(dest, src, (n) * sizeof(char))
@@ -165,6 +165,14 @@ typedef enum {
CENTER, NONE
} update_type;
typedef enum {
CONTROL, META, FKEY, RAW
} function_type;
typedef enum {
ADD, DEL, REPLACE, SPLIT, UNSPLIT, CUT, CUTTOEND, UNCUT, INSERT, OTHER
} undo_type;
/* Structure types. */
typedef struct filestruct {
char *data;
@@ -241,6 +249,40 @@ typedef struct syntaxtype {
} syntaxtype;
#endif /* ENABLE_COLOR */
#ifndef NANO_TINY
typedef struct undo {
ssize_t lineno;
undo_type type;
/* What type of undo was this */
int begin;
/* Where did this action begin or end */
char *strdata;
/* String type data we will use for ccopying the affected line back */
int xflags;
/* Some flag data we need */
/* Cut specific stuff we need */
filestruct *cutbuffer;
/* Copy of the cutbuffer */
filestruct *cutbottom;
/* Copy of cutbottom */
bool mark_set;
/* was the marker set when we cut */
bool to_end;
/* was this a cut to end */
ssize_t mark_begin_lineno;
/* copy copy copy */
ssize_t mark_begin_x;
/* Another shadow variable */
ssize_t linescut;
/* How many lines we cut on a straight non-marked non-to-end cut */
struct undo *next;
} undo;
#endif /* NANO_TINY */
typedef struct openfilestruct {
char *filename;
/* The current file's name. */
@@ -274,6 +316,11 @@ typedef struct openfilestruct {
/* The current file's format. */
struct stat *current_stat;
/* The current file's stat. */
undo *undotop;
/* Top of the undo list */
undo *current_undo;
/* The current (i.e. n ext) level of undo */
undo_type last_action;
#endif
#ifdef ENABLE_COLOR
colortype *colorstrings;
@@ -314,25 +361,6 @@ typedef struct shortcut {
/* Next shortcut. */
} shortcut;
#ifndef NANO_TINY
typedef struct toggle {
int val;
/* The sequence to toggle the key. We should only need one. */
const char *desc;
/* The description of the toggle, e.g. "Cut to end"; we'll
* append Enabled or Disabled to it. */
#ifndef DISABLE_HELP
bool blank_after;
/* Whether there should be a blank line after the description of
* the toggle. */
#endif
long flag;
/* Which flag actually gets toggled. */
struct toggle *next;
/* Next toggle. */
} toggle;
#endif
#ifdef ENABLE_NANORC
typedef struct rcoption {
const char *name;
@@ -340,8 +368,52 @@ typedef struct rcoption {
long flag;
/* The flag associated with it, if any. */
} rcoption;
#endif
typedef struct sc {
char *keystr;
/* The shortcut key for a function, ASCII version */
function_type type;
/* What kind of function key is it for convenience later */
int seq;
/* The actual sequence to check on the the type is determined */
int menu;
/* What list does this apply to */
void (*scfunc)(void);
/* The function we're going to run */
int toggle;
/* If a toggle, what we're toggling */
bool execute;
/* Whether to execute the function in question or just return
so the sequence can be caught by the calling code */
struct sc *next;
/* Next in the list */
} sc;
typedef struct subnfunc {
void (*scfunc)(void);
/* What function is this */
int menus;
/* In what menus does this function applu */
const char *desc;
/* The function's description, e.g. "Page Up". */
#ifndef DISABLE_HELP
const char *help;
/* The help file entry text for this function. */
bool blank_after;
/* Whether there should be a blank line after the help entry
* text for this function. */
#endif
bool viewok;
/* Is this function allowed when in view mode? */
long toggle;
/* If this is a toggle, if nonzero what toggle to set */
struct subnfunc *next;
/* next item in the list */
} subnfunc;
/* Bitwise flags so that we can save space (or, more correctly, not
* waste it). */
#define CASE_SENSITIVE (1<<0)
@@ -376,6 +448,24 @@ typedef struct rcoption {
#define NO_NEWLINES (1<<29)
#define BOLD_TEXT (1<<30)
/* Flags for which menus in which a given function should be present */
#define MMAIN (1<<0)
#define MWHEREIS (1<<1)
#define MREPLACE (1<<2)
#define MREPLACE2 (1<<3)
#define MGOTOLINE (1<<4)
#define MWRITEFILE (1<<5)
#define MINSERTFILE (1<<6)
#define MEXTCMD (1<<7)
#define MHELP (1<<8)
#define MSPELL (1<<9)
#define MBROWSER (1<<10)
#define MWHEREISFILE (1<<11)
#define MGOTODIR (1<<12)
#define MYESNO (1<<13)
/* This really isnt all but close enough */
#define MALL (MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MBROWSER|MWHEREISFILE|MGOTODIR|MHELP)
/* Control key sequences. Changing these would be very, very bad. */
#define NANO_CONTROL_SPACE 0
#define NANO_CONTROL_A 1
@@ -412,54 +502,54 @@ typedef struct rcoption {
#define NANO_CONTROL_8 127
/* Meta key sequences. */
#define NANO_ALT_SPACE ' '
#define NANO_ALT_LPARENTHESIS '('
#define NANO_ALT_RPARENTHESIS ')'
#define NANO_ALT_PLUS '+'
#define NANO_ALT_COMMA ','
#define NANO_ALT_MINUS '-'
#define NANO_ALT_PERIOD '.'
#define NANO_ALT_SLASH '/'
#define NANO_ALT_0 '0'
#define NANO_ALT_6 '6'
#define NANO_ALT_9 '9'
#define NANO_ALT_LCARET '<'
#define NANO_ALT_EQUALS '='
#define NANO_ALT_RCARET '>'
#define NANO_ALT_QUESTION '?'
#define NANO_ALT_BACKSLASH '\\'
#define NANO_ALT_RBRACKET ']'
#define NANO_ALT_CARET '^'
#define NANO_ALT_UNDERSCORE '_'
#define NANO_ALT_A 'a'
#define NANO_ALT_B 'b'
#define NANO_ALT_C 'c'
#define NANO_ALT_D 'd'
#define NANO_ALT_E 'e'
#define NANO_ALT_F 'f'
#define NANO_ALT_G 'g'
#define NANO_ALT_H 'h'
#define NANO_ALT_I 'i'
#define NANO_ALT_J 'j'
#define NANO_ALT_K 'k'
#define NANO_ALT_L 'l'
#define NANO_ALT_M 'm'
#define NANO_ALT_N 'n'
#define NANO_ALT_O 'o'
#define NANO_ALT_P 'p'
#define NANO_ALT_Q 'q'
#define NANO_ALT_R 'r'
#define NANO_ALT_S 's'
#define NANO_ALT_T 't'
#define NANO_ALT_U 'u'
#define NANO_ALT_V 'v'
#define NANO_ALT_W 'w'
#define NANO_ALT_X 'x'
#define NANO_ALT_Y 'y'
#define NANO_ALT_Z 'z'
#define NANO_ALT_LCURLYBRACKET '{'
#define NANO_ALT_PIPE '|'
#define NANO_ALT_RCURLYBRACKET '}'
#define NANO_META_SPACE ' '
#define NANO_META_LPARENTHESIS '('
#define NANO_META_RPARENTHESIS ')'
#define NANO_META_PLUS '+'
#define NANO_META_COMMA ','
#define NANO_META_MINUS '-'
#define NANO_META_PERIOD '.'
#define NANO_META_SLASH '/'
#define NANO_META_0 '0'
#define NANO_META_6 '6'
#define NANO_META_9 '9'
#define NANO_META_LCARET '<'
#define NANO_META_EQUALS '='
#define NANO_META_RCARET '>'
#define NANO_META_QUESTION '?'
#define NANO_META_BACKSLASH '\\'
#define NANO_META_RBRACKET ']'
#define NANO_META_CARET '^'
#define NANO_META_UNDERSCORE '_'
#define NANO_META_A 'a'
#define NANO_META_B 'b'
#define NANO_META_C 'c'
#define NANO_META_D 'd'
#define NANO_META_E 'e'
#define NANO_META_F 'f'
#define NANO_META_G 'g'
#define NANO_META_H 'h'
#define NANO_META_I 'i'
#define NANO_META_J 'j'
#define NANO_META_K 'k'
#define NANO_META_L 'l'
#define NANO_META_M 'm'
#define NANO_META_N 'n'
#define NANO_META_O 'o'
#define NANO_META_P 'p'
#define NANO_META_Q 'q'
#define NANO_META_R 'r'
#define NANO_META_S 's'
#define NANO_META_T 't'
#define NANO_META_U 'u'
#define NANO_META_V 'v'
#define NANO_META_W 'w'
#define NANO_META_X 'x'
#define NANO_META_Y 'y'
#define NANO_META_Z 'z'
#define NANO_META_LCURLYBRACKET '{'
#define NANO_META_PIPE '|'
#define NANO_META_RCURLYBRACKET '}'
/* Some semi-changeable keybindings; don't play with these unless you're
* sure you know what you're doing. Assume ERR is defined as -1. */
@@ -480,22 +570,22 @@ typedef struct rcoption {
#define NANO_WRITEOUT_FKEY KEY_F(3)
#define NANO_GOTOLINE_KEY NANO_CONTROL_7
#define NANO_GOTOLINE_FKEY KEY_F(13)
#define NANO_GOTOLINE_ALTKEY NANO_ALT_G
#define NANO_GOTOLINE_METAKEY NANO_META_G
#define NANO_GOTODIR_KEY NANO_CONTROL_7
#define NANO_GOTODIR_FKEY KEY_F(13)
#define NANO_GOTODIR_ALTKEY NANO_ALT_G
#define NANO_GOTODIR_METAKEY NANO_META_G
#define NANO_TOGOTOLINE_KEY NANO_CONTROL_T
#define NANO_HELP_KEY NANO_CONTROL_G
#define NANO_HELP_FKEY KEY_F(1)
#define NANO_WHEREIS_KEY NANO_CONTROL_W
#define NANO_WHEREIS_FKEY KEY_F(6)
#define NANO_WHEREIS_NEXT_KEY NANO_ALT_W
#define NANO_WHEREIS_NEXT_KEY NANO_META_W
#define NANO_WHEREIS_NEXT_FKEY KEY_F(16)
#define NANO_TOOTHERWHEREIS_KEY NANO_CONTROL_T
#define NANO_REGEXP_KEY NANO_ALT_R
#define NANO_REGEXP_KEY NANO_META_R
#define NANO_REPLACE_KEY NANO_CONTROL_4
#define NANO_REPLACE_FKEY KEY_F(14)
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
#define NANO_REPLACE_METAKEY NANO_META_R
#define NANO_TOOTHERSEARCH_KEY NANO_CONTROL_R
#define NANO_PREVPAGE_KEY NANO_CONTROL_Y
#define NANO_PREVPAGE_FKEY KEY_F(7)
@@ -503,8 +593,8 @@ typedef struct rcoption {
#define NANO_NEXTPAGE_FKEY KEY_F(8)
#define NANO_CUT_KEY NANO_CONTROL_K
#define NANO_CUT_FKEY KEY_F(9)
#define NANO_COPY_KEY NANO_ALT_CARET
#define NANO_COPY_ALTKEY NANO_ALT_6
#define NANO_COPY_KEY NANO_META_CARET
#define NANO_COPY_METAKEY NANO_META_6
#define NANO_UNCUT_KEY NANO_CONTROL_U
#define NANO_UNCUT_FKEY KEY_F(10)
#define NANO_CURSORPOS_KEY NANO_CONTROL_C
@@ -513,20 +603,20 @@ typedef struct rcoption {
#define NANO_SPELL_FKEY KEY_F(12)
#define NANO_FIRSTLINE_KEY NANO_PREVPAGE_KEY
#define NANO_FIRSTLINE_FKEY NANO_PREVPAGE_FKEY
#define NANO_FIRSTLINE_ALTKEY NANO_ALT_BACKSLASH
#define NANO_FIRSTLINE_ALTKEY2 NANO_ALT_PIPE
#define NANO_FIRSTLINE_METAKEY NANO_META_BACKSLASH
#define NANO_FIRSTLINE_METAKEY2 NANO_META_PIPE
#define NANO_FIRSTFILE_KEY NANO_FIRSTLINE_KEY
#define NANO_FIRSTFILE_FKEY NANO_FIRSTLINE_FKEY
#define NANO_FIRSTFILE_ALTKEY NANO_FIRSTLINE_ALTKEY
#define NANO_FIRSTFILE_ALTKEY2 NANO_FIRSTLINE_ALTKEY2
#define NANO_FIRSTFILE_METAKEY NANO_FIRSTLINE_METAKEY
#define NANO_FIRSTFILE_METAKEY2 NANO_FIRSTLINE_METAKEY2
#define NANO_LASTLINE_KEY NANO_NEXTPAGE_KEY
#define NANO_LASTLINE_FKEY NANO_NEXTPAGE_FKEY
#define NANO_LASTLINE_ALTKEY NANO_ALT_SLASH
#define NANO_LASTLINE_ALTKEY2 NANO_ALT_QUESTION
#define NANO_LASTLINE_METAKEY NANO_META_SLASH
#define NANO_LASTLINE_METAKEY2 NANO_META_QUESTION
#define NANO_LASTFILE_KEY NANO_LASTLINE_KEY
#define NANO_LASTFILE_FKEY NANO_LASTLINE_FKEY
#define NANO_LASTFILE_ALTKEY NANO_LASTLINE_ALTKEY
#define NANO_LASTFILE_ALTKEY2 NANO_LASTLINE_ALTKEY2
#define NANO_LASTFILE_METAKEY NANO_LASTLINE_METAKEY
#define NANO_LASTFILE_METAKEY2 NANO_LASTLINE_METAKEY2
#define NANO_REFRESH_KEY NANO_CONTROL_L
#define NANO_JUSTIFY_KEY NANO_CONTROL_J
#define NANO_JUSTIFY_FKEY KEY_F(4)
@@ -537,42 +627,42 @@ typedef struct rcoption {
#define NANO_FORWARD_KEY NANO_CONTROL_F
#define NANO_BACK_KEY NANO_CONTROL_B
#define NANO_MARK_KEY NANO_CONTROL_6
#define NANO_MARK_ALTKEY NANO_ALT_A
#define NANO_MARK_METAKEY NANO_META_A
#define NANO_MARK_FKEY KEY_F(15)
#define NANO_HOME_KEY NANO_CONTROL_A
#define NANO_END_KEY NANO_CONTROL_E
#define NANO_DELETE_KEY NANO_CONTROL_D
#define NANO_BACKSPACE_KEY NANO_CONTROL_H
#define NANO_TAB_KEY NANO_CONTROL_I
#define NANO_INDENT_KEY NANO_ALT_RCURLYBRACKET
#define NANO_UNINDENT_KEY NANO_ALT_LCURLYBRACKET
#define NANO_INDENT_KEY NANO_META_RCURLYBRACKET
#define NANO_UNINDENT_KEY NANO_META_LCURLYBRACKET
#define NANO_SUSPEND_KEY NANO_CONTROL_Z
#define NANO_ENTER_KEY NANO_CONTROL_M
#define NANO_TOFILES_KEY NANO_CONTROL_T
#define NANO_APPEND_KEY NANO_ALT_A
#define NANO_PREPEND_KEY NANO_ALT_P
#define NANO_PREVFILE_KEY NANO_ALT_LCARET
#define NANO_PREVFILE_ALTKEY NANO_ALT_COMMA
#define NANO_NEXTFILE_KEY NANO_ALT_RCARET
#define NANO_NEXTFILE_ALTKEY NANO_ALT_PERIOD
#define NANO_BRACKET_KEY NANO_ALT_RBRACKET
#define NANO_APPEND_KEY NANO_META_A
#define NANO_PREPEND_KEY NANO_META_P
#define NANO_PREVFILE_KEY NANO_META_LCARET
#define NANO_PREVFILE_METAKEY NANO_META_COMMA
#define NANO_NEXTFILE_KEY NANO_META_RCARET
#define NANO_NEXTFILE_METAKEY NANO_META_PERIOD
#define NANO_BRACKET_KEY NANO_META_RBRACKET
#define NANO_NEXTWORD_KEY NANO_CONTROL_SPACE
#define NANO_PREVWORD_KEY NANO_ALT_SPACE
#define NANO_WORDCOUNT_KEY NANO_ALT_D
#define NANO_SCROLLUP_KEY NANO_ALT_MINUS
#define NANO_SCROLLDOWN_KEY NANO_ALT_PLUS
#define NANO_SCROLLUP_ALTKEY NANO_ALT_UNDERSCORE
#define NANO_SCROLLDOWN_ALTKEY NANO_ALT_EQUALS
#define NANO_CUTTILLEND_ALTKEY NANO_ALT_T
#define NANO_PREVWORD_KEY NANO_META_SPACE
#define NANO_WORDCOUNT_KEY NANO_META_D
#define NANO_SCROLLUP_KEY NANO_META_MINUS
#define NANO_SCROLLDOWN_KEY NANO_META_PLUS
#define NANO_SCROLLUP_METAKEY NANO_META_UNDERSCORE
#define NANO_SCROLLDOWN_METAKEY NANO_META_EQUALS
#define NANO_CUTTILLEND_METAKEY NANO_META_T
#define NANO_PARABEGIN_KEY NANO_CONTROL_W
#define NANO_PARABEGIN_ALTKEY NANO_ALT_LPARENTHESIS
#define NANO_PARABEGIN_ALTKEY2 NANO_ALT_9
#define NANO_PARABEGIN_METAKEY NANO_META_LPARENTHESIS
#define NANO_PARABEGIN_METAKEY2 NANO_META_9
#define NANO_PARAEND_KEY NANO_CONTROL_O
#define NANO_PARAEND_ALTKEY NANO_ALT_RPARENTHESIS
#define NANO_PARAEND_ALTKEY2 NANO_ALT_0
#define NANO_PARAEND_METAKEY NANO_META_RPARENTHESIS
#define NANO_PARAEND_METAKEY2 NANO_META_0
#define NANO_FULLJUSTIFY_KEY NANO_CONTROL_U
#define NANO_FULLJUSTIFY_ALTKEY NANO_ALT_J
#define NANO_VERBATIM_KEY NANO_ALT_V
#define NANO_FULLJUSTIFY_METAKEY NANO_META_J
#define NANO_VERBATIM_KEY NANO_META_V
/* Toggles do not exist if NANO_TINY is defined. */
#ifndef NANO_TINY
@@ -581,26 +671,31 @@ typedef struct rcoption {
#define TOGGLE_NO_KEY -2
/* Normal toggles. */
#define TOGGLE_NOHELP_KEY NANO_ALT_X
#define TOGGLE_CONST_KEY NANO_ALT_C
#define TOGGLE_MORESPACE_KEY NANO_ALT_O
#define TOGGLE_SMOOTH_KEY NANO_ALT_S
#define TOGGLE_WHITESPACE_KEY NANO_ALT_P
#define TOGGLE_SYNTAX_KEY NANO_ALT_Y
#define TOGGLE_SMARTHOME_KEY NANO_ALT_H
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
#define TOGGLE_WRAP_KEY NANO_ALT_L
#define TOGGLE_TABSTOSPACES_KEY NANO_ALT_Q
#define TOGGLE_BACKUP_KEY NANO_ALT_B
#define TOGGLE_MULTIBUFFER_KEY NANO_ALT_F
#define TOGGLE_MOUSE_KEY NANO_ALT_M
#define TOGGLE_NOCONVERT_KEY NANO_ALT_N
#define TOGGLE_SUSPEND_KEY NANO_ALT_Z
#define TOGGLE_CASE_KEY NANO_ALT_C
#define TOGGLE_BACKWARDS_KEY NANO_ALT_B
#define TOGGLE_DOS_KEY NANO_ALT_D
#define TOGGLE_MAC_KEY NANO_ALT_M
#define TOGGLE_NOHELP_KEY NANO_META_X
#define TOGGLE_CONST_KEY NANO_META_C
#define TOGGLE_MORESPACE_KEY NANO_META_O
#define TOGGLE_SMOOTH_KEY NANO_META_S
#define TOGGLE_WHITESPACE_KEY NANO_META_P
#define TOGGLE_SYNTAX_KEY NANO_META_Y
#define TOGGLE_SMARTHOME_KEY NANO_META_H
#define TOGGLE_AUTOINDENT_KEY NANO_META_I
#define TOGGLE_CUTTOEND_KEY NANO_META_K
#define TOGGLE_WRAP_KEY NANO_META_L
#define TOGGLE_TABSTOSPACES_KEY NANO_META_Q
#define TOGGLE_BACKUP_KEY NANO_META_B
#define TOGGLE_MULTIBUFFER_KEY NANO_META_F
#define TOGGLE_MOUSE_KEY NANO_META_M
#define TOGGLE_NOCONVERT_KEY NANO_META_N
#define TOGGLE_SUSPEND_KEY NANO_META_Z
#define TOGGLE_CASE_KEY NANO_META_C
#define TOGGLE_BACKWARDS_KEY NANO_META_B
#define TOGGLE_DOS_KEY NANO_META_D
#define TOGGLE_MAC_KEY NANO_META_M
/* Extra bits for the undo function */
#define UNDO_DEL_DEL (1<<0)
#define UNDO_DEL_BACKSPACE (1<<1)
#endif /* !NANO_TINY */
#define VIEW TRUE

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* prompt.c *
* *
* Copyright (C) 1999-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -28,7 +28,7 @@
#include <string.h>
static char *prompt = NULL;
/* The prompt string for statusbar questions. */
/* The prompt string used for statusbar questions. */
static size_t statusbar_x = (size_t)-1;
/* The cursor position in answer. */
static size_t statusbar_pww = (size_t)-1;
@@ -44,14 +44,14 @@ static bool reset_statusbar_x = FALSE;
/* Read in a character, interpret it as a shortcut or toggle if
* necessary, and return it. Set meta_key to TRUE if the character is a
* meta sequence, set func_key to TRUE if the character is a function
* key, set s_or_t to TRUE if the character is a shortcut or toggle
* key, set have_shortcut to TRUE if the character is a shortcut
* key, set ran_func to TRUE if we ran a function associated with a
* shortcut key, and set finished to TRUE if we're done after running
* or trying to run a function associated with a shortcut key. If
* allow_funcs is FALSE, don't actually run any functions associated
* with shortcut keys. refresh_func is the function we will call to
* refresh the edit window. */
int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut,
bool *ran_func, bool *finished, bool allow_funcs, void
(*refresh_func)(void))
{
@@ -61,10 +61,10 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
/* The input buffer. */
static size_t kbinput_len = 0;
/* The length of the input buffer. */
const shortcut *s;
bool have_shortcut;
const sc *s;
const subnfunc *f;
*s_or_t = FALSE;
*have_shortcut = FALSE;
*ran_func = FALSE;
*finished = FALSE;
@@ -76,7 +76,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
/* If we got a mouse click and it was on a shortcut, read in the
* shortcut character. */
if (*func_key && input == KEY_MOUSE) {
if (do_statusbar_mouse())
if (do_statusbar_mouse() == 1)
input = get_kbinput(bottomwin, meta_key, func_key);
else {
*meta_key = FALSE;
@@ -88,31 +88,15 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
#endif
/* Check for a shortcut in the current list. */
s = get_shortcut(currshortcut, &input, meta_key, func_key);
s = get_shortcut(currmenu, &input, meta_key, func_key);
/* If we got a shortcut from the current list, or a "universal"
* statusbar prompt shortcut, set have_shortcut to TRUE. */
have_shortcut = (s != NULL || input == NANO_TAB_KEY || input ==
NANO_ENTER_KEY || input == NANO_REFRESH_KEY || input ==
NANO_HOME_KEY || input == NANO_END_KEY || input ==
NANO_BACK_KEY || input == NANO_FORWARD_KEY || input ==
NANO_BACKSPACE_KEY || input == NANO_DELETE_KEY || input ==
NANO_CUT_KEY ||
#ifndef NANO_TINY
input == NANO_NEXTWORD_KEY ||
#endif
(*meta_key && (
#ifndef NANO_TINY
input == NANO_PREVWORD_KEY || input == NANO_BRACKET_KEY ||
#endif
input == NANO_VERBATIM_KEY)));
/* Set s_or_t to TRUE if we got a shortcut. */
*s_or_t = have_shortcut;
*have_shortcut = (s != NULL);
/* If we got a non-high-bit control key, a meta key sequence, or a
* function key, and it's not a shortcut or toggle, throw it out. */
if (!*s_or_t) {
if (!*have_shortcut) {
if (is_ascii_cntrl_char(input) || *meta_key || *func_key) {
beep();
*meta_key = FALSE;
@@ -126,12 +110,12 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
* it's a normal text character. Display the warning if we're
* in view mode, or add the character to the input buffer if
* we're not. */
if (input != ERR && !*s_or_t) {
if (input != ERR && !*have_shortcut) {
/* If we're using restricted mode, the filename isn't blank,
* and we're at the "Write File" prompt, disable text
* input. */
if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
currshortcut != writefile_list) {
currmenu != MWRITEFILE) {
kbinput_len++;
kbinput = (int *)nrealloc(kbinput, kbinput_len *
sizeof(int));
@@ -142,7 +126,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
/* If we got a shortcut, or if there aren't any other characters
* waiting after the one we read in, we need to display all the
* characters in the input buffer if it isn't empty. */
if (*s_or_t || get_key_buffer_len() == 0) {
if (*have_shortcut || get_key_buffer_len() == 0) {
if (kbinput != NULL) {
/* Display all the characters in the input buffer at
* once, filtering out control characters. */
@@ -167,60 +151,47 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
}
}
if (have_shortcut) {
switch (input) {
/* Handle the "universal" statusbar prompt shortcuts. */
case NANO_TAB_KEY:
case NANO_ENTER_KEY:
break;
case NANO_REFRESH_KEY:
total_statusbar_refresh(refresh_func);
break;
case NANO_CUT_KEY:
if (*have_shortcut) {
if (s->scfunc == do_tab || s->scfunc == do_enter)
;
else if (s->scfunc == total_refresh)
total_statusbar_refresh(refresh_func);
else if (s->scfunc == (void *) do_cut_text) {
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable Cut. */
if (!ISSET(RESTRICTED) || openfile->filename[0] ==
'\0' || currmenu != MWRITEFILE)
do_statusbar_cut_text();
} else if (s->scfunc == do_right)
do_statusbar_right();
else if (s->scfunc == do_left)
do_statusbar_left();
#ifndef NANO_TINY
else if (s->scfunc == (void *) do_next_word)
do_statusbar_next_word(FALSE);
else if (s->scfunc == (void *) do_prev_word)
do_statusbar_prev_word(FALSE);
#endif
else if (s->scfunc == do_home)
do_statusbar_home();
else if (s->scfunc == do_end)
do_statusbar_end();
#ifndef NANO_TINY
else if (s->scfunc == do_find_bracket)
do_statusbar_find_bracket();
#endif
else if (s->scfunc == do_verbatim_input) {
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable Cut. */
if (!ISSET(RESTRICTED) || openfile->filename[0] ==
'\0' || currshortcut != writefile_list)
do_statusbar_cut_text();
break;
case NANO_FORWARD_KEY:
do_statusbar_right();
break;
case NANO_BACK_KEY:
do_statusbar_left();
break;
#ifndef NANO_TINY
case NANO_NEXTWORD_KEY:
do_statusbar_next_word(FALSE);
break;
case NANO_PREVWORD_KEY:
if (*meta_key)
do_statusbar_prev_word(FALSE);
break;
#endif
case NANO_HOME_KEY:
do_statusbar_home();
break;
case NANO_END_KEY:
do_statusbar_end();
break;
#ifndef NANO_TINY
case NANO_BRACKET_KEY:
if (*meta_key)
do_statusbar_find_bracket();
break;
#endif
case NANO_VERBATIM_KEY:
if (*meta_key) {
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable verbatim input. */
if (!ISSET(RESTRICTED) ||
openfile->filename[0] == '\0' ||
currshortcut != writefile_list) {
* prompt, disable verbatim input. */
if (!ISSET(RESTRICTED) ||
openfile->filename[0] == '\0' ||
currmenu != MWRITEFILE) {
bool got_enter;
/* Whether we got the Enter key. */
/* Whether we got the Enter key. */
do_statusbar_verbatim_input(&got_enter);
@@ -230,40 +201,38 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
* to indicate that we're done. */
if (got_enter) {
get_input(NULL, 1);
input = NANO_ENTER_KEY;
input = sc_seq_or(do_enter, 0);
*finished = TRUE;
}
}
}
break;
case NANO_DELETE_KEY:
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable Delete. */
if (!ISSET(RESTRICTED) || openfile->filename[0] ==
'\0' || currshortcut != writefile_list)
do_statusbar_delete();
break;
case NANO_BACKSPACE_KEY:
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable Backspace. */
if (!ISSET(RESTRICTED) || openfile->filename[0] ==
'\0' || currshortcut != writefile_list)
do_statusbar_backspace();
break;
/* Handle the normal statusbar prompt shortcuts, setting
* ran_func to TRUE if we try to run their associated
* functions and setting finished to TRUE to indicate
* that we're done after running or trying to run their
* associated functions. */
default:
if (s->func != NULL) {
} else if (s->scfunc == do_delete) {
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable Delete. */
if (!ISSET(RESTRICTED) || openfile->filename[0] ==
'\0' || currmenu != MWRITEFILE)
do_statusbar_delete();
} else if (s->scfunc == do_backspace) {
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable Backspace. */
if (!ISSET(RESTRICTED) || openfile->filename[0] ==
'\0' || currmenu != MWRITEFILE)
do_statusbar_backspace();
} else {
/* Handle the normal statusbar prompt shortcuts, setting
* ran_func to TRUE if we try to run their associated
* functions and setting finished to TRUE to indicate
* that we're done after running or trying to run their
* associated functions. */
f = sctofunc((sc *) s);
if (s->scfunc != NULL && s->execute == TRUE) {
*ran_func = TRUE;
if (!ISSET(VIEW_MODE) || s->viewok)
s->func();
}
*finished = TRUE;
if (!ISSET(VIEW_MODE) || f->viewok)
f->scfunc();
}
*finished = TRUE;
}
}
}
@@ -273,37 +242,31 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
#ifndef DISABLE_MOUSE
/* Handle a mouse click on the statusbar prompt or the shortcut list. */
bool do_statusbar_mouse(void)
int do_statusbar_mouse(void)
{
int mouse_x, mouse_y;
bool retval = get_mouseinput(&mouse_x, &mouse_y, TRUE);
int retval = get_mouseinput(&mouse_x, &mouse_y, TRUE);
if (!retval) {
/* We can click in the statusbar window text to move the
* cursor. */
if (wenclose(bottomwin, mouse_y, mouse_x)) {
size_t start_col;
/* We can click on the statusbar window text to move the cursor. */
if (retval == 0 && wmouse_trafo(bottomwin, &mouse_y, &mouse_x,
FALSE)) {
size_t start_col;
assert(prompt != NULL);
assert(prompt != NULL);
start_col = strlenpt(prompt) + 1;
start_col = strlenpt(prompt) + 2;
/* Subtract out the sizes of topwin and edit. */
mouse_y -= (2 - no_more_space()) + editwinrows;
/* Move to where the click occurred. */
if (mouse_x >= start_col && mouse_y == 0) {
size_t pww_save = statusbar_pww;
/* Move to where the click occurred. */
if (mouse_x > start_col && mouse_y == 0) {
size_t pww_save = statusbar_pww;
statusbar_x = actual_x(answer,
statusbar_x = actual_x(answer,
get_statusbar_page_start(start_col, start_col +
statusbar_xplustabs()) + mouse_x - start_col -
1);
statusbar_pww = statusbar_xplustabs();
statusbar_xplustabs()) + mouse_x - start_col);
statusbar_pww = statusbar_xplustabs();
if (need_statusbar_horizontal_update(pww_save))
update_statusbar_line(answer, statusbar_x);
}
if (need_statusbar_horizontal_update(pww_save))
update_statusbar_line(answer, statusbar_x);
}
}
@@ -328,8 +291,8 @@ void do_statusbar_output(char *output, size_t output_len, bool
*got_enter = FALSE;
while (i < output_len) {
/* If allow_cntrls is FALSE, filter out nulls and newlines,
* since they're ASCII control characters. */
/* If allow_cntrls is TRUE, convert nulls and newlines
* properly. */
if (allow_cntrls) {
/* Null to newline, if needed. */
if (output[i] == '\0')
@@ -870,10 +833,10 @@ size_t get_statusbar_page_start(size_t start_col, size_t column)
/* Put the cursor in the statusbar prompt at statusbar_x. */
void reset_statusbar_cursor(void)
{
size_t start_col = strlenpt(prompt) + 1;
size_t start_col = strlenpt(prompt) + 2;
size_t xpt = statusbar_xplustabs();
wmove(bottomwin, 0, start_col + 1 + xpt -
wmove(bottomwin, 0, start_col + xpt -
get_statusbar_page_start(start_col, start_col + xpt));
}
@@ -887,7 +850,7 @@ void update_statusbar_line(const char *curranswer, size_t index)
assert(prompt != NULL && index <= strlen(curranswer));
start_col = strlenpt(prompt) + 1;
start_col = strlenpt(prompt) + 2;
index = strnlenpt(curranswer, index);
page_start = get_statusbar_page_start(start_col, start_col + index);
@@ -904,10 +867,9 @@ void update_statusbar_line(const char *curranswer, size_t index)
waddstr(bottomwin, expanded);
free(expanded);
reset_statusbar_cursor();
wattroff(bottomwin, reverse_attr);
reset_statusbar_cursor();
wnoutrefresh(bottomwin);
}
@@ -916,7 +878,7 @@ void update_statusbar_line(const char *curranswer, size_t index)
* different pages. */
bool need_statusbar_horizontal_update(size_t pww_save)
{
size_t start_col = strlenpt(prompt) + 1;
size_t start_col = strlenpt(prompt) + 2;
return get_statusbar_page_start(start_col, start_col + pww_save) !=
get_statusbar_page_start(start_col, start_col + statusbar_pww);
@@ -932,23 +894,25 @@ void total_statusbar_refresh(void (*refresh_func)(void))
/* Get a string of input at the statusbar prompt. This should only be
* called from do_prompt(). */
int get_prompt_string(bool allow_tabs,
const sc *get_prompt_string(int *actual, bool allow_tabs,
#ifndef DISABLE_TABCOMP
bool allow_files,
#endif
const char *curranswer,
bool *meta_key, bool *func_key,
#ifndef NANO_TINY
filestruct **history_list,
#endif
void (*refresh_func)(void), const shortcut *s
void (*refresh_func)(void), int menu
#ifndef DISABLE_TABCOMP
, bool *list
#endif
)
{
int kbinput = ERR;
bool meta_key, func_key, s_or_t, ran_func, finished;
bool have_shortcut, ran_func, finished;
size_t curranswer_len;
const sc *s;
#ifndef DISABLE_TABCOMP
bool tabbed = FALSE;
/* Whether we've pressed Tab. */
@@ -989,7 +953,11 @@ int get_prompt_string(bool allow_tabs,
statusbar_pww = statusbar_xplustabs();
}
currshortcut = s;
currmenu = menu;
#ifdef DEBUG
fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %d\n", answer, statusbar_x);
#endif
update_statusbar_line(answer, statusbar_x);
@@ -999,26 +967,31 @@ int get_prompt_string(bool allow_tabs,
wnoutrefresh(bottomwin);
/* If we're using restricted mode, we aren't allowed to change the
* name of a file once it has one because that would allow writing
* to files not specified on the command line. In this case,
* disable all keys that would change the text if the filename isn't
* blank and we're at the "Write File" prompt. */
while ((kbinput = do_statusbar_input(&meta_key, &func_key, &s_or_t,
&ran_func, &finished, TRUE, refresh_func)) != NANO_CANCEL_KEY &&
kbinput != NANO_ENTER_KEY) {
* name of the current file once it has one, because that would
* allow writing to files not specified on the command line. In
* this case, disable all keys that would change the text if the
* filename isn't blank and we're at the "Write File" prompt. */
while (1) {
kbinput = do_statusbar_input(meta_key, func_key, &have_shortcut,
&ran_func, &finished, TRUE, refresh_func);
assert(statusbar_x <= strlen(answer));
s = get_shortcut(currmenu, &kbinput, meta_key, func_key);
if (s)
if (s->scfunc == (void *) cancel_msg || s->scfunc == do_enter)
break;
#ifndef DISABLE_TABCOMP
if (kbinput != NANO_TAB_KEY)
if (s && s->scfunc != do_tab)
tabbed = FALSE;
#endif
switch (kbinput) {
#ifndef DISABLE_TABCOMP
#ifndef NANO_TINY
case NANO_TAB_KEY:
if (s && s->scfunc == do_tab) {
if (history_list != NULL) {
if (last_kbinput != NANO_TAB_KEY)
if (last_kbinput != sc_seq_or(do_tab, NANO_CONTROL_I))
complete_len = strlen(answer);
if (complete_len > 0) {
@@ -1034,10 +1007,10 @@ int get_prompt_string(bool allow_tabs,
&statusbar_x, &tabbed, refresh_func, list);
update_statusbar_line(answer, statusbar_x);
break;
} else
#endif /* !DISABLE_TABCOMP */
#ifndef NANO_TINY
case NANO_PREVLINE_KEY:
if (s && s->scfunc == (void *) prev_history_msg) {
if (history_list != NULL) {
/* If we're scrolling up at the bottom of the
* history list and answer isn't blank, save answer
@@ -1065,8 +1038,7 @@ int get_prompt_string(bool allow_tabs,
* statusbar prompt. */
finished = FALSE;
}
break;
case NANO_NEXTLINE_KEY:
} else if (s && s->scfunc == (void *) next_history_msg) {
if (history_list != NULL) {
/* Get the newer search from the history list and
* save it in answer. If there is no newer search,
@@ -1082,7 +1054,7 @@ int get_prompt_string(bool allow_tabs,
* magichistory is set, save magichistory in
* answer. */
if ((*history_list)->next == NULL &&
answer[0] == '\0' && magichistory != NULL) {
*answer == '\0' && magichistory != NULL) {
answer = mallocstrcpy(answer, magichistory);
statusbar_x = strlen(answer);
}
@@ -1096,9 +1068,10 @@ int get_prompt_string(bool allow_tabs,
* statusbar prompt. */
finished = FALSE;
}
break;
} else
#endif /* !NANO_TINY */
case NANO_HELP_KEY:
#ifndef DISABLE_HELP
if (s && s->scfunc == do_help_void) {
update_statusbar_line(answer, statusbar_x);
/* This key has a shortcut list entry when it's used to
@@ -1108,8 +1081,8 @@ int get_prompt_string(bool allow_tabs,
* here, so that we aren't kicked out of the statusbar
* prompt. */
finished = FALSE;
break;
}
#endif
/* If we have a shortcut with an associated function, break out
* if we're finished after running or trying to run the
@@ -1122,8 +1095,10 @@ int get_prompt_string(bool allow_tabs,
#endif
reset_statusbar_cursor();
wnoutrefresh(bottomwin);
}
#ifndef NANO_TINY
/* Set the current position in the history list to the bottom and
* free magichistory, if we need to. */
@@ -1135,24 +1110,28 @@ int get_prompt_string(bool allow_tabs,
}
#endif
/* We've finished putting in an answer or run a normal shortcut's
* associated function, so reset statusbar_x and statusbar_pww. If
* we've finished putting in an answer, reset the statusbar cursor
* position too. */
if (kbinput == NANO_CANCEL_KEY || kbinput == NANO_ENTER_KEY ||
if (s) {
if (s->scfunc == (void *) cancel_msg || s->scfunc == do_enter ||
ran_func) {
statusbar_x = old_statusbar_x;
statusbar_pww = old_pww;
statusbar_x = old_statusbar_x;
statusbar_pww = old_pww;
if (!ran_func)
reset_statusbar_x = TRUE;
if (!ran_func)
reset_statusbar_x = TRUE;
/* Otherwise, we're still putting in an answer or a shortcut with
* an associated function, so leave the statusbar cursor position
* alone. */
} else
reset_statusbar_x = FALSE;
} else
reset_statusbar_x = FALSE;
}
return kbinput;
*actual = kbinput;
return s;
}
/* Ask a question on the statusbar. The prompt will be stored in the
@@ -1171,7 +1150,8 @@ int do_prompt(bool allow_tabs,
#ifndef DISABLE_TABCOMP
bool allow_files,
#endif
const shortcut *s, const char *curranswer,
int menu, const char *curranswer,
bool *meta_key, bool *func_key,
#ifndef NANO_TINY
filestruct **history_list,
#endif
@@ -1179,6 +1159,7 @@ int do_prompt(bool allow_tabs,
{
va_list ap;
int retval;
const sc *s;
#ifndef DISABLE_TABCOMP
bool list = FALSE;
#endif
@@ -1190,22 +1171,23 @@ int do_prompt(bool allow_tabs,
prompt = charalloc(((COLS - 4) * mb_cur_max()) + 1);
bottombars(s);
bottombars(menu);
va_start(ap, msg);
vsnprintf(prompt, (COLS - 4) * mb_cur_max(), msg, ap);
va_end(ap);
null_at(&prompt, actual_x(prompt, COLS - 4));
retval = get_prompt_string(allow_tabs,
s = get_prompt_string(&retval, allow_tabs,
#ifndef DISABLE_TABCOMP
allow_files,
#endif
curranswer,
meta_key, func_key,
#ifndef NANO_TINY
history_list,
#endif
refresh_func, s
refresh_func, menu
#ifndef DISABLE_TABCOMP
, &list
#endif
@@ -1221,14 +1203,10 @@ int do_prompt(bool allow_tabs,
/* If we left the prompt via Cancel or Enter, set the return value
* properly. */
switch (retval) {
case NANO_CANCEL_KEY:
retval = -1;
break;
case NANO_ENTER_KEY:
retval = (answer[0] == '\0') ? -2 : 0;
break;
}
if (s && s->scfunc == (void *) cancel_msg)
retval = -1;
else if (s && s->scfunc == do_enter)
retval = (*answer == '\0') ? -2 : 0;
blank_statusbar();
wnoutrefresh(bottomwin);
@@ -1268,6 +1246,8 @@ int do_yesno_prompt(bool all, const char *msg)
const char *yesstr; /* String of Yes characters accepted. */
const char *nostr; /* Same for No. */
const char *allstr; /* And All, surprise! */
const sc *s;
int oldmenu = currmenu;
assert(msg != NULL);
@@ -1315,7 +1295,7 @@ int do_yesno_prompt(bool all, const char *msg)
blank_statusbar();
mvwaddnstr(bottomwin, 0, 0, msg, actual_x(msg, COLS - 1));
wattroff(bottomwin, reverse_attr);
wattroff(bottomwin, reverse_attr);
/* Refresh the edit window and the statusbar before getting
* input. */
@@ -1329,26 +1309,25 @@ int do_yesno_prompt(bool all, const char *msg)
int mouse_x, mouse_y;
#endif
currmenu = MYESNO;
kbinput = get_kbinput(bottomwin, &meta_key, &func_key);
s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
switch (kbinput) {
case NANO_CANCEL_KEY:
ok = -1;
break;
if (s && s->scfunc == (void *) cancel_msg)
ok = -1;
#ifndef DISABLE_MOUSE
case KEY_MOUSE:
get_mouseinput(&mouse_x, &mouse_y, FALSE);
if (wenclose(bottomwin, mouse_y, mouse_x) &&
!ISSET(NO_HELP) && mouse_x < (width * 2) &&
mouse_y - (2 - no_more_space()) -
editwinrows - 1 >= 0) {
else if (kbinput == KEY_MOUSE) {
/* We can click on the Yes/No/All shortcut list to
* select an answer. */
if (get_mouseinput(&mouse_x, &mouse_y, FALSE) == 0 &&
wmouse_trafo(bottomwin, &mouse_y, &mouse_x,
FALSE) && mouse_x < (width * 2) &&
mouse_y > 0) {
int x = mouse_x / width;
/* Calculate the x-coordinate relative to the
* two columns of the Yes/No/All shortcuts in
* bottomwin. */
int y = mouse_y - (2 - no_more_space()) -
editwinrows - 1;
int y = mouse_y - 1;
/* Calculate the y-coordinate relative to the
* beginning of the Yes/No/All shortcuts in
* bottomwin, i.e. with the sizes of topwin,
@@ -1364,12 +1343,12 @@ int do_yesno_prompt(bool all, const char *msg)
if (ok == 2 && !all)
ok = -2;
}
break;
}
#endif /* !DISABLE_MOUSE */
case NANO_REFRESH_KEY:
total_redraw();
continue;
default:
else if (s && s->scfunc == total_refresh) {
total_redraw();
continue;
} else {
/* Look for the kbinput in the Yes, No and (optionally)
* All strings. */
if (strchr(yesstr, kbinput) != NULL)
@@ -1381,5 +1360,6 @@ int do_yesno_prompt(bool all, const char *msg)
}
} while (ok == -2);
currmenu = oldmenu;
return ok;
}

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* proto.h *
* *
* Copyright (C) 1999-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -26,7 +26,7 @@
#include "nano.h"
/* Public external variables. See global.c for their descriptions. */
/* All external variables. See global.c for their descriptions. */
#ifndef NANO_TINY
extern sigjmp_buf jump_buf;
extern bool jump_buf_main;
@@ -47,6 +47,7 @@ extern WINDOW *bottomwin;
extern int editwinrows;
extern filestruct *cutbuffer;
extern filestruct *cutbottom;
#ifndef DISABLE_JUSTIFY
extern filestruct *jusbuffer;
#endif
@@ -60,6 +61,7 @@ extern char *matchbrackets;
#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
extern char *whitespace;
extern int whitespace_len[2];
extern undo_type last_action;
#endif
#ifndef DISABLE_JUSTIFY
@@ -91,37 +93,15 @@ extern char *full_operating_dir;
extern char *alt_speller;
#endif
extern shortcut *main_list;
extern shortcut *whereis_list;
extern shortcut *replace_list;
extern shortcut *replace_list_2;
extern shortcut *gotoline_list;
extern shortcut *writefile_list;
extern shortcut *insertfile_list;
#ifndef NANO_TINY
extern shortcut *extcmd_list;
#endif
#ifndef DISABLE_HELP
extern shortcut *help_list;
#endif
#ifndef DISABLE_SPELLER
extern shortcut *spell_list;
#endif
#ifndef DISABLE_BROWSER
extern shortcut *browser_list;
extern shortcut *whereis_file_list;
extern shortcut *gotodir_list;
#endif
extern sc *sclist;
extern subnfunc *allfuncs;
#ifdef ENABLE_COLOR
extern syntaxtype *syntaxes;
extern char *syntaxstr;
#endif
extern const shortcut *currshortcut;
#ifndef NANO_TINY
extern toggle *toggles;
#endif
extern int currmenu;
#ifndef NANO_TINY
extern filestruct *search_history;
@@ -141,7 +121,7 @@ extern int reverse_attr;
extern char *homedir;
/* Public functions in browser.c. */
/* All functions in browser.c. */
#ifndef DISABLE_BROWSER
char *do_browser(char *path, DIR *dir);
char *do_browse_from(const char *inpath);
@@ -160,7 +140,7 @@ void do_last_file(void);
char *striponedir(const char *path);
#endif
/* Public functions in chars.c. */
/* All functions in chars.c. */
#ifdef ENABLE_UTF8
void utf8_init(void);
bool using_utf8(void);
@@ -203,18 +183,18 @@ int nstrncasecmp(const char *s1, const char *s2, size_t n);
#endif
int mbstrncasecmp(const char *s1, const char *s2, size_t n);
#ifndef HAVE_STRCASESTR
const char *nstrcasestr(const char *haystack, const char *needle);
char *nstrcasestr(const char *haystack, const char *needle);
#endif
const char *mbstrcasestr(const char *haystack, const char *needle);
char *mbstrcasestr(const char *haystack, const char *needle);
#if !defined(NANO_TINY) || !defined(DISABLE_TABCOMP)
const char *revstrstr(const char *haystack, const char *needle, const
char *rev_start);
char *revstrstr(const char *haystack, const char *needle, const char
*rev_start);
#endif
#ifndef NANO_TINY
const char *revstrcasestr(const char *haystack, const char *needle,
const char *rev_start);
const char *mbrevstrcasestr(const char *haystack, const char *needle,
const char *rev_start);
char *revstrcasestr(const char *haystack, const char *needle, const char
*rev_start);
char *mbrevstrcasestr(const char *haystack, const char *needle, const
char *rev_start);
#endif
size_t mbstrlen(const char *s);
#ifndef HAVE_STRNLEN
@@ -242,14 +222,14 @@ bool is_valid_unicode(wchar_t wc);
bool is_valid_mbstring(const char *s);
#endif
/* Public functions in color.c. */
/* All functions in color.c. */
#ifdef ENABLE_COLOR
void set_colorpairs(void);
void color_init(void);
void color_update(void);
#endif
/* Public functions in cut.c. */
/* All functions in cut.c. */
void cutbuffer_reset(void);
void cut_line(void);
#ifndef NANO_TINY
@@ -259,7 +239,7 @@ void cut_to_eof(void);
#endif
void do_cut_text(
#ifndef NANO_TINY
bool copy_text, bool cut_till_end
bool copy_text, bool cut_till_end, bool undoing
#else
void
#endif
@@ -271,11 +251,11 @@ void do_cut_till_end(void);
#endif
void do_uncut_text(void);
/* Public functions in files.c. */
/* All functions in files.c. */
void make_new_buffer(void);
void initialize_buffer(void);
void initialize_buffer_text(void);
void open_buffer(const char *filename);
void open_buffer(const char *filename, bool undoable);
#ifndef DISABLE_SPELLER
void replace_buffer(const char *filename);
#endif
@@ -288,7 +268,7 @@ bool close_buffer(void);
#endif
filestruct *read_line(char *buf, filestruct *prevnode, bool
*first_line_ins, size_t buf_len);
void read_file(FILE *f, const char *filename);
void read_file(FILE *f, const char *filename, bool undoable);
int open_file(const char *filename, bool newfie, FILE **f);
char *get_next_filename(const char *name, const char *suffix);
void do_insertfile(
@@ -310,13 +290,13 @@ bool check_operating_dir(const char *currpath, bool allow_tabcomp);
void init_backup_dir(void);
#endif
int copy_file(FILE *inn, FILE *out);
int write_file(const char *name, FILE *f_open, bool tmp, append_type
bool write_file(const char *name, FILE *f_open, bool tmp, append_type
append, bool nonamechange);
#ifndef NANO_TINY
int write_marked_file(const char *name, FILE *f_open, bool tmp,
bool write_marked_file(const char *name, FILE *f_open, bool tmp,
append_type append);
#endif
int do_writeout(bool exiting);
bool do_writeout(bool exiting);
void do_writeout_void(void);
char *real_dir_from_tilde(const char *buf);
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
@@ -324,10 +304,11 @@ int diralphasort(const void *va, const void *vb);
void free_chararray(char **array, size_t len);
#endif
#ifndef DISABLE_TABCOMP
bool is_dir(const char *buf);
char **username_tab_completion(const char *buf, size_t *num_matches,
size_t buflen);
size_t buf_len);
char **cwd_tab_completion(const char *buf, bool allow_files, size_t
*num_matches, size_t buflen);
*num_matches, size_t buf_len);
char *input_tab(char *buf, bool allow_files, size_t *place, bool
*lastwastab, void (*refresh_func)(void), bool *list);
#endif
@@ -339,8 +320,8 @@ bool writehist(FILE *hist, filestruct *histhead);
void save_history(void);
#endif
/* Public functions in global.c. */
size_t length_of_list(const shortcut *s);
/* All functions in global.c. */
size_t length_of_list(int menu);
#ifndef NANO_TINY
void toggle_init_one(int val
#ifndef DISABLE_HELP
@@ -361,19 +342,19 @@ void free_shortcutage(shortcut **shortcutage);
void thanks_for_all_the_fish(void);
#endif
/* Public functions in help.c. */
#ifndef DISABLE_HELP
void do_help(void (*refresh_func)(void));
void do_help_void(void);
/* All functions in help.c. */
#ifndef DISABLE_BROWSER
void do_browser_help(void);
#endif
void do_help_void(void);
#ifndef DISABLE_HELP
void do_help(void (*refresh_func)(void));
void help_init(void);
void parse_help_input(int *kbinput, bool *meta_key, bool *func_key);
size_t help_line_len(const char *ptr);
#endif
/* Public functions in move.c. */
/* All functions in move.c. */
void do_first_line(void);
void do_last_line(void);
void do_page_up(void);
@@ -417,7 +398,7 @@ void do_scroll_down(void);
void do_left(void);
void do_right(void);
/* Public functions in nano.c. */
/* All functions in nano.c. */
filestruct *make_new_node(filestruct *prevnode);
filestruct *copy_node(const filestruct *src);
void splice_node(filestruct *begin, filestruct *newnode, filestruct
@@ -471,29 +452,31 @@ RETSIGTYPE handle_sigwinch(int signal);
void allow_pending_sigwinch(bool allow);
#endif
#ifndef NANO_TINY
void do_toggle(const toggle *which);
void do_toggle(int flag);
#endif
void disable_extended_io(void);
#ifdef USE_SLANG
void disable_signals(void);
#endif
#ifndef NANO_TINY
void enable_signals(void);
#endif
void disable_flow_control(void);
void enable_flow_control(void);
void terminal_init(void);
int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
int do_input(bool *meta_key, bool *func_key, bool *have_shortcut, bool
*ran_func, bool *finished, bool allow_funcs);
#ifndef DISABLE_MOUSE
bool do_mouse(void);
int do_mouse(void);
#endif
void do_output(char *output, size_t output_len, bool allow_cntrls);
/* Public functions in prompt.c. */
int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
/* All functions in prompt.c. */
int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut,
bool *ran_func, bool *finished, bool allow_funcs, void
(*refresh_func)(void));
#ifndef DISABLE_MOUSE
bool do_statusbar_mouse(void);
int do_statusbar_mouse(void);
#endif
void do_statusbar_output(char *output, size_t output_len, bool
*got_enter, bool allow_cntrls);
@@ -520,15 +503,16 @@ void reset_statusbar_cursor(void);
void update_statusbar_line(const char *curranswer, size_t index);
bool need_statusbar_horizontal_update(size_t pww_save);
void total_statusbar_refresh(void (*refresh_func)(void));
int get_prompt_string(bool allow_tabs,
const sc *get_prompt_string(int *value, bool allow_tabs,
#ifndef DISABLE_TABCOMP
bool allow_files,
#endif
const char *curranswer,
bool *meta_key, bool *func_key,
#ifndef NANO_TINY
filestruct **history_list,
#endif
void (*refresh_func)(void), const shortcut *s
void (*refresh_func)(void), int menu
#ifndef DISABLE_TABCOMP
, bool *list
#endif
@@ -537,7 +521,8 @@ int do_prompt(bool allow_tabs,
#ifndef DISABLE_TABCOMP
bool allow_files,
#endif
const shortcut *s, const char *curranswer,
int menu, const char *curranswer,
bool *meta_key, bool *func_key,
#ifndef NANO_TINY
filestruct **history_list,
#endif
@@ -545,7 +530,7 @@ int do_prompt(bool allow_tabs,
void do_prompt_abort(void);
int do_yesno_prompt(bool all, const char *msg);
/* Public functions in rcfile.c. */
/* All functions in rcfile.c. */
#ifdef ENABLE_NANORC
void rcfile_error(const char *msg, ...);
char *parse_next_word(char *ptr);
@@ -566,9 +551,9 @@ void parse_rcfile(FILE *rcstream
void do_rcfile(void);
#endif
/* Public functions in search.c. */
/* All functions in search.c. */
#ifdef HAVE_REGEX_H
int regexp_init(const char *regexp);
bool regexp_init(const char *regexp);
void regexp_cleanup(void);
#endif
void not_found_msg(const char *str);
@@ -622,7 +607,7 @@ char *get_history_completion(filestruct **h, const char *s, size_t len);
#endif
#endif
/* Public functions in text.c. */
/* All functions in text.c. */
#ifndef NANO_TINY
void do_mark(void);
#endif
@@ -633,6 +618,8 @@ void do_tab(void);
void do_indent(ssize_t cols);
void do_indent_void(void);
void do_unindent(void);
void do_undo(void);
void do_redo(void);
#endif
void do_enter(void);
#ifndef NANO_TINY
@@ -646,7 +633,7 @@ bool do_wrap(filestruct *line);
#if !defined(DISABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY)
ssize_t break_line(const char *line, ssize_t goal
#ifndef DISABLE_HELP
, bool newline
, bool newln
#endif
);
#endif
@@ -679,7 +666,7 @@ void do_wordlinechar_count(void);
#endif
void do_verbatim_input(void);
/* Public functions in utils.c. */
/* All functions in utils.c. */
int digits(size_t n);
void get_homedir(void);
bool parse_num(const char *str, ssize_t *val);
@@ -698,6 +685,7 @@ ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream);
#endif
#ifdef HAVE_REGEX_H
bool regexp_bol_or_eol(const regex_t *preg, const char *string);
const char *fixbounds(const char *r);
#endif
#ifndef DISABLE_SPELLER
bool is_whole_word(size_t pos, const char *buf, const char *word);
@@ -720,14 +708,17 @@ void new_magicline(void);
void remove_magicline(void);
void mark_order(const filestruct **top, size_t *top_x, const filestruct
**bot, size_t *bot_x, bool *right_side_up);
void add_undo(undo_type current_action);
void update_undo(undo_type action);
#endif
size_t get_totsize(const filestruct *begin, const filestruct *end);
filestruct *fsfromline(ssize_t lineno);
#ifdef DEBUG
void dump_filestruct(const filestruct *inptr);
void dump_filestruct_reverse(void);
#endif
/* Public functions in winio.c. */
/* All functions in winio.c. */
void get_key_buffer(WINDOW *win);
size_t get_key_buffer_len(void);
void unget_input(int *input, size_t input_len);
@@ -748,13 +739,11 @@ void unparse_kbinput(char *output, size_t output_len);
int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
#ifndef DISABLE_MOUSE
bool get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
#endif
const shortcut *get_shortcut(const shortcut *s_list, int *kbinput, bool
const sc *get_shortcut(int menu, int *kbinput, bool
*meta_key, bool *func_key);
#ifndef NANO_TINY
const toggle *get_toggle(int kbinput, bool meta_key);
#endif
const sc *first_sc_for(int menu, void *func);
void blank_line(WINDOW *win, int y, int x, int n);
void blank_titlebar(void);
void blank_topbar(void);
@@ -767,7 +756,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
void titlebar(const char *path);
void set_modified(void);
void statusbar(const char *msg, ...);
void bottombars(const shortcut *s);
void bottombars(int menu);
void onekey(const char *keystroke, const char *desc, size_t len);
void reset_cursor(void);
void edit_draw(const filestruct *fileptr, const char *converted, int
@@ -785,6 +774,51 @@ void display_main_list(void);
void do_cursorpos(bool constant);
void do_cursorpos_void(void);
void do_replace_highlight(bool highlight, const char *word);
char *flagtostr(int flag);
const subnfunc *sctofunc(sc *s);
void print_sclist(void);
sc *strtosc(int menu, char *input);
function_type strtokeytype(char *str);
int strtomenu(char *input);
void assign_keyinfo(sc *s);
void xon_complaint(void);
void xoff_complaint(void);
int sc_seq_or (void *func, int defaultval);
void do_suspend_void(void);
const char *cancel_msg;
#ifndef NANO_TINY
const char *case_sens_msg;
const char *backwards_msg;
const char *prev_history_msg;
const char *next_history_msg;
#endif
const char *replace_msg;
const char *no_replace_msg;
const char *go_to_line_msg;
const char *whereis_next_msg;
const char *first_file_msg;
const char *last_file_msg;
const char *goto_dir_msg;
const char *ext_cmd_msg;
const char *to_files_msg;
const char *dos_format_msg;
const char *mac_format_msg;
const char *append_msg;
const char *prepend_msg;
const char *backup_file_msg;
const char *dos_format_msg;
const char *mac_format_msg;
const char *append_msg;
const char *prepend_msg;
const char *backup_file_msg;
const char *gototext_msg;
const char *new_buffer_msg;
#ifdef HAVE_REGEX_H
const char *regexp_msg;
#endif
#ifdef NANO_EXTRA
void do_credits(void);
#endif

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* rcfile.c *
* *
* Copyright (C) 2001-2004 Chris Allegretta *
* Copyright (C) 2005-2006 David Lawrence Ramsey *
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 *
* Free Software Foundation, Inc. *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
* the Free Software Foundation; either version 3, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
@@ -97,8 +97,7 @@ static const rcoption rcopts[] = {
static bool errors = FALSE;
/* Whether we got any errors while parsing an rcfile. */
static size_t lineno = 0;
/* If we did, the line number where the current error
* occurred. */
/* If we did, the line number where the last error occurred. */
static char *nanorc = NULL;
/* The path to the rcfile we're parsing. */
#ifdef ENABLE_COLOR
@@ -204,7 +203,7 @@ char *parse_next_regex(char *ptr)
return NULL;
}
/* Null terminate and advance ptr. */
/* Null-terminate and advance ptr. */
*ptr++ = '\0';
while (isblank(*ptr))
@@ -218,19 +217,19 @@ char *parse_next_regex(char *ptr)
bool nregcomp(const char *regex, int eflags)
{
regex_t preg;
int rc = regcomp(&preg, regex, REG_EXTENDED | eflags);
const char *r = fixbounds(regex);
int rc = regcomp(&preg, r, REG_EXTENDED | eflags);
if (rc != 0) {
size_t len = regerror(rc, &preg, NULL, 0);
char *str = charalloc(len);
regerror(rc, &preg, str, len);
rcfile_error(N_("Bad regex \"%s\": %s"), regex, str);
rcfile_error(N_("Bad regex \"%s\": %s"), r, str);
free(str);
}
regfree(&preg);
return (rc == 0);
}
@@ -348,6 +347,118 @@ void parse_syntax(char *ptr)
}
}
int check_bad_binding(sc *s)
{
#define BADLISTLEN 1
int badtypes[BADLISTLEN] = {META};
int badseqs[BADLISTLEN] = { 91 };
int i;
for (i = 0; i < BADLISTLEN; i++)
if (s->type == badtypes[i] && s->seq == badseqs[i])
return 1;
return 0;
}
void parse_keybinding(char *ptr)
{
char *keyptr = NULL, *keycopy = NULL, *funcptr = NULL, *menuptr = NULL;
sc *s, *newsc;
int i, menu;
assert(ptr != NULL);
if (*ptr == '\0') {
rcfile_error(N_("Missing key name"));
return;
}
keyptr = ptr;
ptr = parse_next_word(ptr);
keycopy = mallocstrcpy(NULL, keyptr);
for (i = 0; i < strlen(keycopy); i++)
keycopy[i] = toupper(keycopy[i]);
if (keycopy[0] != 'M' && keycopy[0] != '^' && keycopy[0] != 'F' && keycopy[0] != 'K') {
rcfile_error(
N_("keybindings must begin with \"^\", \"M\", or \"F\"\n"));
return;
}
funcptr = ptr;
ptr = parse_next_word(ptr);
if (funcptr == NULL) {
rcfile_error(
N_("Must specify function to bind key to\n"));
return;
}
menuptr = ptr;
ptr = parse_next_word(ptr);
if (menuptr == NULL) {
rcfile_error(
/* Note to translators, do not translate the word "all"
in the sentence below, everything else is fine */
N_("Must specify menu bind key to (or \"all\")\n"));
return;
}
menu = strtomenu(menuptr);
if (menu < 1) {
rcfile_error(
N_("Could not map name \"%s\" to a menu\n"), menuptr);
return;
}
newsc = strtosc(menu, funcptr);
if (newsc == NULL) {
rcfile_error(
N_("Could not map name \"%s\" to a function\n"), funcptr);
return;
}
#ifdef DEBUG
fprintf(stderr, "newsc now address %d, menu func assigned = %d, menu = %d\n",
&newsc, &newsc->scfunc, menu);
#endif
newsc->keystr = keycopy;
newsc->menu = menu;
newsc->type = strtokeytype(newsc->keystr);
assign_keyinfo(newsc);
#ifdef DEBUG
fprintf(stderr, "s->keystr = \"%s\"\n", newsc->keystr);
fprintf(stderr, "s->seq = \"%d\"\n", newsc->seq);
#endif
if (check_bad_binding(newsc)) {
rcfile_error(
N_("Sorry, keystr \"%s\" is an illegal binding\n"), newsc->keystr);
return;
}
/* now let's have some fun. Try and delete the other entries
we found for the same menu, then make this new new
beginning */
for (s = sclist; s != NULL; s = s->next) {
if (((s->menu & newsc->menu)) && s->seq == newsc->seq) {
s->menu &= ~newsc->menu;
#ifdef DEBUG
fprintf(stderr, "replaced menu entry %d\n", s->menu);
#endif
}
}
newsc->next = sclist;
sclist = newsc;
}
/* Read and parse additional syntax files. */
void parse_include(char *ptr)
{
@@ -364,25 +475,23 @@ void parse_include(char *ptr)
/* Get the specified file's full path. */
full_option = get_full_path(option);
if (full_option == NULL) {
rcfile_error(_("Error reading %s: %s"), option, strerror(errno));
goto cleanup_include;
}
if (full_option == NULL)
full_option = mallocstrcpy(NULL, option);
/* Don't open directories, character files, or block files. */
if (stat(nanorc, &rcinfo) != -1) {
if (stat(full_option, &rcinfo) != -1) {
if (S_ISDIR(rcinfo.st_mode) || S_ISCHR(rcinfo.st_mode) ||
S_ISBLK(rcinfo.st_mode)) {
rcfile_error(S_ISDIR(rcinfo.st_mode) ?
_("\"%s\" is a directory") :
_("\"%s\" is a device file"), nanorc);
_("\"%s\" is a device file"), option);
goto cleanup_include;
}
}
/* Open the new syntax file. */
if ((rcstream = fopen(full_option, "rb")) == NULL) {
rcfile_error(_("Error reading %s: %s"), full_option,
rcfile_error(_("Error reading %s: %s"), option,
strerror(errno));
goto cleanup_include;
}
@@ -392,6 +501,10 @@ void parse_include(char *ptr)
nanorc = full_option;
lineno = 0;
#ifdef DEBUG
fprintf(stderr, "Parsing file \"%s\"\n", full_option);
#endif
parse_rcfile(rcstream
#ifdef ENABLE_COLOR
, TRUE
@@ -604,6 +717,32 @@ void parse_colors(char *ptr, bool icase)
}
#endif /* ENABLE_COLOR */
/* Check whether the user has unmapped every shortcut for a
sequence we consider 'vital', like the exit function */
static void check_vitals_mapped(void)
{
subnfunc *f;
int v;
#define VITALS 5
void *vitals[VITALS] = { do_exit, do_exit, (void *) cancel_msg, (void *) cancel_msg, (void *) cancel_msg };
int inmenus[VITALS] = { MMAIN, MHELP, MWHEREIS, MREPLACE, MGOTOLINE };
for (v = 0; v < VITALS; v++) {
for (f = allfuncs; f != NULL; f = f->next) {
if (f->scfunc == vitals[v] && f->menus & inmenus[v]) {
const sc *s = first_sc_for(inmenus[v], f->scfunc);
if (!s) {
rcfile_error(N_("Fatal error: no keys mapped for function \"%s\""),
f->desc);
fprintf(stderr, N_("Exiting. Please use nano with the -I option if needed to adjust your nanorc settings\n"));
exit(1);
}
break;
}
}
}
}
/* Parse the rcfile, once it has been opened successfully at rcstream,
* and close it afterwards. If syntax_only is TRUE, only allow the file
* to contain color syntax commands: syntax, color, and icolor. */
@@ -677,6 +816,8 @@ void parse_rcfile(FILE *rcstream
parse_colors(ptr, FALSE);
else if (strcasecmp(keyword, "icolor") == 0)
parse_colors(ptr, TRUE);
else if (strcasecmp(keyword, "bind") == 0)
parse_keybinding(ptr);
#endif /* ENABLE_COLOR */
else
rcfile_error(N_("Command \"%s\" not understood"), keyword);
@@ -846,6 +987,8 @@ void parse_rcfile(FILE *rcstream
fclose(rcstream);
lineno = 0;
check_vitals_mapped();
if (errors) {
errors = FALSE;
fprintf(stderr,
@@ -875,6 +1018,10 @@ void do_rcfile(void)
_("\"%s\" is a device file"), nanorc);
}
#ifdef DEBUG
fprintf(stderr, "Parsing file \"%s\"\n", nanorc);
#endif
/* Try to open the system-wide nanorc. */
rcstream = fopen(nanorc, "rb");
if (rcstream != NULL)
@@ -897,8 +1044,11 @@ void do_rcfile(void)
if (homedir == NULL)
rcfile_error(N_("I can't find my home directory! Wah!"));
else {
nanorc = charealloc(nanorc, strlen(homedir) + 9);
sprintf(nanorc, "%s/.nanorc", homedir);
#ifndef RCFILE_NAME
#define RCFILE_NAME ".nanorc"
#endif
nanorc = charealloc(nanorc, strlen(homedir) + strlen(RCFILE_NAME) + 2);
sprintf(nanorc, "%s/%s", homedir, RCFILE_NAME);
/* Don't open directories, character files, or block files. */
if (stat(nanorc, &rcinfo) != -1) {

Some files were not shown because too many files have changed in this diff Show More