Compare commits

...

229 Commits

Author SHA1 Message Date
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
100 changed files with 50240 additions and 36118 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

@@ -6,8 +6,8 @@ nano editor. Please see the ChangeLog for specific changes by author.
Chris Allegretta <chrisa@asty.org>
* Original program author, former stable series maintainer.
David Lawrence Ramsey <pooka109@cox.net>
* Current stable 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.

16
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,
@@ -139,5 +141,19 @@
- 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.

8609
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

88
NEWS
View File

@@ -1,3 +1,87 @@
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",
@@ -220,8 +304,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.

6
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
@@ -66,7 +66,7 @@ Mailing List and Bug Reports
Current Status
GNU nano has reached its third stable milestone, 2.0.x.
Chris Allegretta (chrisa@asty.org)
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)

5
TODO
View File

@@ -35,6 +35,11 @@ For the next version:
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], [2.0.2], [nano-devel@gnu.org], [nano])
AC_INIT([GNU nano], [2.1.2], [nano-devel@gnu.org], [nano])
AC_CONFIG_SRCDIR([src/nano.c])
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE
@@ -53,7 +54,7 @@ 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 debug messages and assert warnings.]) debug_support=yes
@@ -76,7 +77,7 @@ AC_ARG_ENABLE(tiny,
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 functions.])
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.])
@@ -98,7 +99,7 @@ fi])
AC_ARG_ENABLE(justify,
[ --disable-justify Disable justify/unjustify functions],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
fi])
AC_ARG_ENABLE(mouse,
@@ -122,7 +123,7 @@ fi])
AC_ARG_ENABLE(tabcomp,
[ --disable-tabcomp Disable tab completion functions],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.])
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.])
fi])
AC_ARG_ENABLE(wrapping,
@@ -371,14 +372,27 @@ 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)
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
@@ -452,12 +466,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,7 +19,7 @@
<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>
@@ -44,7 +44,8 @@
<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 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></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>
<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,7 +75,7 @@
<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>
@@ -84,7 +83,7 @@
<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 2.0.2. 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/v2.0/nano.1.html">here</a>.</p></blockquote>
<hr width="100%">
@@ -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>
@@ -171,9 +170,11 @@
<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>
@@ -214,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>
@@ -227,17 +230,14 @@
<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>
@@ -247,14 +247,24 @@
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/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 patch?</h2>
<blockquote><p>See Section <a href="#7.2">7.2</a>.</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/11/25 - Add miscellaneous wording and capitalization 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>

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 2.0.0" "28\ octobre\ 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.
.\"
@@ -277,8 +310,8 @@ le syst
.SH TRADUCTION
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 28\ octobre\ 2006 à partir
de la version du 28\ octobre\ 2006 de la page de manuel de nano
<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

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 2.0.0" "28\ octobre\ 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.
@@ -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
@@ -326,9 +359,9 @@ le syst
.SH TRADUCTION
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 28\ octobre\ 2006 à partir de
la version du 28\ octobre\ 2006 de la page de manuel de nanorc (pour la
version 2.0.0 de nano). Cette page a été relue par Gé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 (C) 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 2.0.0" "28\ octobre\ 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.
.\"
@@ -106,8 +138,8 @@ elle peut
.SH TRADUCTION
Cette adaptation française a été réalisée par Jean-Philippe\ Guérard
<jean-philippe.guerard@tigreraye.org> le 28\ octobre\ 2006 à partir
de la version du 28\ octobre\ 2006 de la page de manuel de rnano
<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

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 2.0.0" "October 28, 2006"
.TH NANO 1 "version 2.0.0" "August 23, 2007"
.\" Please adjust this date whenever revising the manpage.
.\"

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 2.0.0" "October 28, 2006"
.TH NANORC 5 "version 2.0.0" "August 23, 2007"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
@@ -238,6 +250,270 @@ 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 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 (C) 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 2.0.0" "October 28, 2006"
.TH RNANO 1 "version 2.0.0" "August 23, 2007"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME

View File

@@ -213,6 +213,15 @@
##
## 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
## Nanorc files
# include "@PKGDATADIR@/nanorc.nanorc"

View File

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

View File

@@ -12,6 +12,13 @@ pkgdata_DATA = asm.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

@@ -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:]]+$"

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

@@ -9,7 +9,7 @@
@smallbook
@set EDITION 0.1
@set VERSION 2.0.0
@set UPDATED 27 Oct 2006
@set UPDATED 17 Dec 2007
@dircategory Editors
@direntry
@@ -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}@*
@@ -831,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

@@ -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"
;;

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,7 +1,52 @@
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: Fixed incorrect "Project-Id-Version" entry.
* ms.po: Fix incorrect "Project-Id-Version" entry.
2006-12-06 Jordi Mallach <jordi@gnu.org>
@@ -12,7 +57,7 @@
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.
generates errors upon encountering them.
2006-10-25 Jordi Mallach <jordi@gnu.org>
@@ -93,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>
@@ -106,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>

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

1201
po/bg.po

File diff suppressed because it is too large Load Diff

1239
po/ca.po

File diff suppressed because it is too large Load Diff

2921
po/cs.po

File diff suppressed because it is too large Load Diff

2885
po/da.po

File diff suppressed because it is too large Load Diff

1231
po/de.po

File diff suppressed because it is too large Load Diff

1215
po/es.po

File diff suppressed because it is too large Load Diff

1221
po/eu.po

File diff suppressed because it is too large Load Diff

2791
po/fi.po

File diff suppressed because it is too large Load Diff

1428
po/fr.po

File diff suppressed because it is too large Load Diff

1190
po/ga.po

File diff suppressed because it is too large Load Diff

1247
po/gl.po

File diff suppressed because it is too large Load Diff

1212
po/hu.po

File diff suppressed because it is too large Load Diff

2873
po/id.po

File diff suppressed because it is too large Load Diff

1203
po/it.po

File diff suppressed because it is too large Load Diff

1398
po/ms.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1187
po/nb.po

File diff suppressed because it is too large Load Diff

1323
po/nl.po

File diff suppressed because it is too large Load Diff

2995
po/nn.po

File diff suppressed because it is too large Load Diff

2930
po/pl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2456
po/ro.po

File diff suppressed because it is too large Load Diff

3006
po/ru.po

File diff suppressed because it is too large Load Diff

2619
po/rw.po

File diff suppressed because it is too large Load Diff

2974
po/sr.po

File diff suppressed because it is too large Load Diff

1191
po/sv.po

File diff suppressed because it is too large Load Diff

3208
po/tr.po

File diff suppressed because it is too large Load Diff

2887
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

2137
po/vi.po

File diff suppressed because it is too large Load Diff

