Compare commits

...

88 Commits

Author SHA1 Message Date
David Lawrence Ramsey
133f7b16ea GNU nano 1.3.0
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1575 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-22 17:15:12 +00:00
David Lawrence Ramsey
8bbd1eb89f minor comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1574 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-22 16:27:18 +00:00
David Lawrence Ramsey
f6cf4a7d7c avoid having duplicate case values when some key values are missing
(assume ERR is -1 when doing so)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1573 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-22 16:20:47 +00:00
David Lawrence Ramsey
13dfdb2493 document the setting of EXTRA_DIST
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1572 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-22 15:37:13 +00:00
David Lawrence Ramsey
699412175d set EXTRA_DIST so that 'make dist" and "make distcheck" actually include
the manual pages and their HTML versions


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1571 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-22 15:36:15 +00:00
Jordi Mallach
3a420879d6 Create html manpages when building nano.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1570 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-19 23:30:48 +00:00
David Lawrence Ramsey
c1f630e914 SunOS 5.9 doesn't define KEY_RESIZE either
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1569 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-18 20:21:52 +00:00
Jordi Mallach
5f34d6e3b0 Updated Catalan translation.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1568 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-18 10:59:55 +00:00
David Lawrence Ramsey
25307257c9 Changelog update: fix problem with KEY_RESIZE's not being defined on
SunOS 5.7 and 5.8


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1567 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-10 04:42:48 +00:00
David Lawrence Ramsey
bb7e2cbfad fix problem with KEY_RESIZE's not being defined on SunOS 5.7 and 5.8
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1566 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-10 04:38:17 +00:00
David Lawrence Ramsey
f5b256bb9f miscellaneous #define cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1565 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-03 20:26:25 +00:00
David Lawrence Ramsey
4dcd070cdf fix problems with the marking highlight's being drawn improperly in some
cases


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1564 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-10-03 04:20:28 +00:00
David Lawrence Ramsey
0362c58b37 add missing set of parentheses
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1563 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-30 03:31:56 +00:00
David Lawrence Ramsey
99bede34e7 have nano handle SIGHUP/SIGTERM properly when it's suspended
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1562 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-29 07:21:11 +00:00
David Lawrence Ramsey
2dd7ed14bc a few last missing minor bits of DB's refactored display code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1561 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-29 05:15:24 +00:00
David Lawrence Ramsey
f03c78b382 DB's minor efficiency tweak for do_mark()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1560 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-28 21:26:49 +00:00
David Lawrence Ramsey
5dcba30395 a few missing minor bits of DB's refactored display code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1559 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-28 19:15:18 +00:00
David Lawrence Ramsey
7bf00de84f set fileformat back to 0 after reading in a file to prevent erroneous
conversion messages from showing up when we read in more files


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1558 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-23 04:25:05 +00:00
David Lawrence Ramsey
a3831ab2b8 minor cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1557 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-22 16:26:40 +00:00
David Lawrence Ramsey
f0b7dcaa99 remove abcd(); the low-level input overhaul left it unused
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1556 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-22 15:46:21 +00:00
David Lawrence Ramsey
9eff7465d9 all our memmove() function calls work on char*'s, so we can use the
charmove() macro for them instead


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1554 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-16 02:04:00 +00:00
David Lawrence Ramsey
da8fd8f894 a few minor fixes for low-level keyboard input
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1553 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-16 01:22:31 +00:00
David Lawrence Ramsey
5ffbec56f6 port over some of DB's refactored display code, most importantly the
display_string() function, and convert some parts of nano to use it


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1552 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-16 01:16:49 +00:00
Jordi Mallach
b23554fa25 2003-09-12 Jordi Mallach <jordi@gnu.org>
* POTFILES.in: Updated path to sources.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1551 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-12 00:25:04 +00:00
David Lawrence Ramsey
1356a0a72d change enum "topmidbotnone" to "topmidnone", since we no longer have a
BOTTOM option


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1550 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-10 20:31:02 +00:00
David Lawrence Ramsey
c97acfb2d6 since the SAMELINEWRAP flag is only used in nano.c, convert it to a
static int there and free up space for one more flag; also make a few
misc. cleanups involving #ifdefs


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1549 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-10 20:08:00 +00:00
David Lawrence Ramsey
14509a3aa2 capitalize one last rcfile message I missed before
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1548 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-10 17:15:12 +00:00
David Lawrence Ramsey
7f47d42289 don't let the user type in ASCII 127 at the statusbar prompt
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1547 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-08 18:01:49 +00:00
David Lawrence Ramsey
d91ab6e912 DB's movement code overhaul (smooth paging, etc.) with a few of my fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1546 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-07 23:57:24 +00:00
David Lawrence Ramsey
dc9c40a56d Brand Huntsman's improved nanorc regexes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1545 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-07 23:54:57 +00:00
David Lawrence Ramsey
e0a9f50a64 fix slang compilation problem
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1544 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-07 05:32:24 +00:00
Jordi Mallach
298b975264 Major package reorganization:
- Move code to src/.
- Move docs to doc/:
  + texi doc to doc/texinfo/
  + original manual pages to doc/man/
  + translated manual pages to doc/man/xx/


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1543 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-07 00:44:12 +00:00
David Lawrence Ramsey
417b03a4c3 make sure the "historylog" option isn't included in tiny mode
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1542 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-06 21:44:37 +00:00
David Lawrence Ramsey
21cc550752 minor nanorc.sample fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1541 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-06 19:04:02 +00:00
David Lawrence Ramsey
3bd9628b38 minor rcfile fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1540 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-06 05:09:32 +00:00
David Lawrence Ramsey
74ea836fcc slightly simplify paragraph searching code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1539 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-04 23:22:47 +00:00
David Lawrence Ramsey
8faf305d0c add paragraph searching ability
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1538 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-04 20:25:29 +00:00
Jordi Mallach
954b00de74 Updated French translation by Jean-Philippe Guérard.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1537 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-01 21:54:27 +00:00
David Lawrence Ramsey
79c849a4a9 fix indentation of a label
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1536 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-09-01 16:34:12 +00:00
David Lawrence Ramsey
cb7ee0e491 one last documentation fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1535 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-31 17:08:59 +00:00
David Lawrence Ramsey
aaad3af523 documentation updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1534 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-31 16:44:10 +00:00
David Lawrence Ramsey
ec290f2385 fix bug where calculated filename space on the titlebar is short by one
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1533 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-30 19:05:40 +00:00
David Lawrence Ramsey
27863665ca fix Meta-X's turning the keypad off under ncurses
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1532 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-29 21:31:37 +00:00
David Lawrence Ramsey
ba6fd42b3c move line wrapping toggle entry to global.c
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1531 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-23 21:16:02 +00:00
David Lawrence Ramsey
e04970675f Wouter van Hemel's "Where Is Next" patch
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1530 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-23 21:11:06 +00:00
Jordi Mallach
222feaa953 Updated Turkish translation by A. Murat EREN.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1526 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-17 19:41:07 +00:00
David Lawrence Ramsey
10187610f8 minor changelog fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1525 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-17 05:40:45 +00:00
David Lawrence Ramsey
a9cebd8054 remove unneeded breaks at the ends of default: clauses
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1524 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-17 03:31:57 +00:00
David Lawrence Ramsey
4d7c260270 low-level input overhaul
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1523 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-17 02:48:43 +00:00
Chris Allegretta
f3fee5db91 Update the ChangeLog too
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1522 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-12 02:40:47 +00:00
Chris Allegretta
21599f805b Update stable/development series maintainership in the AUTHORS file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1519 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-12 02:37:01 +00:00
Chris Allegretta
6954f05276 add 1.3 fork info, change version to 1.2.99-cvs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1518 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-12 02:34:03 +00:00
Chris Allegretta
194c26f879 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1517 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-12 02:01:17 +00:00
Chris Allegretta
3364214200 GNU nano 1.2.2 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1515 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-12 01:49:20 +00:00
Chris Allegretta
c30fc242c3 - winio.c:nanogetstr() - Fix problem where pressing down,up,down does not blank the search prompt but keeps the previous search (DLR)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1514 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-11 00:32:45 +00:00
Jordi Mallach
66d60099a2 Updated Catalan translation.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1513 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-05 21:39:12 +00:00
Jordi Mallach
f9390afbd1 Remove gettext marks from debug messages.
Add translator comments for short statusbar messages.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1512 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-05 19:31:12 +00:00
Chris Allegretta
4f5335d93e Add DLR's excellent workaround for strcasecmp not being available
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1511 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-04 02:51:12 +00:00
Chris Allegretta
653d614439 Use DLR's home/end patch instead of mine, because it's cleaner and remove some unneeded code in do_help()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1510 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-04 02:12:03 +00:00
Chris Allegretta
13f094e80e - winio.c:nanogetstr() - Add handler for Alt-[-H and F as home and end when -K is used. Basically a workaround until a cleaner way can be found.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1509 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-08-04 00:59:27 +00:00
David Lawrence Ramsey
6d97d18fba faq update for inability to see color when nano is compiled w/color support
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1508 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-07-02 14:20:11 +00:00
David Lawrence Ramsey
b764eb6663 a few more manpage fixes, and a resync of their html versions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1507 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-06-29 02:25:46 +00:00
David Lawrence Ramsey
70047eef7d miscellaneous cleanups, updates, and fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1506 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-06-14 20:41:34 +00:00
Jordi Mallach
d995e9a762 More formatting fixes for nanorc.5 from Jean-Philippe.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1505 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-06-11 16:38:35 +00:00
Jordi Mallach
9e74ade187 Add Geir Helland to THANKS.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1504 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-06-11 15:52:34 +00:00
Jordi Mallach
a1475aedd2 Updated Norwegian bokmal translation by Geir Helland.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1503 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-06-11 15:50:58 +00:00
Jordi Mallach
5b63eafd83 Formatting fixes for nano.1 from Jean-Philippe.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1502 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-06-11 10:17:20 +00:00
Jordi Mallach
67fa8935aa More French updates.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1501 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-06-10 14:35:19 +00:00
Jordi Mallach
b111f57082 Updated French translation by Jean-Philippe Guérard.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1500 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-06-10 13:12:49 +00:00
Jordi Mallach
023e9cda99 Updated German translation by Michael Piefel.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1499 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-06-02 12:34:57 +00:00
Jordi Mallach
4654cd19bd Updated Malay translation by Sharuzzaman Ahmat Raslan.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1498 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-05-06 14:02:44 +00:00
Jordi Mallach
2e6d0ca131 Added Laurentiu Buzdugan, for Romanian.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1497 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-04-24 18:23:56 +00:00
Jordi Mallach
d8ce36e6e1 Added "ro" (Romanian).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1496 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-04-24 18:21:38 +00:00
Jordi Mallach
cccc511fef New Romanian translation and Indonesian update.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1495 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-04-24 18:20:11 +00:00
Chris Allegretta
ffe575f509 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1494 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-04-20 16:25:46 +00:00
Chris Allegretta
aa4593124d GNU nano 1.2.1 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1492 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-04-20 16:20:15 +00:00
Chris Allegretta
8151ba5a1a DLR's patch to change justify_mode to a flag
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1491 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-04-19 19:34:05 +00:00
Chris Allegretta
4b376a4982 latest fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1490 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-04-16 02:08:23 +00:00
Chris Allegretta
e1e0fd634b DLR and DB's latest fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1489 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-04-15 01:15:09 +00:00
Jordi Mallach
0f4a7dc53a French and Malay updates.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1488 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-04-12 00:29:16 +00:00
Jordi Mallach
e2a9e3c5fa Sigh. It's nanorc.sample...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1487 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-03-24 13:09:26 +00:00
Jordi Mallach
db469d8666 Documentation updates.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1486 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-03-24 13:08:16 +00:00
Jordi Mallach
8f711b8d6b Malay translation update.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1485 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-03-17 21:53:57 +00:00
Chris Allegretta
d845193a1d DLR's cumulative patch, one minor configure.ac tweak
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1484 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-03-11 03:50:40 +00:00
Jordi Mallach
53c3b47bf9 Danish update.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1483 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-03-10 09:34:27 +00:00
Jordi Mallach
23f575628a Malay and Indonesian updates.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1482 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-03-06 14:09:24 +00:00
Jordi Mallach
723399a3a2 Dutch update.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1481 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-02-23 19:12:54 +00:00
Chris Allegretta
dbc3ec72e1 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1480 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2003-02-20 03:14:37 +00:00
69 changed files with 13541 additions and 12261 deletions

View File

@@ -18,10 +18,7 @@ depcomp
install-sh
missing
mkinstalldirs
nano
nano.info
nano.spec
stamp-h
stamp-h.in
stamp-h1
texinfo.tex

13
AUTHORS
View File

@@ -4,7 +4,13 @@ editor. Please see the ChangeLog for specific changes by author.
-------------------------------------------------------------------------
Chris Allegretta <chrisa@asty.org>
* Main program author and maintainer.
* Original program author, stable series maintainer.
David Lawrence Ramsey <pooka_regent@sluggy.net>
* Development series maintainer. Multiple buffer support,
operating dir (-o) option, bug fixes for display routines,
wrapping code, spelling fixes, const mode and various other
fixes.
Jordi Mallach <jordi@sindominio.net>
* Debian package maintainer, fellow bug squasher.
@@ -25,11 +31,6 @@ Rocco Corsi <rocco.corsi@sympatico.ca>
findnextstr and search-related functions, various display and
file handling fixes.
David Lawrence Ramsey <pooka_regent@sluggy.net>
* Multiple buffer support, operating dir (-o) option, bug fixes
for display routines, wrapping code, spelling fixes, const
mode and various other fixes.
David Benbennick <dbenbenn@math.cornell.edu>
* Wrap and justify bugfixes/enhancements, new color syntax
code, memleak fixes and other miscellaneous fixes.

362
ChangeLog
View File

@@ -1,3 +1,342 @@
GNU nano 1.3.0 - 2003.10.22
- General:
- Complete overhaul and abstraction of the lowest level of
keyboard input, mostly rewritten but incorporating a few bits
from the old functions and adding support for Pico's Esc Esc
[three-digit decimal ASCII code] input method. New functions
get_kbinput(), get_verbatim_kbinput(), get_ignored_kbinput(),
get_accepted_kbinput(), get_ascii_kbinput(),
get_escape_seq_kbinput(), and get_skip_tilde_kbinput(). These
should work properly on FreeBSD (due to code and input
provided by Lee Nelson and Wouter van Hemel, respectively).
(DLR)
- The -K/--keypad command line/rcfile option has been removed,
and keypad() is now always TRUE. keypad_on() in winio.c and
the check for _use_keypad in configure.ac have both been
removed. (DLR)
- The -d/--rebinddelete command line/rcfile option, equivalent
to Pico's -d, has been added. It is intended to work around
the problem with Backspace/Delete confusion on some terminals,
notably FreeBSD; if your Backspace key acts like Delete, this
option will fix that. (DLR)
- Remove unneeded breaks at the ends of default: clauses. (DLR)
- Add the ability to repeat the last search without prompting
via Meta-W, and move the line wrapping toggle to Meta-L. New
function do_research(). (Wouter van Hemel)
- Added the ability to move to the beginning or end of the
paragraph, which Pico has via ^W^W (previous paragraph)
and ^W^O (next paragraph). Modifications to do_justify(),
new functions do_para_operation(), do_para_begin(), and
do_para_end(). Note that the last three functions are
disabled if justification is disabled. (DLR)
- Make sure the "historylog" option isn't included at all if
NANO_SMALL is defined. (DLR)
- Source reorganization: move code to src/, docs to doc/.
(Jordi)
- Translation updates (see po/ChangeLog for details).
- Since SAMELINEWRAP is only used in nano.c, make it a static
variable in nano.c instead of a flag, and surround all
wrap_reset() calls with DISABLE_WRAPPING #ifdefs. (DLR)
- Change enum "topmidbotnone" to "topmidnone", as there's no
BOTTOM option anymore. (DLR)
- Split out the string-displaying routine from update_line()
into a separate function; convert the edit window, statusbar
display, and statusbar prompt to use it, so that they can all
properly display control characters and tabs; free and NULL
the backup search string in one place in the search code
instead of several; and do some other minor refactoring of
related display functions to simplify them. New functions
mark_order() and display_string(); changes to actual_x(),
strnlenpt(), blank_bottombars(), blank_edit(),
get_page_start(), edit_add(), update_line(), statusbar(), and
do_replace_highlight(). (David Benbennick) DLR: Add minor
cosmetic tweaks, add missing NANO_SMALL #ifdef around the text
for a backwards search in the refactored code, and enclose
dump_buffer() and dump_buffer_reverse() in one ENABLE_DEBUG
#ifdef instead of two.
- Convert memmove() function calls to charmove() macro calls, as
the former all work on char*'s. (DLR)
- Miscellaneous #define cleanups: only include the prototype for
and definition of wrap_at if wrapping and/or justification are
enabled, remove duplicate wrap_at prototype, and define
DISABLE_MOUSE if NCURSES_MOUSE_VERSION isn't defined in nano.h
instead of all over the code. (DLR)
- Autogenerate the html versions of the manpages in the
Makefile.am's in doc/man/, make sure that they're properly
installed via "make dist", and make sure that "make distcheck"
works too. Also be sure to set EXTRA_DIST properly. (Jordi,
DLR and Jeff Bailey)
- files.c:
read_file()
- After we've read in a file and possibly converted it from
DOS/Mac format, set fileformat back to 0 to prevent erroneous
conversion messages when we read other files in. (DLR)
do_browser()
- Some of the Pico compatibility options in the file browser
that don't work properly for current Pico have been removed.
Backspace, 'g', 'l', 'q', and 'u' are invalid. 'd' deletes
the highlighted file, and 'r' renames the highlighted file;
neither of these are implemented. (DLR)
- global.c:
toggle_init()
- Change the message for the line wrapping toggle from "Auto
wrap" to "Auto line wrap", to more clearly associate it with
Meta-L. (DLR)
shortcut_init()
- Change multibuffer-enabled references to
opening/closing/toggling the previous/next loaded file to
toggling/switching to/closing the previous/next file buffer,
for consistency with other references. (DLR)
- nano.c:
window_init()
- Set keypad() to TRUE regardless of whether PDCurses is being
used, as Meta-X apparently turns it off even under ncurses.
(DLR)
do_backspace()
- Vastly simplify, and remove dependency on page_up(). (David
Benbennick)
help_init()
- Document the support for Esc Esc [character]'s being
interpreted as Ctrl-[character], and the support for Pico's
Esc Esc [three-digit decimal ASCII code] input method. (DLR)
do_mark()
- Toggle MARK_ISSET() at the beginning of the function instead
of setting it in one place and unsetting it in another place.
(David Benbennick)
do_suspend()
- Use handle_hupterm() to handle SIGHUP and SIGTERM so we can
properly deal with them while nano is suspended. (DLR; problem
found by David Benbennick)
abcd()
- Removed, as it's unneeded due to the low-level input overhaul.
(DLR)
- nano.h:
- Define KEY_RESIZE and KEY_SUSPEND as -1 when slang is used, as
slang has no equivalent of either. When nano is compiled with
slang support, resizing the window doesn't generate
KEY_RESIZE, and pressing Ctrl-Z to suspend nano at the Linux
console with keypad(TRUE) generates Ctrl-Z instead of
KEY_SUSPEND, both unlike ncurses. (DLR)
- Define KEY_RESIZE as -1 if it isn't defined, as it isn't in
the curses library included with SunOS 5.7-5.9. Also define
KEY_SUSPEND as -1 if it isn't defined, in case it isn't in
more than just Slang. (DLR)
- Define all potentially missing keys as different negative
values (ERR is -1, so use -2, -3, etc.) so as to avoid having
duplicate case values when keys are missing. (DLR)
- move.c:
- Remove unneeded inclusion of stdio.h, make various cleanups,
and preserve the cursor's coordinates when paging up and down.
(David Benbennick) DLR: Readd the ability to behave the old
way while paging, make it so the new behavior is only used in
smooth-scrolling mode, and modify page_down() to always go
down a full page (even when there's less than one page of text
left) for consistency.
page_up()
- Removed due to rewrite of movement functions. (David
Benbennick)
- proto.h:
- Surround the do_prev_word() and do_next_word() prototypes with
NANO_SMALL #ifdefs, since the actual functions aren't included
in tiny mode. (DLR)
- rcfile.c:
parse_colors()
- Generate an error if we try to use a bright background color
in a nanorc file. (DLR; found by Brand Huntsman)
- Make sure all rcfile error messages are capitalized, for
consistency. (DLR)
- winio.c:
get_verbatim_kbinput()
- Fix a silly memory corruption bug that would occur when trying
to read a sequence of more than one key verbatim. (DLR)
get_accepted_kbinput()
Handle Ctrl-{ to Ctrl-~ correctly, and drop support for
converting Esc ` to Esc Space, since making Meta-[key]
correspond to Ctrl-[key] in all cases is inconsistent due to
the different natures of Contol and Meta key sequences. (DLR)
do_first_line()
- Call edit_update() with TOP instead of CENTER; both do the
same thing, but it works faster with TOP. (DLR)
nanogetstr()
- Don't let the user type in ASCII 127 at the statusbar prompt.
(DLR)
titlebar()
- Fix problem with the available space for a filename on the
titlebar's being short by one. (DLR)
edit_add()
- Fix problems with the marking highlight's being drawn
improperly in some cases. (DLR)
edit_update()
- Tweak for efficiency and remove the fix_editbot() call. (David
Benbennick)
do_credits()
- Update the copyright years to "1999-2003", to match those
given in the rest of the code. (DLR)
- configure.ac:
- Change instances of "GNU Nano" to "GNU nano" for consistency.
(DLR)
- nano.1, nanorc.5, nano.texi:
- Change all instances of $SYSCONFDIR to SYSCONFDIR, since
SYSCONFDIR is set at compile time and can't be overridden by
setting SYSCONFDIR in the environment. (David Benbennick)
- Remove -K/--keypad, and document -d/--rebinddelete. (DLR)
- Document the support for Esc Esc [character]'s being
interpreted as Ctrl-[character], and the support for Pico's
Esc Esc [three-digit decimal ASCII code] input method, if
applicable. (DLR)
- French translation by Jean-Philippe Guérard.
- nano.1.html, nanorc.5.html:
- Regenerated. (DLR)
- nanorc.sample:
- Remove duplicate "historylog" entry, remove "keypad" entry,
and add "rebinddelete" entry. (DLR)
- Update and add comments to the regexes for nanorc files.
(Brand Huntsman)
- Fix an attempt at a bright background color in the sample Java
source regexes. (DLR)
- Since tabs are shown as groups of spaces, they are interpreted
as such when parsed by color regexes. Accordingly, simplify
regexes that handle both spaces and tabs to just handle
spaces, as the results are the same. (DLR)
- AUTHORS
- Updated to show 1.2/1.3 maintainers.
- 1.3 tree forks here
GNU nano 1.2.2 - 2003.08.11
- General:
- Translation updates (see po/ChangeLog for details).
- Change uncast nrealloc()s assigned to char pointers/arrays to
charealloc()s, and cast all other nrealloc()s and all
nmalloc()s. (David Benbennick and DLR)
- Remove gettext marks from all debug messages. Good for developers,
better for translators. (Jordi)
- Add translator comments on strings that should be short, like in
status bar strings, etc. (Jordi)
- utils.c:
align()
- Tweak to avoid a potential problem when strp is non-NULL but
*strp is NULL. (David Benbennick)
nstricmp(), nstrnicmp()
- Add these functions, equivalent to strcasecmp() and
strncasecmp(), and convert nano to use them when strcasecmp()
and/or strncasecmp() are unavailable. (DLR)
- winio.c:
do_help()
- Get rid of keypad_on() call for bottomwin, which should not be
needed (DLR).
nanogetstr()
- Fix problem with search history where a temporary string
added at the bottom of the history (but which was not in the
history) would not be preserved after scrolling down to the
blank bottom entry and then scrolling back up. (DLR)
- Fix problem where pressing down,up,down does not blank the
search prompt but keeps the previous search (DLR).
- Handle Alt-[-F and H (DLR, fixed home and end not working with
-K in statusbar).
- configure.ac:
- Change the program used to detect a broken regexec() function
so that it works properly, using information found at
http://sources.redhat.com/ml/libc-hacker/2001-06/msg00015.html.
(DLR)
- nanorc.sample:
- Revised comment explaining the non-escaping of quotes to cover
non-escaping of all shell-interpreted characters. (DLR)
- Fixes to the descriptions and examples in the comments, and
changes to some default values. (David Benbennick and DLR)
- Add regexes for Perl syntax. (Richard Smith, tweaked for
greater efficiency by David Benbennick)
- Add regexes for Java source syntax. (David Benbennick)
Regex for C++-style comments (colored the same way as C-style
comments) added by DLR.
- THANKS:
- Added Laurentiu Buzdugan, for Romanian.
- Added Geir Helland, for Norwegian Bokmål.
- TODO:
- Move the items for nano 1.2 to the "Old Requests" section,
and mark color syntax highlighting as done. (David Benbennick)
- faq.html:
- Added question about nano's not showing color when it's
compiled with color support. (DLR; suggested by Jordi)
- nano.1, nanorc.5:
- Formatting improvements by Jean-Philippe Guérard.
- Minor fixes by DLR.
- nano.1.html, nanorc.5.html:
- Regenerated from nano.1 and nanorc.5. (DLR)
GNU nano 1.2.1 - 2003.04.19
- General:
- Translation updates (see po/ChangeLog for details).
- Work around broken regexec() on some systems that segfaults
when passed an empty string. New function regexec_safe().
(David Benbennick)
- Fix various bugs with search string history logging: don't
print a broken error message and freeze if ~/.nano_history is
unreadable, actually show an error message in save_history()
if ~/.nano_history is unwritable, and prevent ~/.nano_history
from being completely overwritten by save_history() if it's
unreadable but writable. (David Benbennick)
- Only unset KEEP_CUTBUFFER in main() when we do something other
than cut text in the main input loop, instead of unsetting it
all over the place (which, as written, didn't handle cases
like a cut followed by M-Space properly). Also, instead of
checking for keyhandled's not being set inside the for loops,
do it in if blocks surrounding the for loops to increase
efficiency. (David Benbennick) DLR: Also unset KEEP_CUTBUFFER
if we hit a shortcut key other than the one for cutting text.
- Make it so a marked cut immediately followed by an unmarked
cut tacks the latter's text onto the end of the former's text
instead of putting it on a new line, as Pico does. (DLR)
- Convert instances of "(char *)nrealloc()" to the macro
charealloc(), which does the same thing. (DLR)
- Change justify_mode from a boolean int to a flag (DLR).
- cut.c:
do_cut_text()
- Tweak where KEEP_CUTBUFFER is set so that a marked cut
immediately followed by an unmarked cut preserves the
cutbuffer between the two. (David Benbennick) DLR: Also
properly set KEEP_CUTBUFFER in tiny mode.
do_uncut_text()
- If we're about to uncut on the magicline, always make a new
magicline in advance, as Pico does. (DLR)
- global.c:
shortcut_init()
- Simplify the #ifdef used to enable file insertion in view mode
if multibuffer support has been compiled in. (DLR)
- nano.c:
justify_format()
- If we shave spaces off the end of the line, make sure totsize
is properly updated. (DLR; much simplified by David
Benbennick)
- nano.h:
- Simplify #ifdefs relating to HAVE_STRCASECMP and
HAVE_STRNCASECMP. (David Benbennick)
- search.c:
goto_abort()
- Removed, with all instances replaced with display_main_list(),
since with the removal of all the scattered calls to
SET(KEEP_CUTBUFFER), that function was all that was left of
it. (DLR)
do_find_bracket()
- If a matching bracket wasn't found, call update_line() after
setting current and current_x back to their original values,
in case current_x's original value is greater than the width
of the screen. (DLR)
- winio.c:
nanogetstr()
- Remove a few unnecessary breaks occurring immediately after
gotos, and properly interpret the up and down arrow keys when
ALT_KEYPAD is set. (DLR)
- configure.ac:
- Enable autodetection of broken regexec(). (DLR) Re-added
regex.h check to ensure compile under Debian w/autoconf 1.6.
- README:
- Update obsolete 1.1.x information.
- TODO:
- Fix typo. (David Benbennick)
- faq.html:
- Update RPM links for nano 1.2.x. (DLR)
GNU nano 1.2.0 - 2003.02.19
- General:
- Translation updates (see po/ChangeLog for details).
@@ -28,31 +367,32 @@ GNU nano 1.1.99pre3 - 2003.02.13
nano.c:global_init(), window_init(), and handle_sigwinch().
New macro MIN_EDITOR_COLS replaces MIN_FILL_LENGTH
(David Benbennick).
- Change ngettext macro to P_(), to avoid a clash with the reserved C
__ identifier (Jordi).
- Change ngettext macro to P_(), to avoid a clash with the
reserved C __ identifier (Jordi).
- Memory leak fixes for files.c:do_insertfile(),do_browser(),
nano.c:do_spell(), and search.c:do_replace() (David Benbennick).
nano.c:do_spell(), and search.c:do_replace() (David
Benbennick).
- Remove do_preserve_msg, as using -p still gives Pico-style
string behavior, so an annoying message every invocation is
probably unneeded (all cheer).
- Change resetpos function to be global (now called
- Change resetpos function to be global (now called
resetstatuspos. Fixes annoying but small odd problem with
cursor placement when inserting a file. This needs to be done
better in 1.3 (originally by David Lawrence Ramsey).
Added this issue to TODO.
cursor placement when inserting a file. This needs to be done
better in 1.3 (originally by David Lawrence Ramsey). Added
this issue to TODO.
- files.c:
cwd_tab_completion()
- Memory leak fix (David Benbennick).
intput_tab()
- Fix assumption that matches is null terminated (David
- Fix assumption that matches is null terminated (David
Benbennick).
load_history()
- Fix segfault on loading huge strings from history file
- Fix segfault on loading huge strings from history file
(David Benbennick).
load_history(), save_history()
- Changed to look at $HOME before getpwuid(geteuid()), see
details in comment for rcfile.c:do_rcfile().
real_dir_from_tidle()
real_dir_from_tilde()
- Change check for the running user's home dir to use
getpwuid(geteuid()) rather than a getpwent() loop
(suggested by Jordi).
@@ -65,7 +405,7 @@ GNU nano 1.1.99pre3 - 2003.02.13
nano.c:line_len(). (David Benbennick).
do_justify()
- Add regfree() to quote regex (David Benbennick).
- Only copy previous indent if AUTOINDENT is set (David
- Only copy previous indent if AUTOINDENT is set (David
Benbennick).
do_suspend()
- Fix untranslated message (David Benbennick).

View File

@@ -1,36 +1,11 @@
## $Id$
AUTOMAKE_OPTIONS = gnu no-dependencies
DEFS= -DSYSCONFDIR=\"$(sysconfdir)\"
SUBDIRS = doc m4 po src
bin_PROGRAMS = nano
nano_SOURCES = color.c \
cut.c \
files.c \
global.c \
move.c \
nano.c \
nano.h \
proto.h \
rcfile.c \
search.c \
utils.c \
winio.c
man_MANS = nano.1 nanorc.5
nano_LDADD = @GLIB_LIBS@ @LIBINTL@
info_TEXINFOS = nano.texi
MAKEINFO = makeinfo --no-split
EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS \
README THANKS TODO UPGRADE config.rpath install-sh missing \
mkinstalldirs nano.1.html nanorc.5.html faq.html \
nanorc.sample nano.spec $(man_MANS)
SUBDIRS = po m4
localedir = $(datadir)/locale
INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
mkinstalldirs nano.spec
ACLOCAL_AMFLAGS = -I m4

30
NEWS
View File

@@ -1,3 +1,33 @@
2003.10.22 - GNU nano 1.3.0 is loosed upon the world. This is the first
release in the unstable 1.3.x series, and as such it
includes a lot of new features, including the addition
of a -d option for those FreeBSD users with Backspace
keys that act like Delete keys, the ability to repeat
the last search without prompting, the ability to search
for the beginning or end of a paragraph, new smooth
paging routines to go with the smooth scrolling
routines, and various improvements to the input and
display routines to make them behave more intuitively.
It also includes the usual load of bugfixes. Enjoy.
2003.08.11 - GNU nano 1.2.2 is released, only four months since the
last version :-). This release includes fixes for
broken regex detection, search history recall, and
keypad handling with -K. Debugging strings are no
longer translated and comments denote where translations
should be as short as possible (i.e. the statusbar).
There are new examples for syntax highlighting, and
documentation updates and fixes. The 1.3.0 CVS
tree will be opening soon for all your nano desires, so
stay tuned!
2003.04.19 - Happy Easter! GNU nano 1.2.1 is released. This release
features a new check for broken regexec()
implementations and some variable, function and macro
cleanups. Fixes are included for search history,
cutting marked text, alt keyboard mode, and the usual
translation and documentation updates.
2003.02.19 - GNU nano 1.2.0 is released. Few changes from pre3, just
some doc and translation updates, and bugfixes for
justify and file conversion. For those of you who

29
README
View File

@@ -56,32 +56,9 @@ Mailing List and Bug Reports
Current Status
This is the 1.1 or unstable branch of nano. New features
will be added and things will be changed around and basically
stability is not guaranteed. If this is not what you're
interested in, please use the latest 1.0.x release of nano.
New features in this branch include:
+ .nanorc file support (--enable-nanorc configure option,
see sample.nanorc file)
+ Negative -r value for "#cols from right", allows dynamic adjustment
of wrap margin based on window size.
+ Write marked text to separate file (^O after selecting with ^^).
+ Append to file (Meta-A at write file menu).
+ Multiple file buffers! (--enable-multibuffer configure option,
--multibuffer, -F cmdline flag, Meta-F toggle, then ^R to load).
+ Better compatibility with Pico. Mouse mode now supports clicking
shortcuts and files in browser, search toggles that are Pico
extensions moved to Meta keys so as to not interfere with Pico
control sequences.
+ Smooth scrolling through files, instead of the jerky half-page
down, half-page up method. This is available by using the
-S or --smooth switch, or the Meta-S toggle.
+ Better non-*nix file support. GNU nano now automatically
converts files from DOS format or Mac format to standard file
format. It can also write files in either format by using the
appropriate command line (-D, --dos or -M, --mac) or toggle
(Meta-D, Meta-O).
GNU nano has reaching its second major milestone, 1.2.x. Development
of new features will continue in the 1.3.x branch, while 1.2.x
versions will be dedicated to bugfixing and polishing.
Chris Allegretta (chrisa@asty.org)

4
THANKS
View File

@@ -2,13 +2,15 @@ The following people have helped GNU nano in some way or another.
If we missed you here, let us know!
Sharuzzaman Ahmat Raslan <sharuzzaman@excite.com>
Bahasa Melayu translator
Malay translator
Laurentiu Buzdugan <buzdugan@voyager.net> Romanian translator
Ricardo Cárdenes Medina <ricardo@conisys.com> Spanish translator
Marco Colombo <magicdice@inwind.it> Italian translator
Karl Eichwalder <keichwa@gmx.net> German translator
Doruk Fisek <dfisek@fisek.com.tr> Turkish translator
Jean-Philippe Guérard <jean-philippe.guerard@laposte.net>
French translator
Geir Helland Norwegian bokmål translator
Tedi Heriyanto <tedi_h@gmx.net> Indonesian translator
Václav Haisman <V.Haisman@sh.cvut.cz> Czech translator
Szabolcs Horvath <horvaths@janus.gimsz.sulinet.hu>

38
TODO
View File

@@ -1,34 +1,38 @@
TODO file (? means the feature may be implemented, but not definitely)
-----------------------------------------------------------------------------
For version 1.2:
- Single line scroll up/down? [DONE]
- Color syntax highlighting? (certainly seems like there's a demand for it.)
- .nanorc [DONE]
- Backup making (filename~)? [DONE]
- Search (etc.) string history [DONE]
- Implement Pico's -j and -g flags, as they are pretty easy to do. [DONE]
- Make mouse support work with clicking on the shortcuts (-m). Must
make global variable pointing to current shortcut list to determine what
keystroke to ungetch(). [DONE].
- Implement -o (chroot of sorts) [DONE]
- Allow -r to take a negative argument, meaning right margin instead of
left (allows resizing that way), formerly -W arg. [DONE]
For version 1.4:
- UTF-8 support.
- Support for Pico's paragraph searching ability.
- Support for Pico's paragraph searching ability. [DONE]
- Undo/Redo key?
- Remindable keys?
- Rebindable keys?
- Keystroke to implement "Add next sequence as raw" like vi's ^V.
- Spell check selected text only.
- Make "To line" (^W^T) and "Read from Command" (^R^X) re-enter their
parent menu when their keystroke is entered a second time (^W^T^T and
(^R^X^X)(requires figuring out when to keep cursor pos and when not to).
(^R^X^X)(requires figuring out when to keep cursor pos and when not
to).
- Fix resetstatuspos global which we shouldn't have.
- Rewrite the nano FAQ in SGML.
Old requests:
For version 1.2:
- Single line scroll up/down? [DONE]
- Color syntax highlighting? (certainly seems like there's a demand for
it.) [DONE]
- .nanorc [DONE]
- Backup making (filename~)? [DONE]
- Search (etc.) string history [DONE]
- Implement Pico's -j and -g flags, as they are pretty easy to do.
[DONE]
- Make mouse support work with clicking on the shortcuts (-m). Must
make global variable pointing to current shortcut list to determine
what keystroke to ungetch(). [DONE].
- Implement -o (chroot of sorts) [DONE]
- Allow -r to take a negative argument, meaning right margin instead of
left (allows resizing that way), formerly -W arg. [DONE]
For version 1.0:
- Implement Spelling [DONE]
- Implement Help [DONE]

View File

@@ -6,7 +6,7 @@ Visible changes since 1.0
* Editor Features
- Complete Pico compatibility (--pico has been removed, and -p means
something else, see below).
- nanorc support.
- nanorc support (see nanorc.sample included in sources).
- Smooth scrolling (-S).
- Searching of matching brace/bracket/etc.
- Help for all editor features.

View File

@@ -2,25 +2,25 @@
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# GNU Nano is free software; you can redistribute it and/or modify
# 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 later version.
#
# GNU Nano is distributed in the hope that it will be useful,
# GNU nano 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 GNU Nano; if not, write to the Free Software
# along with GNU nano; if not, write to the Free Software
# Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
AC_INIT([GNU Nano], [1.2.0], [nano-devel@gnu.org], [nano])
AC_CONFIG_SRCDIR([nano.c])
AC_INIT([GNU nano], [1.3.0], [nano-devel@gnu.org], [nano])
AC_CONFIG_SRCDIR([src/nano.c])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h:config.h.in])
@@ -38,12 +38,22 @@ AM_GNU_GETTEXT([external], [need-ngettext])
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h getopt.h libintl.h limits.h regex.h termio.h termios.h unistd.h)
AC_CHECK_HEADER(regex.h,
AC_MSG_CHECKING([for broken regexec])
AC_TRY_RUN([
#include <sys/types.h>
#include <regex.h>
int main () { regex_t reg; size_t n = 1; regmatch_t r; regcomp(&reg, "\\<", 0); regexec(&reg, "", n, &r, 0); regfree(&reg); return 0; }],
AC_MSG_RESULT(no),
AC_MSG_RESULT(yes); AC_DEFINE(BROKEN_REGEXEC, 1, [Define this if your regexec() function segfaults when passed an empty string under certain conditions.])
)
)
dnl options
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debugging (disabled by default)],
[if test x$enableval = xyes; then
AC_DEFINE(DEBUG, 1, [Define this to enable nano debug messages and assert warnings.])
AC_DEFINE(DEBUG, 1, [Define this to enable nano debug messages and assert warnings.])
debug_support=yes
fi])
@@ -125,7 +135,6 @@ AC_ARG_ENABLE(wrapping-as-root,
AC_DEFINE(DISABLE_ROOTWRAP, 1, [Define this to disable wrapping as root by default.])
fi])
AC_ARG_ENABLE(color,
[ --enable-color Enable color and syntax highlighting],
[if test x$enableval = xyes; then
@@ -321,20 +330,6 @@ AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, AC_DEFINE(HAVE_USE_DEFAULT_
if test x$slang_support != xyes; then
AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, AC_DEFINE(HAVE_WRESIZE, 1, [Define this if you have the wresize function in your ncurses-type library.]))
AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, AC_DEFINE(HAVE_RESIZETERM, 1, [Define this if you have the resizeterm function in your ncurses-type library.]))
# Taken from aumix (can't tell from the variable name?)
AC_CACHE_CHECK([for private member _use_keypad in WINDOW],
aumix_cv_struct_window_usekeypad,
[AC_TRY_COMPILE([#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else
#include <curses.h>
#endif], [WINDOW w; w._use_keypad;],
aumix_cv_struct_window_usekeypad=yes, aumix_cv_struct_window_usekeypad=no)])
if test $aumix_cv_struct_window_usekeypad = yes; then
AC_DEFINE(HAVE_USEKEYPAD, 1, [Define this if your curses lib has the _use_keypad flag.])
fi
fi
dnl Parse any configure options
@@ -352,5 +347,16 @@ then
LDFLAGS="$LDFLAGS $glib_libs"
fi
AC_CONFIG_FILES([Makefile m4/Makefile po/Makefile.in nano.spec])
AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/man/Makefile
doc/man/fr/Makefile
doc/texinfo/Makefile
m4/Makefile
po/Makefile.in
src/Makefile
nano.spec
])
AC_OUTPUT

2
doc/.cvsignore Normal file
View File

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

3
doc/Makefile.am Normal file
View File

@@ -0,0 +1,3 @@
SUBDIRS = man texinfo
EXTRA_DIST = faq.html nanorc.sample

View File

@@ -36,9 +36,10 @@
<a href="#4.3">4.3. Nano crashes when I resize my window. How can I fix that?</a><br>
<a href="#4.4">4.4. [version 1.1.12 and earlier] Why does nano show ^\ in the shortcut list instead of ^J?</a><br>
<a href="#4.5a">4.5a. [version 1.1.12 and earlier] When I type in a search string, the string I last searched for is already in front of my cursor! What happened?!</a><br>
<a href="#4.5b">4.5b. [version 1.2.0 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</a><br>
<a href="#4.5b">4.5b. [version 1.2.2 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</a><br>
<a href="#4.6">4.6. I get the message &quot;NumLock glitch detected. Keypad will malfunction with NumLock off.&quot; What gives?</a><br>
<a href="#4.7">4.7. How do I make nano my default editor (in Pine, mutt, etc.)?</a></p></blockquote>
<a href="#4.7">4.7. How do I make nano my default editor (in Pine, mutt, etc.)?</a><br>
<a href="#4.8">4.8. I've compiled nano with color support, but I don't see any color when I run 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></p></blockquote>
@@ -77,7 +78,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 1.2.0. 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 1.3.0. Of course you should always check the nano homepage to see what the latest and greatest version is.</p></blockquote>
<h2><a name="1.7"></a>1.7. I want to read the man page without having to download the program!</h2>
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="http://www.nano-editor.org/dist/v1.2/nano.1.html">here</a>.</p></blockquote>
<hr width="100%">
@@ -93,8 +94,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.0/RPMS/">http://www.nano-editor.org/dist/v1.0/RPMS/</a></li>
<li><a href="http://www.ewtoo.org/~astyanax/nano/dist/v1.0/RPMS/">http://www.ewtoo.org/~astyanax/nano/dist/v1.0/RPMS/</a></li>
<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>
</ul>
<p>Additionally, check out the RedHat contribs section at:</p>
<ul>
@@ -175,7 +176,7 @@
<a name="4.5"></a>
<h2><a name="4.5a"></a>4.5a. [version 1.1.12 and earlier] When I type in a search string, the string I last searched for is already in front of my cursor! What happened?!</h2>
<blockquote><p>In nano version 0.9.20, the default is to have a completely consistent user interface across all user input functions. This means that regardless of whether you're being asked for a filename to insert or write, or a string to search for, the previous value is already inserted before the cursor. If you prefer the old behavior, use the Pico emulation mode (-p or --pico) or just hit Meta-P while in nano (see the ^G help text for more details).</p></blockquote>
<h2><a name="4.5b"></a>4.5b. [version 1.2.0 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</h2>
<h2><a name="4.5b"></a>4.5b. [version 1.2.2 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</h2>
<blockquote><p>It was decided that consistency was nice, but people are used to Pico's inconsistent behavior. Also, in version 1.1.99pre1, search and replace history was introduced. If you wish to edit your previous search/replace entry (or any previous entry), you can do so by hitting the up arrow to cycle through your history. This method allows the best of both worlds: You don't need to erase the previous string if you want to enter a new one, but you can with one keystroke recall previous entries for editing. Therefore there is now no "Pico mode", nano is and has always been a Pico <b>clone</b>, and clones by default should be compatible.</p></blockquote>
<h2><a name="4.6"></a>4.6. I get the message &quot;NumLock glitch detected. Keypad will malfunction with NumLock off.&quot; What gives?</h2>
<blockquote><p>Nano (and actually almost all console editors) has issues when cycling the NumLock key in certain X terminals (rxvt, aterm, wterm, etc...). When you switch NumLock from on to off, you put the terminal into an &quot;application mode&quot; that changes what sequences are sent by the keypad. These sequences vary sufficiently from terminal to terminal that it is nearly impossible to work around them from within nano.</p>
@@ -193,6 +194,8 @@
<p>Mutt users should see an effect immediately the next time you log in, no further configuration is needed. However, if you want to let people know you use nano to compose your email messages, you can put a line like this in your <b>.muttrc</b>:</p>
<p><b>my_hdr X-Composer: nano x.y.z</b></p>
<p>Again, replace x.y.z with the version of nano you use.</p></blockquote>
<h2><a name="4.8"></a>4.8. I've compiled nano with color support, but I don't see any color when I run it!</h2>
<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.8">3.8</a>.</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>
@@ -233,7 +236,9 @@
<h2><a name="8"></a>8. ChangeLog</h2>
<blockquote>
<p>
2003/01/16 - Split section 4.5 into 4.5a and 4.5b for search string behavior. Added --enable-all docs.<br>
2003/07/02 - Added question about nano's not showing color when it's compiled with color support (DLR; suggested by Jordi).<br>
2003/02/23 - Updated RPM links for nano 1.2.x. (DLR).<br>
2003/01/16 - Split section 4.5 into 4.5a and 4.5b for search string behavior. Added --enable-all docs.<br>
2002/12/28 - More misc. fixes (David Benbennick, DLR).<br>
2002/10/25 - Misc. fixes and link updates (DLR).<br>
2002/09/10 - Another typo fix (DLR).<br>

4
doc/man/.cvsignore Normal file
View File

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

12
doc/man/Makefile.am Normal file
View File

@@ -0,0 +1,12 @@
SUBDIRS = fr
man_MANS = nano.1 nanorc.5
BUILT_SOURCES = nano.1.html nanorc.5.html
nano.1.html: nano.1
cat $< | groff -t -mandoc -Thtml > $@
nanorc.5.html: nanorc.5
cat $< | groff -t -mandoc -Thtml > $@
EXTRA_DIST = $(man_MANS) $(BUILT_SOURCES)

4
doc/man/fr/.cvsignore Normal file
View File

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

10
doc/man/fr/Makefile.am Normal file
View File

@@ -0,0 +1,10 @@
man_MANS = nano.1 nanorc.5
BUILT_SOURCES = nano.1.html nanorc.5.html
nano.1.html: nano.1
cat $< | groff -t -mandoc -Thtml > $@
nanorc.5.html: nanorc.5
cat $< | groff -t -mandoc -Thtml > $@
EXTRA_DIST = $(man_MANS) $(BUILT_SOURCES)

229
doc/man/fr/nano.1 Normal file
View File

@@ -0,0 +1,229 @@
.\" Hey, EMACS: -*- nroff -*-
.\" nano.1 is copyright (C) 1999, 2000, 2001, 2002, 2003 by
.\" Chris Allegretta <chrisa@asty.org>
.\"
.\" (c) 2003 Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>
.\" pour l'adaptation française
.\"
.\" This is free documentation, see the latest version of the GNU General
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" 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. AUCUNE garantie n'est offerte.
.\"
.TH NANO 1 "19 juin 2003 (v.f. du 25 août 2003)"
.\" Please adjust this date whenever revising the manpage.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.SH NOM
nano \- NAno un NOuvel éditeur, un clone libre et amélioré de Pico
.SH SYNOPSIS
.B nano
.I [\+LIGNE]\ [options]\ [fichier]
.br
.SH DESCRIPTION
Cette page de manuel décrit brièvement la commande \fBnano\fP.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
.\" respectively.
\fBnano\fP est un petit éditeur sympathique et libre, qui vise à remplacer
Pico, l'éditeur par défaut du paquet non-libre Pine. \fBnano\fP ne se
contentant pas de copier l'interface et l'ergonomie de Pico, il offre
également certaines fonctionnalités manquantes (ou désactivées par
défaut) de Pico. Ces fonctionnalités sont, par exemple, les fonctions de
recherche et de remplacement, et la possibilité de sauter directement à
un numéro de ligne.
.SH OPTIONS
.TP
.B \+\fILIGNE\fP
Démarre avec le curseur positionné à la ligne numéro \fILIGNE\fP.
.TP
.B \-B (\-\-backup)
Lors de l'écriture d'un fichier, crée une copie de sécurité de la
version précédente, en ajoutant un tilde (~) au nom du fichier.
.TP
.B \-D (\-\-dos)
Écrit le fichier au format DOS.
.TP
.B \-F (\-\-multibuffer)
Active le mode multifichiers, autorisant l'édition simultanée de
plusieurs fichiers, si ce mode est disponible.
.TP
.B \-H (\-\-historylog)
Enregistre les chaînes ayant fait l'objet d'une recherche ou d'un
remplacement dans le fichier
.I ~/.nano_history
afin de permettre leur réutilisation. Ceci n'est possible que si
.B nano
est capable d'utiliser les fichiers
nanorc.
.TP
.B \-I (\-\-ignorercfiles)
N'utilise pas les fichiers
.I $SYSCONFDIR/nanorc
et
.IR ~/.nanorc ,
même si
.B nano
est capable de les utiliser.
.TP
.B \-K (\-\-keypad)
Essaie au maximum de ne pas utiliser les appels keypad() de ncurses.
Utilisez ce paramètre si vous vous apercevez que les flèches du pavé
numérique ne fonctionnent pas sous nano.
.TP
.B \-M (\-\-mac)
Écrit le fichier au format Mac.
.TP
.B \-N (\-\-noconvert)
Désactive la conversion automatique des fichiers depuis les
formats Mac et DOS.
.TP
.B \-Q \fIchaîne\fP (\-\-quotestr=\fIchaîne\fP)
Définit le préfixe par défaut des citations. Nano utilise ce préfixe
pour réaliser une justification correcte des citations.
Si nano est capable d'utiliser des expressions rationnelles, le préfixe
par défaut sera "^([\ \\t]*[|>:}#])+", sinon, ce sera ">\ ".
.TP
.B \-R (\-\-regexp)
Active l'utilisation d'expressions rationnelles lors des recherches,
ainsi que la possibilité d'utiliser \\\fIn\fP dans les chaînes de
remplacement pour faire référence à la \fIn\fP-ième sous-expression du
motif de recherche, si cette fonction est disponible.
.TP
.B \-S (\-\-smooth)
Active le défilement progressif. Le texte défilera ligne-par-ligne au
lieu de défiler morceau-par-morceau.
.TP
.B \-T \fInombre\fP (\-\-tabsize=\fInombre\fP)
Définit la taille (largeur) des tabulations.
.TP
.B \-V (\-\-version)
Affiche le numéro de version et l'auteur.
.TP
.B \-Y \fIchaîne\fP (\-\-syntax=\fIchaîne\fP)
Indique quel mode de colorisation syntaxique adopter, parmi les modes
définis dans le fichier
.IR .nanorc ,
si cette fonctionnalité est disponible.
.TP
.B \-c (\-\-const)
Affiche en permanence la position du curseur.
.TP
.B \-h (\-\-help)
Affiche de la liste des options disponibles en ligne de commande.
.TP
.B \-i (\-\-autoindent)
Indentation automatique. Commence chaque nouvelle ligne au même niveau
que la ligne précédente. Utile pour l'édition de code source.
.TP
.B \-k (\-\-cut)
^K coupe le texte du curseur à la fin de la ligne, au lieu de couper la
ligne entière.
.TP
.B \-l (\-\-nofollow)
Si le fichier édité est un lien symbolique, remplace le lien par le
nouveau fichier, sans le suivre. Ce mode ne serait-il pas utile pour
éditer les fichiers de
.IR /tmp \ ?
.TP
.B \-m (\-\-mouse)
Active l'utilisation de la souris (si elle est disponible sur votre
système).
.TP
.B \-o \fIrépertoire\fP (\-\-operatingdir=\fIrépertoire\fP)
Définit le répertoire de travail. Demande à nano de mettre en place
quelque-chose de similaire à une cage chroot.
.TP
.B \-p (\-\-preserve)
Préserve les séquences XON et XOFF (^Q et ^S), afin qu'elle soient
reçues par le terminal.
.TP
.B \-r \fIcolonne\fP (\-\-fill=\fIcolonne\fP)
Passe automatiquement à la ligne à la colonne \fIcolonne\fP. Par défaut,
le passage à la ligne se fait à la taille de l'écran moins huit. Si la
valeur indiquée est négative, le point de passage à la ligne sera
calculé relativement au bord droit de l'écran. Cela permet de faire
varier le point de passage à la ligne lorsque l'on change la taille de
l'écran.
.TP
.B \-s \fIprogramme\fP (\-\-speller=\fIprogramme\fP)
Choix d'un correcteur orthographique de remplacement.
.TP
.B \-t (\-\-tempfile)
S'il a été modifié, le fichier sera sauvegardé automatiquement sans
demande de confirmation. Identique à l'option -t de Pico.
.TP
.B \-v (\-\-view)
Mode visualisation (lecture seule).
.TP
.B \-w (\-\-nowrap)
Désactive le passage automatique à la ligne.
.TP
.B \-x (\-\-nohelp)
Désactive la barre d'aide affichée en bas de l'écran.
.TP
.B \-z (\-\-suspend)
Autorise à suspendre l'éditeur.
.TP
.B \-a, \-b, \-e, \-f, \-g, \-j
Ignoré, pour être compatible avec Pico.
.SH FICHIERS D'INITIALISATION
\fBnano\fP lit les fichiers d'initialisation dans l'ordre suivant\ :
\fI$SYSCONFDIR/nanorc\fP, puis \fI~/.nanorc\fP. Reportez-vous à la page
de manuel de \fBnanorc\fP(5) et au fichier-exemple \fInanorc.sample\fP
qui devrait être livré avec \fBnano\fP.
.SH NOTES
Dans certains cas, \fBnano\fP essaiera de sauvegarder le fichier en
cours d'édition dans un fichier de secours. Cela arrivera
principalement si \fBnano\fP reçoit un signal SIGHUP ou SIGTERM, ou
bien se trouve à court de mémoire. Le nom de ce fichier de secours sera
\fInano.save\fP si le fichier en cours n'avait pas encore de nom, ou
sera composé du nom du fichier en cours suivi du suffixe «\ .save\ ». Si
un fichier de ce nom existe déjà dans le répertoire, un «\ .save\ » et
un nombre seront ajoutée à la fin du nom du fichier en cours afin de le
rendre unique (par exemple, «\ .save.1\ »). En mode multifichiers,
\fBnano\fP réalisera une sauvegarde de tous les fichiers en cours dans
leurs fichiers de secours respectifs.
.SH BOGUES
Merci de nous faire parvenir vos commentaires et de nous signaler les
bogues, en écrivant, en anglais, à
.BR nano@nano-editor.org .
N'hésitez pas à faire parvenir vos suggestions et commentaires relatifs
à la version française de \fBnano\fP à
.BR jean-philippe.guerard@corbeaunoir.org .
La liste de discussion anglophone \fBnano\fP est disponible via
.BR nano-devel@gnu.org .
Pour vous abonner, envoyez un courrier électronique à
.BR nano-devel-request@gnu.org ,
ayant pour objet «\ subscribe\ ».
.SH SITE INTERNET
http://www.nano-editor.org/
.SH VOIR AUSSI
.PD 0
.TP
\fBnanorc\fP(5)
.PP
\fI/usr/share/doc/nano/\fP (ou son équivalent sur votre système)
.SH AUTEUR
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
\fIAUTHORS\fP et \fITHANKS\fP pour plus d'information). Cette page de
manuel a été initialement rédigée par Jordi Mallach
<jordi@sindominio.net> pour le système GNU Debian (mais elle peut être
utilisée par d'autres).
.SH TRADUCTION
Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>, 2003.

198
doc/man/fr/nanorc.5 Normal file
View File

@@ -0,0 +1,198 @@
.\" Hey, EMACS: -*- nroff -*-
.\" nanorc.5 is Copyright (C) 2003 Free Software Foundation, Inc.
.\"
.\" (c) 2003 Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>
.\" pour l'adaptation française
.\"
.\" This is free documentation, see the latest version of the GNU General
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" 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. AUCUNE garantie n'est offerte.
.\"
.TH NANORC 5 "19 juin 2003 (v.f. du 25 août 2003)"
.\" Please adjust this date whenever revising the manpage.
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
.SH NAME
nanorc \- fichier de configuration de l'éditeur nano du projet GNU
.SH DESCRIPTION
Cette page de manuel décrit brièvement le fichier de configuration de
l'éditeur \fBnano\fP du projet GNU.
.PP
\fBnano\fP est un petit éditeur sympathique et libre, qui vise à
remplacer Pico, l'éditeur par défaut du paquet non-libre Pine.
\fBnano\fP ne se contentant pas de copier l'interface et l'ergonomie de
Pico, il offre également certaines fonctionnalités manquantes (ou
désactivées par défaut) de Pico. Ces fonctionnalités sont, par exemple,
les fonctions de recherche et de remplacement, et la possibilité de
sauter directement à un numéro de ligne.
.PP
Le fichier \fInanorc\fP contient les paramètres par défaut de
\fBnano\fP. Lors de son démarrage, nano commence par lire le fichier de
configuration général \fI$SYSCONFDIR/nanorc\fP, puis lit le fichier de
configuration personnel de l'utilisateur \fI~/.nanorc\fP.
.SH OPTIONS
Le fichier de configuration accepte une série de commandes «\ set\ »
(activer) et «\ unset\ » (désactiver), qui permettent de définir la
configuration de nano au démarrage sans avoir à utiliser d'options sur
la ligne de commande.
De plus, les mots clefs «\ syntax\ » (syntaxe) et «\ color\ » (couleur)
sont utilisés pour définir les règles de colorisation pour différents
motifs de texte. Nano lira une commande par ligne.
Les options du fichier de configuration ont priorité sur les valeurs par
défaut utilisées par nano. Les options données sur la ligne de commande
permettent d'outrepasser les options du fichier de configuration.
Les options sont désactivées (unset) par défaut, sauf les options
prenant un argument.
Les commandes et arguments reconnus sont\ :
.TP 3
\fBset/unset autoindent\fP
Active l'indentation automatique.
.TP
\fBset/unset backup\fP
Crée des copie de sécurité appelées
.IR nom_du_fichier~ .
.TP
\fBset/unset const\fP
Affiche en permanence la position du curseur dans la barre
d'information.
.TP
\fBset/unset cut\fP
Par défaut, utilise ^K pour couper le texte du curseur à la fin de la
ligne, au lieu de couper la ligne entière.
.TP
\fBset fill \fIn\fP\fP
Passe automatiquement à la ligne à la colonne \fIn\fP. Si la valeur
indiquée est 0 ou moins, la longueur de la ligne sera égale à la largeur
de l'écran moins \fIn\fP. La valeur par défaut est -8.
.TP
\fBset/unset historylog\fP
Active l'utilisation de
.I ~/.nano_history
pour enregistrer et relire les chaînes ayant fait l'objet d'une
recherche ou d'un remplacement.
.TP
\fBset/unset keypad\fP
Utilise l'autre gestion du pavé numérique.
.TP
\fBset/unset multibuffer\fP
Permet de charger simultanément plusieurs fichiers.
.TP
\fBset/unset noconvert\fP
Pas de conversion depuis les formats DOS et Mac.
.TP
\fBset/unset nofollow\fP
Ne suit pas les liens symboliques lors de l'écriture des fichiers.
.TP
\fBset/unset nohelp\fP
Désactive la barre d'aide affichée en bas de l'écran.
.TP
\fBset/unset nowrap\fP
Désactive le passage automatique à la ligne.
.TP
\fBset operatingdir "\fIrépertoire\fP"\fP
\fBnano\fP ne lira et n'écrira des fichiers qu'à l'intérieur du
\fIrépertoire\fP et de ses sous-répertoires. De plus, celui-ci devient
le répertoire courant, afin que les fichiers soient écrits dans ce
dossier. Par défaut, cette fonction est désactivée.
.TP
\fBset/unset preserve\fP
Préserve les séquences XON et XOFF (^Q et ^S).
.TP
\fBset quotestr "\fIchaîne\fP"\fP
Définit le préfixe par défaut utilisé pour les citations dans les
courriers électroniques. Ce préfixe est utilisé pour réaliser une
justification correcte de ces citations. Il s'agira, si votre système le
permet, d'une «\ expression rationnelle étendue\ ». Dans le cas
contraire, il s'agira d'une chaîne de texte brut. Si vous disposez des
expressions rationnelles, la valeur par défaut sera\ :
set quotestr "^([\ \\t]*[|>:}#])+"
Sinon, ce sera ">\ ". Notez que le «\ \\t\ » ci-dessus correspond à un
caractère de tabulation.
.TP
\fBset/unset regexp\fP
Utilise par défaut des expressions rationnelles pour les recherches.
.TP
\fBset/unset smooth\fP
Active le défilement ligne-par-ligne du texte.
.TP
\fBset speller \fIprogramme\fP\fP
Utilise le correcteur orthographique \fIprogramme\fP au lieu du
correcteur intégré, qui s'appuie sur \fIspell\fP.
.TP
\fBset/unset suspend\fP
Autorise à suspendre nano avec ^Z.
.TP
\fBset tabsize \fIn\fP\fP
Utilise une largeur de tabulation de \fIn\fP au lieu de la valeur par
défaut (8). Cette valeur doit être supérieur à 0.
.TP
\fBset/unset tempfile\fP
S'il a été modifié, le fichier sera sauvegardé automatiquement
sans demande de confirmation.
.TP
\fBset/unset view\fP
Interdit la modification du fichier.
.TP
.B syntax "\fIchaîne\fP" ["\fImotif_de_fichier\fP" ... ]
Définit une syntaxe nommée \fIchaîne\fP qui pourra être activé via
l'option \fB-Y\fP, ou qui sera automatiquement activé si le nom du
fichier en cours correspond au \fImotif_de_fichier\fP. Toutes les
instructions de colorisation \fBcolor\fP suivantes s'appliqueront à cette
syntaxe, jusqu'à la définition d'une nouvelle syntaxe.
.TP
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] "\fImotif\fP" ...
Pour la syntaxe en cours, affiche toutes les expressions correspondant à
l'expression rationnelle \fImotif\fP en utilisant la couleur de texte
\fIcouleur_texte\fP et éventuellement la couleur de fond
\fIcouleur_fond\fP. Les couleurs acceptées par \fBnano\fP pour le
texte et le fond sont\ : \fIwhite\fP (blanc), \fIblack\fP (noir),
\fIred\fP (rouge), \fIblue\fP (bleu), \fIgreen\fP (vert), \fIyellow\fP
(jaune), \fImagenta\fP, et \fIcyan\fP. Vous pouvez ajouter à
ces couleurs le préfixe \fIbright\fP pour obtenir une couleur plus
lumineuse. Si votre terminal est capable de gérer la transparence, ne
pas spécifier de \fIcouleur_fond\fP indique à \fBnano\fP d'essayer
d'utiliser un fond transparent.
.TP
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] start="\fImotif_début\fP" end="\fImotif_fin\fP"
Affiche les expressions commençant par \fImotif_début\fP et se terminant
par \fImotif_fin\fP en utilisant la couleur de texte \fIcouleur_texte\fP
et éventuellement la couleur de fond \fIcouleur_fond\fP. Cela permet à
la colorisation syntaxique de s'étendre sur plusieurs lignes. Notez que
toutes les occurrences successives de \fImotif_début\fP après le
\fImotif_début\fP initial seront colorées jusqu'à la prochaine instance
de \fImotif_fin\fP.
.SH FICHIERS
.TP
.I $SYSCONFDIR/nanorc
Fichier de configuration général
.TP
.I ~/.nanorc
Fichier de configuration personnel
.SH VOIR AUSSI
.PD 0
.TP
\fBnano\fP(1)
.PP
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (ou son équivalent sur
votre système)
.SH AUTEUR
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
\fIAUTHORS\fP et \fITHANKS\fP pour plus d'information). Cette page de
manuel a été rédigée par Jordi Mallach <jordi@gnu.org>.
.SH TRADUCTION
Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>, 2003.

View File

@@ -3,10 +3,10 @@
.\" Chris Allegretta <chrisa@asty.org>
.\"
.\" This is free documentation, see the latest version of the GNU General
.\" Public License for copying conditions. There is NO warranty.
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" $Id$
.TH NANO 1 "February 9, 2003"
.TH NANO 1 "August 24, 2003"
.\" Please adjust this date whenever revising the manpage.
.\"
@@ -22,10 +22,10 @@ nano \- Nano's ANOther editor, an enhanced free Pico clone
This manual page documents briefly the \fBnano\fP command.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
.\" respectively.
\fBnano\fP is a small, free and friendly editor which aims to replace
Pico, the default editor included in the non-free Pine package. Rather
Pico, the default editor included in the non-free Pine package. Rather
than just copying Pico's look and feel, \fBnano\fP also implements some
missing (or disabled by default) features in Pico, such as "search and
replace" and "go to line number".
@@ -46,17 +46,17 @@ Write file in DOS format.
Enable multiple file buffers, if available.
.TP
.B \-H (\-\-historylog)
Log search and replace strings to ~/.nano_history so they may be
stored for later editing, if nanorc support is configured.
Log search and replace strings to
.I ~/.nano_history
so they may be stored for later editing, if nanorc support is
configured.
.TP
.B \-I (\-\-ignorercfiles)
Don't look at $SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
available.
.TP
.B \-K (\-\-keypad)
Do not use the ncurses keypad() call unless necessary. Try this flag if
you find that the arrow keys on the numeric keypad do not work for you
under nano.
Don't look at
.I SYSCONFDIR/nanorc
or
.IR ~/.nanorc ,
if nanorc support is available.
.TP
.B \-M (\-\-mac)
Write file in Mac format.
@@ -66,15 +66,15 @@ Disable automatic conversion of files from DOS/Mac format.
.TP
.B \-Q \fIstr\fP (\-\-quotestr=\fIstr\fP)
Set the quoting string for justifying. The default is
"^([ \\t]*[|>:}#])+" if regular expression support is available, or
"> " otherwise.
"^([\ \\t]*[|>:}#])+" if regular expression support is available, or
">\ " otherwise.
.TP
.B \-R (\-\-regexp)
Enable regular expression matching for search strings, as well as
\\n subexpression replacement for replace strings, if available.
.TP
.B \-S (\-\-smooth)
Enable smooth scrolling. Text will scroll line-by-line, instead of the
Enable smooth scrolling. Text will scroll line-by-line, instead of the
usual chunk-by-chunk behavior.
.TP
.B \-T \fInum\fP (\-\-tabsize=\fInum\fP)
@@ -84,17 +84,23 @@ Set the size (width) of a tab.
Show the current version number and author.
.TP
.B \-Y \fIstr\fP (\-\-syntax=\fIstr\fP)
Specify a specific syntax highlighting from the .nanorc to use, if
available.
Specify a specific syntax highlighting from the
.I .nanorc
to use, if available.
.TP
.B \-c (\-\-const)
Constantly show the cursor position.
.TP
.B \-d (\-\-rebinddelete)
Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
.TP
.B \-h (\-\-help)
Display a summary of command line options.
.TP
.B \-i (\-\-autoindent)
Indent new lines to the previous line's indentation. Useful when editing
Indent new lines to the previous line's indentation. Useful when editing
source code.
.TP
.B \-k (\-\-cut)
@@ -102,23 +108,25 @@ Enable cut from cursor to end of line with ^K.
.TP
.B \-l (\-\-nofollow)
If the file being edited is a symbolic link, replace the link with
a new file, do not follow it. Good for editing files in /tmp, perhaps?
a new file, do not follow it. Good for editing files in
.IR /tmp ,
perhaps?
.TP
.B \-m (\-\-mouse)
Enable mouse support (if available for your system).
.TP
.B \-o \fIdir\fP (\-\-operatingdir=\fIdir\fP)
Set operating directory. Makes nano set up something similar to a
Set operating directory. Makes nano set up something similar to a
chroot.
.TP
.B \-p (\-\-preserve)
Preserve the XON and XOFF sequences (^Q and ^S) so they will be
caught by the terminal.
Preserve the XON and XOFF sequences (^Q and ^S) so they will be caught
by the terminal.
.TP
.B \-r \fIcols\fP (\-\-fill=\fIcols\fP)
Wrap lines at column \fIcols\fP. By default, this is the width of the
screen, less eight. If this value is negative, wrapping will occur at
\fIcols\fP columns from the right of the screen, allowing the wrap point
\fIcols\fP columns from the right of the screen, allowing the wrap point
to vary along with the screen width if resized.
.TP
.B \-s \fIprog\fP (\-\-speller=\fIprog\fP)
@@ -143,32 +151,38 @@ Enable suspend ability.
Ignored, for compatibility with Pico.
.SH INITIALIZATION FILE
\fBnano\fP will read initialization files in the following
order: $SYSCONFDIR/nanorc, then ~/.nanorc. Please see nanorc(5) and
the example file \fBnanorc.sample\fP which should be provided with
\fBnano\fP.
\fBnano\fP will read initialization files in the following order:
.IR SYSCONFDIR/nanorc ,
then
.IR ~/.nanorc .
Please see
.BR nanorc (5)
and the example file \fBnanorc.sample\fP which should be provided with
\fBnano\fP.
.SH NOTES
\fBnano\fP will try to dump the buffer into an emergency file in some
cases. Mainly, this will happen if \fBnano\fP receives a SIGHUP or
SIGTERM or runs out of memory, when it will write the buffer into a file
named "nano.save" if the buffer didn't have a name already, or will add
a ".save" suffix to the current filename. If an emergency file with that
name already exists in the current directory, ".save" and a number (e.g.
".save.1") will be suffixed to the current filename in order to make it
unique. In multibuffer mode, \fBnano\fP will write all the open buffers
to the respective emergency files.
named
.I nano.save
if the buffer didn't have a name already, or will add a ".save" suffix
to the current filename. If an emergency file with that name already
exists in the current directory, ".save" and a number (e.g. ".save.1")
will be suffixed to the current filename in order to make it unique. In
multibuffer mode, \fBnano\fP will write all the open buffers to the
respective emergency files.
.SH BUGS
Please send any comments or bug reports to
.br
.B nano@nano-editor.org.
.br
.BR nano@nano-editor.org .
The \fBnano\fP mailing list is available from
.br
.B nano-devel@gnu.org.
To subscribe, email to nano-devel-request@gnu.org with a
subject of "subscribe".
.BR nano-devel@gnu.org .
To subscribe, email to
.B nano-devel-request@gnu.org
with a subject of "subscribe".
.SH HOMEPAGE
http://www.nano-editor.org/
@@ -181,8 +195,10 @@ http://www.nano-editor.org/
\fI/usr/share/doc/nano/\fP (or equivalent on your system)
.SH AUTHOR
Chris Allegretta <chrisa@asty.org>, et al (see AUTHORS and THANKS for
details).
This manual page was originally written by Jordi Mallach
<jordi@sindominio.net>, for the Debian GNU system (but may be
used by others).
Chris Allegretta <chrisa@asty.org>, et al (see
.I AUTHORS
and
.I THANKS
for details). This manual page was originally written by Jordi Mallach
<jordi@sindominio.net>, for the Debian GNU system (but may be used by
others).

View File

@@ -2,37 +2,38 @@
.\" nanorc.5 is Copyright (C) 2003 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.
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" $Id$
.TH NANORC 5 "February 14, 2003"
.TH NANORC 5 "August 24, 2003"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
nanorc \- GNU nano's rcfile
.SH SYNOPSIS
.B /etc/nanorc
.br
.B $HOME/.nanorc
.br
.SH DESCRIPTION
This manual page documents GNU \fBnano\fP's rcfile.
.PP
\fBnano\fP is a small, free and friendly editor which aims to replace
Pico, the default editor included in the non-free Pine package. Rather
Pico, the default editor included in the non-free Pine package. Rather
than just copying Pico's look and feel, \fBnano\fP also implements some
missing (or disabled by default) features in Pico, such as "search and
replace" and "go to line number".
.PP
The \fInanorc\fP file contains the default settings for \fBnano\fP.
During startup, \fBnano\fP will first read its system-wide settings from
.IR SYSCONFDIR/nanorc ,
and then user-specific settings from
.IR ~/.nanorc .
.SH OPTIONS
The configuration file accepts a series of "set" and "unset" commands,
which can be used to configure nano on startup without using the
command-line options. Additionally, the "syntax" and "color" keywords
are used to define syntax highlighting rules for different text patterns.
GNU nano will read one command per line.
command-line options. Additionally, the "syntax" and "color" keywords
are used to define syntax highlighting rules for different text
patterns. GNU nano will read one command per line.
Options in rcfiles take precedence over nano's defaults, and command line
options override rcfile settings.
Options in rcfiles take precedence over nano's defaults, and command
line options override rcfile settings.
Options are unset by default, except for options that take an argument.
@@ -43,7 +44,8 @@ The supported commands and arguments are:
Use auto-indentation.
.TP
\fBset/unset backup\fP
Create backup files in filename~.
Create backup files in
.IR filename~ .
.TP
\fBset/unset const\fP
Constantly display the cursor position in the status bar.
@@ -55,8 +57,10 @@ Use cut to end of line with ^K by default.
Wrap lines at column number \fIn\fP. If \fIn\fP is 0 or less, the line
length will be the screen width less \fIn\fP. The default value is -8.
.TP
\fBset/unset keypad\fP
Use alternate keypad routines.
\fBset/unset historylog\fP
Enable
.I ~/.nano_history
for saving and reading search/replace strings.
.TP
\fBset/unset multibuffer\fP
Allow inserting files into their own buffers.
@@ -75,22 +79,27 @@ Don't wrap text at all.
.TP
\fBset operatingdir "\fIdirectory\fP"\fP
\fBnano\fP will only read and write files inside \fIdirectory\fP and its
subdirectories. Also, the current directory is changed to here, so files
are inserted from this dir. By default the operating directory feature is
turned off.
subdirectories. Also, the current directory is changed to here, so
files are inserted from this dir. By default the operating directory
feature is turned off.
.TP
\fBset/unset preserve\fP
Preserve the XON and XOFF keys (^Q and ^S).
.TP
\fBset quotestr "\fIstring\fP"\fP
The email-quote string, used to justify email-quoted paragraphs. This is
an "extended regular expression" if your system supports them, otherwise a
literal string. The default value is
The email-quote string, used to justify email-quoted paragraphs. This
is an "extended regular expression" if your system supports them,
otherwise a literal string. The default value is
set quotestr "^([ \\t]*[|>:}#])+"
set quotestr "^([\ \\t]*[|>:}#])+"
if you have regexps, otherwise set quotestr "> ". Note that '\\t' above
stands for a literal Tab character.
if you have regexps, otherwise set quotestr ">\ ". Note that '\\t'
above stands for a literal Tab character.
.TP
\fBset/unset rebinddelete\fP
Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
.TP
\fBset/unset regexp\fP
Do regular expression searches by default.
@@ -106,49 +115,56 @@ calls \fIspell\fP.
Allow nano to be suspended with ^Z.
.TP
\fBset tabsize \fIn\fP\fP
Use a tab size of \fIn\fP instead of the default (8); must be greater
Use a tab size of \fIn\fP instead of the default (8); must be greater
than 0.
.TP
\fBset/unset tempfile\fP
Save automatically on exit, don't prompt.
.TP
\fBset/unset historylog\fP
Enable ~/.nano_history for saving and reading search/replace strings.
.TP
\fBset/unset view\fP
Disallow file modification.
.TP
.B syntax "\fIstr\fP" ["\fIfileregex\fP" ... ]
Defines a syntax named \fIstr\fP which can be activated via the
\fB-Y\fP flag, or will be automatically activated if the current
filename matches \fIfileregex\fP. All following \fBcolor\fP statements
will apply to \fIsyntax\fP until a new syntax is defined.
Defines a syntax named \fIstr\fP which can be activated via the \fB-Y\fP
flag, or will be automatically activated if the current filename matches
\fIfileregex\fP. All following \fBcolor\fP statements will apply to
\fIsyntax\fP until a new syntax is defined.
.TP
.B color \fIfgcolor\fP[,\fIbgcolor\fP] "\fIregex\fP" ...
For the currently defined syntax, display all expressions matching
\fIregex\fP with foreground color \fIfgcolor\fP and optional background
color \fIbgcolor\fP. Legal colors for foreground and background color are:
white, black, red, blue, green, yellow, magenta, and cyan. You may use
the prefix "bright" to force a stronger color highlight. If your
terminal supports transparency, not specifying a \fIbgcolor\fP tells
For the currently defined syntax, display all expressions matching
\fIregex\fP with foreground color \fIfgcolor\fP and optional background
color \fIbgcolor\fP. Legal colors for foreground and background color
are: white, black, red, blue, green, yellow, magenta, and cyan. You may
use the prefix "bright" to force a stronger color highlight. If your
terminal supports transparency, not specifying a \fIbgcolor\fP tells
\fBnano\fP to attempt to use a transparent background.
.TP
.B color \fIfgcolor\fP[,\fIbgcolor\fP] start="\fIsr\fP" end="\fIer\fP"
Display expressions which start with \fIsr\fP and end with \fIer\fP
with foreground color \fIfgcolor\fP and optional
background color \fIbgcolor\fP. This allows syntax highlighting to span
multiple lines. Note that all subsequent instances of \fIsr\fP after
an initial \fIsr\fP is found will be highlighted until the first
instance of \fIer\fP.
Display expressions which start with \fIsr\fP and end with \fIer\fP
with foreground color \fIfgcolor\fP and optional background color
\fIbgcolor\fP. This allows syntax highlighting to span multiple lines.
Note that all subsequent instances of \fIsr\fP after an initial \fIsr\fP
is found will be highlighted until the first instance of \fIer\fP.
\fI
.SH FILES
.TP
.I SYSCONFDIR/nanorc
System-wide configuration file
.TP
.I ~/.nanorc
Per-user configuration file
.SH SEE ALSO
.PD 0
.TP
\fBnano\fP(1)
.PP
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your system)
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your
system)
.SH AUTHOR
Chris Allegretta <chrisa@asty.org>, et al (see AUTHORS and THANKS for
details).
Chris Allegretta <chrisa@asty.org>, et al (see
.I AUTHORS
and
.I THANKS
for details).
This manual page was written by Jordi Mallach <jordi@gnu.org>.

212
doc/nanorc.sample Normal file
View File

@@ -0,0 +1,212 @@
## Sample initialization file for GNU nano
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read! Also note that characters specially
## interpreted by the shell should not be escaped here.
##
## To make sure a value is not enabled, use "unset <option>"
##
## For the options that take parameters, the default value is given.
## Other options are unset by default.
## Use auto-indentation
# set autoindent
## Backup files to filename~
# set backup
## Constantly display the cursor position in the status bar.
# set const
## Use cut to end of line with ^K by default
# set cut
## Set the line length for wrapping text and justifying paragraphs.
## If fill is negative, the line length will be the screen width less
## this number.
##
# set fill -8
## Enable ~/.nano_history for saving and reading search/replace strings.
# set historylog
## Allow multiple file buffers (using ^R inserts into separate buffer).
## You must have configured with --enable-multibuffer or --enable-extra
## for this to work.
##
## set multibuffer
## Don't convert files from DOS/Mac format
# set noconvert
## Don't follow symlinks when writing files
# set nofollow
## Don't display the help lists at the bottom of the screen
# set nohelp
## Don't wrap text at all
# set nowrap
## Set operating directory. nano will not read or write files outside
## this directory and its subdirectories. Also, the current directory
## is changed to here, so files are inserted from this dir. A blank
## string means the operating directory feature is turned off.
##
# set operatingdir ""
## Preserve the XON and XOFF keys (^Q and ^S)
# set preserve
## The email-quote string, used to justify email-quoted paragraphs.
## This is an extended regular expression if your system supports them,
## otherwise a literal string. Default:
# set quotestr "^([ ]*[\|>:}#])+"
## if you have regexps, otherwise:
# set quotestr "> "
## You can get old nano quoted-justify behavior via:
# set quotestr "(> )+"
## Fix Backspace if it acts like Delete
# set rebinddelete
## Do extended regular expression searches by default
# set regexp
## Use smooth scrolling as the default
# set smooth
## Use this spelling checker instead of the internal one. This option
## does not properly have a default value.
##
# set speller "aspell -c"
## Allow nano to be suspended with ^Z
# set suspend
## Use this tab size instead of the default; it must be greater than 0
# set tabsize 8
## Save automatically on exit, don't prompt
# set tempfile
## Disallow file modification, why would you want this in an rc file? ;)
# set view
## Color setup
## Format:
## syntax "short description" ["filename regex" ...]
## color foreground,background "regex" ["regex"...]
##
## Legal colors: white, black, red, blue, green, yellow, magenta, cyan.
## You may use the prefix "bright" to mean a stronger color highlight.
##
## To use multi-line regexes use the start="regex" end="regex" format.
##
## If your system supports transparency, not specifying a background
## color will use a transparent color. If you don't want this, be sure
## to set the background color to black or white.
##
# syntax "c-file" "\.(c|h)$"
# color red "\<[A-Z_]{2,}\>"
# color green "\<(float|char|int|void|static|const|struct)\>"
# color brightyellow "\<(if|while|do|else|case|switch)\>"
# color brightcyan "^ *# *(define|include|ifn?def|endif|elif|else|if)"
##
## 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 "<[^= ]*>" ""(\\.|[^\"])*""
##
## This string is VERY resource intensive!!!
# color brightyellow start=""(\\.|[^\"])*\\ *$" end="^(\\.|[^\"])*""
##
## And we want to have some nice comment highlighting too
# color brightblue "//.*"
# color brightblue start="/\*" end="\*/"
## Here is a short example for HTML
# syntax "HTML" "\.html$"
# color blue start="<" end=">"
# color red "&[^; ]*;"
## Here is a short example for TeX files
# syntax "TeX" "\.tex$"
# color green "\\.|\\[A-Za-z]*"
# color magenta "[{}]"
# color blue "%.*"
## Here is an example for quoted emails (under e.g. mutt)
# syntax "mutt"
# color green "^>.*"
## Here is an example for groff
##
# syntax "groff" "\.ms$" "\.mm$" "\.me$" "\.tmac$" "^tmac." ".rof"
## The argument of .nr or .ds
# color cyan "^\.ds [^ ]*"
# color cyan "^\.nr [^ ]*"
## Single character escapes
# color brightmagenta "\\."
## Highlight the argument of \f or \s in the same color
# color brightmagenta "\\f."
# color brightmagenta "\\f\(.."
# color brightmagenta "\\s(\+|\-)?[0-9]"
## \n
# color cyan "(\\|\\\\)n."
# color cyan "(\\|\\\\)n\(.."
# color cyan start="(\\|\\\\)n\[" end="]"
## Requests
# color brightgreen "^\. *[^ ]*"
## Comments
# color yellow "^\.\\\".*$"
## Strings
# color green "(\\|\\\\)\*."
# color green "(\\|\\\\)\*\(.."
# color green start="(\\|\\\\)\*\[" end="]"
## Characters
# color brightred "\\\(.."
# color brightred start="\\\[" end="]"
## Macro arguments
# color brightcyan "\\\\\$[1-9]"
## Here is an example for perl
##
# syntax "perl" "\.p[lm]$"
# color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork)|get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join|keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek|seekdir|se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr|y|truncate|umask|un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
# color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
# color cyan start="[$@%]" end="( |\\W|-)"
# color yellow "".*"|qq\|.*\|"
# color white "[sm]/.*/"
# color white start="(^use| = new)" end=";"
# color green "#.*"
# color yellow start="<< 'STOP'" end="STOP"
## Here is an example for Java source
##
# syntax "Java source" "\.java$"
# color green "\<(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\>"
# color red "\<(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\>"
# color cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>"
# color red ""[^\"]*""
# color yellow "\<(true|false|null)\>"
# color blue "//.*"
# color blue start="/\*" end="\*/"
# color brightblue start="/\*\*" end="\*/"
# color brightgreen,green " +$"
## Here is an example for your .nanorc
##
#syntax "nanorc" "(\.|/|)nanorc$"
## highlight possible errors and parameters
#color brightwhite "^ *(set|unset|syntax|color).*$"
## set, unset and syntax
#color cyan "^ *(set|unset) +(autoindent|backup|const|cut|fill|historylog|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|rebinddelete|regexp|smooth|speller|suspend|tabsize|tempfile|view)"
#color green "^ *(set|unset|syntax)\>"
## colors
#color yellow "^ *color +(bright)?(white|black|red|blue|green|yellow|magenta|cyan)(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
#color magenta "^ *color\>" "\<(start|end)="
## strings
#color white "\"(\\.|[^\"])*\""
## comments
#color blue "^ *#.*$"

4
doc/texinfo/.cvsignore Normal file
View File

@@ -0,0 +1,4 @@
Makefile
Makefile.in
nano.info
texinfo.tex

5
doc/texinfo/Makefile.am Normal file
View File

@@ -0,0 +1,5 @@
info_TEXINFOS = nano.texi
MAKEINFO = makeinfo --no-split
EXTRA_DIST = nano.info

View File

@@ -8,8 +8,8 @@
@c Run `makeinfo' rather than `texinfo-format-buffer'.
@smallbook
@set EDITION 0.1
@set VERSION 1.2.0
@set UPDATED 17 Jan 2003
@set VERSION 1.3.0
@set UPDATED 22 Oct 2003
@dircategory Editors
@direntry
@@ -23,7 +23,7 @@
@titlepage
@title GNU @code{nano}
@subtitle a small and friendly text editor.
@subtitle version 1.2.0
@subtitle version 1.3.0
@author Chris Allegretta
@page
@@ -95,10 +95,10 @@ internationalization support, and filename tab completion.
The original goal for @code{nano} was a complete bug-for-bug compatible
emulation of Pico, but nano's main goal is to be as compatible as
possible while offering a superset of Pico's functionality.
Also see @xref{Pico Compatibility}, for other differences.
possible while offering a superset of Pico's functionality. Also see
@xref{Pico Compatibility}, for other differences.
Email bug reports to @email{nano@@nano-editor.org}.
Email bug reports to @email{nano@@nano-editor.org}.
@node Command Line Options, , Overview, Introduction
@section Command Line Options
@@ -118,14 +118,9 @@ Write file in DOS format.
Enable multiple file buffers, if available.
@item -I, --ignorercfiles
Don't look at $SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
Don't look at SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
available.
@item -K, --keypad
Do not use the ncurses keypad() call unless necessary. Try this flag if
you find that the arrow keys on the numeric keypad do not work for you
under @code{nano}.
@item -M, --mac
Write file in Mac format.
@@ -151,7 +146,7 @@ Enable smooth scrolling.
@item -T [num], --tabsize=[num]
Set the displayed tab length to [num] columns.
@item -V, --version
@item -V, --version
Print the version number and copyright and quit.
@item -Y, --syntax=[str]
@@ -161,6 +156,11 @@ available.
@item -c, --const
Constantly display the cursor position and line number on the statusbar.
@item -d, --rebinddelete
Interpret the Delete key differently so that both Backspace and Delete
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
@item -h, --help
Print the usage and exit.
@@ -181,18 +181,18 @@ Enables the use of the mouse to select text (currently only useful for
running under the X window system).
@item -o [dir], --operatingdir=[dir]
Set operating directory. Makes @code{nano} set up something similar to a
chroot.
Set operating directory. Makes @code{nano} set up something similar to
a chroot.
@item -p, --preserve
Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the editor
can be can be stopped and started.
Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the
editor can be can be stopped and started.
@item -r [#cols], --fill=[#cols].
Wrap lines at column #cols. By default this is the width of the screen,
less eight. If this value is negative, wrapping will occur at #cols from
the right of the screen, allowing it to vary along with the screen width
if the screen is resized.
less eight. If this value is negative, wrapping will occur at #cols
from the right of the screen, allowing it to vary along with the screen
width if the screen is resized.
@item -s [prog], --speller=[prog]
Invoke [prog] as the spell checker. By default, @code{nano} uses its
@@ -206,21 +206,21 @@ composer of a mailer program.
@anchor{Expert Mode}
@item -x, --nohelp
In Expert Mode, the Shortcut Lists will not appear at the bottom of the
screen. This affects the location of the statusbar as well, as in Expert
Mode it is located at the very bottom of the editor.
In Expert Mode, the Shortcut Lists will not appear at the bottom of the
screen. This affects the location of the statusbar as well, as in
Expert Mode it is located at the very bottom of the editor.
Note: When accessing the help system, Expert Mode is temporarily disabled
to display the help system navigation keys.
Note: When accessing the help system, Expert Mode is temporarily
disabled to display the help system navigation keys.
@item -v, --view
Do not allow the contents of the file to be altered. Note that this
flag should NOT be used in place of correct file permissions to implement
a read-only file.
flag should NOT be used in place of correct file permissions to
implement a read-only file.
@item -w, --nowrap
Do not wrap long lines at any length. This option overrides any value for
-r.
Do not wrap long lines at any length. This option overrides any value
for -r.
@item -z, --suspend
Enable suspend ability of @code{nano} using the system's suspend
@@ -249,38 +249,41 @@ Start at line number LINE instead of the default of line 1.
All key sequences in @code{nano} are entered using the keyboard.
@code{nano} is a ``modeless'' editor. All keys with the exception of
Control and Meta key sequences will enter text into the file being
edited.
edited.
@node Special Functions, The Titlebar, Entering Text, Editor Basics
@section Special Functions
Special functions use the Control key (displayed in the help and
shortcut lists as ^) or the Meta key (displayed as M).
shortcut lists as ^), the Meta key (displayed as M), or the Esc key.
@itemize @bullet
@item
Control key sequences are entered by holding down the Control key and
pressing the desired letter.
pressing the desired key, or by pressing the Esc key twice and pressing
the desired key.
@item
Meta key sequences can be entered in a number of
possible ways: Pressing the Escape key, then releasing it and pressing
the desired key, or holding down the Alt key while pressing the desired
key. This varies from keyboard to keyboard, and certain commercial
operating systems ``swallow'' the Alt key so that it never reaches the
application. If your operating system does this, you should use the
Escape key to generate Meta key sequences.
Pressing Esc twice and then typing a three-digit number from 000 to 255
will enter the character with the corresponding ASCII code.
@item
Meta key sequences can be entered in a number of possible ways: Pressing
the Escape key, then releasing it and pressing the desired key, or
holding down the Alt key while pressing the desired key. This varies
from keyboard to keyboard, and certain commercial operating systems
``swallow'' the Alt key so that it never reaches the application. If
your operating system does this, you should use the Escape key to
generate Meta key sequences.
@end itemize
@node The Titlebar, The Statusbar, Special Functions, Editor Basics
@section The Titlebar
The titlebar is the line displayed at the top of the editor. There are
three sections: left, center and right. The section on the left displays
the version of @code{nano} being used. The center section displays the
current file name, or ``New Buffer'' if the file has not yet been named.
The section on the right will display ``Modified'' if the file has been
modified since it was last saved or opened.
three sections: left, center and right. The section on the left
displays the version of @code{nano} being used. The center section
displays the current file name, or ``New Buffer'' if the file has not
yet been named. The section on the right will display ``Modified'' if
the file has been modified since it was last saved or opened.
Special modes: When @code{nano} is in ``File browser'' mode, the center
section will display the current directory instead of the filename.
@@ -302,13 +305,13 @@ the statusbar.
@section Shortcut Lists
The Shortcut Lists are the two lines at the bottom of the screen which
show some of the more commonly used functions in the editor.
show some of the more commonly used functions in the editor.
@node Online Help, Feature Toggles, Editor Basics, Top
@chapter Online Help
The online help system in @code{nano} is available by pressing ^G.
It is fairly self explanatory, documenting the various parts of the
It is fairly self explanatory, documenting the various parts of the
editor and available keystrokes. Navigation is via the ^Y (Page Up)
and ^V (Page Down) keys. ^X exits the help system.
@@ -317,8 +320,8 @@ and ^V (Page Down) keys. ^X exits the help system.
@chapter Feature Toggles
Toggles allow you to change certain aspects of the editor that
would normally be done via command line flags. They are invoked via
certain Meta key sequences. @xref{Special Functions}, for more info.
would normally be done via command line flags. They are invoked via
certain Meta key sequences. @xref{Special Functions}, for more info.
The following global toggles are available:
@table @code
@@ -375,7 +378,7 @@ find the desired file.
Basic movement in the file browser is accomplished with the arrow keys
and page up/down. The behavior of the enter (or `s') key varies by what
is currently selected. If the currently selected object is a directory,
the file browser will enter and display the contents of the directory.
the file browser will enter and display the contents of the directory.
If the object is a file, this filename and path are copied to the
statusbar and the file browser is exited.
@@ -387,16 +390,16 @@ are certain differences between the editors:
@table @code
@item Search and Replace History
As of version 1.2.0 of @code{nano}, text entered as search or replace
strings will be stored and can be accessed with the up/down
arrow keys. Previously, @code{nano} offered a more consistent, but incompatible
with Pico, method for entering search and replace strings. In the old
method, previous entries would be displayed by default as editable text
in front of the cursor, as opposed to being bracketed and uneditable as
it is in Pico. The old behavior could be made compatible with Pico via the
@code{-p} flag, but recent versions of Pico use the @code{-p} flag
to preserve the XON and XOFF sequences within the editor. Since with the new
method search and replace strings can still be edited by simply
As of version 1.2.2 of @code{nano}, text entered as search or replace
strings will be stored and can be accessed with the up/down arrow keys.
Previously, @code{nano} offered a more consistent, but incompatible with
Pico, method for entering search and replace strings. In the old
method, previous entries would be displayed by default as editable text
in front of the cursor, as opposed to being bracketed and uneditable as
it is in Pico. The old behavior could be made compatible with Pico via
the @code{-p} flag, but recent versions of Pico use the @code{-p} flag
to preserve the XON and XOFF sequences within the editor. Since with
the new method search and replace strings can still be edited by simply
hitting the up arrow key once, the old method was removed completely.
@@ -405,13 +408,12 @@ Text selected using the Control-Caret (^^) key can be written out or
appended to a new or existing file using the Writeout key (^O).
@item Toggles
Many options which alter the functionality of the program can be
"toggled" on or off using Meta key sequences, meaning the program does
not have to be restarted to turn a particular feature of the editor
on or off. Please see the internal help function (^G) for a list of
what functions can be toggled for a particular version of
@code{nano}. Also see @xref{Feature Toggles}, though this may be out
of date.
Many options which alter the functionality of the program can be
"toggled" on or off using Meta key sequences, meaning the program does
not have to be restarted to turn a particular feature of the editor on
or off. Please see the internal help function (^G) for a list of what
functions can be toggled for a particular version of @code{nano}. Also
see @xref{Feature Toggles}, though this may be out of date.
@item Cursor Position Display
The output of the "Display Cursor Position" in @code{nano} displays
@@ -420,21 +422,21 @@ position of the cursor.
@item Interactive Replace and Spell Checker
It is worth noting that the @code{nano} replace function is interactive,
i.e. it does not stop after one search string is found and automatically
i.e, it does not stop after one search string is found and automatically
replace it. The @code{nano} implementation will stop at each search
string found and query whether to replace this instance or not. The
internal spell checker operates similarly. Note that these is no way
to force these functions to behave in the Pico fashion. As of
version 1.2.0, misspelled words are sorted and trimmed for
uniqueness in the internal spell checker such that the words 'apple'
and 'Apple' will be prompted for correction separately.
string found and query whether to replace this instance or not. The
internal spell checker operates similarly. Note that these is no way to
force these functions to behave in the Pico fashion. As of version
1.2.2, misspelled words are sorted and trimmed for uniqueness in the
internal spell checker such that the words 'apple' and 'Apple' will be
prompted for correction separately.
@end table
@node Building and Configure Options, , Pico Compatibility, Top
@chapter Building and Configure Options
Building @code{nano} from source is fairly straightforward if you are familiar
with compiling programs with autoconf support:
Building @code{nano} from source is fairly straightforward if you are
familiar with compiling programs with autoconf support:
@itemize @bullet
@item tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano)
@@ -486,7 +488,7 @@ Disable all word wrapping in the editor. This also eliminates the -w
command line flag, as nonwrapping is then the default behavior.
@item --disable-nls
Disables Native Language support. This will make the available GNU
Disables Native Language support. This will make the available GNU
@code{nano} translations unusable.
@item --with-slang

230
move.c
View File

@@ -1,230 +0,0 @@
/* $Id$ */
/**************************************************************************
* move.c *
* *
* Copyright (C) 1999-2003 Chris Allegretta *
* 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) *
* 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., 675 Mass Ave, Cambridge, MA 02139, USA. *
* *
**************************************************************************/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "proto.h"
#include "nano.h"
int do_home(void)
{
UNSET(KEEP_CUTBUFFER);
current_x = 0;
placewewant = 0;
update_line(current, current_x);
return 1;
}
int do_end(void)
{
UNSET(KEEP_CUTBUFFER);
current_x = strlen(current->data);
placewewant = xplustabs();
update_line(current, current_x);
return 1;
}
void page_up(void)
{
if (edittop != fileage) {
#ifndef NANO_SMALL
if (ISSET(SMOOTHSCROLL))
edit_update(edittop->prev, TOP);
else
#endif
{
edit_update(edittop, CENTER);
/* Now that we've updated the edit window, edittop might be
at the top of the file; if so, just move the cursor up one
line and don't center it. */
if (edittop != fileage)
center_cursor();
else
reset_cursor();
}
} else
current_y = 0;
update_cursor();
}
int do_page_up(void)
{
int i;
wrap_reset();
current_x = 0;
placewewant = 0;
if (current == fileage)
return 0;
current_y = 0;
current = edittop;
for (i = 0; i <= editwinrows - 3 && current->prev != NULL; i++)
current = current->prev;
edit_update(current, TOP);
update_cursor();
UNSET(KEEP_CUTBUFFER);
check_statblank();
return 1;
}
int do_page_down(void)
{
wrap_reset();
current_x = 0;
placewewant = 0;
if (current == filebot)
return 0;
/* AHEM, if we only have a screen or less of text, DON'T do an
edit_update(), just move the cursor to editbot! */
if (edittop == fileage && editbot == filebot && totlines < editwinrows) {
current = editbot;
reset_cursor();
#ifndef NANO_SMALL
/* ...unless marking is on, in which case we need it to update
the highlight. */
if (ISSET(MARK_ISSET))
edit_update(current, NONE);
#endif
} else if (editbot != filebot || edittop == fileage) {
current_y = 0;
current = editbot;
if (current->prev != NULL)
current = current->prev;
if (current->prev != NULL)
current = current->prev;
edit_update(current, TOP);
} else {
while (current != filebot) {
current = current->next;
current_y++;
}
edit_update(edittop, TOP);
}
update_cursor();
UNSET(KEEP_CUTBUFFER);
check_statblank();
return 1;
}
int do_up(void)
{
wrap_reset();
if (current->prev != NULL) {
current_x = actual_x(current->prev, placewewant);
current = current->prev;
if (current_y > 0) {
update_line(current->next, 0);
/* It is necessary to change current first, so the mark
display will change! */
current_y--;
update_line(current, current_x);
} else
page_up();
UNSET(KEEP_CUTBUFFER);
check_statblank();
}
return 1;
}
/* Return value 1 means we moved down, 0 means we were already at the
* bottom. */
int do_down(void)
{
wrap_reset();
UNSET(KEEP_CUTBUFFER);
check_statblank();
if (current->next == NULL)
return 0;
current = current->next;
current_x = actual_x(current, placewewant);
/* Note current_y is zero-based. This test checks for the cursor's
* being on the last row of the edit window. */
if (current_y == editwinrows - 1) {
#ifndef NANO_SMALL
if (ISSET(SMOOTHSCROLL)) {
/* In this case current_y does not change. The cursor
* remains at the bottom of the edit window. */
edittop = edittop->next;
editbot = editbot->next;
edit_refresh();
} else
#endif
{
/* Set edittop so editbot->next (or else editbot) is
* centered, and set current_y = editwinrows / 2. */
edit_update(editbot->next != NULL ? editbot->next : editbot, CENTER);
center_cursor();
}
} else {
update_line(current->prev, 0);
update_line(current, current_x);
current_y++;
}
return 1;
}
int do_left(void)
{
if (current_x > 0)
current_x--;
else if (current != fileage) {
do_up();
current_x = strlen(current->data);
}
placewewant = xplustabs();
update_line(current, current_x);
UNSET(KEEP_CUTBUFFER);
check_statblank();
return 1;
}
int do_right(void)
{
assert(current_x <= strlen(current->data));
if (current->data[current_x] != '\0')
current_x++;
else if (current->next != NULL) {
do_down();
current_x = 0;
}
placewewant = xplustabs();
update_line(current, current_x);
UNSET(KEEP_CUTBUFFER);
check_statblank();
return 1;
}

View File

@@ -1,272 +0,0 @@
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
</HEAD><BODY>
<H1>NANO</H1>
Section: User Commands (1)<BR>Updated: February 9, 2003<BR><A HREF="#index">Index</A>
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<P>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
nano - Nano's ANOther editor, an enhanced free Pico clone
<P>
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>nano</B>
<I>[+LINE]&nbsp;[options]&nbsp;[file]</I>
<BR>
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
This manual page documents briefly the <B>nano</B> command.
<P>
<B>nano</B> is a small, free and friendly editor which aims to replace
Pico, the default editor included in the non-free Pine package. Rather
than just copying Pico's look and feel, <B>nano</B> also implements some
missing (or disabled by default) features in Pico, such as &quot;search and
replace&quot; and &quot;go to line number&quot;.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT><B>+</B><I>LINE</I>
<DD>
Places cursor at <I>LINE</I> on startup.
<DT><B>-B (--backup)</B>
<DD>
When saving a file, back up the previous version of it to the current
filename suffixed with a ~.
<DT><B>-D (--dos)</B>
<DD>
Write file in DOS format.
<DT><B>-F (--multibuffer)</B>
<DD>
Enable multiple file buffers, if available.
<DT><B>-H (--historylog)</B>
<DD>
Log search and replace strings to ~/.nano_history so they may be
stored for later editing, if nanorc support is configured.
<DT><B>-I (--ignorercfiles)</B>
<DD>
Don't look at $SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
available.
<DT><B>-K (--keypad)</B>
<DD>
Do not use the ncurses keypad() call unless necessary. Try this flag if
you find that the arrow keys on the numeric keypad do not work for you
under nano.
<DT><B>-M (--mac)</B>
<DD>
Write file in Mac format.
<DT><B>-N (--noconvert)</B>
<DD>
Disable automatic conversion of files from DOS/Mac format.
<DT><B>-Q </B><I>str</I> (--quotestr=<I>str</I>)
<DD>
Set the quoting string for justifying. The default is
&quot;^([ \t]*[|&gt;:}#])+&quot; if regular expression support is available, or
&quot;&gt; &quot; otherwise.
<DT><B>-R (--regexp)</B>
<DD>
Enable regular expression matching for search strings, as well as
\n subexpression replacement for replace strings, if available.
<DT><B>-S (--smooth)</B>
<DD>
Enable smooth scrolling. Text will scroll line-by-line, instead of the
usual chunk-by-chunk behavior.
<DT><B>-T </B><I>num</I> (--tabsize=<I>num</I>)
<DD>
Set the size (width) of a tab.
<DT><B>-V (--version)</B>
<DD>
Show the current version number and author.
<DT><B>-Y </B><I>str</I> (--syntax=<I>str</I>)
<DD>
Specify a specific syntax highlighting from the .nanorc to use, if
available.
<DT><B>-c (--const)</B>
<DD>
Constantly show the cursor position.
<DT><B>-h (--help)</B>
<DD>
Display a summary of command line options.
<DT><B>-i (--autoindent)</B>
<DD>
Indent new lines to the previous line's indentation. Useful when editing
source code.
<DT><B>-k (--cut)</B>
<DD>
Enable cut from cursor to end of line with ^K.
<DT><B>-l (--nofollow)</B>
<DD>
If the file being edited is a symbolic link, replace the link with
a new file, do not follow it. Good for editing files in /tmp, perhaps?
<DT><B>-m (--mouse)</B>
<DD>
Enable mouse support (if available for your system).
<DT><B>-o </B><I>dir</I> (--operatingdir=<I>dir</I>)
<DD>
Set operating directory. Makes nano set up something similar to a
chroot.
<DT><B>-p (--preserve)</B>
<DD>
Preserve the XON and XOFF sequences (^Q and ^S) so they will be
caught by the terminal.
<DT><B>-r </B><I>cols</I> (--fill=<I>cols</I>)
<DD>
Wrap lines at column <I>cols</I>. By default, this is the width of the
screen, less eight. If this value is negative, wrapping will occur at
<I>cols</I> columns from the right of the screen, allowing the wrap point
to vary along with the screen width if resized.
<DT><B>-s </B><I>prog</I> (--speller=<I>prog</I>)
<DD>
Enable alternative spell checker command.
<DT><B>-t (--tempfile)</B>
<DD>
Always save changed buffer without prompting. Same as Pico -t option.
<DT><B>-v (--view)</B>
<DD>
View file (read only) mode.
<DT><B>-w (--nowrap)</B>
<DD>
Disable wrapping of long lines.
<DT><B>-x (--nohelp)</B>
<DD>
Disable help screen at bottom of editor.
<DT><B>-z (--suspend)</B>
<DD>
Enable suspend ability.
<DT><B>-a, -b, -e, -f, -g, -j</B>
<DD>
Ignored, for compatibility with Pico.
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>INITIALIZATION FILE</H2>
<B>nano</B> will read initialization files in the following
order: $SYSCONFDIR/nanorc, then ~/.nanorc. Please see <A HREF="http://localhost/cgi-bin/man/man2html?5+nanorc">nanorc</A>(5) and
the example file <B>nanorc.sample</B> which should be provided with
<B>nano</B>.
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>NOTES</H2>
<B>nano</B> will try to dump the buffer into an emergency file in some
cases. Mainly, this will happen if <B>nano</B> receives a SIGHUP or
SIGTERM or runs out of memory, when it will write the buffer into a file
named &quot;nano.save&quot; if the buffer didn't have a name already, or will add
a &quot;.save&quot; suffix to the current filename. If an emergency file with that
name already exists in the current directory, &quot;.save&quot; and a number (e.g.
&quot;.save.1&quot;) will be suffixed to the current filename in order to make it
unique. In multibuffer mode, <B>nano</B> will write all the open buffers
to the respective emergency files.
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>BUGS</H2>
Please send any comments or bug reports to
<BR>
<B><A HREF="mailto:nano@nano-editor.org">nano@nano-editor.org</A>.</B>
<BR>
The <B>nano</B> mailing list is available from
<BR>
<B><A HREF="mailto:nano-devel@gnu.org">nano-devel@gnu.org</A>.</B>
To subscribe, email to <A HREF="mailto:nano-devel-request@gnu.org">nano-devel-request@gnu.org</A> with a
subject of &quot;subscribe&quot;.
<P>
<A NAME="lbAI">&nbsp;</A>
<H2>HOMEPAGE</H2>
<A HREF="http://www.nano-editor.org/">http://www.nano-editor.org/</A>
<P>
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<DL COMPACT>
<DT><B><A HREF="http://localhost/cgi-bin/man/man2html?5+nanorc">nanorc</A></B>(5)<DD>
</DL>
<P>
<I>/usr/share/doc/nano/</I> (or equivalent on your system)
<P>
<A NAME="lbAK">&nbsp;</A>
<H2>AUTHOR</H2>
Chris Allegretta &lt;<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>&gt;, et al (see AUTHORS and THANKS for
details).
This manual page was originally written by Jordi Mallach
&lt;<A HREF="mailto:jordi@sindominio.net">jordi@sindominio.net</A>&gt;, for the Debian GNU system (but may be
used by others).
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT><A HREF="#lbAE">OPTIONS</A><DD>
<DT><A HREF="#lbAF">INITIALIZATION FILE</A><DD>
<DT><A HREF="#lbAG">NOTES</A><DD>
<DT><A HREF="#lbAH">BUGS</A><DD>
<DT><A HREF="#lbAI">HOMEPAGE</A><DD>
<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
<DT><A HREF="#lbAK">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 04:08:28 GMT, February 13, 2003
</BODY>
</HTML>

View File

@@ -1,160 +0,0 @@
<HTML><HEAD><TITLE>Manpage of NANORC</TITLE>
</HEAD><BODY>
<H1>NANORC</H1>
Section: File Formats (5)<BR>Updated: February 9, 2003<BR><A HREF="#index">Index</A>
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
nanorc - GNU nano's rcfile
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>/etc/nanorc</B>
<B>$HOME/.nanorc</B>
<BR>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
This manual page documents GNU <B>nano</B>'s rcfile.
<P>
<B>nano</B> is a small, free and friendly editor which aims to replace
Pico, the default editor included in the non-free Pine package. Rather
than just copying Pico's look and feel, <B>nano</B> also implements some
missing (or disabled by default) features in Pico, such as &quot;search and
replace&quot; and &quot;go to line number&quot;.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
The configuration file accepts a series of &quot;set&quot; and &quot;unset&quot; commands,
which can be used to configure nano on startup without using the
command-line options. Additionally, the &quot;syntax&quot; and &quot;color&quot; keywords
are used to define syntax highlighting rules for different text patterns.
GNU nano will read one command per line.
<P>
Options in rcfiles take precedence over nano's defaults, and command line
options override rcfile settings.
<P>
The supported commands and arguments are:
<P>
<DL COMPACT>
<DT><B>set/unset autoindent</B><DD>
Use auto-indentation.
<DT><B>set/unset backup</B><DD>
Create backup files in filename~.
<DT><B>set/unset const</B><DD>
Constantly update the cursor position.
<DT><B>set/unset cut</B><DD>
Use cut to end of line with ^K by default.
<DT><B>set fill </B><I>n</I><DD>
Set the column where lines will be wrapped at to <I>n</I>.
<DT><B>set/unset keypad</B><DD>
Use alternate keypad routines.
<DT><B>set/unset multibuffer</B><DD>
Allow inserting files into their own buffers.
<DT><B>set/unset noconvert</B><DD>
Don't convert files from DOS/Mac format.
<DT><B>set/unset nofollow</B><DD>
Don't follow symlinks when writing files.
<DT><B>set/unset nohelp</B><DD>
Don't display the help lists at the bottom of the screen.
<DT><B>set/unset nowrap</B><DD>
Don't wrap text at all.
<DT><B>set operatingdir &quot;</B><I>directory</I>&quot;<DD>
Set operating directory (chroots the user to <I>directory</I> and below).
<DT><B>set/unset preserve</B><DD>
Preserve the XON and XOFF keys (^Q and ^S).
<DT><B>set quotestr &quot;</B><I>string</I>&quot;<DD>
The email-quote string. This is a &quot;regular expression&quot; if your
system supports them, otherwise a literal string.
Default value is set quotestr &quot;^([ ]*[|&gt;:}#])+&quot; if you have regexps,
otherwise set quotestr &quot;&gt; &quot;.
<DT><B>set/unset regexp</B><DD>
Do regular expression searches by default.
<DT><B>set/unset smooth</B><DD>
Use smooth scrolling by default.
<DT><B>set speller </B><I>spellprog</I><DD>
Use spelling checker <I>spellprog</I> instead of the default (spell).
<DT><B>set/unset suspend</B><DD>
Allow nano to be suspended with ^Z.
<DT><B>set tabsize </B><I>n</I><DD>
Use a tab size of <I>n</I> instead of the default (8); must be greater
than 0.
<DT><B>set/unset tempfile</B><DD>
Save automatically on exit, don't prompt.
<DT><B>set/unset historylog</B><DD>
Enable ~/.nano_history for saving and reading search/replace strings.
<DT><B>set/unset view</B><DD>
Disallow file modification.
<DT><B>syntax </B><I>str</I> [<I>fileregex</I> ... ]
<DD>
Defines a syntax named <I>str</I> which can be activated via the
<B>-Y</B> flag, or will be automatically activated if the current
filename matches <I>fileregex</I>. All following <B>color</B> statements
will apply to <I>syntax</I> until a new syntax is defined.
<DT><B>color </B><I>fgcolor</I>[,<I>bgcolor</I>] <I>regex</I> ...
<DD>
For the currently defined syntax, display all expressions matching
<I>regex</I> with foreground color <I>fgcolor</I> and optional background
color <I>bgcolor</I>. Legal colors for foreground and background color are:
white, black, red, blue, green, yellow, magenta, and cyan. You may use
the prefix &quot;bright&quot; to force a stronger color highlight. If your
terminal supports transparency, not specifying a <I>bgcolor</I> tells
<B>nano</B> to attempt to use a transparent background.
<DT><B>color </B><I>fgcolor</I>[,<I>bgcolor</I>] start=<I>sr</I> end=<I>er</I>
<DD>
Display expressions which start with <I>sr</I> and end with <I>er</I>
with foreground color <I>fgcolor</I> and optional
background color <I>bgcolor</I>. This allows syntax highlighting to span
multiple lines. Note that all subsequent instances of <I>sr</I> after
an initial <I>sr</I> is found will be highlighted until the first
instance of <I>er</I>.
<I>
<P>
</DL>
</I><A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>
<DL COMPACT>
<DT><B><A HREF="http://localhost/cgi-bin/man/man2html?1+nano">nano</A></B>(1)<DD>
</DL>
<P>
<I>/usr/share/doc/nano/examples/nanorc.sample</I> (or equivalent on your system)
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>
Chris Allegretta &lt;<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>&gt;, et al (see AUTHORS and THANKS for
details).
This manual page was written by Jordi Mallach &lt;<A HREF="mailto:jordi@gnu.org">jordi@gnu.org</A>&gt;.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT><A HREF="#lbAE">OPTIONS</A><DD>
<DT><A HREF="#lbAF">SEE ALSO</A><DD>
<DT><A HREF="#lbAG">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 04:08:33 GMT, February 13, 2003
</BODY>
</HTML>

View File

@@ -1,177 +0,0 @@
## Sample initialization file for GNU nano
## Please note that you must have configured nano with
## --enable-nanorc for this file to be read!
##
## To make sure a value is not enabled, use "unset <option>"
## Use auto-indentation
# set autoindent
## Backup files to filename~
# set backup
## Constantly update the cursor position
# set const
## Use cut to end of line with ^K by default
# set cut
## Use this value instead of the default
## An out-of-range negative value can make nano die complaining that the
## screen is too small
## set fill -8
## Use alternate keypad routines
# set keypad
## Allow multiple file buffers (using ^R inserts into separate buffer)
## You must have configured with --enable-multibuffer or --enable-extra
## for this to work
##
## set multibuffer
## Don't convert files from DOS/Mac format
# set noconvert
## Don't follow symlinks when writing files
# set nofollow
## Don't display the help lists at the bottom of the screen
# set nohelp
## Don't wrap text at all
# set nowrap
## Set operating directory (chroot of sorts)
# set operatingdir "~"
## Preserve the XON and XOFF keys (^Q and ^S)
# set preserve
## The email-quote string. This is a "regular expression" if your
## system supports them, otherwise a literal string. Default
# set quotestr "^([ \t]*[|>:}#])+" if you have regexps, otherwise
# set quotestr "> ".
## You can get old nano quoted-justify behavior via:
# set quotestr "(> )+"
## Do regular expression searches by default
# set regexp
## Use smooth scrolling as the default
# set smooth
## Use this spelling checker instead of the default one
# set speller aspell
## Allow nano to be suspended with ^Z
# set suspend
## Use this tab size instead of the default; it must be greater than 0
# set tabsize 4
## Save automatically on exit, don't prompt
# set tempfile
## Enable ~/.nano_history for saving and reading search/replace strings.
# set historylog
## Disallow file modification, why would you want this in an rc file? ;)
# set view
## Color setup
## Format:
## syntax "short description" ["filename regex" ...]
## color foreground,background "regex" ["regex"...]
##
## Legal colors are: white, black, red, blue, green, yellow, magenta,
## cyan. You may use the prefix "bright" to mean a stronger color
## highlight.
##
## To use multi-line regexes use the start="regex" end="regex" format.
##
## If your system supports transparency, not specifying a background
## color will use a transparent color. If you don't want this, be sure
## to set the background color to black or white.
# syntax "c-file" ".*\.c$" ".*\.h$"
# color red "\<[A-Z_]{2,}\>"
# color green "\<float\>" "\<char\>" "\<int\>" "\<void\>"
# color green "\<static\>" "\<const\>" "\<struct\>"
# color brightyellow "\<if\>" "\<while\>" "\<do\>" "\<else\>" "\<case\>" "\<switch\>"
# color brightcyan "#define" "#include" "#ifn*def" "#endif"
# color brightcyan "#elif" "#else" "#if"
## 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. Note that quotes in regexes should not be escaped (use "
## instead of \").
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
## This string is VERY resource intensive!!!
# color brightyellow start=""(\\.|[^\"])*\\( | )*$" end="^(\\.|[^\"])*""
## And we want to have some nice comment highlighting too
# color brightblue "//.*"
# color brightblue start="/\*" end="\*/"
## Here are some short examples for TeX files and HTML
# syntax "HTML" "\.html$"
#
# color blue start="<" end=">"
# color red "&([^; ])*;"
#
# syntax "TeX" "\.tex$"
#
# color green "\\(.|([A-Za-z]*))"
# color magenta "\{" "\}"
# color blue "%.*"
## For this you will probably want to set your editor to "nano -Y mutt"
# syntax "mutt"
# color green "^>.*"
## Here is are examples for groff and for your .nanorc
#syntax "groff" "\.ms$" "\.mm$" "\.me$" "\.tmac$" "^tmac." ".rof"
## The argument of .nr or .ds
#color cyan "^\.ds [^ ]*"
#color cyan "^\.nr [^ ]*"
## Single character escapes
#color brightmagenta "\\."
## Highlight the argument of \f or \s in the same colour
#color brightmagenta "\\f."
#color brightmagenta "\\f\(.."
#color brightmagenta "\\s(\+|\-)?[0-9]"
## \n
#color cyan "(\\|\\\\)n."
#color cyan "(\\|\\\\)n\(.."
#color cyan start="(\\|\\\\)n\[" end="]"
## Requests
#color brightgreen "^\. *[^ ]*"
## Comments
#color yellow "^\.\\\".*$"
## Strings
#color green "(\\|\\\\)\*."
#color green "(\\|\\\\)\*\(.."
#color green start="(\\|\\\\)\*\[" end="]"
## Characters
#color brightred "\\\(.."
#color brightred start="\\\[" end="]"
## Macro arguments
#color brightcyan "\\\\\$[1-9]"
#syntax "nanorc" "[\.]*nanorc$"
#color white "^ *(set|unset).*$"
#color cyan "^ *(set|unset) (autoindent|backup|const|cut|fill|keypad|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|regexp|smooth|speller|suspend|tabsize|tempfile|historylog|view)"
#color brightwhite "^ *syntax [^ ]*"
#color brightblue "^ *set\>" "^ *unset\>" "^ *syntax\>"
#color white "^ *color\>.*"
#color yellow "^ *color (bright)?(white|black|red|blue|green|yellow|magenta|cyan)\>"
#color magenta "^ *color\>"
#color green "^#.*$"

View File

@@ -1,3 +1,70 @@
2003-10-18 Jordi Mallach <jordi@gnu.org>
* ca.po: Updated Catalan translation.
2003-09-12 Jordi Mallach <jordi@gnu.org>
* POTFILES.in: Updated path to sources.
2003-09-01 Jordi Mallach <jordi@gnu.org>
* fr.po: Updated French translation by Jean-Philippe Guérard.
2003-08-17 Jordi Mallach <jordi@gnu.org>
* tr.po: Updated Turkish translation by A. Murat EREN.
2003-08-05 Jordi Mallach <jordi@gnu.org>
* ca.po: Updated Catalan translation.
2003-06-11 Jordi Mallach <jordi@gnu.org>
* nb.po: Updated Norwegian bokmål translation by Geir Helland.
2003-06-10 Jordi Mallach <jordi@gnu.org>
* fr.po: Updated French translation by Jean-Philippe Guérard.
2003-06-02 Jordi Mallach <jordi@gnu.org>
* de.po: Updated German translation by Michael Piefel.
2003-05-06 Jordi Mallach <jordi@gnu.org>
* ms.po: Malay translation by Sharuzzaman Ahmat Raslan.
2003-04-24 Jordi Mallach <jordi@gnu.org>
* ro.po: New Romanian translation by Laurentiu Buzdugan.
* id.po: Updated Indonesian translation by Tedi Heriyanto.
* LINGUAS: Added "ro" (Romanian).
2003-04-12 Jordi Mallach <jordi@gnu.org>
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
2003-04-04 Jordi Mallach <jordi@gnu.org>
* fr.po: Updated French translation by Jean-Philippe Guérard.
2003-03-17 Jordi Mallach <jordi@gnu.org>
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
2003-03-10 Jordi Mallach <jordi@gnu.org>
* da.po: Updated Danish translation by Keld Simonsen.
2003-03-06 Jordi Mallach <jordi@gnu.org>
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
* id.po: Updated Indonesian translation by Tedi Heriyanto.
2003-02-23 Jordi Mallach <jordi@gnu.org>
* nl.po: Updated Dutch translation by Guus Sliepen.
2003-02-19 Jordi Mallach <jordi@gnu.org>
* fi.po: Updated Finnish translation by Kalle Olavi Niemitalo.

View File

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

View File

@@ -2,16 +2,16 @@
# List of source files containing translatable strings.
# Package source files
cut.c
files.c
global.c
move.c
nano.c
rcfile.c
search.c
utils.c
winio.c
src/cut.c
src/files.c
src/global.c
src/move.c
src/nano.c
src/rcfile.c
src/search.c
src/utils.c
src/winio.c
# Package header files
nano.h
proto.h
src/nano.h
src/proto.h

1007
po/ca.po

File diff suppressed because it is too large Load Diff

755
po/cs.po

File diff suppressed because it is too large Load Diff

874
po/da.po

File diff suppressed because it is too large Load Diff

747
po/de.po

File diff suppressed because it is too large Load Diff

755
po/es.po

File diff suppressed because it is too large Load Diff

751
po/eu.po

File diff suppressed because it is too large Load Diff

739
po/fi.po

File diff suppressed because it is too large Load Diff

1166
po/fr.po

File diff suppressed because it is too large Load Diff

739
po/gl.po

File diff suppressed because it is too large Load Diff

751
po/hu.po

File diff suppressed because it is too large Load Diff

883
po/id.po

File diff suppressed because it is too large Load Diff

739
po/it.po

File diff suppressed because it is too large Load Diff

824
po/ms.po

File diff suppressed because it is too large Load Diff

1356
po/nb.po

File diff suppressed because it is too large Load Diff

744
po/nl.po

File diff suppressed because it is too large Load Diff

751
po/nn.po

File diff suppressed because it is too large Load Diff

739
po/pl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1710
po/ro.po Normal file

File diff suppressed because it is too large Load Diff

739
po/ru.po

File diff suppressed because it is too large Load Diff

743
po/sv.po

File diff suppressed because it is too large Load Diff

1336
po/tr.po

File diff suppressed because it is too large Load Diff

739
po/uk.po

File diff suppressed because it is too large Load Diff

4
src/.cvsignore Normal file
View File

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

22
src/Makefile.am Normal file
View File

@@ -0,0 +1,22 @@
DEFS= -DSYSCONFDIR=\"$(sysconfdir)\"
localedir = $(datadir)/locale
INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
ACLOCAL_AMFLAGS = -I m4
bin_PROGRAMS = nano
nano_SOURCES = color.c \
cut.c \
files.c \
global.c \
move.c \
nano.c \
nano.h \
proto.h \
rcfile.c \
search.c \
utils.c \
winio.c
nano_LDADD = @GLIB_LIBS@ @LIBINTL@

View File

@@ -91,7 +91,7 @@ void do_colorinit(void)
init_pair(tmpcolor->pairnum, tmpcolor->fg, background);
#ifdef DEBUG
fprintf(stderr, _("Running %s with fg = %d and bg = %d\n"),
fprintf(stderr, "Running %s with fg = %d and bg = %d\n",
"init_pair()", tmpcolor->fg, tmpcolor->bg);
#endif
}

View File

@@ -29,6 +29,12 @@
#include "nano.h"
static int marked_cut; /* Is the cutbuffer from a mark? */
#ifndef NANO_SMALL
static int concatenate_cut; /* Should we add this cut string to the
end of the last one? */
#endif
static filestruct *cutbottom = NULL;
/* Pointer to end of cutbuffer */
@@ -40,13 +46,22 @@ filestruct *get_cutbottom(void)
void add_to_cutbuffer(filestruct *inptr)
{
#ifdef DEBUG
fprintf(stderr, _("add_to_cutbuffer() called with inptr->data = %s\n"),
fprintf(stderr, "add_to_cutbuffer() called with inptr->data = %s\n",
inptr->data);
#endif
if (cutbuffer == NULL) {
cutbuffer = inptr;
inptr->prev = NULL;
#ifndef NANO_SMALL
} else if (concatenate_cut && !ISSET(JUSTIFY_MODE)) {
/* Just tack the text in inptr onto the text in cutbottom,
unless we're backing up lines while justifying text. */
cutbottom->data = charealloc(cutbottom->data,
strlen(cutbottom->data) + strlen(inptr->data) + 1);
strcat(cutbottom->data, inptr->data);
return;
#endif
} else {
cutbottom->next = inptr;
inptr->prev = cutbottom;
@@ -102,7 +117,7 @@ void cut_marked_segment(filestruct *top, size_t top_x, filestruct *bot,
/* Make the first cut line manually. */
tmp = copy_node(top);
newsize = (top == bot ? bot_x - top_x : strlen(top->data + top_x));
memmove(tmp->data, top->data + top_x, newsize);
charmove(tmp->data, top->data + top_x, newsize);
null_at(&tmp->data, newsize);
add_to_cutbuffer(tmp);
@@ -116,18 +131,16 @@ void cut_marked_segment(filestruct *top, size_t top_x, filestruct *bot,
if (top == bot) {
/* In this case, the remainder line is shorter, so we must
move text from the end forward first. */
memmove(top->data + top_x, bot->data + bot_x,
charmove(top->data + top_x, bot->data + bot_x,
newsize - top_x);
top->data = (char *)nrealloc(top->data,
sizeof(char) * newsize);
top->data = charealloc(top->data, newsize);
} else {
totsize -= bot_x + 1;
/* Here, the remainder line might get longer, so we
realloc() it first. */
top->data = (char *)nrealloc(top->data,
sizeof(char) * newsize);
memmove(top->data + top_x, bot->data + bot_x,
top->data = charealloc(top->data, newsize);
charmove(top->data + top_x, bot->data + bot_x,
newsize - top_x);
}
}
@@ -172,6 +185,9 @@ void cut_marked_segment(filestruct *top, size_t top_x, filestruct *bot,
new_magicline();
}
}
#ifdef DEBUG
dump_buffer(cutbuffer);
#endif
}
#endif
@@ -190,8 +206,11 @@ int do_cut_text(void)
free_filestruct(cutbuffer);
cutbuffer = NULL;
marked_cut = 0;
#ifndef NANO_SMALL
concatenate_cut = 0;
#endif
#ifdef DEBUG
fprintf(stderr, _("Blew away cutbuffer =)\n"));
fprintf(stderr, "Blew away cutbuffer =)\n");
#endif
}
@@ -204,6 +223,8 @@ int do_cut_text(void)
)
return 0;
SET(KEEP_CUTBUFFER);
#ifndef NANO_SMALL
if (ISSET(CUT_TO_END) && !ISSET(MARK_ISSET)) {
assert(current_x >= 0 && current_x <= strlen(current->data));
@@ -223,12 +244,10 @@ int do_cut_text(void)
}
do_delete();
SET(KEEP_CUTBUFFER);
marked_cut = 2;
return 1;
} else {
SET(MARK_ISSET);
SET(KEEP_CUTBUFFER);
mark_beginx = strlen(current->data);
mark_beginbuf = current;
@@ -249,6 +268,11 @@ int do_cut_text(void)
placewewant = xplustabs();
UNSET(MARK_ISSET);
/* If we just did a marked cut of part of a line, we should add
the first line of any cut done immediately afterward to the
end of this cut, as Pico does. */
if (current == mark_beginbuf && current_x < strlen(current->data))
concatenate_cut = 1;
marked_cut = 1;
if (dontupdate)
edit_refresh();
@@ -283,8 +307,10 @@ int do_cut_text(void)
edit_refresh();
set_modified();
marked_cut = 0;
#ifndef NANO_SMALL
concatenate_cut = 0;
#endif
placewewant = 0;
SET(KEEP_CUTBUFFER);
return 1;
}
@@ -296,7 +322,9 @@ int do_uncut_text(void)
filestruct *hold = current;
int i;
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
check_statblank();
if (cutbuffer == NULL || fileptr == NULL)
return 0; /* AIEEEEEEEEEEEE */
@@ -312,6 +340,11 @@ int do_uncut_text(void)
placewewant = 0;
}
/* If we're going to uncut on the magicline, always make a new
magicline in advance. */
if (current->next == NULL)
new_magicline();
if (marked_cut == 0 || cutbuffer->next != NULL)
{
newbuf = copy_filestruct(cutbuffer);
@@ -330,18 +363,14 @@ int do_uncut_text(void)
size_t buf_len = strlen(cutbuffer->data);
size_t cur_len = strlen(current->data);
current->data = nrealloc(current->data, cur_len + buf_len + 1);
memmove(current->data + current_x + buf_len,
current->data = charealloc(current->data, cur_len + buf_len + 1);
charmove(current->data + current_x + buf_len,
current->data + current_x, cur_len - current_x + 1);
strncpy(current->data + current_x, cutbuffer->data, buf_len);
/* Use strncpy() to not copy the terminal '\0'. */
current_x += buf_len;
totsize += buf_len;
/* If we've uncut a line, make sure there's a magicline after
it */
if (current->next == NULL)
new_magicline();
placewewant = xplustabs();
update_cursor();
@@ -426,7 +455,6 @@ int do_uncut_text(void)
edit_update(current, CENTER);
else
edit_refresh();
UNSET(KEEP_CUTBUFFER);
return 0;
}
@@ -464,6 +492,5 @@ int do_uncut_text(void)
#endif
set_modified();
UNSET(KEEP_CUTBUFFER);
return 1;
}

View File

@@ -236,7 +236,7 @@ int read_file(FILE *f, const char *filename, int quiet)
decrease it at all. We do free it at the end, though. */
if (i >= bufx - 1) {
bufx += 128;
buf = nrealloc(buf, bufx);
buf = charealloc(buf, bufx);
}
buf[i] = input;
buf[i + 1] = '\0';
@@ -326,6 +326,12 @@ int read_file(FILE *f, const char *filename, int quiet)
statusbar(P_("Read %d line", "Read %d lines", num_lines),
num_lines);
#ifndef NANO_SMALL
/* Set fileformat back to 0, now that we've read the file in and
possibly converted it from DOS/Mac format. */
fileformat = 0;
#endif
totlines += num_lines;
return 1;
@@ -427,13 +433,15 @@ int do_insertfile(int loading_file)
inspath[0] = '\0';
}
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
#if !defined(DISABLE_BROWSER) || !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
start_again: /* Goto here when the user cancels the file browser. */
#endif
#if !defined(DISABLE_BROWSER) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE)
currshortcut = insertfile_list;
#endif
@@ -476,7 +484,7 @@ int do_insertfile(int loading_file)
if (i != -1) {
inspath = mallocstrcpy(inspath, answer);
#ifdef DEBUG
fprintf(stderr, _("filename is %s\n"), answer);
fprintf(stderr, "filename is %s\n", answer);
#endif
#ifndef NANO_SMALL
@@ -495,7 +503,6 @@ int do_insertfile(int loading_file)
_("Command to execute"));
if (ts == -1 || answer == NULL || answer[0] == '\0') {
statusbar(_("Cancelled"));
UNSET(KEEP_CUTBUFFER);
display_main_list();
return 0;
}
@@ -618,7 +625,6 @@ int do_insertfile(int loading_file)
free(inspath);
inspath = NULL;
UNSET(KEEP_CUTBUFFER);
display_main_list();
return i;
}
@@ -647,7 +653,7 @@ int do_insertfile_void(void)
/* Create a new openfilestruct node. */
openfilestruct *make_new_opennode(openfilestruct *prevnode)
{
openfilestruct *newnode = nmalloc(sizeof(openfilestruct));
openfilestruct *newnode = (openfilestruct *)nmalloc(sizeof(openfilestruct));
newnode->filename = NULL;
newnode->fileage = NULL;
@@ -703,12 +709,12 @@ void free_openfilestruct(openfilestruct *src)
src = src->next;
delete_opennode(src->prev);
#ifdef DEBUG
fprintf(stderr, _("%s: free'd a node, YAY!\n"), "delete_opennode()");
fprintf(stderr, "%s: free'd a node, YAY!\n", "delete_opennode()");
#endif
}
delete_opennode(src);
#ifdef DEBUG
fprintf(stderr, _("%s: free'd last node.\n"), "delete_opennode()");
fprintf(stderr, "%s: free'd last node.\n", "delete_opennode()");
#endif
}
}
@@ -735,7 +741,7 @@ int add_open_file(int update)
open_files and splice it in after the current one */
#ifdef DEBUG
fprintf(stderr, _("filename is %s\n"), open_files->filename);
fprintf(stderr, "filename is %s\n", open_files->filename);
#endif
tmp = make_new_opennode(NULL);
@@ -792,7 +798,7 @@ int add_open_file(int update)
}
#ifdef DEBUG
fprintf(stderr, _("filename is %s\n"), open_files->filename);
fprintf(stderr, "filename is %s\n", open_files->filename);
#endif
return 0;
@@ -880,7 +886,7 @@ int open_prevfile(int closing_file)
open_files = open_files->prev;
#ifdef DEBUG
fprintf(stderr, _("filename is %s\n"), open_files->filename);
fprintf(stderr, "filename is %s\n", open_files->filename);
#endif
}
@@ -892,7 +898,7 @@ int open_prevfile(int closing_file)
open_files = open_files->next;
#ifdef DEBUG
fprintf(stderr, _("filename is %s\n"), open_files->filename);
fprintf(stderr, "filename is %s\n", open_files->filename);
#endif
}
@@ -943,7 +949,7 @@ int open_nextfile(int closing_file)
open_files = open_files->next;
#ifdef DEBUG
fprintf(stderr, _("filename is %s\n"), open_files->filename);
fprintf(stderr, "filename is %s\n", open_files->filename);
#endif
}
@@ -954,7 +960,7 @@ int open_nextfile(int closing_file)
open_files = open_files->prev;
#ifdef DEBUG
fprintf(stderr, _("filename is %s\n"), open_files->filename);
fprintf(stderr, "filename is %s\n", open_files->filename);
#endif
}
@@ -1040,7 +1046,7 @@ char *get_full_path(const char *origpath)
align(&d_here);
if (strcmp(d_here, "/")) {
d_here = nrealloc(d_here, strlen(d_here) + 2);
d_here = charealloc(d_here, strlen(d_here) + 2);
strcat(d_here, "/");
}
@@ -1062,9 +1068,9 @@ char *get_full_path(const char *origpath)
if (path_only) {
tmp = d_there[strlen(d_there) - 1];
if (tmp != '/') {
d_there = nrealloc(d_there, strlen(d_there) + 2);
d_there = charealloc(d_there, strlen(d_there) + 2);
strcat(d_there, "/");
d_there_file = nrealloc(d_there_file, strlen(d_there_file) + 2);
d_there_file = charealloc(d_there_file, strlen(d_there_file) + 2);
strcat(d_there_file, "/");
}
}
@@ -1112,7 +1118,7 @@ char *get_full_path(const char *origpath)
/* add a slash to d_there, unless it's "/", in which
case we don't need it */
if (strcmp(d_there, "/")) {
d_there = nrealloc(d_there, strlen(d_there) + 2);
d_there = charealloc(d_there, strlen(d_there) + 2);
strcat(d_there, "/");
}
}
@@ -1225,7 +1231,7 @@ char *safe_tempnam(const char *dirname, const char *filename_prefix)
strcpy(full_tempdir, "/tmp/");
}
full_tempdir = nrealloc(full_tempdir, strlen(full_tempdir) + 12);
full_tempdir = charealloc(full_tempdir, strlen(full_tempdir) + 12);
/* like tempnam(), use only the first 5 characters of the prefix */
strncat(full_tempdir, filename_prefix, 5);
@@ -1400,7 +1406,7 @@ int write_file(const char *name, int tmp, int append, int nonamechange)
}
#ifdef DEBUG
fprintf(stderr, _("Backing up %s to %s\n"), realname, backupname);
fprintf(stderr, "Backing up %s to %s\n", realname, backupname);
#endif
/* copy the file */
@@ -1515,7 +1521,7 @@ int write_file(const char *name, int tmp, int append, int nonamechange)
}
#ifdef DEBUG
else
fprintf(stderr, _("Wrote >%s\n"), fileptr->data);
fprintf(stderr, "Wrote >%s\n", fileptr->data);
#endif
#ifndef NANO_SMALL
if (ISSET(DOS_FILE) || ISSET(MAC_FILE))
@@ -1704,7 +1710,7 @@ int do_writeout(const char *path, int exiting, int append)
static int did_cred = 0;
#endif
#if !defined(DISABLE_BROWSER) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE)
currshortcut = writefile_list;
#endif
@@ -1814,7 +1820,7 @@ int do_writeout(const char *path, int exiting, int append)
}
#ifdef DEBUG
fprintf(stderr, _("filename is %s\n"), answer);
fprintf(stderr, "filename is %s\n", answer);
#endif
#ifdef NANO_EXTRA
@@ -1825,7 +1831,7 @@ int do_writeout(const char *path, int exiting, int append)
return -1;
}
#endif
if (append == 0 && strcmp(answer, filename) != 0) {
if (append == 0 && strcmp(answer, filename)) {
struct stat st;
if (!stat(answer, &st)) {
@@ -1898,8 +1904,8 @@ char *real_dir_from_tilde(const char *buf)
for (i = 1; buf[i] != '/' && buf[i] != '\0'; i++)
;
/* Determine home directory using getpwent(), don't rely on
$HOME */
/* Determine home directory using getpwuid() or getpwent(),
don't rely on $HOME */
if (i == 1)
userdata = getpwuid(geteuid());
else {
@@ -1972,7 +1978,7 @@ char **username_tab_completion(char *buf, int *num_matches)
struct passwd *userdata;
*num_matches = 0;
matches = nmalloc(BUFSIZ * sizeof(char *));
matches = (char **)nmalloc(BUFSIZ * sizeof(char *));
strcat(buf, "*");
@@ -2019,7 +2025,7 @@ char **cwd_tab_completion(char *buf, int *num_matches)
DIR *dir;
struct dirent *next;
matches = nmalloc(BUFSIZ * sizeof(char *));
matches = (char **)nmalloc(BUFSIZ * sizeof(char *));
/* Stick a wildcard onto the buf, for later use */
strcat(buf, "*");
@@ -2142,8 +2148,8 @@ char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list)
/* Make a local copy of the string -- up to the position of the
cursor */
matchbuf = (char *)nmalloc((strlen(buf) + 2) * sizeof(char));
memset(matchbuf, '\0', (strlen(buf) + 2));
matchbuf = charalloc(strlen(buf) + 2);
memset(matchbuf, '\0', strlen(buf) + 2);
strncpy(matchbuf, buf, place);
tmp = matchbuf;
@@ -2199,7 +2205,7 @@ char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list)
break;
case 1:
buf = nrealloc(buf, strlen(buf) + strlen(matches[0]) + 1);
buf = charealloc(buf, strlen(buf) + strlen(matches[0]) + 1);
if (buf[0] != '\0' && strstr(buf, "/") != NULL) {
for (tmp = buf + strlen(buf); *tmp != '/' && tmp != buf;
@@ -2262,7 +2268,7 @@ char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list)
(i == num_matches || matches[i] != 0)) {
/* All the matches have the same character at pos+1,
so paste it into buf... */
buf = nrealloc(buf, strlen(buf) + 2);
buf = charealloc(buf, strlen(buf) + 2);
strncat(buf, matches[0] + pos, 1);
*newplace += 1;
pos++;
@@ -2271,7 +2277,6 @@ char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list)
break;
}
}
break;
}
} else {
/* Ok -- the last char was a TAB. Since they
@@ -2451,7 +2456,7 @@ char **browser_init(const char *path, int *longest, int *numents)
rewinddir(dir);
*longest += 10;
filelist = nmalloc(*numents * sizeof (char *));
filelist = (char **)nmalloc(*numents * sizeof (char *));
if (!strcmp(path, "/"))
path = "";
@@ -2479,11 +2484,11 @@ char *do_browser(const char *inpath)
struct stat st;
char *foo, *retval = NULL;
static char *path = NULL;
int numents = 0, i = 0, j = 0, kbinput = 0, longest = 0, abort = 0;
int col = 0, selected = 0, editline = 0, width = 0, filecols = 0;
int lineno = 0, kb;
int numents = 0, i = 0, j = 0, kbinput = -1, meta, longest = 0;
int abort = 0, col = 0, selected = 0, editline = 0, width = 0;
int filecols = 0, lineno = 0;
char **filelist = (char **)NULL;
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
#ifndef DISABLE_MOUSE
MEVENT mevent;
#endif
@@ -2507,7 +2512,6 @@ char *do_browser(const char *inpath)
/* Sort the list by directory first, then alphabetically */
qsort(filelist, numents, sizeof(char *), diralphasort);
kb = keypad_on(edit, 1);
titlebar(path);
bottombars(browser_list);
curs_set(0);
@@ -2523,7 +2527,7 @@ char *do_browser(const char *inpath)
blank_statusbar_refresh();
#if !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
currshortcut = browser_list;
#endif
@@ -2537,7 +2541,7 @@ char *do_browser(const char *inpath)
switch (kbinput) {
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
#ifndef DISABLE_MOUSE
case KEY_MOUSE:
if (getmouse(&mevent) == ERR)
return retval;
@@ -2571,34 +2575,23 @@ char *do_browser(const char *inpath)
break;
#endif
case NANO_UP_KEY:
case KEY_UP:
case 'u':
if (selected - width >= 0)
selected -= width;
break;
case NANO_BACK_KEY:
case KEY_LEFT:
case NANO_BACKSPACE_KEY:
case 127:
case 'l':
if (selected > 0)
selected--;
break;
case KEY_DOWN:
case NANO_DOWN_KEY:
case 'd':
if (selected + width <= numents - 1)
selected += width;
break;
case KEY_RIGHT:
case NANO_FORWARD_KEY:
case 'r':
if (selected < numents - 1)
selected++;
break;
case NANO_PREVPAGE_KEY:
case NANO_PREVPAGE_FKEY:
case KEY_PPAGE:
case '-':
if (selected >= (editwinrows + lineno % editwinrows) * width)
selected -= (editwinrows + lineno % editwinrows) * width;
@@ -2607,7 +2600,6 @@ char *do_browser(const char *inpath)
break;
case NANO_NEXTPAGE_KEY:
case NANO_NEXTPAGE_FKEY:
case KEY_NPAGE:
case ' ':
selected += (editwinrows - lineno % editwinrows) * width;
if (selected >= numents)
@@ -2617,7 +2609,6 @@ char *do_browser(const char *inpath)
case NANO_HELP_FKEY:
do_help();
break;
case KEY_ENTER:
case NANO_ENTER_KEY:
case 's': /* More Pico compatibility */
case 'S':
@@ -2680,10 +2671,8 @@ char *do_browser(const char *inpath)
return do_browser(path);
/* Goto a specific directory */
case 'g': /* Pico compatibility */
case 'G':
case NANO_GOTO_KEY:
case NANO_GOTO_FKEY:
curs_set(1);
j = statusq(0, gotodir_list, "",
#ifndef NANO_SMALL
@@ -2728,11 +2717,10 @@ char *do_browser(const char *inpath)
return do_browser(path);
/* Stuff we want to abort the browser */
case 'q':
case 'Q':
case 'e': /* Pico compatibility, yeech */
case 'E':
case NANO_CANCEL_KEY:
case NANO_EXIT_KEY:
case NANO_EXIT_FKEY:
abort = 1;
break;
@@ -2808,12 +2796,11 @@ char *do_browser(const char *inpath)
}
}
wrefresh(edit);
} while ((kbinput = wgetch(edit)) != NANO_EXIT_KEY);
} while ((kbinput = get_kbinput(edit, &meta, ISSET(REBIND_DELETE))) != NANO_EXIT_KEY && kbinput != NANO_EXIT_FKEY);
curs_set(1);
blank_edit();
titlebar(NULL);
edit_refresh();
kb = keypad_on(edit, kb);
/* cleanup */
free_charptrarray(filelist, numents);
@@ -2878,12 +2865,12 @@ void load_history(void)
if (homenv != NULL) {
nanohist = nrealloc(nanohist, strlen(homenv) + 15);
nanohist = charealloc(nanohist, strlen(homenv) + 15);
sprintf(nanohist, "%s/.nano_history", homenv);
} else {
userage = getpwuid(geteuid());
endpwent();
nanohist = nrealloc(nanohist, strlen(userage->pw_dir) + 15);
nanohist = charealloc(nanohist, strlen(userage->pw_dir) + 15);
sprintf(nanohist, "%s/.nano_history", userage->pw_dir);
}
@@ -2891,9 +2878,12 @@ void load_history(void)
if (homenv != NULL || userage != NULL) {
hist = fopen(nanohist, "r");
if (!hist) {
if (errno != ENOENT)
if (hist == NULL) {
if (errno != ENOENT) {
/* Don't save history when we quit. */
UNSET(HISTORYLOG);
rcfile_error(_("Unable to open ~/.nano_history file, %s"), strerror(errno));
}
free(nanohist);
} else {
buf = charalloc(1024);
@@ -2930,25 +2920,25 @@ void save_history(void)
return;
if (homenv != NULL) {
nanohist = nrealloc(nanohist, strlen(homenv) + 15);
nanohist = charealloc(nanohist, strlen(homenv) + 15);
sprintf(nanohist, "%s/.nano_history", homenv);
} else {
userage = getpwuid(geteuid());
endpwent();
nanohist = nrealloc(nanohist, strlen(userage->pw_dir) + 15);
nanohist = charealloc(nanohist, strlen(userage->pw_dir) + 15);
sprintf(nanohist, "%s/.nano_history", userage->pw_dir);
}
if (homenv != NULL || userage != NULL) {
hist = fopen(nanohist, "wb");
if (!hist) {
if (hist == NULL) {
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
} else {
/* set rw only by owner for security ?? */
chmod(nanohist, S_IRUSR | S_IWUSR);
/* write oldest first */
for (h = search_history.tail ; h->prev ; h = h->prev) {
h->data = nrealloc(h->data, strlen(h->data) + 2);
h->data = charealloc(h->data, strlen(h->data) + 2);
strcat(h->data, "\n");
if (fputs(h->data, hist) == EOF) {
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
@@ -2960,14 +2950,14 @@ void save_history(void)
goto come_from;
}
for (h = replace_history.tail ; h->prev ; h = h->prev) {
h->data = nrealloc(h->data, strlen(h->data) + 2);
h->data = charealloc(h->data, strlen(h->data) + 2);
strcat(h->data, "\n");
if (fputs(h->data, hist) == EOF) {
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
goto come_from;
}
}
come_from:
come_from:
fclose(hist);
}
free(nanohist);

View File

@@ -29,8 +29,11 @@
/* Global variables */
#ifndef DISABLE_WRAPJUSTIFY
/* wrap_at might be set in rcfile.c or nano.c */
int wrap_at = -CHARS_FROM_EOL;/* Right justified fill value, allows resize */
#endif
char *last_search = NULL; /* Last string we searched for */
char *last_replace = NULL; /* Last replacement string */
int search_last_line; /* Is this the last search line? */
@@ -129,7 +132,7 @@ syntaxtype *syntaxes = NULL;
char *syntaxstr = NULL;
#endif
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
const shortcut *currshortcut; /* Current shortcut list we're using */
#endif
@@ -174,12 +177,12 @@ void sc_init_one(shortcut **shortcutage, int key, const char *desc,
shortcut *s;
if (*shortcutage == NULL) {
*shortcutage = nmalloc(sizeof(shortcut));
*shortcutage = (shortcut *)nmalloc(sizeof(shortcut));
s = *shortcutage;
} else {
for (s = *shortcutage; s->next != NULL; s = s->next)
;
s->next = nmalloc(sizeof(shortcut));
s->next = (shortcut *)nmalloc(sizeof(shortcut));
s = s->next;
}
@@ -204,12 +207,12 @@ void toggle_init_one(int val, const char *desc, int flag)
toggle *u;
if (toggles == NULL) {
toggles = nmalloc(sizeof(toggle));
toggles = (toggle *)nmalloc(sizeof(toggle));
u = toggles;
} else {
for (u = toggles; u->next != NULL; u = u->next)
;
u->next = nmalloc(sizeof(toggle));
u->next = (toggle *)nmalloc(sizeof(toggle));
u = u->next;
}
@@ -225,7 +228,7 @@ void toggle_init(void)
*toggle_nohelp_msg, *toggle_cuttoend_msg,
*toggle_noconvert_msg, *toggle_dos_msg, *toggle_mac_msg,
*toggle_backup_msg, *toggle_smooth_msg;
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
#ifndef DISABLE_MOUSE
char *toggle_mouse_msg;
#endif
#ifndef DISABLE_WRAPPING
@@ -247,7 +250,7 @@ void toggle_init(void)
toggle_autoindent_msg = _("Auto indent");
toggle_suspend_msg = _("Suspend");
toggle_nohelp_msg = _("Help mode");
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
#ifndef DISABLE_MOUSE
toggle_mouse_msg = _("Mouse support");
#endif
toggle_cuttoend_msg = _("Cut to end");
@@ -260,7 +263,7 @@ void toggle_init(void)
toggle_syntax_msg = _("Color syntax highlighting");
#endif
#ifndef DISABLE_WRAPPING
toggle_wrap_msg = _("Auto wrap");
toggle_wrap_msg = _("Auto line wrap");
#endif
#ifdef ENABLE_MULTIBUFFER
toggle_load_msg = _("Multiple file buffers");
@@ -273,7 +276,7 @@ void toggle_init(void)
#ifndef DISABLE_WRAPPING
toggle_init_one(TOGGLE_WRAP_KEY, toggle_wrap_msg, NO_WRAP);
#endif
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
#ifndef DISABLE_MOUSE
toggle_init_one(TOGGLE_MOUSE_KEY, toggle_mouse_msg, USE_MOUSE);
#endif
toggle_init_one(TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg, CUT_TO_END);
@@ -321,10 +324,11 @@ void shortcut_init(int unjustify)
const char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg =
"", *nano_goto_msg = "", *nano_justify_msg =
"", *nano_replace_msg = "", *nano_insert_msg =
"", *nano_whereis_msg = "", *nano_prevpage_msg =
"", *nano_nextpage_msg = "", *nano_cut_msg =
"", *nano_uncut_msg = "", *nano_cursorpos_msg =
"", *nano_spell_msg = "", *nano_up_msg = "", *nano_down_msg =
"", *nano_whereis_msg = "", *nano_whereis_next_msg =
"", *nano_prevpage_msg = "", *nano_nextpage_msg =
"", *nano_cut_msg = "", *nano_uncut_msg =
"", *nano_cursorpos_msg = "", *nano_spell_msg =
"", *nano_up_msg = "", *nano_down_msg =
"", *nano_forward_msg = "", *nano_back_msg = "", *nano_home_msg =
"", *nano_end_msg = "", *nano_firstline_msg =
"", *nano_lastline_msg = "", *nano_refresh_msg =
@@ -336,7 +340,8 @@ void shortcut_init(int unjustify)
"", *nano_gotodir_msg = "", *nano_case_msg =
"", *nano_reverse_msg = "", *nano_execute_msg =
"", *nano_dos_msg = "", *nano_mac_msg =
"", *nano_backup_msg = "", *nano_editstr_msg = "";
"", *nano_backup_msg = "", *nano_editstr_msg =
"", *nano_parabegin_msg = "", *nano_paraend_msg = "";
#ifdef ENABLE_MULTIBUFFER
const char *nano_openprev_msg = "", *nano_opennext_msg =
@@ -349,7 +354,7 @@ void shortcut_init(int unjustify)
nano_help_msg = _("Invoke the help menu");
nano_writeout_msg = _("Write the current file to disk");
#ifdef ENABLE_MULTIBUFFER
nano_exit_msg = _("Close currently loaded file/Exit from nano");
nano_exit_msg = _("Close current file buffer/Exit from nano");
#else
nano_exit_msg = _("Exit from nano");
#endif
@@ -359,6 +364,7 @@ void shortcut_init(int unjustify)
nano_replace_msg = _("Replace text within the editor");
nano_insert_msg = _("Insert another file into the current one");
nano_whereis_msg = _("Search for text within the editor");
nano_whereis_next_msg = _("Repeat last search");
nano_prevpage_msg = _("Move to the previous screen");
nano_nextpage_msg = _("Move to the next screen");
nano_cut_msg = _("Cut the current line and store it in the cutbuffer");
@@ -393,14 +399,16 @@ void shortcut_init(int unjustify)
nano_mac_msg = _("Write file out in Mac format");
nano_backup_msg = _("Back up original file when saving");
nano_editstr_msg = _("Edit the previous search/replace strings");
nano_parabegin_msg = _("Go to the beginning of the current paragraph");
nano_paraend_msg = _("Go to the end of the current paragraph");
#ifdef HAVE_REGEX_H
nano_regexp_msg = _("Use regular expressions");
nano_bracket_msg = _("Find other bracket");
#endif
#ifdef ENABLE_MULTIBUFFER
nano_openprev_msg = _("Open previously loaded file");
nano_opennext_msg = _("Open next loaded file");
nano_multibuffer_msg = _("Toggle insert into new buffer");
nano_openprev_msg = _("Switch to previous file buffer");
nano_opennext_msg = _("Switch to next file buffer");
nano_multibuffer_msg = _("Toggle insert into new file buffer");
#endif
#endif /* !DISABLE_HELP */
@@ -414,71 +422,83 @@ void shortcut_init(int unjustify)
#else
# define IFHELP(help, nextvar) help, nextvar
#endif
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, 0), NANO_HELP_FKEY, 0, VIEW,
do_help);
#ifdef ENABLE_MULTIBUFFER
if (open_files != NULL && (open_files->prev != NULL || open_files->next != NULL))
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_EXIT_KEY, _("Close"),
IFHELP(nano_exit_msg, 0), NANO_EXIT_FKEY, 0, VIEW,
do_exit);
else
#endif
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_EXIT_KEY, _("Exit"),
IFHELP(nano_exit_msg, 0), NANO_EXIT_FKEY, 0, VIEW,
do_exit);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_WRITEOUT_KEY, _("WriteOut"),
IFHELP(nano_writeout_msg, 0),
NANO_WRITEOUT_FKEY, 0, NOVIEW, do_writeout_void);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_JUSTIFY_KEY, _("Justify"),
IFHELP(nano_justify_msg, 0), NANO_JUSTIFY_FKEY, 0,
NOVIEW, do_justify);
/* this is so we can view multiple files */
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
IFHELP(nano_insert_msg, 0), NANO_INSERTFILE_FKEY, 0,
#ifdef ENABLE_MULTIBUFFER
/* this is so we can view multiple files */
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
IFHELP(nano_insert_msg, 0),
NANO_INSERTFILE_FKEY, 0, VIEW, do_insertfile_void);
VIEW
#else
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
IFHELP(nano_insert_msg, 0),
NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile_void);
NOVIEW
#endif
, do_insertfile_void);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_WHEREIS_KEY, _("Where Is"),
IFHELP(nano_whereis_msg, 0),
NANO_WHEREIS_FKEY, 0, VIEW, do_search);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_PREVPAGE_KEY, _("Prev Page"),
IFHELP(nano_prevpage_msg, 0),
NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, do_page_up);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_NEXTPAGE_KEY, _("Next Page"),
IFHELP(nano_nextpage_msg, 0),
NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, do_page_down);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_CUT_KEY, _("Cut Text"),
IFHELP(nano_cut_msg, 0),
NANO_CUT_FKEY, 0, NOVIEW, do_cut_text);
if (unjustify)
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, _("UnJustify"),
IFHELP(nano_unjustify_msg, 0),
0, 0, NOVIEW, do_uncut_text);
else
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_UNCUT_KEY, _("UnCut Txt"),
IFHELP(nano_uncut_msg, 0),
NANO_UNCUT_FKEY, 0, NOVIEW, do_uncut_text);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_CURSORPOS_KEY, _("Cur Pos"),
IFHELP(nano_cursorpos_msg, 0),
NANO_CURSORPOS_FKEY, 0, VIEW, do_cursorpos_void);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_SPELL_KEY, _("To Spell"),
IFHELP(nano_spell_msg, 0),
NANO_SPELL_FKEY, 0, NOVIEW, do_spell);
@@ -552,6 +572,11 @@ void shortcut_init(int unjustify)
IFHELP(nano_bracket_msg, NANO_BRACKET_KEY),
0, 0, VIEW, do_find_bracket);
#endif
sc_init_one(&main_list, -9, _("Where Is Next"),
IFHELP(nano_whereis_next_msg, NANO_WHEREIS_NEXT_KEY), 0, 0,
NOVIEW, do_research);
#ifdef ENABLE_MULTIBUFFER
sc_init_one(&main_list, -9, _("Previous File"),
IFHELP(nano_openprev_msg, NANO_OPENPREV_KEY),
@@ -566,35 +591,54 @@ void shortcut_init(int unjustify)
sc_init_one(&whereis_list, NANO_HELP_KEY, _("Get Help"),
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_CANCEL_KEY, _("Cancel"),
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, _("First Line"),
IFHELP(nano_firstline_msg, 0),
0, 0, VIEW, do_first_line);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_LASTLINE_KEY, _("Last Line"),
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_OTHERSEARCH_KEY, _("Replace"),
IFHELP(nano_replace_msg, 0), 0, 0, VIEW, do_replace);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_FROMSEARCHTOGOTO_KEY, _("Go To Line"),
IFHELP(nano_goto_msg, 0), 0, 0, VIEW, do_gotoline_void);
#ifndef DISABLE_JUSTIFY
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, _("Beg of Par"),
IFHELP(nano_parabegin_msg, 0), 0, 0, VIEW, do_para_begin);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_PARAEND_KEY, _("End of Par"),
IFHELP(nano_paraend_msg, 0), 0, 0, VIEW, do_para_end);
#endif
#ifndef NANO_SMALL
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, TOGGLE_CASE_KEY, _("Case Sens"),
IFHELP(nano_case_msg, 0), 0, 0, VIEW, 0);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, TOGGLE_BACKWARDS_KEY, _("Direction"),
IFHELP(nano_reverse_msg, 0), 0, 0, VIEW, 0);
#ifdef HAVE_REGEX_H
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, TOGGLE_REGEXP_KEY, _("Regexp"),
IFHELP(nano_regexp_msg, 0), 0, 0, VIEW, 0);
#endif
#ifndef NANO_SMALL
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, KEY_UP, _("History"),
IFHELP(nano_editstr_msg, 0), NANO_UP_KEY, 0, VIEW, 0);
#endif
@@ -615,6 +659,7 @@ void shortcut_init(int unjustify)
sc_init_one(&replace_list, NANO_LASTLINE_KEY, _("Last Line"),
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
/* Translators: try to keep this string under 12 characters long */
sc_init_one(&replace_list, NANO_OTHERSEARCH_KEY, _("No Replace"),
IFHELP(nano_whereis_msg, 0), 0, 0, VIEW, do_search);
@@ -692,25 +737,31 @@ void shortcut_init(int unjustify)
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
#ifndef DISABLE_BROWSER
/* Translators: try to keep this string under 16 characters long */
sc_init_one(&writefile_list, NANO_TOFILES_KEY, _("To Files"),
IFHELP(nano_tofiles_msg, 0), 0, 0, NOVIEW, 0);
#endif
#ifndef NANO_SMALL
/* Translators: try to keep this string under 16 characters long */
sc_init_one(&writefile_list, TOGGLE_DOS_KEY, _("DOS Format"),
IFHELP(nano_dos_msg, 0), 0, 0, NOVIEW, 0);
/* Translators: try to keep this string under 16 characters long */
sc_init_one(&writefile_list, TOGGLE_MAC_KEY, _("Mac Format"),
IFHELP(nano_mac_msg, 0), 0, 0, NOVIEW, 0);
#endif
/* Translators: try to keep this string under 16 characters long */
sc_init_one(&writefile_list, NANO_APPEND_KEY, _("Append"),
IFHELP(nano_append_msg, 0), 0, 0, NOVIEW, 0);
/* Translators: try to keep this string under 16 characters long */
sc_init_one(&writefile_list, NANO_PREPEND_KEY, _("Prepend"),
IFHELP(nano_prepend_msg, 0), 0, 0, NOVIEW, 0);
#ifndef NANO_SMALL
/* Translators: try to keep this string under 16 characters long */
sc_init_one(&writefile_list, TOGGLE_BACKUP_KEY, _("Backup File"),
IFHELP(nano_backup_msg, 0), 0, 0, NOVIEW, 0);
#endif
@@ -731,9 +782,11 @@ void shortcut_init(int unjustify)
IFHELP(nano_tofiles_msg, 0), 0, 0, NOVIEW, 0);
#endif
#ifndef NANO_SMALL
/* Translators: try to keep this string under 22 characters long */
sc_init_one(&insertfile_list, NANO_EXTCMD_KEY, _("Execute Command"),
IFHELP(nano_execute_msg, 0), 0, 0, NOVIEW, 0);
#ifdef ENABLE_MULTIBUFFER
/* Translators: try to keep this string under 22 characters long */
sc_init_one(&insertfile_list, TOGGLE_LOAD_KEY, _("New Buffer"),
IFHELP(nano_multibuffer_msg, 0), 0, 0, NOVIEW, 0);
#endif
@@ -776,6 +829,7 @@ void shortcut_init(int unjustify)
IFHELP(nano_nextpage_msg, 0), NANO_NEXTPAGE_FKEY,
KEY_NPAGE, VIEW, 0);
/* Translators: try to keep this string under 22 characters long */
sc_init_one(&browser_list, NANO_GOTO_KEY, _("Go To Dir"),
IFHELP(nano_gotodir_msg, NANO_ALT_GOTO_KEY),
NANO_GOTO_FKEY, 0, VIEW, 0);
@@ -789,7 +843,7 @@ void shortcut_init(int unjustify)
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
#endif
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
currshortcut = main_list;
#endif
#ifndef NANO_SMALL

225
src/move.c Normal file
View File

@@ -0,0 +1,225 @@
/* $Id$ */
/**************************************************************************
* move.c *
* *
* Copyright (C) 1999-2003 Chris Allegretta *
* 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) *
* 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., 675 Mass Ave, Cambridge, MA 02139, USA. *
* *
**************************************************************************/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "proto.h"
#include "nano.h"
int do_home(void)
{
current_x = 0;
placewewant = 0;
check_statblank();
update_line(current, current_x);
return 1;
}
int do_end(void)
{
current_x = strlen(current->data);
placewewant = xplustabs();
check_statblank();
update_line(current, current_x);
return 1;
}
int do_page_up(void)
{
int i;
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
/* If edittop is the first line of the file, move current up there
* and put the cursor at the beginning of the line. */
if (edittop == fileage) {
current = fileage;
placewewant = 0;
} else {
/* Move the top line of the edit window up a page. */
for (i = 0; i < editwinrows - 2 && edittop->prev != NULL; i++)
edittop = edittop->prev;
#ifndef NANO_SMALL
/* If we're in smooth scrolling mode and there was at least one
* page of text left, move the current line of the edit window
* up a page. */
if (ISSET(SMOOTHSCROLL) && current->lineno > editwinrows - 2)
for (i = 0; i < editwinrows - 2; i++)
current = current->prev;
/* If we're not in smooth scrolling mode and there was at least
* one page of text left, put the cursor at the beginning of the
* top line of the edit window, as Pico does. */
else {
#endif
current = edittop;
placewewant = 0;
#ifndef NANO_SMALL
}
#endif
}
/* Get the equivalent x-coordinate of the new line. */
current_x = actual_x(current->data, placewewant);
edit_refresh();
check_statblank();
return 1;
}
int do_page_down(void)
{
int i;
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
/* If the last line of the file is onscreen, move current down
* there and put the cursor at the beginning of the line. */
if (edittop->lineno + editwinrows > filebot->lineno) {
current = filebot;
placewewant = 0;
} else {
/* Move the top line of the edit window down a page. */
for (i = 0; i < editwinrows - 2; i++)
edittop = edittop->next;
#ifndef NANO_SMALL
/* If we're in smooth scrolling mode and there was at least one
* page of text left, move the current line of the edit window
* down a page. */
if (ISSET(SMOOTHSCROLL) && current->lineno + editwinrows - 2 <= filebot->lineno)
for (i = 0; i < editwinrows - 2; i++)
current = current->next;
/* If we're not in smooth scrolling mode and there was at least
* one page of text left, put the cursor at the beginning of the
* top line of the edit window, as Pico does. */
else {
#endif
current = edittop;
placewewant = 0;
#ifndef NANO_SMALL
}
#endif
}
/* Get the equivalent x-coordinate of the new line. */
current_x = actual_x(current->data, placewewant);
edit_refresh();
check_statblank();
return 1;
}
int do_up(void)
{
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
check_statblank();
if (current->prev == NULL)
return 0;
assert(current_y == current->lineno - edittop->lineno);
current = current->prev;
current_x = actual_x(current->data, placewewant);
if (current_y > 0) {
update_line(current->next, 0);
/* It was necessary to change current first, so the mark
* display will change! */
update_line(current, current_x);
} else
#ifndef NANO_SMALL
if (ISSET(SMOOTHSCROLL))
edit_update(current, TOP);
else
#endif
edit_update(current, CENTER);
return 1;
}
/* Return value 1 means we moved down, 0 means we were already at the
* bottom. */
int do_down(void)
{
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
check_statblank();
if (current->next == NULL)
return 0;
assert(current_y == current->lineno - edittop->lineno);
current = current->next;
current_x = actual_x(current->data, placewewant);
/* Note that current_y is zero-based. This test checks for the
* cursor's being not on the last row of the edit window. */
if (current_y != editwinrows - 1) {
update_line(current->prev, 0);
update_line(current, current_x);
} else
#ifndef NANO_SMALL
if (ISSET(SMOOTHSCROLL))
/* In this case current_y does not change. The cursor remains
* at the bottom of the edit window. */
edit_update(edittop->next, TOP);
else
#endif
edit_update(current, CENTER);
return 1;
}
int do_left(void)
{
if (current_x > 0)
current_x--;
else if (current != fileage) {
do_up();
current_x = strlen(current->data);
}
placewewant = xplustabs();
check_statblank();
update_line(current, current_x);
return 1;
}
int do_right(void)
{
assert(current_x <= strlen(current->data));
if (current->data[current_x] != '\0')
current_x++;
else if (current->next != NULL) {
do_down();
current_x = 0;
}
placewewant = xplustabs();
check_statblank();
update_line(current, current_x);
return 1;
}

File diff suppressed because it is too large Load Diff

View File

@@ -29,26 +29,31 @@
/* Macros for the flags int... */
#define SET(bit) flags |= bit
#define UNSET(bit) flags &= ~bit
#define ISSET(bit) (flags & bit)
#define ISSET(bit) ((flags & bit) != 0)
#define TOGGLE(bit) flags ^= bit
/* Define charalloc as a macro rather than duplicating code */
#define charalloc(howmuch) (char *)nmalloc((howmuch) * sizeof(char))
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char))
#ifndef NANO_SMALL
/* For the backup file copy ... */
# define COPYFILEBLOCKSIZE 1024
#define charmove(dest, src, n) memmove(dest, src, (n) * sizeof(char))
#ifdef BROKEN_REGEXEC
#define regexec(preg, string, nmatch, pmatch, eflags) regexec_safe(preg, string, nmatch, pmatch, eflags)
#endif
#ifdef USE_SLANG /* Slang support enabled */
#ifndef NANO_SMALL
/* For the backup file copy ... */
#define COPYFILEBLOCKSIZE 1024
#endif
#ifdef USE_SLANG
/* Slang support enabled */
#include <slcurses.h>
#define KEY_IC SL_KEY_IC
#define KEY_DC SL_KEY_DELETE
#define KEY_IC SL_KEY_IC
#elif defined(HAVE_NCURSES_H)
#include <ncurses.h>
#else /* Uh oh */
#include <curses.h>
#include <curses.h>
#endif /* CURSES_H */
#ifdef ENABLE_NLS
@@ -76,23 +81,36 @@
# endif
#endif
#if !defined(HAVE_STRCASECMP) || !defined(HAVE_STRNCASECMP)
# ifndef HAVE_STRCASECMP
# define strcasecmp strcmp
# endif
# ifndef HAVE_STRNCASECMP
# define strncasecmp strncmp
# endif
#ifndef HAVE_STRCASECMP
#define strcasecmp nstricmp
#endif
#ifndef HAVE_STRNCASECMP
#define strncasecmp nstrnicmp
#endif
/* Assume ERR is defined as -1. To avoid duplicate case values when
some key definitions are missing, we have to set these all to
different negative values other than -1. */
/* HP-UX 10 & 11 do not seem to support KEY_HOME and KEY_END */
#ifndef KEY_HOME
#define KEY_HOME -1
#endif /* KEY_HOME */
#define KEY_HOME -2
#endif
#ifndef KEY_END
#define KEY_END -1
#endif /* KEY_END */
#define KEY_END -3
#endif
/* Slang and SunOS 5.7-5.9 do not seem to support KEY_RESIZE */
#ifndef KEY_RESIZE
#define KEY_RESIZE -4
#endif
/* Slang does not seem to support KEY_SUSPEND */
#ifndef KEY_SUSPEND
#define KEY_SUSPEND -5
#endif
/* Snatch these out of the ncurses defs, so we can use them in search
history regardless of whether we're using ncurses or not */
@@ -103,6 +121,10 @@
#define VERMSG "GNU nano " VERSION
#ifndef NCURSES_MOUSE_VERSION
#define DISABLE_MOUSE 1
#endif
#if defined(DISABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
#define DISABLE_WRAPJUSTIFY 1
#endif
@@ -229,27 +251,27 @@ typedef struct historyheadtype {
#define SUSPEND (1<<7)
#define NO_WRAP (1<<8)
#define AUTOINDENT (1<<9)
#define SAMELINEWRAP (1<<10)
#define VIEW_MODE (1<<11)
#define USE_MOUSE (1<<12)
#define USE_REGEXP (1<<13)
#define REGEXP_COMPILED (1<<14)
#define TEMP_OPT (1<<15)
#define CUT_TO_END (1<<16)
#define REVERSE_SEARCH (1<<17)
#define MULTIBUFFER (1<<18)
#define DOS_FILE (1<<19)
#define MAC_FILE (1<<20)
#define SMOOTHSCROLL (1<<21)
#define DISABLE_CURPOS (1<<22) /* Damn, we still need it */
#define ALT_KEYPAD (1<<23)
#define NO_CONVERT (1<<24)
#define BACKUP_FILE (1<<25)
#define NO_RCFILE (1<<26)
#define COLOR_SYNTAX (1<<27)
#define PRESERVE (1<<28)
#define HISTORY_CHANGED (1<<29)
#define HISTORYLOG (1<<30)
#define VIEW_MODE (1<<10)
#define USE_MOUSE (1<<11)
#define USE_REGEXP (1<<12)
#define REGEXP_COMPILED (1<<13)
#define TEMP_OPT (1<<14)
#define CUT_TO_END (1<<15)
#define REVERSE_SEARCH (1<<16)
#define MULTIBUFFER (1<<17)
#define DOS_FILE (1<<18)
#define MAC_FILE (1<<19)
#define SMOOTHSCROLL (1<<20)
#define DISABLE_CURPOS (1<<21) /* Damn, we still need it */
#define REBIND_DELETE (1<<22)
#define NO_CONVERT (1<<23)
#define BACKUP_FILE (1<<24)
#define NO_RCFILE (1<<25)
#define COLOR_SYNTAX (1<<26)
#define PRESERVE (1<<27)
#define HISTORY_CHANGED (1<<28)
#define HISTORYLOG (1<<29)
#define JUSTIFY_MODE (1<<30)
/* Control key sequences, changing these would be very very bad */
@@ -280,11 +302,12 @@ typedef struct historyheadtype {
#define NANO_CONTROL_X 24
#define NANO_CONTROL_Y 25
#define NANO_CONTROL_Z 26
#define NANO_CONTROL_3 27
#define NANO_CONTROL_4 28
#define NANO_CONTROL_5 29
#define NANO_CONTROL_6 30
#define NANO_CONTROL_7 31
#define NANO_CONTROL_8 127
#define NANO_ALT_A 'a'
#define NANO_ALT_B 'b'
@@ -319,8 +342,8 @@ typedef struct historyheadtype {
#define NANO_ALT_BRACKET ']'
#define NANO_ALT_SPACE ' '
/* Some semi-changeable keybindings; don't play with unless you're sure you
know what you're doing */
/* Some semi-changeable keybindings; don't play with unless you're sure
you know what you're doing */
#define NANO_INSERTFILE_KEY NANO_CONTROL_R
#define NANO_INSERTFILE_FKEY KEY_F(5)
@@ -335,6 +358,7 @@ know what you're doing */
#define NANO_HELP_FKEY KEY_F(1)
#define NANO_WHEREIS_KEY NANO_CONTROL_W
#define NANO_WHEREIS_FKEY KEY_F(6)
#define NANO_WHEREIS_NEXT_KEY NANO_ALT_W
#define NANO_REPLACE_KEY NANO_CONTROL_4
#define NANO_REPLACE_FKEY KEY_F(14)
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
@@ -383,6 +407,8 @@ know what you're doing */
#define NANO_EXTCMD_KEY NANO_CONTROL_X
#define NANO_NEXTWORD_KEY NANO_CONTROL_SPACE
#define NANO_PREVWORD_KEY NANO_ALT_SPACE
#define NANO_PARABEGIN_KEY NANO_CONTROL_W
#define NANO_PARAEND_KEY NANO_CONTROL_O
#ifndef NANO_SMALL
/* Toggles do not exist with NANO_SMALL. */
@@ -393,7 +419,7 @@ know what you're doing */
#define TOGGLE_MOUSE_KEY NANO_ALT_M
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
#define TOGGLE_REGEXP_KEY NANO_ALT_R
#define TOGGLE_WRAP_KEY NANO_ALT_W
#define TOGGLE_WRAP_KEY NANO_ALT_L
#define TOGGLE_BACKWARDS_KEY NANO_ALT_B
#define TOGGLE_CASE_KEY NANO_ALT_C
#define TOGGLE_LOAD_KEY NANO_ALT_F
@@ -411,8 +437,8 @@ know what you're doing */
#define NOVIEW 0
typedef enum {
CENTER, TOP, NONE
} topmidbotnone;
TOP, CENTER, NONE
} topmidnone;
/* Minimum editor window rows required for nano to work correctly */
#define MIN_EDITOR_ROWS 3

View File

@@ -29,7 +29,9 @@
#include "nano.h"
#ifndef DISABLE_WRAPJUSTIFY
extern int wrap_at;
#endif
extern int editwinrows;
extern int current_x, current_y, totlines;
extern int placewewant;
@@ -38,7 +40,8 @@ extern int mark_beginx;
#endif
extern long totsize;
extern int temp_opt;
extern int wrap_at, flags, tabsize;
extern int flags;
extern int tabsize;
extern int search_last_line;
extern int search_offscreen;
extern int currslen;
@@ -101,12 +104,11 @@ extern shortcut *spell_list;
extern shortcut *browser_list, *gotodir_list;
#endif
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
extern const shortcut *currshortcut;
#endif
#ifdef HAVE_REGEX_H
extern int use_regexp, regexp_compiled;
extern regex_t search_regexp;
extern regmatch_t regmatches[10];
#ifdef ENABLE_COLOR
@@ -222,7 +224,6 @@ void thanks_for_all_the_fish(void);
/* Public functions in move.c */
int do_home(void);
int do_end(void);
void page_up(void);
int do_page_up(void);
int do_page_down(void);
int do_up(void);
@@ -238,7 +239,7 @@ void die_too_small(void);
void print_view_warning(void);
void global_init(int save_cutbuffer);
void window_init(void);
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
#ifndef DISABLE_MOUSE
void mouse_init(void);
#endif
#ifndef DISABLE_HELP
@@ -267,20 +268,20 @@ RETSIGTYPE cancel_fork(int signal);
int open_pipe(const char *command);
#endif
#ifndef DISABLE_MOUSE
#ifdef NCURSES_MOUSE_VERSION
void do_mouse(void);
#endif
#endif
void do_char(char ch);
int do_backspace(void);
int do_delete(void);
int do_tab(void);
int do_enter(void);
#ifndef NANO_SMALL
int do_next_word(void);
int do_prev_word(void);
#endif
int do_mark(void);
void wrap_reset(void);
#ifndef DISABLE_WRAPPING
void wrap_reset(void);
int do_wrap(filestruct *inptr);
#endif
#ifndef DISABLE_SPELLER
@@ -312,8 +313,13 @@ filestruct *backup_lines(filestruct *first_line, size_t par_len,
size_t quote_len);
int breakable(const char *line, int goal);
int break_line(const char *line, int goal, int force);
int do_para_operation(int operation);
#endif /* !DISABLE_JUSTIFY */
int do_justify(void);
#ifndef DISABLE_JUSTIFY
int do_para_begin(void);
int do_para_end(void);
#endif
int do_exit(void);
void signal_init(void);
RETSIGTYPE handle_hupterm(int signal);
@@ -326,7 +332,6 @@ void print_numlock_warning(void);
#ifndef NANO_SMALL
void do_toggle(const toggle *which);
#endif
int abcd(int input);
/* Public functions in rcfile.c */
#ifdef ENABLE_NANORC
@@ -359,6 +364,7 @@ filestruct *findnextstr(int quiet, int bracket_mode,
const filestruct *begin, int beginx,
const char *needle);
int do_search(void);
int do_research(void);
void replace_abort(void);
#ifdef HAVE_REGEX_H
int replace_regexp(char *string, int create_flag);
@@ -367,7 +373,6 @@ char *replace_line(void);
int do_replace_loop(const char *prevanswer, const filestruct *begin,
int *beginx, int wholewords, int *i);
int do_replace(void);
void goto_abort(void);
int do_gotoline(int line, int save_pos);
int do_gotoline_void(void);
#if defined (ENABLE_MULTIBUFFER) || !defined (DISABLE_SPELLER)
@@ -391,12 +396,22 @@ void save_history(void);
#endif
/* Public functions in utils.c */
#ifdef BROKEN_REGEXEC
int regexec_safe(const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags);
#endif
int is_cntrl_char(int c);
int num_of_digits(int n);
void align(char **strp);
void null_at(char **data, size_t index);
void unsunder(char *str, size_t true_len);
void sunder(char *str);
#ifndef HAVE_STRCASECMP
int nstricmp(const char *s1, const char *s2);
#endif
#ifndef HAVE_STRNCASECMP
int nstrnicmp(const char *s1, const char *s2, size_t n);
#endif
#ifndef NANO_SMALL
const char *revstrstr(const char *haystack, const char *needle,
const char *rev_start);
@@ -411,16 +426,28 @@ void *nmalloc(size_t howmuch);
void *nrealloc(void *ptr, size_t howmuch);
char *mallocstrcpy(char *dest, const char *src);
void new_magicline(void);
#ifndef NANO_SMALL
void mark_order(const filestruct **top, size_t *top_x,
const filestruct **bot, size_t *bot_x);
#endif
#ifndef DISABLE_TABCOMP
int check_wildcard_match(const char *text, const char *pattern);
#endif
/* Public functions in winio.c */
int get_kbinput(WINDOW *win, int *meta, int rebind_delete);
char *get_verbatim_kbinput(WINDOW *win, int *kbinput_len);
int get_ignored_kbinput(WINDOW *win);
int get_accepted_kbinput(WINDOW *win, int kbinput, int *meta,
int rebind_delete);
int get_ascii_kbinput(WINDOW *win, int kbinput);
int get_escape_seq_kbinput(WINDOW *win, int kbinput);
int get_skip_tilde_kbinput(WINDOW *win, int errval, int retval);
int do_first_line(void);
int do_last_line(void);
int xpt(const filestruct *fileptr, int index);
size_t xplustabs(void);
size_t actual_x(const filestruct *fileptr, size_t xplus);
size_t actual_x(const char *str, size_t xplus);
size_t strnlenpt(const char *buf, size_t size);
size_t strlenpt(const char *buf);
void blank_bottombars(void);
@@ -429,7 +456,8 @@ void blank_edit(void);
void blank_statusbar(void);
void blank_statusbar_refresh(void);
void check_statblank(void);
void nanoget_repaint(const char *buf, const char *inputbuf, int x);
char *display_string(const char *buf, size_t start_col, int len);
void nanoget_repaint(const char *buf, const char *inputbuf, size_t x);
int nanogetstr(int allowtabs, const char *buf, const char *def,
#ifndef NANO_SMALL
historyheadtype *history_list,
@@ -446,21 +474,18 @@ void onekey(const char *keystroke, const char *desc, int len);
#ifndef NDEBUG
int check_linenumbers(const filestruct *fileptr);
#endif
int get_page_start(int column);
size_t get_page_start(size_t column);
void reset_cursor(void);
void add_marked_sameline(int begin, int end, filestruct *fileptr, int y,
int virt_cur_x, int this_page);
void edit_add(const filestruct *fileptr, int yval, int start
#ifndef NANO_SMALL
, int virt_mark_beginx, int virt_cur_x
#endif
);
void update_line(filestruct *fileptr, int index);
void edit_add(const filestruct *fileptr, const char *converted,
int yval, size_t start);
void update_line(const filestruct *fileptr, size_t index);
void update_cursor(void);
void center_cursor(void);
void edit_refresh(void);
void edit_refresh_clearok(void);
void edit_update(filestruct *fileptr, topmidbotnone location);
void edit_update(filestruct *fileptr, topmidnone location);
int statusq(int tabs, const shortcut *s, const char *def,
#ifndef NANO_SMALL
historyheadtype *history_list,
@@ -474,7 +499,6 @@ int do_cursorpos(int constant);
int do_cursorpos_void(void);
int line_len(const char *ptr);
int do_help(void);
int keypad_on(WINDOW *win, int newval);
void do_replace_highlight(int highlight_flag, const char *word);
void fix_editbot(void);
#ifdef DEBUG

View File

@@ -49,8 +49,10 @@ const static rcoption rcopts[] = {
#ifndef DISABLE_WRAPJUSTIFY
{"fill", 0},
#endif
{"keypad", ALT_KEYPAD},
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
#ifndef NANO_SMALL
{"historylog", HISTORYLOG},
#endif
#ifndef DISABLE_MOUSE
{"mouse", USE_MOUSE},
#endif
#ifdef ENABLE_MULTIBUFFER
@@ -68,6 +70,7 @@ const static rcoption rcopts[] = {
{"operatingdir", 0},
#endif
{"preserve", PRESERVE},
{"rebinddelete", REBIND_DELETE},
#ifndef DISABLE_JUSTIFY
{"quotestr", 0},
#endif
@@ -84,7 +87,6 @@ const static rcoption rcopts[] = {
{"tabsize", 0},
{"tempfile", TEMP_OPT},
{"view", VIEW_MODE},
{"historylog", HISTORYLOG},
{NULL, 0}
};
@@ -170,7 +172,7 @@ char *parse_argument(char *ptr)
ptr = NULL;
else
*ptr++ = '\0';
rcfile_error(_("argument %s has unterminated \""), ptr_bak);
rcfile_error(_("Argument %s has unterminated \""), ptr_bak);
} else {
*last_quote = '\0';
ptr = last_quote + 1;
@@ -212,11 +214,11 @@ int colortoint(const char *colorname, int *bright)
else if (!strcasecmp(colorname, "black"))
mcolor = COLOR_BLACK;
else {
rcfile_error(_("color %s not understood.\n"
"Valid colors are \"green\", \"red\", \"blue\", \n"
"\"white\", \"yellow\", \"cyan\", \"magenta\" and \n"
"\"black\", with the optional prefix \"bright\".\n"),
colorname);
rcfile_error(_("Color %s not understood.\n"
"Valid colors are \"green\", \"red\", \"blue\", \n"
"\"white\", \"yellow\", \"cyan\", \"magenta\" and \n"
"\"black\", with the optional prefix \"bright\" \n"
"for foreground colors.\n"), colorname);
mcolor = -1;
}
return mcolor;
@@ -271,7 +273,7 @@ void parse_syntax(char *ptr)
return;
if (*ptr != '"') {
rcfile_error(_("regex strings must begin and end with a \" character\n"));
rcfile_error(_("Regex strings must begin and end with a \" character\n"));
return;
}
ptr++;
@@ -295,7 +297,7 @@ void parse_syntax(char *ptr)
tmpsyntax->next = (syntaxtype *)nmalloc(sizeof(syntaxtype));
tmpsyntax = tmpsyntax->next;
#ifdef DEBUG
fprintf(stderr, _("Adding new syntax after 1st\n"));
fprintf(stderr, "Adding new syntax after 1st\n");
#endif
}
tmpsyntax->desc = mallocstrcpy(NULL, nameptr);
@@ -303,7 +305,7 @@ void parse_syntax(char *ptr)
tmpsyntax->extensions = NULL;
tmpsyntax->next = NULL;
#ifdef DEBUG
fprintf(stderr, _("Starting a new syntax type\n"));
fprintf(stderr, "Starting a new syntax type\n");
fprintf(stderr, "string val=%s\n", nameptr);
#endif
@@ -354,8 +356,14 @@ void parse_colors(char *ptr)
}
if (strstr(fgstr, ",")) {
char *bgcolorname;
strtok(fgstr, ",");
bg = colortoint(strtok(NULL, ","), &bright);
bgcolorname = strtok(NULL, ",");
if (!strncasecmp(bgcolorname, "bright", 6)) {
rcfile_error(_("Background color %s cannot be bright"), bgcolorname);
return;
}
bg = colortoint(bgcolorname, &bright);
} else
bg = -1;
@@ -395,7 +403,7 @@ void parse_colors(char *ptr)
}
if (*ptr != '"') {
rcfile_error(_("regex strings must begin and end with a \" character\n"));
rcfile_error(_("Regex strings must begin and end with a \" character\n"));
ptr = parse_next_regex(ptr);
continue;
}
@@ -417,7 +425,7 @@ void parse_colors(char *ptr)
if (tmpsyntax->color == NULL) {
tmpsyntax->color = newcolor;
#ifdef DEBUG
fprintf(stderr, _("Starting a new colorstring for fg %d bg %d\n"),
fprintf(stderr, "Starting a new colorstring for fg %d bg %d\n",
fg, bg);
#endif
} else {
@@ -425,7 +433,7 @@ void parse_colors(char *ptr)
tmpcolor = tmpcolor->next)
;
#ifdef DEBUG
fprintf(stderr, _("Adding new entry for fg %d bg %d\n"), fg, bg);
fprintf(stderr, "Adding new entry for fg %d bg %d\n", fg, bg);
#endif
tmpcolor->next = newcolor;
}
@@ -442,7 +450,7 @@ void parse_colors(char *ptr)
if (*ptr != '"') {
rcfile_error(_
("regex strings must begin and end with a \" character\n"));
("Regex strings must begin and end with a \" character\n"));
continue;
}
ptr++;
@@ -483,7 +491,7 @@ void parse_rcfile(FILE *rcstream)
if (*ptr == '#') {
#ifdef DEBUG
fprintf(stderr, _("%s: Read a comment\n"), "parse_rcfile()");
fprintf(stderr, "%s: Read a comment\n", "parse_rcfile()");
#endif
continue; /* Skip past commented lines */
}
@@ -506,7 +514,7 @@ void parse_rcfile(FILE *rcstream)
parse_colors(ptr);
#endif /* ENABLE_COLOR */
else {
rcfile_msg(_("command %s not understood"), keyword);
rcfile_msg(_("Command %s not understood"), keyword);
continue;
}
@@ -518,7 +526,7 @@ void parse_rcfile(FILE *rcstream)
for (i = 0; rcopts[i].name != NULL; i++) {
if (!strcasecmp(option, rcopts[i].name)) {
#ifdef DEBUG
fprintf(stderr, _("%s: Parsing option %s\n"),
fprintf(stderr, "%s: Parsing option %s\n",
"parse_rcfile()", rcopts[i].name);
#endif
if (set == 1) {
@@ -538,7 +546,7 @@ void parse_rcfile(FILE *rcstream)
) {
if (*ptr == '\n' || *ptr == '\0') {
rcfile_error(_
("option %s requires an argument"),
("Option %s requires an argument"),
rcopts[i].name);
continue;
}
@@ -563,7 +571,7 @@ void parse_rcfile(FILE *rcstream)
* errors. */
j = (int)strtol(option, &first_error, 10);
if (errno == ERANGE || *option == '\0' || *first_error != '\0')
rcfile_error(_("requested fill size %d invalid"),
rcfile_error(_("Requested fill size %d invalid"),
j);
else
wrap_at = j;
@@ -587,7 +595,7 @@ void parse_rcfile(FILE *rcstream)
* errors. */
j = (int)strtol(option, &first_error, 10);
if (errno == ERANGE || *option == '\0' || *first_error != '\0')
rcfile_error(_("requested tab size %d invalid"),
rcfile_error(_("Requested tab size %d invalid"),
j);
else
tabsize = j;
@@ -595,13 +603,13 @@ void parse_rcfile(FILE *rcstream)
} else
SET(rcopts[i].flag);
#ifdef DEBUG
fprintf(stderr, _("set flag %d!\n"),
fprintf(stderr, "set flag %d!\n",
rcopts[i].flag);
#endif
} else {
UNSET(rcopts[i].flag);
#ifdef DEBUG
fprintf(stderr, _("unset flag %d!\n"),
fprintf(stderr, "unset flag %d!\n",
rcopts[i].flag);
#endif
}
@@ -640,7 +648,7 @@ void do_rcfile(void)
/* Rely on $HOME, fall back on getpwuid() */
if (homenv != NULL) {
nanorc = nrealloc(nanorc, strlen(homenv) + 10);
nanorc = charealloc(nanorc, strlen(homenv) + 10);
sprintf(nanorc, "%s/.nanorc", homenv);
} else {
userage = getpwuid(euid);
@@ -650,7 +658,7 @@ void do_rcfile(void)
rcfile_error(_("I can't find my home directory! Wah!"));
SET(NO_RCFILE);
} else {
nanorc = nrealloc(nanorc, strlen(userage->pw_dir) + 9);
nanorc = charealloc(nanorc, strlen(userage->pw_dir) + 9);
sprintf(nanorc, "%s/.nanorc", userage->pw_dir);
}
@@ -676,6 +684,7 @@ void do_rcfile(void)
fclose(rcstream);
}
}
lineno = 0;
free(nanorc);
#ifdef ENABLE_COLOR

View File

@@ -67,7 +67,6 @@ void not_found_msg(const char *str)
void search_abort(void)
{
UNSET(KEEP_CUTBUFFER);
display_main_list();
wrefresh(bottomwin);
if (ISSET(MARK_ISSET))
@@ -108,18 +107,22 @@ int search_init(int replacing)
search_init_globals();
/* If we don't already have a backupstring, set it. */
if (backupstring == NULL)
backupstring = mallocstrcpy(backupstring, "");
backupstring = mallocstrcpy(NULL, "");
#ifndef NANO_SMALL
search_history.current = (historytype *)&search_history.next;
#endif
if (last_search[0] != '\0') {
char *disp = display_string(last_search, 0, COLS / 3);
buf = charalloc(COLS / 3 + 7);
/* We use COLS / 3 here because we need to see more on the line */
sprintf(buf, " [%.*s%s]", COLS / 3, last_search,
strlen(last_search) > COLS / 3 ? "..." : "");
sprintf(buf, " [%s%s]", disp,
strlenpt(last_search) > COLS / 3 ? "..." : "");
free(disp);
} else {
buf = charalloc(1);
buf[0] = '\0';
@@ -133,17 +136,23 @@ int search_init(int replacing)
"%s%s%s%s%s%s",
_("Search"),
#ifndef NANO_SMALL
/* This string is just a modifier for the search prompt,
no grammar is implied */
ISSET(CASE_SENSITIVE) ? _(" [Case Sensitive]") : "",
ISSET(CASE_SENSITIVE) ? _(" [Case Sensitive]") :
#endif
"",
/* This string is just a modifier for the search prompt,
no grammar is implied */
ISSET(USE_REGEXP) ? _(" [Regexp]") : "",
#ifndef NANO_SMALL
/* This string is just a modifier for the search prompt,
no grammar is implied */
ISSET(REVERSE_SEARCH) ? _(" [Backwards]") : "",
ISSET(REVERSE_SEARCH) ? _(" [Backwards]") :
#endif
"",
replacing ? _(" (to replace)") : "",
buf);
@@ -151,12 +160,13 @@ int search_init(int replacing)
/* Release buf now that we don't need it anymore */
free(buf);
free(backupstring);
backupstring = NULL;
/* Cancel any search, or just return with no previous search */
if (i == -1 || (i < 0 && last_search[0] == '\0')) {
statusbar(_("Search Cancelled"));
reset_cursor();
free(backupstring);
backupstring = NULL;
#ifndef NANO_SMALL
search_history.current = search_history.next;
#endif
@@ -170,29 +180,23 @@ int search_init(int replacing)
if (regexp_init(last_search) == 0) {
statusbar(regex_error, last_search);
reset_cursor();
free(backupstring);
backupstring = NULL;
return -3;
}
#endif
break;
case 0: /* They entered something new */
last_replace[0] = '\0';
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP))
if (regexp_init(answer) == 0) {
statusbar(regex_error, answer);
reset_cursor();
free(backupstring);
backupstring = NULL;
#ifndef NANO_SMALL
search_history.current = search_history.next;
#endif
return -3;
}
#endif
free(backupstring);
backupstring = NULL;
last_replace[0] = '\0';
break;
#ifndef NANO_SMALL
case TOGGLE_CASE_KEY:
@@ -214,8 +218,6 @@ int search_init(int replacing)
backupstring = mallocstrcpy(backupstring, answer);
return -2; /* Call the opposite search function */
case NANO_FROMSEARCHTOGOTO_KEY:
free(backupstring);
backupstring = NULL;
#ifndef NANO_SMALL
search_history.current = search_history.next;
#endif
@@ -227,8 +229,6 @@ int search_init(int replacing)
return -3;
default:
do_early_abort();
free(backupstring);
backupstring = NULL;
return -3;
}
}
@@ -386,7 +386,9 @@ int do_search(void)
filestruct *fileptr = current, *didfind;
int fileptr_x = current_x;
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
i = search_init(0);
switch (i) {
case -1:
@@ -431,6 +433,48 @@ int do_search(void)
return 1;
}
/* Search for the next string without prompting. */
int do_research(void)
{
filestruct *fileptr = current, *didfind;
int fileptr_x = current_x;
#ifdef HAVE_REGEX_H
const char *regex_error = _("Invalid regex \"%s\"");
#endif /* HAVE_REGEX_H */
#ifndef DISABLE_WRAPPING
wrap_reset();
#endif
search_init_globals();
if (last_search[0] != '\0') {
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP))
if (regexp_init(last_search) == 0) {
statusbar(regex_error, last_search);
reset_cursor();
return -3;
}
#endif
search_last_line = 0;
didfind = findnextstr(FALSE, FALSE, current, current_x, last_search);
if (fileptr == current && fileptr_x == current_x && didfind != NULL)
statusbar(_("This is the only occurrence"));
else if (current->lineno <= edittop->lineno
|| current->lineno >= editbot->lineno)
edit_update(current, CENTER);
} else
statusbar(_("No current search pattern"));
search_abort();
return 1;
}
void replace_abort(void)
{
/* Identical to search_abort, so we'll call it here. If it
@@ -588,6 +632,8 @@ int do_replace_loop(const char *prevanswer, const filestruct *begin,
last_replace = mallocstrcpy(last_replace, answer);
while (1) {
size_t match_len;
/* Sweet optimization by Rocco here */
fileptr = findnextstr(fileptr || replaceall || search_last_line,
FALSE, begin, *beginx, prevanswer);
@@ -608,13 +654,27 @@ int do_replace_loop(const char *prevanswer, const filestruct *begin,
if (numreplaced == -1)
numreplaced = 0;
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP))
match_len = regmatches[0].rm_eo - regmatches[0].rm_so;
else
#endif
match_len = strlen(prevanswer);
if (!replaceall) {
char *exp_word;
size_t xpt = xplustabs();
exp_word = display_string(current->data, xpt,
strnlenpt(current->data, match_len + current_x) - xpt);
curs_set(0);
do_replace_highlight(TRUE, prevanswer);
do_replace_highlight(TRUE, exp_word);
*i = do_yesno(1, 1, _("Replace this instance?"));
do_replace_highlight(FALSE, prevanswer);
do_replace_highlight(FALSE, exp_word);
free(exp_word);
curs_set(1);
}
@@ -768,12 +828,6 @@ int do_replace(void)
return 1;
}
void goto_abort(void)
{
UNSET(KEEP_CUTBUFFER);
display_main_list();
}
int do_gotoline(int line, int save_pos)
{
if (line <= 0) { /* Ask for it */
@@ -787,7 +841,7 @@ int do_gotoline(int line, int save_pos)
if (st == -1 || st == -2)
statusbar(_("Aborted"));
if (st != 0) {
goto_abort();
display_main_list();
return 0;
}
@@ -796,7 +850,7 @@ int do_gotoline(int line, int save_pos)
/* Bounds check */
if (line <= 0) {
statusbar(_("Come on, be reasonable"));
goto_abort();
display_main_list();
return 0;
}
}
@@ -813,7 +867,7 @@ int do_gotoline(int line, int save_pos)
else
edit_update(current, CENTER);
placewewant = 0;
goto_abort();
display_main_list();
return 1;
}
@@ -909,6 +963,7 @@ int do_find_bracket(void)
statusbar(_("No matching bracket"));
current_x = current_x_save;
current = current_save;
update_line(current, current_x);
break;
}
}
@@ -966,7 +1021,7 @@ void insert_node(historytype *h, const char *s)
{
historytype *a;
a = nmalloc(sizeof(historytype));
a = (historytype *)nmalloc(sizeof(historytype));
a->next = h->next;
a->prev = h->next->prev;
h->next->prev = a;

View File

@@ -30,6 +30,18 @@
#include "proto.h"
#include "nano.h"
#ifdef BROKEN_REGEXEC
#undef regexec
int regexec_safe(const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags)
{
if (string != NULL && *string != '\0')
return regexec(preg, string, nmatch, pmatch, eflags);
return REG_NOMATCH;
}
#define regexec(preg, string, nmatch, pmatch, eflags) regexec_safe(preg, string, nmatch, pmatch, eflags)
#endif
int is_cntrl_char(int c)
{
return (-128 <= c && c < -96) || (0 <= c && c < 32) ||
@@ -54,15 +66,16 @@ int num_of_digits(int n)
/* Fix the memory allocation for a string. */
void align(char **strp)
{
if (strp != NULL)
*strp = nrealloc(*strp, strlen(*strp) + 1);
assert(strp != NULL);
if (*strp != NULL)
*strp = charealloc(*strp, strlen(*strp) + 1);
}
/* Null a string at a certain index and align it. */
void null_at(char **data, size_t index)
{
assert(data != NULL);
*data = (char *)nrealloc(*data, sizeof(char) * (index + 1));
*data = charealloc(*data, index + 1);
(*data)[index] = '\0';
}
@@ -86,6 +99,37 @@ void sunder(char *str)
*str = '\0';
}
#ifndef HAVE_STRCASECMP
/* This function is equivalent to strcasecmp(). */
int nstricmp(const char *s1, const char *s2)
{
assert(s1 != NULL && s2 != NULL);
for (; *s1 != '\0' && *s2 != '\0'; s1++, s2++) {
if (tolower(*s1) != tolower(*s2))
break;
}
return (tolower(*s1) - tolower(*s2));
}
#endif
#ifndef HAVE_STRNCASECMP
/* This function is equivalent to strncasecmp(). */
int nstrnicmp(const char *s1, const char *s2, size_t n)
{
assert(s1 != NULL && s2 != NULL);
for (; n > 0 && *s1 != '\0' && *s2 != '\0'; n--, s1++, s2++) {
if (tolower(*s1) != tolower(*s2))
break;
}
if (n > 0)
return (tolower(*s1) - tolower(*s2));
else if (n == 0)
return 0;
else if (n < 0)
return -1;
}
#endif
/* None of this is needed if we're using NANO_SMALL! */
#ifndef NANO_SMALL
const char *revstrstr(const char *haystack, const char *needle,
@@ -247,7 +291,7 @@ char *mallocstrcpy(char *dest, const char *src)
/* Append a new magic-line to filebot. */
void new_magicline(void)
{
filebot->next = nmalloc(sizeof(filestruct));
filebot->next = (filestruct *)nmalloc(sizeof(filestruct));
filebot->next->data = charalloc(1);
filebot->next->data[0] = '\0';
filebot->next->prev = filebot;
@@ -258,6 +302,28 @@ void new_magicline(void)
totsize++;
}
#ifndef NANO_SMALL
/* 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. */
void mark_order(const filestruct **top, size_t *top_x,
const filestruct **bot, size_t *bot_x)
{
assert(top != NULL && top_x != NULL && bot != NULL && bot_x != NULL);
if ((current->lineno == mark_beginbuf->lineno && current_x > mark_beginx)
|| current->lineno > mark_beginbuf->lineno) {
*top = mark_beginbuf;
*top_x = mark_beginx;
*bot = current;
*bot_x = current_x;
} else {
*bot = mark_beginbuf;
*bot_x = mark_beginx;
*top = current;
*top_x = current_x;
}
}
#endif
#ifndef DISABLE_TABCOMP
/*
* Routine to see if a text string is matched by a wildcard pattern.

File diff suppressed because it is too large Load Diff