1886
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, 2002, 2003, 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,117 +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);
#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_METAKEY:
} else if (f->scfunc == (void *) first_file_msg) {
if (meta_key)
selected = 0;
break;
case NANO_LASTFILE_METAKEY:
} 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 the directory begins with a newline (i.e. an
* encoded null), treat it as though it's blank. */
if (i < 0 || answer[0] == '\n') {
if (i < 0 || *answer == '\n') {
/* We canceled. Indicate that on the statusbar, and
* blank out ans, since we're done with it. */
statusbar(_("Cancelled"));
@@ -244,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;
}
@@ -291,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"));
@@ -365,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);
@@ -558,37 +546,36 @@ 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;
*kbinput = sc_seq_or(do_help_void, 0);
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;
}
}
@@ -771,6 +758,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. */
@@ -802,7 +791,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
@@ -833,42 +823,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;
@@ -962,8 +950,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
@@ -990,7 +978,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);
@@ -1030,7 +1018,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, 2002, 2003, 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,9 +506,12 @@ 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;
}
@@ -527,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;
@@ -552,63 +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, 1997, 1998, 1999, 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;
@@ -616,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);
@@ -680,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;
@@ -702,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;
@@ -723,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);
@@ -804,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;
@@ -819,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
@@ -894,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;
@@ -980,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);
@@ -1022,7 +944,7 @@ bool is_valid_mbstring(const char *s)
{
assert(s != NULL);
return
return
#ifdef ENABLE_UTF8
use_utf8 ? (mbstowcs(NULL, s, 0) != (size_t)-1) :
#endif

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* color.c *
* *
* Copyright (C) 2001, 2002, 2003, 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;

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* cut.c *
* *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 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 *
@@ -146,7 +146,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);
}
@@ -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

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* files.c *
* *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 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 *
@@ -382,12 +382,15 @@ void read_file(FILE *f, const char *filename)
* conversion isn't disabled, handle it! */
if (input == '\n') {
#ifndef NANO_TINY
/* If there's a '\r' before the '\n', set format to DOS if
* we currently think this is a *nix file, or to both if we
* currently think it's a Mac file. */
if (!ISSET(NO_CONVERT) && i > 0 && buf[i - 1] == '\r' &&
(format == 0 || format == 2))
format++;
/* If it's a DOS file or a DOS/Mac file ('\r' before '\n' on
* the first line if we think it's a *nix file, or on any
* line otherwise), and file conversion isn't disabled,
* handle it! */
if (!ISSET(NO_CONVERT) && (num_lines == 0 || format != 0) &&
i > 0 && buf[i - 1] == '\r') {
if (format == 0 || format == 2)
format++;
}
#endif
/* Read in the line properly. */
@@ -401,9 +404,11 @@ void read_file(FILE *f, const char *filename)
buf[0] = '\0';
i = 0;
#ifndef NANO_TINY
/* If it's a Mac file ('\r' without '\n'), and file conversion
* isn't disabled, handle it! */
} else if (!ISSET(NO_CONVERT) && i > 0 && buf[i - 1] == '\r') {
/* If it's a Mac file ('\r' without '\n' on the first line if we
* think it's a *nix file, or on any line otherwise), and file
* conversion isn't disabled, handle it! */
} else if (!ISSET(NO_CONVERT) && (num_lines == 0 ||
format != 0) && i > 0 && buf[i - 1] == '\r') {
/* If we currently think the file is a *nix file, set format
* to Mac. If we currently think the file is a DOS file,
* set format to both DOS and Mac. */
@@ -579,17 +584,24 @@ void read_file(FILE *f, const char *filename)
* "New File" if the file is missing. Otherwise, say "[filename] not
* found".
*
* Return -2 if we say "New File". Otherwise, -1 if the file isn't
* opened, 0 otherwise. The file might still have an error while
* reading with a 0 return value. *f is set to the opened file. */
* Return -2 if we say "New File", -1 if the file isn't opened, and 0
* otherwise. The file might still have an error while reading with a 0
* return value. *f is set to the opened file. */
int open_file(const char *filename, bool newfie, FILE **f)
{
struct stat fileinfo;
int fd;
char *full_filename;
assert(filename != NULL && f != NULL);
if (stat(filename, &fileinfo) == -1) {
/* Get the specified file's full path. */
full_filename = get_full_path(filename);
if (full_filename == NULL)
full_filename = mallocstrcpy(NULL, filename);
if (stat(full_filename, &fileinfo) == -1) {
if (newfie) {
statusbar(_("New File"));
return -2;
@@ -606,8 +618,9 @@ int open_file(const char *filename, bool newfie, FILE **f)
_("\"%s\" is a device file"), filename);
beep();
return -1;
} else if ((fd = open(filename, O_RDONLY)) == -1) {
statusbar(_("Error reading %s: %s"), filename, strerror(errno));
} else if ((fd = open(full_filename, O_RDONLY)) == -1) {
statusbar(_("Error reading %s: %s"), filename,
strerror(errno));
beep();
return -1;
} else {
@@ -623,6 +636,8 @@ int open_file(const char *filename, bool newfie, FILE **f)
statusbar(_("Reading File"));
}
free(full_filename);
return 0;
}
@@ -681,19 +696,24 @@ void do_insertfile(
int i;
const char *msg;
char *ans = mallocstrcpy(NULL, "");
/* The last answer the user typed on the statusbar. */
/* The last answer the user typed at the statusbar prompt. */
filestruct *edittop_save = openfile->edittop;
size_t current_x_save = openfile->current_x;
ssize_t current_y_save = openfile->current_y;
bool at_edittop = FALSE;
/* Whether we're at the top of the edit window. */
bool edittop_inside = FALSE, meta_key = FALSE, func_key = FALSE;
const sc *s;
#ifndef NANO_TINY
bool right_side_up = FALSE, single_line = FALSE;
#endif
currmenu = MINSERTFILE;
while (TRUE) {
#ifndef NANO_TINY
if (execute) {
msg =
msg =
#ifdef ENABLE_MULTIBUFFER
ISSET(MULTIBUFFER) ?
ISSET(MULTIBUFFER) ?
_("Command to execute in new buffer [from %s] ") :
#endif
_("Command to execute [from %s] ");
@@ -701,7 +721,7 @@ void do_insertfile(
#endif
msg =
#ifdef ENABLE_MULTIBUFFER
ISSET(MULTIBUFFER) ?
ISSET(MULTIBUFFER) ?
_("File to insert into new buffer [from %s] ") :
#endif
_("File to insert [from %s] ");
@@ -714,9 +734,10 @@ void do_insertfile(
TRUE,
#endif
#ifndef NANO_TINY
execute ? extcmd_list :
execute ? MEXTCMD :
#endif
insertfile_list, ans,
MINSERTFILE, ans,
&meta_key, &func_key,
#ifndef NANO_TINY
NULL,
#endif
@@ -731,7 +752,7 @@ void do_insertfile(
* blank, open a new buffer instead of canceling. If the
* filename or command begins with a newline (i.e. an encoded
* null), treat it as though it's blank. */
if (i == -1 || ((i == -2 || answer[0] == '\n')
if (i == -1 || ((i == -2 || *answer == '\n')
#ifdef ENABLE_MULTIBUFFER
&& !ISSET(MULTIBUFFER)
#endif
@@ -743,16 +764,19 @@ void do_insertfile(
ans = mallocstrcpy(ans, answer);
s = get_shortcut(currmenu, &i, &meta_key, &func_key);
#ifndef NANO_TINY
#ifdef ENABLE_MULTIBUFFER
if (i == TOGGLE_MULTIBUFFER_KEY) {
if (s && s->scfunc == (void *) new_buffer_msg) {
/* Don't allow toggling if we're in view mode. */
if (!ISSET(VIEW_MODE))
TOGGLE(MULTIBUFFER);
continue;
} else
#endif
if (i == NANO_TOOTHERINSERT_KEY) {
if (s && s->scfunc == (void *) ext_cmd_msg) {
execute = !execute;
continue;
}
@@ -762,7 +786,7 @@ void do_insertfile(
#endif /* !NANO_TINY */
#ifndef DISABLE_BROWSER
if (i == NANO_TOFILES_KEY) {
if (s && s->scfunc == (void *) to_files_msg) {
char *tmp = do_browse_from(answer);
if (tmp == NULL)
@@ -785,19 +809,34 @@ void do_insertfile(
)
continue;
#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
#ifdef ENABLE_MULTIBUFFER
if (!ISSET(MULTIBUFFER)) {
#endif
/* If we're not inserting into a new buffer, partition
* the filestruct so that it contains no text and hence
* looks like a new buffer, and keep track of whether
* the top of the partition is the top of the edit
* window. */
* the top of the edit window is inside the
* partition. */
filepart = partition_filestruct(openfile->current,
openfile->current_x, openfile->current,
openfile->current_x);
at_edittop =
(openfile->fileage == openfile->edittop);
edittop_inside =
(openfile->edittop == openfile->fileage);
#ifdef ENABLE_MULTIBUFFER
}
#endif
@@ -854,14 +893,38 @@ void do_insertfile(
/* If we were at the top of the edit window before, set
* the saved value of edittop to the new top of the edit
* window. */
if (at_edittop)
if (edittop_inside)
edittop_save = openfile->fileage;
/* Update the current x-coordinate to account for the
* number of characters inserted on the current line. */
* number of characters inserted on the current line.
* If the mark begins inside the partition, adjust the
* mark coordinates to compensate for the change in the
* current line. */
openfile->current_x = strlen(openfile->filebot->data);
if (openfile->fileage == openfile->filebot)
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
/* Update the current y-coordinate to account for the
* number of lines inserted. */
@@ -893,6 +956,7 @@ void do_insertfile(
break;
}
}
shortcut_init(FALSE);
free(ans);
}
@@ -1224,11 +1288,11 @@ void init_backup_dir(void)
* on write error. */
int copy_file(FILE *inn, FILE *out)
{
int retval = 0;
char buf[BUFSIZ];
size_t charsread;
int retval = 0;
assert(inn != NULL && out != NULL);
assert(inn != NULL && out != NULL && inn != out);
do {
charsread = fread(buf, sizeof(char), BUFSIZ, inn);
@@ -1250,28 +1314,27 @@ int copy_file(FILE *inn, FILE *out)
return retval;
}
/* Write a file out. If f_open isn't NULL, we assume that it is a
* stream associated with the file, and we don't try to open it
/* Write a file out to disk. If f_open isn't NULL, we assume that it is
* a stream associated with the file, and we don't try to open it
* ourselves. If tmp is TRUE, we set the umask to disallow anyone else
* from accessing the file, we don't set the filename to its name, and
* we don't print out how many lines we wrote on the statusbar.
*
* tmp means we are writing a temporary file in a secure fashion. We
* use it when spell checking or dumping the file on an error.
* use it when spell checking or dumping the file on an error. If
* append is APPEND, it means we are appending instead of overwriting.
* If append is PREPEND, it means we are prepending instead of
* overwriting. If nonamechange is TRUE, we don't change the current
* filename. nonamechange is ignored if tmp is FALSE, we're appending,
* or we're prepending.
*
* append == APPEND means we are appending instead of overwriting.
* append == PREPEND means we are prepending instead of overwriting.
*
* nonamechange means don't change the current filename. It is ignored
* if tmp is FALSE or if we're appending/prepending.
*
* Return 0 on success or -1 on error. */
int write_file(const char *name, FILE *f_open, bool tmp, append_type
* Return TRUE on success or FALSE on error. */
bool write_file(const char *name, FILE *f_open, bool tmp, append_type
append, bool nonamechange)
{
int retval = -1;
bool retval = FALSE;
/* Instead of returning in this function, you should always
* merely set retval and then goto cleanup_and_exit. */
* set retval and then goto cleanup_and_exit. */
size_t lineswritten = 0;
const filestruct *fileptr = openfile->fileage;
int fd;
@@ -1298,7 +1361,7 @@ int write_file(const char *name, FILE *f_open, bool tmp, append_type
assert(name != NULL);
if (name[0] == '\0')
if (*name == '\0')
return -1;
if (f_open != NULL)
@@ -1399,7 +1462,7 @@ int write_file(const char *name, FILE *f_open, bool tmp, append_type
sprintf(backupname, "%s%s", backup_dir, backuptemp);
free(backuptemp);
backuptemp = get_next_filename(backupname, "~");
if (backuptemp[0] == '\0') {
if (*backuptemp == '\0') {
statusbar(_("Error writing %s: %s"), backupname,
_("Too many backup files?"));
free(backuptemp);
@@ -1686,7 +1749,7 @@ int write_file(const char *name, FILE *f_open, bool tmp, append_type
titlebar(NULL);
}
retval = 0;
retval = TRUE;
cleanup_and_exit:
free(realname);
@@ -1697,11 +1760,12 @@ int write_file(const char *name, FILE *f_open, bool tmp, append_type
}
#ifndef NANO_TINY
/* Write a marked selection from a file out. */
int write_marked_file(const char *name, FILE *f_open, bool tmp,
/* Write a marked selection from a file out to disk. Return TRUE on
* success or FALSE on error. */
bool write_marked_file(const char *name, FILE *f_open, bool tmp,
append_type append)
{
int retval = -1;
bool retval;
bool old_modified = openfile->modified;
/* write_file() unsets the modified flag. */
bool added_magicline = FALSE;
@@ -1746,25 +1810,27 @@ int write_marked_file(const char *name, FILE *f_open, bool tmp,
/* Write the current file to disk. If the mark is on, write the current
* marked selection to disk. If exiting is TRUE, write the file to disk
* regardless of whether the mark is on, and without prompting if the
* TEMP_FILE flag is set. */
int do_writeout(bool exiting)
* TEMP_FILE flag is set. Return TRUE on success or FALSE on error. */
bool do_writeout(bool exiting)
{
int i, retval = 0;
int i;
append_type append = OVERWRITE;
char *ans;
/* The last answer the user typed on the statusbar. */
/* The last answer the user typed at the statusbar prompt. */
#ifdef NANO_EXTRA
static bool did_credits = FALSE;
#endif
bool retval = FALSE, meta_key = FALSE, func_key = FALSE;
const sc *s;
currshortcut = writefile_list;
currmenu = MWRITEFILE;
if (exiting && openfile->filename[0] != '\0' && ISSET(TEMP_FILE)) {
retval = write_file(openfile->filename, NULL, FALSE, OVERWRITE,
FALSE);
/* Write succeeded. */
if (retval == 0)
if (retval)
return retval;
}
@@ -1785,7 +1851,11 @@ int do_writeout(bool exiting)
backupstr = ISSET(BACKUP_FILE) ? _(" [Backup]") : "";
if (!exiting && openfile->mark_set)
/* If we're using restricted mode, don't display the "Write
* Selection to File" prompt. This function is disabled, since
* it allows reading from or writing to files not specified on
* the command line. */
if (!ISSET(RESTRICTED) && !exiting && openfile->mark_set)
msg = (append == PREPEND) ?
_("Prepend Selection to File") : (append == APPEND) ?
_("Append Selection to File") :
@@ -1804,7 +1874,8 @@ int do_writeout(bool exiting)
#ifndef DISABLE_TABCOMP
TRUE,
#endif
writefile_list, ans,
MWRITEFILE, ans,
&meta_key, &func_key,
#ifndef NANO_TINY
NULL,
#endif
@@ -1818,15 +1889,16 @@ int do_writeout(bool exiting)
/* If the filename or command begins with a newline (i.e. an
* encoded null), treat it as though it's blank. */
if (i < 0 || answer[0] == '\n') {
if (i < 0 || *answer == '\n') {
statusbar(_("Cancelled"));
retval = -1;
retval = FALSE;
break;
} else {
ans = mallocstrcpy(ans, answer);
s = get_shortcut(currmenu, &i, &meta_key, &func_key);
#ifndef DISABLE_BROWSER
if (i == NANO_TOFILES_KEY) {
if (s && s->scfunc == (void *) to_files_msg) {
char *tmp = do_browse_from(answer);
if (tmp == NULL)
@@ -1838,23 +1910,23 @@ int do_writeout(bool exiting)
} else
#endif /* !DISABLE_BROWSER */
#ifndef NANO_TINY
if (i == TOGGLE_DOS_KEY) {
if (s && s->scfunc == (void *) dos_format_msg) {
openfile->fmt = (openfile->fmt == DOS_FILE) ? NIX_FILE :
DOS_FILE;
continue;
} else if (i == TOGGLE_MAC_KEY) {
} else if (s && s->scfunc == (void *) mac_format_msg) {
openfile->fmt = (openfile->fmt == MAC_FILE) ? NIX_FILE :
MAC_FILE;
continue;
} else if (i == TOGGLE_BACKUP_KEY) {
} else if (s && s->scfunc == (void *) backup_file_msg) {
TOGGLE(BACKUP_FILE);
continue;
} else
#endif /* !NANO_TINY */
if (i == NANO_PREPEND_KEY) {
if (s && s->scfunc == (void *) prepend_msg) {
append = (append == PREPEND) ? OVERWRITE : PREPEND;
continue;
} else if (i == NANO_APPEND_KEY) {
} else if (s && s->scfunc == (void *) append_msg) {
append = (append == APPEND) ? OVERWRITE : APPEND;
continue;
}
@@ -1874,14 +1946,14 @@ int do_writeout(bool exiting)
strcasecmp(answer, "zzy") == 0) {
do_credits();
did_credits = TRUE;
retval = -1;
retval = FALSE;
break;
}
#endif
if (append == OVERWRITE) {
size_t answer_len = strlen(answer);
bool name_exists, different_name;
bool name_exists, do_warning;
char *full_answer, *full_filename;
struct stat st;
@@ -1889,10 +1961,14 @@ int do_writeout(bool exiting)
* full path. */
sunder(answer);
name_exists = (stat(answer, &st) != -1);
full_answer = get_full_path(answer);
full_filename = get_full_path(openfile->filename);
different_name = (strcmp((full_answer == NULL) ?
name_exists = (stat((full_answer == NULL) ? answer :
full_answer, &st) != -1);
if (openfile->filename[0] == '\0')
do_warning = name_exists;
else
do_warning = (strcmp((full_answer == NULL) ?
answer : full_answer, (full_filename == NULL) ?
openfile->filename : full_filename) != 0);
@@ -1905,28 +1981,26 @@ int do_writeout(bool exiting)
if (full_answer != NULL)
free(full_answer);
if (different_name) {
if (name_exists) {
/* If we're using restricted mode, we aren't
* allowed to save a new file under the name of
* an existing file. */
if (ISSET(RESTRICTED))
continue;
if (do_warning) {
/* If we're using restricted mode, we aren't allowed
* to overwrite an existing file with the current
* file. We also aren't allowed to change the name
* of the current file if it has one, because that
* would allow reading from or writing to files not
* specified on the command line. */
if (ISSET(RESTRICTED))
continue;
if (name_exists) {
i = do_yesno_prompt(FALSE,
_("File exists, OVERWRITE ? "));
if (i == 0 || i == -1)
continue;
/* 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 reading from or writing
* to files not specified on the command line. */
} else if (!ISSET(RESTRICTED) &&
openfile->filename[0] != '\0'
} else
#ifndef NANO_TINY
&& (exiting || !openfile->mark_set)
if (exiting || !openfile->mark_set)
#endif
) {
{
i = do_yesno_prompt(FALSE,
_("Save file under DIFFERENT NAME ? "));
if (i == 0 || i == -1)
@@ -1940,16 +2014,16 @@ int do_writeout(bool exiting)
sunder(answer);
align(&answer);
#ifndef NANO_TINY
/* Here's where we allow the selected text to be written to
* a separate file. If we're using restricted mode, this is
* disabled, since it allows reading from or writing to
* files not specified on the command line. */
if (!ISSET(RESTRICTED) && !exiting && openfile->mark_set)
retval = write_marked_file(answer, NULL, FALSE, append);
else
* a separate file. If we're using restricted mode, this
* function is disabled, since it allows reading from or
* writing to files not specified on the command line. */
retval =
#ifndef NANO_TINY
(!ISSET(RESTRICTED) && !exiting && openfile->mark_set) ?
write_marked_file(answer, NULL, FALSE, append) :
#endif
retval = write_file(answer, NULL, FALSE, append, FALSE);
write_file(answer, NULL, FALSE, append, FALSE);
break;
}
@@ -1972,45 +2046,45 @@ void do_writeout_void(void)
* convert ~user/ and ~/ notation. */
char *real_dir_from_tilde(const char *buf)
{
char *dirtmp = NULL;
char *retval;
assert(buf != NULL);
if (buf[0] == '~') {
size_t i;
const char *tilde_dir;
if (*buf == '~') {
size_t i = 1;
char *tilde_dir;
/* Figure out how much of the str we need to compare. */
for (i = 1; buf[i] != '/' && buf[i] != '\0'; i++)
/* Figure out how much of the string we need to compare. */
for (; buf[i] != '/' && buf[i] != '\0'; i++)
;
/* Get the home directory. */
if (i == 1) {
get_homedir();
tilde_dir = homedir;
tilde_dir = mallocstrcpy(NULL, homedir);
} else {
const struct passwd *userdata;
tilde_dir = mallocstrncpy(NULL, buf, i + 1);
tilde_dir[i] = '\0';
do {
userdata = getpwent();
} while (userdata != NULL &&
strncmp(userdata->pw_name, buf + 1, i - 1) != 0);
} while (userdata != NULL && strcmp(userdata->pw_name,
tilde_dir + 1) != 0);
endpwent();
tilde_dir = userdata->pw_dir;
if (userdata != NULL)
tilde_dir = mallocstrcpy(tilde_dir, userdata->pw_dir);
}
if (tilde_dir != NULL) {
dirtmp = charalloc(strlen(tilde_dir) + strlen(buf + i) + 1);
sprintf(dirtmp, "%s%s", tilde_dir, buf + i);
}
}
retval = charalloc(strlen(tilde_dir) + strlen(buf + i) + 1);
sprintf(retval, "%s%s", tilde_dir, buf + i);
/* Set a default value for dirtmp, in case the user's home directory
* isn't found. */
if (dirtmp == NULL)
dirtmp = mallocstrcpy(NULL, buf);
free(tilde_dir);
} else
retval = mallocstrcpy(NULL, buf);
return dirtmp;
return retval;
}
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
@@ -2049,15 +2123,19 @@ void free_chararray(char **array, size_t len)
#endif
#ifndef DISABLE_TABCOMP
/* Is the given file a directory? */
int is_dir(const char *buf)
/* Is the given path a directory? */
bool is_dir(const char *buf)
{
char *dirptr = real_dir_from_tilde(buf);
char *dirptr;
struct stat fileinfo;
int retval = (stat(dirptr, &fileinfo) != -1 &&
S_ISDIR(fileinfo.st_mode));
bool retval;
assert(buf != NULL && dirptr != buf);
assert(buf != NULL);
dirptr = real_dir_from_tilde(buf);
retval = (stat(dirptr, &fileinfo) != -1 &&
S_ISDIR(fileinfo.st_mode));
free(dirptr);
@@ -2067,11 +2145,11 @@ int is_dir(const char *buf)
/* These functions, username_tab_completion(), cwd_tab_completion()
* (originally exe_n_cwd_tab_completion()), and input_tab(), were
* adapted from busybox 0.46 (cmdedit.c). Here is the notice from that
* file:
* file, with the copyright years updated:
*
* Termios command line History and Editting, originally
* intended for NetBSD sh (ash)
* Copyright (c) 1999
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
* Main code: Adam Rogoyski <rogoyski@cs.utexas.edu>
* Etc: Dave Cinege <dcinege@psychosis.com>
* Majorly adjusted/re-written for busybox:
@@ -2082,20 +2160,20 @@ int is_dir(const char *buf)
* This code is 'as is' with no warranty.
* This code may safely be consumed by a BSD or GPL license. */
/* We consider the first buflen characters of buf for ~username tab
/* We consider the first buf_len characters of buf for ~username tab
* completion. */
char **username_tab_completion(const char *buf, size_t *num_matches,
size_t buflen)
size_t buf_len)
{
char **matches = NULL;
const struct passwd *userdata;
assert(buf != NULL && num_matches != NULL && buflen > 0);
assert(buf != NULL && num_matches != NULL && buf_len > 0);
*num_matches = 0;
while ((userdata = getpwent()) != NULL) {
if (strncmp(userdata->pw_name, buf + 1, buflen - 1) == 0) {
if (strncmp(userdata->pw_name, buf + 1, buf_len - 1) == 0) {
/* Cool, found a match. Add it to the list. This makes a
* lot more sense to me (Chris) this way... */
@@ -2119,10 +2197,10 @@ char **username_tab_completion(const char *buf, size_t *num_matches,
return matches;
}
/* We consider the first buflen characters of buf for filename tab
/* We consider the first buf_len characters of buf for filename tab
* completion. */
char **cwd_tab_completion(const char *buf, bool allow_files, size_t
*num_matches, size_t buflen)
*num_matches, size_t buf_len)
{
char *dirname = mallocstrcpy(NULL, buf), *filename;
#ifndef DISABLE_OPERATINGDIR
@@ -2133,10 +2211,10 @@ char **cwd_tab_completion(const char *buf, bool allow_files, size_t
DIR *dir;
const struct dirent *nextdir;
assert(dirname != NULL && num_matches != NULL && buflen >= 0);
assert(dirname != NULL && num_matches != NULL);
*num_matches = 0;
null_at(&dirname, buflen);
null_at(&dirname, buf_len);
/* Okie, if there's a / in the buffer, strip out the directory
* part. */
@@ -2225,7 +2303,7 @@ char **cwd_tab_completion(const char *buf, bool allow_files, size_t
char *input_tab(char *buf, bool allow_files, size_t *place, bool
*lastwastab, void (*refresh_func)(void), bool *list)
{
size_t num_matches = 0;
size_t num_matches = 0, buf_len;
char **matches = NULL;
assert(buf != NULL && place != NULL && *place <= strlen(buf) && lastwastab != NULL && refresh_func != NULL && list != NULL);
@@ -2247,7 +2325,9 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
matches = cwd_tab_completion(buf, allow_files, &num_matches,
*place);
if (num_matches <= 0)
buf_len = strlen(buf);
if (num_matches == 0 || *place != buf_len)
beep();
else {
size_t match, common_len = 0;
@@ -2306,8 +2386,6 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
* twice in succession with no statusbar changes to see a match
* list. */
if (common_len != *place) {
size_t buf_len = strlen(buf);
*lastwastab = FALSE;
buf = charealloc(buf, common_len + buf_len - *place + 1);
charmove(buf + common_len, buf + *place, buf_len -
@@ -2317,7 +2395,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
} else if (!*lastwastab || num_matches < 2)
*lastwastab = TRUE;
else {
int longest_name = 0, columns, editline = 0;
int longest_name = 0, ncols, editline = 0;
/* Now we show a list of the available choices. */
assert(num_matches > 1);
@@ -2342,7 +2420,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
/* Each column will be (longest_name + 2) columns wide, i.e.
* two spaces between columns, except that there will be
* only one space after the last column. */
columns = (COLS + 1) / (longest_name + 2);
ncols = (COLS + 1) / (longest_name + 2);
/* Blank the edit window, and print the matches out
* there. */
@@ -2356,11 +2434,11 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
char *disp;
wmove(edit, editline, (longest_name + 2) *
(match % columns));
(match % ncols));
if (match % columns == 0 &&
if (match % ncols == 0 &&
editline == editwinrows - 1 &&
num_matches - match > columns) {
num_matches - match > ncols) {
waddstr(edit, _("(more)"));
break;
}
@@ -2370,7 +2448,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
waddstr(edit, disp);
free(disp);
if ((match + 1) % columns == 0)
if ((match + 1) % ncols == 0)
editline++;
}
@@ -2403,7 +2481,7 @@ const char *tail(const char *foo)
if (tmp == NULL)
tmp = foo;
else if (*tmp == '/')
else
tmp++;
return tmp;
@@ -2454,10 +2532,10 @@ void load_history(void)
* Assume the last history entry is a blank line. */
filestruct **history = &search_history;
char *line = NULL;
size_t buflen = 0;
size_t buf_len = 0;
ssize_t read;
while ((read = getline(&line, &buflen, hist)) >= 0) {
while ((read = getline(&line, &buf_len, hist)) >= 0) {
if (read > 0 && line[read - 1] == '\n') {
read--;
line[read] = '\0';

File diff suppressed because it is too large Load Diff

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* help.c *
* *
* Copyright (C) 2000, 2001, 2002, 2003, 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_METAKEY:
} else if (f->scfunc == do_first_line) {
if (meta_key)
line = 0;
break;
case NANO_LASTLINE_METAKEY:
} 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,12 +189,12 @@ 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);
@@ -212,7 +215,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 +225,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 +238,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 +253,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 +262,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 +277,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 +291,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 +304,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 +317,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 +330,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 +345,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 +401,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 +436,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_META_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,22 +507,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:
case 'E':
case 'e':
*kbinput = NANO_EXIT_KEY;
*kbinput = sc_seq_or(do_exit, 0);;
break;
}
}

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* move.c *
* *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 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

@@ -2,11 +2,11 @@
/**************************************************************************
* nano.c *
* *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 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,7 @@
#include <errno.h>
#include <ctype.h>
#include <locale.h>
#include <langinfo.h>
#include <termios.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
@@ -40,6 +41,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 +52,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 +173,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 +226,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 +348,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 +397,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 +433,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. */
@@ -523,7 +568,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 +592,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 +611,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 +651,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 +715,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 +744,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 +752,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 +820,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 +888,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 +973,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 +1000,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 +1010,7 @@ void do_exit(void)
} else if (i != 1)
statusbar(_("Cancelled"));
shortcut_init(FALSE);
display_main_list();
}
@@ -1035,6 +1090,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 +1182,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 +1204,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 +1268,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 +1279,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 +1316,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 +1378,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 +1393,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 +1405,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 +1428,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 +1444,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 +1477,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 +1485,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 +1520,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;
@@ -1722,12 +1763,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
@@ -1938,6 +1979,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 +2022,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 +2042,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 +2168,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 +2189,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();
@@ -2218,13 +2267,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 +2297,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, 2000, 2001, 2002, 2003, 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,10 @@ typedef enum {
CENTER, NONE
} update_type;
typedef enum {
CONTROL, META, FKEY, RAW
} function_type;
/* Structure types. */
typedef struct filestruct {
char *data;
@@ -340,8 +344,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 +424,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

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* prompt.c *
* *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 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);
}
}
@@ -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, 2000, 2001, 2002, 2003, 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,8 +26,7 @@
#include "nano.h"
/* All 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;
@@ -92,34 +91,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;
extern int currmenu;
#ifndef NANO_TINY
extern toggle *toggles;
#endif
@@ -142,7 +122,7 @@ extern int reverse_attr;
extern char *homedir;
/* All 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);
@@ -161,7 +141,7 @@ void do_last_file(void);
char *striponedir(const char *path);
#endif
/* All public functions in chars.c. */
/* All functions in chars.c. */
#ifdef ENABLE_UTF8
void utf8_init(void);
bool using_utf8(void);
@@ -204,18 +184,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
@@ -243,14 +223,14 @@ bool is_valid_unicode(wchar_t wc);
bool is_valid_mbstring(const char *s);
#endif
/* All 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
/* All public functions in cut.c. */
/* All functions in cut.c. */
void cutbuffer_reset(void);
void cut_line(void);
#ifndef NANO_TINY
@@ -272,7 +252,7 @@ void do_cut_till_end(void);
#endif
void do_uncut_text(void);
/* All public functions in files.c. */
/* All functions in files.c. */
void make_new_buffer(void);
void initialize_buffer(void);
void initialize_buffer_text(void);
@@ -311,13 +291,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)
@@ -325,10 +305,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
@@ -340,8 +321,8 @@ bool writehist(FILE *hist, filestruct *histhead);
void save_history(void);
#endif
/* All 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
@@ -362,7 +343,7 @@ void free_shortcutage(shortcut **shortcutage);
void thanks_for_all_the_fish(void);
#endif
/* All public functions in help.c. */
/* All functions in help.c. */
#ifndef DISABLE_HELP
void do_help(void (*refresh_func)(void));
void do_help_void(void);
@@ -374,7 +355,7 @@ void parse_help_input(int *kbinput, bool *meta_key, bool *func_key);
size_t help_line_len(const char *ptr);
#endif
/* All 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);
@@ -418,7 +399,7 @@ void do_scroll_down(void);
void do_left(void);
void do_right(void);
/* All 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
@@ -472,29 +453,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);
/* All 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);
@@ -521,15 +504,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
@@ -538,7 +522,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
@@ -546,7 +531,7 @@ int do_prompt(bool allow_tabs,
void do_prompt_abort(void);
int do_yesno_prompt(bool all, const char *msg);
/* All 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);
@@ -567,9 +552,9 @@ void parse_rcfile(FILE *rcstream
void do_rcfile(void);
#endif
/* All 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);
@@ -623,7 +608,7 @@ char *get_history_completion(filestruct **h, const char *s, size_t len);
#endif
#endif
/* All public functions in text.c. */
/* All functions in text.c. */
#ifndef NANO_TINY
void do_mark(void);
#endif
@@ -647,7 +632,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
@@ -680,7 +665,7 @@ void do_wordlinechar_count(void);
#endif
void do_verbatim_input(void);
/* All 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);
@@ -728,7 +713,7 @@ void dump_filestruct(const filestruct *inptr);
void dump_filestruct_reverse(void);
#endif
/* All 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);
@@ -749,10 +734,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);
const sc *first_sc_for(int menu, void *func);
#ifndef NANO_TINY
const toggle *get_toggle(int kbinput, bool meta_key);
#endif
@@ -768,7 +754,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
@@ -786,6 +772,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, 2002, 2003, 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
@@ -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') {
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",
(int) newsc, (int) 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)

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* search.c *
* *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 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 *
@@ -39,21 +39,20 @@ static bool history_changed = FALSE;
static bool regexp_compiled = FALSE;
/* Have we compiled any regular expressions? */
/* Regular expression helper functions. */
/* Compile the given regular expression. Return value 0 means the
* expression was invalid, and we wrote an error message on the status
* bar. Return value 1 means success. */
int regexp_init(const char *regexp)
/* Compile the regular expression regexp to see if it's valid. Return
* TRUE if it is, or FALSE otherwise. */
bool regexp_init(const char *regexp)
{
int rc = regcomp(&search_regexp, regexp, REG_EXTENDED
int rc;
assert(!regexp_compiled);
rc = regcomp(&search_regexp, regexp, REG_EXTENDED
#ifndef NANO_TINY
| (ISSET(CASE_SENSITIVE) ? 0 : REG_ICASE)
#endif
);
assert(!regexp_compiled);
if (rc != 0) {
size_t len = regerror(rc, &search_regexp, NULL, 0);
char *str = charalloc(len);
@@ -61,11 +60,13 @@ int regexp_init(const char *regexp)
regerror(rc, &search_regexp, str, len);
statusbar(_("Bad regex \"%s\": %s"), regexp, str);
free(str);
return 0;
return FALSE;
}
regexp_compiled = TRUE;
return 1;
return TRUE;
}
/* Decompile the compiled regular expression we used in the last
@@ -85,7 +86,7 @@ void not_found_msg(const char *str)
{
char *disp;
int numchars;
assert(str != NULL);
disp = display_string(str, 0, (COLS / 2) + 1, FALSE);
@@ -135,6 +136,9 @@ int search_init(bool replacing, bool use_answer)
{
int i = 0;
char *buf;
sc *s;
void *func = NULL;
bool meta_key = FALSE, func_key = FALSE;
static char *backupstring = NULL;
/* The search string we'll be using. */
@@ -172,7 +176,8 @@ int search_init(bool replacing, bool use_answer)
#ifndef DISABLE_TABCOMP
TRUE,
#endif
replacing ? replace_list : whereis_list, backupstring,
replacing ? MREPLACE : MWHEREIS, backupstring,
&meta_key, &func_key,
#ifndef NANO_TINY
&search_history,
#endif
@@ -200,6 +205,8 @@ int search_init(bool replacing, bool use_answer)
#endif
_(" (to replace)") : "", buf);
fflush(stderr);
/* Release buf now that we don't need it anymore. */
free(buf);
@@ -207,49 +214,53 @@ int search_init(bool replacing, bool use_answer)
backupstring = NULL;
/* Cancel any search, or just return with no previous search. */
if (i == -1 || (i < 0 && last_search[0] == '\0') ||
(!replacing && i == 0 && answer[0] == '\0')) {
if (i == -1 || (i < 0 && *last_search == '\0') || (!replacing &&
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. */
for (s = sclist; s != NULL; s = s->next)
if ((s->menu & currmenu) && i == s->seq) {
func = s->scfunc;
break;
}
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;
;
#ifndef NANO_TINY
case TOGGLE_CASE_KEY:
} else if (func == (void *) case_sens_msg) {
TOGGLE(CASE_SENSITIVE);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
case TOGGLE_BACKWARDS_KEY:
} else if (func == (void *) backwards_msg) {
TOGGLE(BACKWARDS_SEARCH);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
#endif
#ifdef HAVE_REGEX_H
case NANO_REGEXP_KEY:
} else if (func == (void *) regexp_msg) {
TOGGLE(USE_REGEXP);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
#endif
case NANO_TOOTHERSEARCH_KEY:
} else if (func == (void *) do_replace ||
func == (void *) no_replace_msg) {
backupstring = mallocstrcpy(backupstring, answer);
return -2; /* Call the opposite search function. */
case NANO_TOGOTOLINE_KEY:
} else if (func == (void *) go_to_line_msg) {
do_gotolinecolumn(openfile->current->lineno,
openfile->placewewant + 1, TRUE, TRUE, FALSE,
TRUE);
/* Put answer up on the statusbar and
* fall through. */
default:
} else {
return -1;
}
}
@@ -444,7 +455,7 @@ void do_search(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);
@@ -511,7 +522,7 @@ void do_research(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
@@ -827,7 +838,8 @@ ssize_t do_replace_loop(
openfile->current_x += match_len + length_change - 1;
/* Cleanup. */
openfile->totsize += length_change;
openfile->totsize += mbstrlen(copy) -
mbstrlen(openfile->current->data);
free(openfile->current->data);
openfile->current->data = copy;
@@ -873,6 +885,7 @@ void do_replace(void)
{
filestruct *edittop_save, *begin;
size_t begin_x, pww_save;
bool meta_key = FALSE, func_key = FALSE;
ssize_t numreplaced;
int i;
@@ -914,7 +927,8 @@ void do_replace(void)
#ifndef DISABLE_TABCOMP
TRUE,
#endif
replace_list_2, last_replace,
MREPLACE2, last_replace,
&meta_key, &func_key,
#ifndef NANO_TINY
&replace_history,
#endif
@@ -974,15 +988,19 @@ void do_replace(void)
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
bool interactive, bool save_pos, bool allow_update)
{
bool meta_key = FALSE, func_key = FALSE;
const sc *s;
if (interactive) {
char *ans = mallocstrcpy(NULL, answer);
/* Ask for it. */
/* Ask for the line and column. */
int i = do_prompt(FALSE,
#ifndef DISABLE_TABCOMP
TRUE,
#endif
gotoline_list, use_answer ? ans : "",
MGOTOLINE, use_answer ? ans : "",
&meta_key, &func_key,
#ifndef NANO_TINY
NULL,
#endif
@@ -997,7 +1015,9 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
return;
}
if (i == NANO_TOOTHERWHEREIS_KEY) {
s = get_shortcut(currmenu, &i, &meta_key, &func_key);
if (s && s->scfunc == (void *) gototext_msg) {
/* Keep answer up on the statusbar. */
search_init(TRUE, TRUE);
@@ -1011,7 +1031,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
if (!parse_line_column(answer, &line, &column) || line < 1 ||
column < 1) {
if (i == 0)
statusbar(_("Come on, be reasonable"));
statusbar(_("Invalid line or column number"));
display_main_list();
return;
}

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* text.c *
* *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 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 *
@@ -191,11 +191,11 @@ void do_tab(void)
}
#ifndef NANO_TINY
/* Indent or unindent the current line (or all lines covered by the mark
* if the mark is on) len columns, depending on whether len is positive
* or negative. If the TABS_TO_SPACES flag is set, indent/unindent by
* len spaces. Otherwise, indent/unindent by (len / tabsize) tabs and
* (len % tabsize) spaces. */
/* Indent or unindent the current line (or, if the mark is on, all lines
* covered by the mark) len columns, depending on whether len is
* positive or negative. If the TABS_TO_SPACES flag is set, indent or
* unindent by len spaces. Otherwise, indent or unindent by (len /
* tabsize) tabs and (len % tabsize) spaces. */
void do_indent(ssize_t cols)
{
bool indent_changed = FALSE;
@@ -503,9 +503,10 @@ bool execute_command(const char *command)
if (!sig_failed && sigaction(SIGINT, &oldaction, NULL) == -1)
nperror("sigaction");
/* Disable interpretation of the special control keys so that we can
/* Restore the terminal to its previous state. In the process,
* disable interpretation of the special control keys so that we can
* use Ctrl-C for other things. */
disable_signals();
terminal_init();
return TRUE;
}
@@ -760,7 +761,7 @@ bool do_wrap(filestruct *line)
* blank, as does a '\n' if newline is TRUE. */
ssize_t break_line(const char *line, ssize_t goal
#ifndef DISABLE_HELP
, bool newline
, bool newln
#endif
)
{
@@ -780,13 +781,13 @@ ssize_t break_line(const char *line, ssize_t goal
if (is_blank_mbchar(line)
#ifndef DISABLE_HELP
|| (newline && *line == '\n')
|| (newln && *line == '\n')
#endif
) {
blank_loc = cur_loc;
#ifndef DISABLE_HELP
if (newline && *line == '\n')
if (newln && *line == '\n')
break;
#endif
}
@@ -809,7 +810,7 @@ ssize_t break_line(const char *line, ssize_t goal
if (is_blank_mbchar(line)
#ifndef DISABLE_HELP
|| (newline && *line == '\n')
|| (newln && *line == '\n')
#endif
) {
if (!found_blank)
@@ -833,11 +834,11 @@ ssize_t break_line(const char *line, ssize_t goal
while (*line != '\0' && (is_blank_mbchar(line)
#ifndef DISABLE_HELP
|| (newline && *line == '\n')
|| (newln && *line == '\n')
#endif
)) {
#ifndef DISABLE_HELP
if (newline && *line == '\n')
if (newln && *line == '\n')
break;
#endif
@@ -1212,9 +1213,16 @@ void backup_lines(filestruct *first_line, size_t par_len)
* line, putting first_line, edittop, current, and mark_begin at the
* same lines in the copied paragraph that they had in the original
* paragraph. */
if (openfile->current != openfile->fileage)
if (openfile->current != openfile->fileage) {
top = openfile->current->prev;
else
#ifndef NANO_TINY
if (old_mark_set &&
openfile->current->lineno == mb_lineno_save) {
openfile->mark_begin = openfile->current;
openfile->mark_begin_x = mark_begin_x_save;
}
#endif
} else
top = openfile->current;
for (i = par_len; i > 0 && top != NULL; i--) {
if (top->lineno == fl_lineno_save)
@@ -1358,6 +1366,7 @@ void do_justify(bool full_justify)
int kbinput;
bool meta_key, func_key, s_or_t, ran_func, finished;
const sc *s;
/* Move to the beginning of the current line, so that justifying at
* the end of the last line of the file, if that line isn't blank,
@@ -1673,8 +1682,9 @@ void do_justify(bool full_justify)
* the keystroke and return. */
kbinput = do_input(&meta_key, &func_key, &s_or_t, &ran_func,
&finished, FALSE);
s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
if (s_or_t && kbinput == NANO_UNJUSTIFY_KEY) {
if (s && s->scfunc == do_uncut_text) {
/* Splice the justify buffer back into the file, but only if we
* actually justified something. */
if (first_par_line != NULL) {
@@ -1760,6 +1770,7 @@ bool do_int_spell_fix(const char *word)
char *save_search, *save_replace;
size_t match_len, current_x_save = openfile->current_x;
size_t pww_save = openfile->placewewant;
bool meta_key = FALSE, func_key = FALSE;
filestruct *edittop_save = openfile->edittop;
filestruct *current_save = openfile->current;
/* Save where we are. */
@@ -1846,7 +1857,8 @@ bool do_int_spell_fix(const char *word)
#ifndef DISABLE_TABCOMP
TRUE,
#endif
spell_list, word,
MSPELL, word,
&meta_key, &func_key,
#ifndef NANO_TINY
NULL,
#endif
@@ -2197,7 +2209,7 @@ const char *do_alt_speller(char *tempfile_name)
if (!WIFEXITED(alt_spell_status) ||
WEXITSTATUS(alt_spell_status) != 0) {
char *altspell_error;
char *alt_spell_error;
char *invoke_error = _("Error invoking \"%s\"");
#ifndef NANO_TINY
@@ -2205,11 +2217,11 @@ const char *do_alt_speller(char *tempfile_name)
openfile->mark_set = old_mark_set;
#endif
altspell_error =
alt_spell_error =
charalloc(strlen(invoke_error) +
strlen(alt_speller) + 1);
sprintf(altspell_error, invoke_error, alt_speller);
return altspell_error;
sprintf(alt_spell_error, invoke_error, alt_speller);
return alt_spell_error;
}
#ifndef NANO_TINY
@@ -2301,7 +2313,7 @@ const char *do_alt_speller(char *tempfile_name)
* specified, use it. Otherwise, use the internal spell checker. */
void do_spell(void)
{
int i;
bool status;
FILE *temp_file;
char *temp = safe_tempfile(&temp_file);
const char *spell_msg;
@@ -2311,14 +2323,14 @@ void do_spell(void)
return;
}
i =
status =
#ifndef NANO_TINY
(openfile->mark_set) ? write_marked_file(temp, temp_file, TRUE,
openfile->mark_set ? write_marked_file(temp, temp_file, TRUE,
OVERWRITE) :
#endif
write_file(temp, temp_file, TRUE, OVERWRITE, FALSE);
if (i == -1) {
if (!status) {
statusbar(_("Error writing temp file: %s"), strerror(errno));
free(temp);
return;
@@ -2329,7 +2341,7 @@ void do_spell(void)
unlink(temp);
free(temp);
currshortcut = main_list;
currmenu = MMAIN;
/* If the spell-checker printed any error messages onscreen, make
* sure that they're cleared off. */
@@ -2353,7 +2365,7 @@ void do_spell(void)
void do_wordlinechar_count(void)
{
size_t words = 0, chars = 0;
ssize_t lines = 0;
ssize_t nlines = 0;
size_t current_x_save = openfile->current_x;
size_t pww_save = openfile->placewewant;
filestruct *current_save = openfile->current;
@@ -2388,7 +2400,7 @@ void do_wordlinechar_count(void)
/* Get the total line and character counts, as "wc -l" and "wc -c"
* do, but get the latter in multibyte characters. */
if (old_mark_set) {
lines = openfile->filebot->lineno -
nlines = openfile->filebot->lineno -
openfile->fileage->lineno + 1;
chars = get_totsize(openfile->fileage, openfile->filebot);
@@ -2397,7 +2409,7 @@ void do_wordlinechar_count(void)
unpartition_filestruct(&filepart);
openfile->mark_set = TRUE;
} else {
lines = openfile->filebot->lineno;
nlines = openfile->filebot->lineno;
chars = openfile->totsize;
}
@@ -2409,7 +2421,7 @@ void do_wordlinechar_count(void)
/* Display the total word, line, and character counts on the
* statusbar. */
statusbar(_("%sWords: %lu Lines: %ld Chars: %lu"), old_mark_set ?
_("In Selection: ") : "", (unsigned long)words, (long)lines,
_("In Selection: ") : "", (unsigned long)words, (long)nlines,
(unsigned long)chars);
}
#endif /* !NANO_TINY */

View File

@@ -2,11 +2,11 @@
/**************************************************************************
* utils.c *
* *
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 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 *
@@ -46,7 +46,7 @@ int digits(size_t n)
}
/* Return the user's home directory. We use $HOME, and if that fails,
* we fall back on getpwuid(). */
* we fall back on the home directory of the effective user ID. */
void get_homedir(void)
{
if (homedir == NULL) {
@@ -162,14 +162,15 @@ void sunder(char *str)
* (originally getdelim()), were adapted from GNU mailutils 0.5
* (mailbox/getline.c). Here is the notice from that file, after
* converting to the GPL via LGPL clause 3, and with the Free Software
* Foundation's address updated:
* Foundation's address and the copyright years updated:
*
* GNU Mailutils -- a suite of utilities for electronic mail
* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
* Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007
* Free Software Foundation, Inc.
*
* This library 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
* published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@@ -207,15 +208,15 @@ ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream)
/* Allocate the line the first time. */
if (*lineptr == NULL) {
*lineptr = charalloc(MAX_BUF_SIZE);
*n = MAX_BUF_SIZE;
*lineptr = charalloc(*n);
}
while ((c = getc(stream)) != EOF) {
/* Check if more memory is needed. */
if (indx >= *n) {
*lineptr = charealloc(*lineptr, *n + MAX_BUF_SIZE);
*n += MAX_BUF_SIZE;
*lineptr = charealloc(*lineptr, *n);
}
/* Put the result in the line. */
@@ -228,8 +229,8 @@ ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream)
/* Make room for the null character. */
if (indx >= *n) {
*lineptr = charealloc(*lineptr, *n + MAX_BUF_SIZE);
*n += MAX_BUF_SIZE;
*lineptr = charealloc(*lineptr, *n);
}
/* Null-terminate the buffer. */
@@ -527,7 +528,7 @@ void remove_magicline(void)
/* Set top_x and bot_x to the top and bottom x-coordinates of the mark,
* respectively, based on the locations of top and bot. If
* right_side_up isn't NULL, set it to TRUE If the mark begins with
* right_side_up isn't NULL, set it to TRUE if the mark begins with
* (mark_begin, mark_begin_x) and ends with (current, current_x), or
* FALSE otherwise. */
void mark_order(const filestruct **top, size_t *top_x, const filestruct

File diff suppressed because it is too large Load Diff