Compare commits

..

60 Commits

Author SHA1 Message Date
Chris Allegretta
629edad237 0.9.18 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@226 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-19 00:27:19 +00:00
Chris Allegretta
834a69d5a4 Revised de.po translations by floki@bigfoot.com
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@225 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-18 17:11:33 +00:00
Chris Allegretta
f45c18daa0 Fix bug #44 by Rocco Corsi
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@224 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-16 05:25:06 +00:00
Chris Allegretta
0b88ce08cb Mouse fix for new key handling code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@223 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-15 15:46:32 +00:00
Chris Allegretta
c9f147aba3 Finally closed bug #16 for inactivity, updated TODO
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@222 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-15 13:28:05 +00:00
Chris Allegretta
e7034c6087 onekey() - Off by one error fix fix ;-) (Rocco Corsi)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@221 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-15 03:31:09 +00:00
Chris Allegretta
90bd712c88 Default case for slang AC_TRY_RUNs in configure.in
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@220 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-13 18:12:05 +00:00
Chris Allegretta
9c35eb0def Made insert key call do_insertfile()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@219 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-13 14:24:52 +00:00
Chris Allegretta
92c9dd255c Oops, update editwinrows in window_init()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@218 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-13 14:03:27 +00:00
Chris Allegretta
2a42af1d62 More display updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@217 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-12 23:02:49 +00:00
Chris Allegretta
16e4168993 A heapin spoonful of updates in key handling
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@216 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-11 22:33:54 +00:00
Chris Allegretta
d0dbb40ef6 Oops, I meant in gnome terminal, not xterm ;)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-11 13:36:46 +00:00
Chris Allegretta
91d392cd2b Adding a new BUG and closing out #41
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@214 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-11 13:27:09 +00:00
Chris Allegretta
b9bfc9bc4f back out change in findnexstr that was causing more bugs *sigh*
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@213 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-10 05:06:09 +00:00
Jordi Mallach
2dc0f6b2bf Gettextized the new Meta strings in nano.c and updated es.po.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@212 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-07 10:48:00 +00:00
Chris Allegretta
44e73dfc96 Show two lines from previous page in help file when paging down
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@211 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-07 03:37:38 +00:00
Chris Allegretta
9239d742d6 Use raw mode if _POSIX_VDISABLE isn't available, to allow support under cygwin
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@210 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-06 15:19:18 +00:00
Chris Allegretta
43932bd17b Type in nano.h
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@209 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-06 14:08:37 +00:00
Chris Allegretta
805c26d1a6 Changed _POSIX_VERSION checks in regex code to HAVE_REGEX_H, added check for regex.h in configure.in
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@208 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-06 13:39:17 +00:00
Chris Allegretta
d746d90cc3 Assigned entire file cut a number, crediting Ken in BUGS instead of ChangeLog
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@207 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-05 13:15:44 +00:00
Chris Allegretta
429a5518ea Fix to cut.c for cutting entire file with marker
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@206 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-05 13:09:56 +00:00
Chris Allegretta
bf9da287a0 Changed version and files to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@205 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 17:44:59 +00:00
Chris Allegretta
423cbfd743 off by one in toggle help code and set up for 0.9.17 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@203 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 16:21:29 +00:00
Chris Allegretta
5577aec4e8 5 newlines instead of 4 on suspend and po update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@202 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 03:53:04 +00:00
Chris Allegretta
18f8be0058 Implemented suspend code to work with Meta-Z
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@201 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-04 03:20:38 +00:00
Chris Allegretta
f8163dc2e7 Added space to autoindent toggle string
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@200 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-03 01:06:40 +00:00
Chris Allegretta
f0f63a82fb Changed awkward messages for no help and no wrap mode toggles
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@199 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 18:44:21 +00:00
Chris Allegretta
a547fd1e0e Removed commented out wrap code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@198 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 17:38:44 +00:00
Chris Allegretta
6306a11ad6 update_line(): Added check for binary data >= 1 and <= 26, and use ^+letter ot display it
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@197 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:55:41 +00:00
Chris Allegretta
9541f2a1d3 credit to Mini edit team for Meta idea
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@196 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:31:32 +00:00
Chris Allegretta
d56bd79daf Fixed typos and updated PO files
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@195 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:27:10 +00:00
Chris Allegretta
e49f123cc0 Moved the toggle Meta keystrokes to the first column. Updated documentation and help code for Meta keys rather than 'alt keys'
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@194 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-02 07:20:39 +00:00
Chris Allegretta
4c780be883 Added small message when using --enable-tiny and toggle keys
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@193 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-01 17:59:18 +00:00
Chris Allegretta
220e7fb132 Oops, fixed the VERSION back to -cvs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@192 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-01 13:37:49 +00:00
Chris Allegretta
756f220a26 New toggles for flags via Meta
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@191 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-09-01 13:32:47 +00:00
Chris Allegretta
cf7c9936ad Updated BUGS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@190 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-30 13:57:36 +00:00
Chris Allegretta
9babaf3b38 findnextstr() - Fixed check for string that only occurs on the same line failing
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@189 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-30 13:49:33 +00:00
Chris Allegretta
340d6e50c2 Made wrapping code less ambitious
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@188 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-29 03:55:29 +00:00
Chris Allegretta
dabc3cb0df Off by one error fix (Rocco Corsi)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@187 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-25 01:44:12 +00:00
Chris Allegretta
e10debd14b Updates by Ben Roberts
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@186 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-22 01:26:42 +00:00
Chris Allegretta
f1d33d30ce Get rid of lack of update when searching andmark is set
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@185 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-19 03:53:39 +00:00
Chris Allegretta
8c81d23a7e Doc updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@184 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-16 02:52:44 +00:00
Chris Allegretta
8d458043d1 cvs branch for 0.9.16
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@183 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 22:11:20 +00:00
Chris Allegretta
5286ccbaf9 0.9.16 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@181 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 22:09:38 +00:00
Chris Allegretta
ba96f7afac Doc updates for 0.9.16 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@180 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 21:38:28 +00:00
Chris Allegretta
a2efc36799 One more time, configure.in slang check
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@179 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-09 03:26:33 +00:00
Chris Allegretta
e5935973f9 New (and again revised =) slang test code (Albert Chin-A-Young)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@178 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-08 22:00:30 +00:00
Chris Allegretta
13415991e8 Added Id to Makefile.am
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@177 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-08 16:59:04 +00:00
Chris Allegretta
b7ea9d45bb New libm test for slang
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@176 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-08 01:49:55 +00:00
Chris Allegretta
0286ba436e Whoops, must let check for blowing away cutbuffer get run before exit on cutting magic line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@175 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 14:58:26 +00:00
Chris Allegretta
c86f714a15 No more cutting the macic line, added check_statblank() to cut and uncut
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@174 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 14:39:32 +00:00
Chris Allegretta
9b45ff54ac Okay, it's not going to work for Makefile.am
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@173 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 02:25:43 +00:00
Chris Allegretta
2b78429248 More RCS schtuff
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@172 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 02:22:40 +00:00
Chris Allegretta
c87a411624 More RCS schtuff
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@171 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-07 02:16:24 +00:00
Chris Allegretta
141c1274c4 Testing RCS headers
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@170 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-06 21:13:46 +00:00
Chris Allegretta
11b0011b1f Testing RCS headers
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@169 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-06 21:13:45 +00:00
Chris Allegretta
b4dc9e0944 New slang test code (Albert Chin-A-Young)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@168 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-05 22:49:30 +00:00
Chris Allegretta
81b1eea10f Patch to handle
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@167 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-05 16:09:07 +00:00
Chris Allegretta
7dc14e81d7 Fixed getting locked into cutbuffer on cutting first line of file
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@166 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-05 16:03:19 +00:00
Chris Allegretta
4dbcc3cd9e Changed tabsize long arg to actually accept an argument *sigh*
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@165 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2000-08-04 15:44:29 +00:00
41 changed files with 3102 additions and 2005 deletions

View File

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

View File

@@ -1,3 +1,4 @@
$Id$
This file lists people who have made significant contribution to the nano
editor. Please see the ChangeLog for specific changes by author.
-------------------------------------------------------------------------

18
BUGS
View File

@@ -11,6 +11,8 @@
(14) [FIXED, mostly]
- Doing a replacement of a substring of the replace string (e.g. replacing
"ed" with "fred" causes an infinite loop. (15) [FIXED]
- Cutting a file with marked text and both marker ends on the same line
causes a random segfault (16) [FIXED]
- Cutting more than one line resets the KEEP_CUTBUFFER flag in 0.9.3
Error is in bitwise assignment (nano.h). (17) [FIXED]
- The wrapping code does not work right for lines like the following:
@@ -51,6 +53,18 @@
written out to disk when saved..... (37). [FIXED]
- Page up and page down do not work the same way as Pico (# of lines). (38)
[FIXED]
- When doing a search and the marker is set, the screen does not always
properly update the inverted text (39). [FIXED]
- Searches for a string that only exist on one line multiple times will
fail after finding the last occurance (discovered by Ken Tyler) (40). [FIXED]
- Alt-Z is current broken to toggle suspend. I guess I still don't know
signals very well =-) (41) [FIXED].
- Unable to cut the entire file using the marker (discovered by Kev Tyler)
(42). [FIXED]
- The keypad does not work when nano runs in the Gnome terminal (43). [FIXED]
- When reading in a file, if the file is a directory the contents of the
file being edited are blown away (discovered by Chris Pimlot) (44). [FIXED]
** Open BUGS **
- Marked cutting sometimes leaves a newline in the file unintelligently,
@@ -59,7 +73,7 @@
- no way to do a replace with the empty string. (11)
- Spelling support is not elegant like pico's integration of the 'spell'
program. Nano only uses ispell (for now) (12)
- Cutting a file with marked text and both marker ends on the same line
causes a random segfault (16) [FIXED?]
- In replace, there is no way to accept the default replace string. (27)
- totsize problems still abound in do_justify (33)
$Id$

123
ChangeLog
View File

@@ -1,3 +1,124 @@
nano 0.9.18 - 09/18/2000
- General
- Changed _POSIX_VERSION checks in regex code to HAVE_REGEX_H,
added check for regex.h in configure.in.
- configure.in:
- Added default case for cross-compiling to get rid of annoying
AC_TRY_RUN warning.
- cut.c:
do_cut_text()
- Don't immediately abort if we're on filebot and the marker is
set (fixes bug #42).
- files.c:
open_file()
- Fix for bug #44 (Rocco Corsi).
- global.c:
shortcut_init()
- Added in FKEYs that for some reason were left out. *boggle*
- nano.c:
main()
- Added check for _POSIX_VDISABLE and use raw mode if not
available, allows nano to work with cygwin.
- Added gettext calls to enable/disable strings (Jordi).
- Revamped a great deal of the F-key and keypad key handling,
because we not longer use keypad() (see below).
- Removed keypad() call because nano was not working with the
keypad in many terms, which is very bad.
- Made insert key call do_insertfile().
do_toggle()
- Rewrote function to allow NOHELP toggle to wotk on systems
without a working resizewin(). New function window_init().
mouse_init()
- Add keypad only if mouse support is on, otherwise mouse doesn't
work. I guess you have to choose between having the mouse and
having a working keypad for the time being (thank god for Meta-m).
- winio.c:
total_refresh()
- Added titlebar() call.
onekey()
- Off by one error fix fix ;-) (Rocco Corsi).
- search.c:
findnextstr()
- Reset starting at current for search instead of begin.
- es.po:
- Translated new strings and minor updates (Jordi).
- de.po
- Revised translations by floki@bigfoot.com
nano-0.9.17 - 09/04/2000
- General
- New shortcuts to toggle certain options that are normally only
flags via Alt/Meta. See Alt-C,E,I,K,M,P,X,Z. New struct called
toggles in nano.h, toggle_init(), toggle_init_one() in global.c
called from shortcut_init(), and do_toggle in nano.c. Also
moved the signal code into a separate function in nano.c called
signal_init(). Moved "struct sigaction act"into a static in
nano.c.
- Changed from Alt-key symbol (@) which is completely nonstandard
to the *nix "Meta" symbol (M-). Changed help_init to show
the M-key usage and the help text to explain keys whcih generate
Meta. Moved the toggle Meta keystrokes to the first column
instead of the third as they are the primary keystrokes for the
functions. Thanks Mini editor team :->
- Changed last_search and last_replace vars to statically
allocated (hence nulled) and moved to search.c (Matt Kraai).
- global.c:
toggle_init()
- Changed "No auto wrap" and "No help mode" to "Auto wrap" and
"Help mode". See the change to do_toggle() below.
- nano.c:
do_mouse()
- Patch for handling lines w/tabs and mouse better (Ben Roberts).
do_wrap()
- Made wrapping code less ambitious.
do_toggle()
- Added checks for no help and no wrap mode, and print opposite
enable/disable message.
do_suspend(), do_cont():
- New functions, handle suspend signal in a Pico-like manner and
work with Meta-Z.
- winio.c:
total_refresh()
- Added edit_refresh() call to actually update the screen if messy.
edit_refresh_clearok()
- New function, does a total update for edit refresh, needed to fix
lack of reversed text on searching with MARK_ISSET.
onekey()
- Off by one error fix (Rocco Corsi).
update_line()
- Added check for binary data >= 1 and <= 26, and use ^+letter
to display it. Should fix editing text files with binary
data in them. Placing of the cursor seems to be a bit screwed
though...
- search.c:
search_abort()
- Now calls edit_refresh_clearok when MARK_ISSET to handle screen
ugliness bug (reported by Ken Tyler).
findnextstr():
- Added reset for placewewant (Ben Roberts).
- Fixed check for string that only occurs on the same line failing
(discovered by Ken Tyler).
nano-0.9.16 - 08/09/2000
- cut.c:
do_cut_text()
- Fixed getting locked into cutbuffer on cutting first line of file.
- Added check_statblank().
- Check for fileptr == filebot, if so return, we shouldn't bother
cutting the magic line.
do_uncut_text()
- Added check_statblank().
- nano.c:
main()
- Changed tabsize long arg to actually accept an argument *sigh*.
- po/Makefile.in.in:
- Patch to handle $DESTDIR (orig by Dan Harnett contributed by
Christian Weisgerber)
- configure.in:
- New (and severally revised =) slang test code (Albert Chin-A-Young)
nano-0.9.15 - 08/03/2000
- Changed edit_update call to take arguments TOP, CENTER or BOTTOM.
Affects many many functions. Removed functions edit_update_top and
@@ -884,3 +1005,5 @@ nano 0.7.6 - 01/15/2000
0.2 Read in data to buffer, bound keystrokes to stub functions,
initial cursor movement on screen. Initial autoconf support.
0.1 Initial program setup w/ncurses
$Id$

View File

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

View File

@@ -1,3 +1,4 @@
## $Id$
bin_PROGRAMS = nano
nano_SOURCES = cut.c \
files.c \

24
NEWS
View File

@@ -1,3 +1,25 @@
09/18/2000 - Nano 0.9.18 is unleashed. It has some new keyboard
handling code, cygwin support out of the box, and
a more portable handler for the NOHELP toggle. There
is also a fix for a somewhat serious bug whereby trying
to insert a directory instead of a normal file would
destroy the contents of the editor. A must-see. Four
stars.
09/04/2000 - Nano 0.9.17, the Labor Day release, is released after a
quiet spell (almost an entire month since last release!)
New features include better (not yet perfect) binary
display support and toggle support for most of the program
flags (M-c, M-i, M-z, M-x, M-p, M-w, M-m, M-k and M-e for
-c, -i, -x, -p, -w, -k, and -R).
08/09/2000 - Nano 0.9.16, after some struggling, is release. This release
should fix a few of the holes that 0.9.15 dug. The
"cutting text on the first line" bug is fixed, as is the
"cutting text on the last line" bug. Nice symmetry there
huh? Also the --tabsize argument should now work as well
as by using -T.
08/03/2000 - Nano 0.9.15 is the "I cant think of a release description"
release. There are the usual gala of display bugfixes,
a for the the nasty bug in -k mode that could create a
@@ -250,3 +272,5 @@
http://faculty.plattsburgh.edu/astyanax/nano. Please
update your bookmarks, tell your friends, and all that
jazz.
$Id$

2
README
View File

@@ -80,3 +80,5 @@ Current Status
can guess, I'm not much of an emacs fan ;)
Chris Allegretta (chrisa@asty.org)
$Id$

9
TODO
View File

@@ -2,7 +2,7 @@ TODO file (? means the feature may be implemented, but not definitely)
-----------------------------------------------------------------------------
Current Version:
- Implement Spelling [DONE, mostly...]
- Implement Spelling [DONE]
- Implement Help [DONE]
- Internationalization [In progress, translators welcome!]
- Allow nano to be resized in X. [DONE]
@@ -11,9 +11,16 @@ Current Version:
- Rewrite edit_refresh, if at all possible [DONE]
- Implement justify function [DONE]
- Cut to end of line [DONE]
- Unjustify command (^U after ^J)
- Built-in speller command [needed for version 1.0]
- Better statusbar interaction (scrolling, tab completion for filename)
[needed for version 1.0]
For Next Version:
- Undo/Redo key?
- single line scroll up/down?
- Color syntax highlighting? (certainly seems like there's a demand for it.)
- .nanorc ?????
$Id$

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Define this if you have the wresize function in your ncurses-type library */
#undef HAVE_WRESIZE

View File

@@ -154,6 +154,9 @@
/* Define if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H

508
configure vendored

File diff suppressed because it is too large Load Diff

View File

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

24
cut.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* cut.c *
* *
@@ -135,6 +136,7 @@ int do_cut_text(void)
int newsize, cuttingtoend = 0;
#endif
check_statblank();
if (fileptr == NULL || fileptr->data == NULL)
return 0;
@@ -148,6 +150,11 @@ int do_cut_text(void)
fprintf(stderr, _("Blew away cutbuffer =)\n"));
#endif
}
/* Must let cutbuffer get blown away first before we do this... */
if (fileptr == filebot && !ISSET(MARK_ISSET))
return 0;
#ifndef NANO_SMALL
if (ISSET(CUT_TO_END) && !ISSET(MARK_ISSET)) {
if (current_x == strlen(current->data))
@@ -223,8 +230,8 @@ int do_cut_text(void)
totsize--; /* get the newline */
totlines--;
fileptr->prev = NULL;
edit_update(fileage, CENTER);
current = fileptr;
edit_update(fileage, CENTER);
} else {
add_to_cutbuffer(fileptr);
fileage = make_new_node(NULL);
@@ -241,18 +248,8 @@ int do_cut_text(void)
current = fileptr->next;
totlines--;
totsize--; /* get the newline */
} else {
/* we're deleteing the last line
and replacing it with a dummy line,
so totlines is the same */
tmp = fileptr->prev;
tmp->next = make_new_node(tmp);
tmp = tmp->next;
tmp->data = nmalloc(1);
strcpy(tmp->data, "");
current = tmp;
filebot = tmp;
}
} /* No longer an else here, because we never get here anymore...
No need to cut the magic line, as it's empty */
add_to_cutbuffer(fileptr);
}
@@ -284,6 +281,7 @@ int do_uncut_text(void)
int i;
wrap_reset();
check_statblank();
if (cutbuffer == NULL || fileptr == NULL)
return 0; /* AIEEEEEEEEEEEE */

View File

@@ -183,7 +183,7 @@ nano was developed).</font></blockquote>
of nano?</font></h2>
<blockquote><font color="#330000">The current version of nano *should*
be 0.9.15.&nbsp; Of course you should always check the nano hompage to
be 0.9.18.&nbsp; Of course you should always check the nano hompage to
see what the latest and greatest version is.</font></blockquote>
<h2>
@@ -300,7 +300,7 @@ isn't hard.&nbsp; Unpack the nano source with a command like:</font>
<p><b><font color="#330000">tar -zxvf nano-x.y.z.tar.gz</font></b>
<p><font color="#330000">If you get error messages about the -z option,
try this:</font>
<p><b><font color="#330000">gunzip -d nano-x.y.z.tar.gz | tar xvf -</font></b>
<p><b><font color="#330000">gzip -dc nano-x.y.z.tar.gz | tar xvf -</font></b>
<p><font color="#330000">(again, where x.y.z is the version number in question).&nbsp;
Then you need to run configure with any options you might want (if any).</font>
<p><font color="#330000">The average case is this:</font>
@@ -473,7 +473,7 @@ also licensed under the GPL.</font></blockquote>
their license?</font></h2>
<blockquote><font color="#330000">You're really not asking the right person
here.&nbsp; I (Chris) waited along time to see if UW would change their
here.&nbsp; I (Chris) waited a long time to see if UW would change their
license because of the amount of high quality software being released and
developed under the GPL without being taken advantage of by malicious corporate
entities or other baddies, but no such luck so far.</font></blockquote>
@@ -541,6 +541,7 @@ and you should know the answer.</font></blockquote>
<a NAME="8"></a>8. ChangeLog</h1>
<blockquote>06/31/2000 - Initial framework.</blockquote>
<P>
$Id$
</body>
</html>

View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* files.c *
* *
@@ -227,7 +228,8 @@ int open_file(char *filename, int insert, int quiet)
} else { /* File is A-OK */
if (S_ISDIR(fileinfo.st_mode)) {
statusbar(_("File \"%s\" is a directory"), filename);
new_file();
if (!insert)
new_file();
return -1;
}
if (!quiet)

View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* global.c *
* *
@@ -38,7 +39,7 @@ int center_x = 0, center_y = 0; /* Center of screen */
WINDOW *edit; /* The file portion of the editor */
WINDOW *topwin; /* Top line of screen */
WINDOW *bottomwin; /* Bottom buffer */
char *filename; /* Name of the file */
char filename[PATH_MAX]; /* Name of the file */
int editwinrows = 0; /* How many rows long is the edit
window? */
filestruct *current; /* Current buffer pointer */
@@ -53,7 +54,7 @@ filestruct *editbot = NULL; /* Same for the bottom */
filestruct *filebot = NULL; /* Last node in the file struct */
filestruct *cutbuffer = NULL; /* A place to store cut text */
char *answer; /* Answer str to many questions */
char answer[132]; /* Answer str to many questions */
int totlines = 0; /* Total number of lines in the file */
int totsize = 0; /* Total number of bytes in the file */
int placewewant = 0; /* The collum we'd like the cursor
@@ -77,12 +78,15 @@ shortcut goto_list[GOTO_LIST_LEN];
shortcut writefile_list[WRITEFILE_LIST_LEN];
shortcut help_list[HELP_LIST_LEN];
shortcut spell_list[SPELL_LIST_LEN];
toggle toggles[TOGGLE_LEN];
/* Regular expressions */
#ifdef HAVE_REGEX_H
regex_t search_regexp; /* Global to store compiled search regexp */
regmatch_t regmatches[10]; /* Match positions for parenthetical
subexpressions, max of 10 */
#endif
/* Initialize a struct *without* our lovely braces =( */
void sc_init_one(shortcut * s, int key, char *desc, char *help, int alt,
@@ -98,6 +102,56 @@ void sc_init_one(shortcut * s, int key, char *desc, char *help, int alt,
s->func = func;
}
/* Initialize the toggles in the same manner */
void toggle_init_one(toggle * t, int val, char *desc, int flag)
{
t->val = val;
t->desc = desc;
t->flag = flag;
}
void toggle_init(void)
{
#ifndef NANO_SMALL
char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg,
*toggle_nohelp_msg, *toggle_picomode_msg, *toggle_mouse_msg,
*toggle_cuttoend_msg, *toggle_regexp_msg, *toggle_wrap_msg;
toggle_const_msg = _("Constant cursor position");
toggle_autoindent_msg = _("Auto indent");
toggle_suspend_msg = _("Suspend");
toggle_nohelp_msg = _("Help mode");
toggle_picomode_msg = _("Pico messages");
toggle_mouse_msg = _("Mouse support");
toggle_cuttoend_msg = _("Cut to end");
#ifdef HAVE_REGEX_H
toggle_regexp_msg = _("Regular expressions");
#endif
toggle_wrap_msg = _("Auto wrap");
toggle_init_one(&toggles[0], TOGGLE_CONST_KEY, toggle_const_msg,
CONSTUPDATE);
toggle_init_one(&toggles[1], TOGGLE_AUTOINDENT_KEY, toggle_autoindent_msg,
AUTOINDENT);
toggle_init_one(&toggles[2], TOGGLE_SUSPEND_KEY, toggle_suspend_msg,
SUSPEND);
toggle_init_one(&toggles[3], TOGGLE_NOHELP_KEY, toggle_nohelp_msg,
NO_HELP);
toggle_init_one(&toggles[4], TOGGLE_PICOMODE_KEY, toggle_picomode_msg,
PICO_MSGS);
toggle_init_one(&toggles[5], TOGGLE_WRAP_KEY, toggle_wrap_msg,
NO_WRAP);
toggle_init_one(&toggles[6], TOGGLE_MOUSE_KEY, toggle_mouse_msg,
USE_MOUSE);
toggle_init_one(&toggles[7], TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg,
CUT_TO_END);
#ifdef HAVE_REGEX_H
toggle_init_one(&toggles[8], TOGGLE_REGEXP_KEY, toggle_regexp_msg,
USE_REGEXP);
#endif
#endif
}
void shortcut_init(void)
{
char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg = "",
@@ -149,10 +203,9 @@ void shortcut_init(void)
nano_cancel_msg = _("Cancel the current function");
#endif
if (ISSET(PICO_MSGS))
sc_init_one(&main_list[0], NANO_HELP_KEY, _("Get Help"),
nano_help_msg, 0, 0, 0, VIEW, do_help);
nano_help_msg, 0, NANO_HELP_FKEY, 0, VIEW, do_help);
else
sc_init_one(&main_list[0], NANO_WRITEOUT_KEY, _("WriteOut"),
nano_writeout_msg,
@@ -172,7 +225,8 @@ void shortcut_init(void)
if (ISSET(PICO_MSGS))
sc_init_one(&main_list[3], NANO_JUSTIFY_KEY, _("Justify"),
nano_justify_msg, 0, 0, 0, NOVIEW, do_justify);
nano_justify_msg, 0, NANO_JUSTIFY_FKEY, 0,
NOVIEW, do_justify);
else
sc_init_one(&main_list[3], NANO_REPLACE_KEY, _("Replace"),
nano_replace_msg,
@@ -250,7 +304,8 @@ void shortcut_init(void)
NANO_ALT_R, NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
else
sc_init_one(&main_list[23], NANO_JUSTIFY_KEY, _("Justify"),
nano_justify_msg, 0, 0, 0, NOVIEW, do_justify);
nano_justify_msg, 0, NANO_JUSTIFY_FKEY, 0,
NOVIEW, do_justify);
sc_init_one(&main_list[24], NANO_ENTER_KEY, _("Enter"),
nano_enter_msg,
@@ -262,7 +317,7 @@ void shortcut_init(void)
NANO_ALT_G, NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
else
sc_init_one(&main_list[25], NANO_HELP_KEY, _("Get Help"),
nano_help_msg, 0, 0, 0, VIEW, do_help);
nano_help_msg, 0, NANO_HELP_FKEY, 0, VIEW, do_help);
sc_init_one(&whereis_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
@@ -339,4 +394,5 @@ void shortcut_init(void)
sc_init_one(&spell_list[1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
toggle_init();
}

1
move.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* move.c *
* *

417
nano.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* nano.c *
* *
@@ -58,13 +59,12 @@
#endif
/* Former globals, now static */
char *last_search = "\0"; /* Last string we searched for */
char *last_replace = "\0"; /* Last replacement string */
int fill = 0; /* Fill - where to wrap lines, basically */
static char *alt_speller; /* Alternative spell command */
struct termios oldterm; /* The user's original term settings */
static char *help_text_init = "";
/* Initial message, not including shortcuts */
static struct sigaction act; /* For all out fun signal handlers */
/* What we do when we're all set to exit */
RETSIGTYPE finish(int sigage)
@@ -147,10 +147,6 @@ void global_init(void)
for (i = 0; i <= COLS - 1; i++)
hblank[i] = ' ';
hblank[i] = 0;
last_search = nmalloc(132);
last_replace = nmalloc(132);
answer = nmalloc(132);
}
void init_help_msg(void)
@@ -170,9 +166,11 @@ void init_help_msg(void)
"The bottom two lines show the most commonly used shortcuts "
"in the editor.\n\n "
"The notation for shortcuts is as follows: Control-key "
"sequences are notated with a caret (^) symbol. Alt-key "
"sequences are notated with an at (@) symbol. The following "
"keystrokes are available in the main editor window. "
"sequences are notated with a caret (^) symbol and are entered "
"with the Control (Ctrl) key. Escape-key sequences are notated "
"with the Meta (M) symbol and can be entered using either the "
"Esc, Alt or Meta key depending on your keyboard setup. The "
"following keystrokes are available in the main editor window. "
"Optional keys are shown in parentheses:\n\n");
#endif
@@ -321,7 +319,7 @@ void usage(void)
printf(_("Option Long option Meaning\n"));
printf(_
(" -T --tabsize=[num] Set width of a tab to num\n"));
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
printf(_
(" -R --regexp Use regular expressions for search\n"));
#endif
@@ -818,18 +816,6 @@ void do_wrap(filestruct * inptr, char input_char)
free(temp->data);
free(temp);
/* The next line line may need to be wrapped as well. */
current_y = old_y + 1;
current_x = strlen(inptr->next->data);
while (current_x >= 0) {
if (isspace(inptr->next->data[current_x])
&& (current_x < fill)) break;
current_x--;
}
if (current_x >= 0)
check_wrap(inptr->next, ' ');
current_x = old_x;
current_y = old_y;
}
@@ -1154,6 +1140,7 @@ int do_exit(void)
void do_mouse(void)
{
MEVENT mevent;
int foo = 0, tab_found = 0;
if (getmouse(&mevent) == ERR)
return;
@@ -1196,6 +1183,23 @@ void do_mouse(void)
}
}
current_x = mevent.x;
placewewant = current_x;
while(foo < current_x) {
if(current->data[foo] == NANO_CONTROL_I) {
current_x -= tabsize - (foo % tabsize);
tab_found = 1;
} else if(current->data[foo] & 0x80)
;
else if(current->data[foo] < 32)
current_x--;
foo++;
}
/* This is where tab_found comes in. I can't figure out why,
* but without it any line with a tab will place the cursor
* one character behind. Whatever, this fixes it. */
if(tab_found == 1)
current_x++;
if (current_x > strlen(current->data))
current_x = strlen(current->data);
@@ -1213,6 +1217,29 @@ RETSIGTYPE handle_hup(int signal)
finish(1);
}
/* What do we do when we catch the suspend signal */
RETSIGTYPE do_suspend(int signal)
{
act.sa_handler = SIG_DFL;
sigemptyset(&act.sa_mask);
sigaction(SIGTSTP, &act, NULL);
endwin();
fprintf(stderr,"\n\n\n\n\nUse \"fg\" to return to nano\n");
raise(SIGTSTP);
}
/* Restore the suspend handler when we come back into the prog */
RETSIGTYPE do_cont(int signal)
{
act.sa_handler = do_suspend;
sigemptyset(&act.sa_mask);
sigaction(SIGTSTP, &act, NULL);
initscr();
total_refresh();
}
void handle_sigwinch(int s)
{
@@ -1283,6 +1310,71 @@ void handle_sigwinch(int s)
#endif
}
void signal_init(void)
{
/* Trap SIGINT and SIGQUIT cuz we want them to do useful things. */
memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = SIG_IGN;
sigaction(SIGINT, &act, NULL);
if (!ISSET(SUSPEND)) {
sigaction(SIGTSTP, &act, NULL);
}
else
{
act.sa_handler = do_suspend;
sigaction(SIGTSTP, &act, NULL);
act.sa_handler = do_cont;
sigaction (SIGCONT, &act, NULL);
}
/* Trap SIGHUP cuz we want to write the file out. */
act.sa_handler = handle_hup;
sigaction(SIGHUP, &act, NULL);
act.sa_handler = handle_sigwinch;
sigaction(SIGWINCH, &act, NULL);
}
void window_init(void)
{
editwinrows = LINES - 5 + no_help();
/* Setup up the main text window */
edit = newwin(editwinrows, COLS, 2, 0);
/* And the other windows */
topwin = newwin(2, COLS, 0, 0);
bottomwin = newwin(3 - no_help(), COLS, LINES - 3 + no_help(), 0);\
}
void mouse_init(void)
{
#ifndef NANO_SMALL
#ifdef NCURSES_MOUSE_VERSION
if (ISSET(USE_MOUSE)) {
keypad(edit, TRUE);
keypad(bottomwin, TRUE);
mousemask(BUTTON1_RELEASED, NULL);
mouseinterval(50);
}
else {
mousemask(0, NULL);
keypad(edit, FALSE);
keypad(bottomwin, FALSE);
}
#endif
#endif
}
int do_tab(void)
{
do_char('\t');
@@ -1495,6 +1587,11 @@ void help_init(void)
if (main_list[i].help != NULL)
allocsize += strlen(main_list[i].help) + 15;
/* And for the toggle list, we also allocate space for extra text. */
for (i = 0; i <= TOGGLE_LEN - 1; i++)
if (toggles[i].desc != NULL)
allocsize += strlen(toggles[i].desc) + 30;
allocsize += strlen(help_text_init);
if (help_text != NULL)
@@ -1507,7 +1604,7 @@ void help_init(void)
strcpy(help_text, help_text_init);
/* Now add our shortcut info */
for (i = 0; i < MAIN_LIST_LEN; i++) {
for (i = 0; i < MAIN_LIST_LEN - 1; i++) {
sofar = snprintf(buf, BUFSIZ, "^%c ", main_list[i].val + 64);
if (main_list[i].misc1 > KEY_F0 && main_list[i].misc1 <= KEY_F(64))
@@ -1517,35 +1614,100 @@ void help_init(void)
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, " ");
if (main_list[i].altval > 0)
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(@%c) ",
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(M-%c) ",
main_list[i].altval - 32);
else
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, " ");
if (main_list[i].help != NULL)
snprintf(&buf[sofar], BUFSIZ - sofar, "%s", main_list[i].help);
strcat(help_text, buf);
strcat(help_text, "\n");
}
/* And the toggles... */
for (i = 0; i <= TOGGLE_LEN - 1; i++) {
sofar = snprintf(buf, BUFSIZ,
"M-%c ", toggles[i].val - 32 );
if (toggles[i].desc != NULL)
snprintf(&buf[sofar], BUFSIZ - sofar, _("%s enable/disable"),
toggles[i].desc);
strcat(help_text, buf);
strcat(help_text, "\n");
}
}
void do_toggle(int which)
{
#ifndef NANO_SMALL
char *enabled = _("enabled");
char *disabled = _("disabled");
if (ISSET(toggles[which].flag))
UNSET(toggles[which].flag);
else
SET(toggles[which].flag);
switch (toggles[which].val) {
case TOGGLE_PICOMODE_KEY:
shortcut_init();
display_main_list();
break;
case TOGGLE_SUSPEND_KEY:
signal_init();
break;
case TOGGLE_MOUSE_KEY:
mouse_init();
break;
case TOGGLE_NOHELP_KEY:
wclear(bottomwin);
wrefresh(bottomwin);
window_init();
edit_refresh();
display_main_list();
break;
}
if (!ISSET(toggles[which].flag)) {
if (toggles[which].val == TOGGLE_NOHELP_KEY ||
toggles[which].val == TOGGLE_WRAP_KEY)
statusbar("%s %s", toggles[which].desc, enabled);
else
statusbar("%s %s", toggles[which].desc, disabled);
} else {
if (toggles[which].val == TOGGLE_NOHELP_KEY ||
toggles[which].val == TOGGLE_WRAP_KEY)
statusbar("%s %s", toggles[which].desc, disabled);
else
statusbar("%s %s", toggles[which].desc, enabled);
}
SET(DISABLE_CURPOS);
#else
nano_small_msg();
#endif
}
int main(int argc, char *argv[])
{
int optchr;
int kbinput; /* Input from keyboard */
long startline = 0; /* Line to try and start at */
struct sigaction act; /* For our lovely signals */
int keyhandled = 0; /* Have we handled the keystroke yet? */
int tmpkey = 0, i;
int i;
char *argv0;
struct termios term;
#ifdef HAVE_GETOPT_LONG
int option_index = 0;
struct option long_options[] = {
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
{"regexp", 0, 0, 'R'},
#endif
{"version", 0, 0, 'V'},
@@ -1564,7 +1726,7 @@ int main(int argc, char *argv[])
{"mouse", 0, 0, 'm'},
{"pico", 0, 0, 'p'},
{"nofollow", 0, 0, 'l'},
{"tabsize", 0, 0, 'T'},
{"tabsize", 1, 0, 'T'},
{0, 0, 0, 0}
};
#endif
@@ -1593,7 +1755,7 @@ int main(int argc, char *argv[])
finish(1);
}
break;
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
case 'R':
SET(USE_REGEXP);
break;
@@ -1667,9 +1829,6 @@ int main(int argc, char *argv[])
|| (!argv0 && strstr(argv[0], "pico")))
SET(PICO_MSGS);
filename = nmalloc(PATH_MAX);
strcpy(filename, "");
/* See if there's a non-option in argv (first non-option is the
filename, if +LINE is not given) */
if (argc == 1 || argc <= optind)
@@ -1692,11 +1851,13 @@ int main(int argc, char *argv[])
/* First back up the old settings so they can be restored, duh */
tcgetattr(0, &oldterm);
#ifdef _POSIX_VDISABLE
term = oldterm;
term.c_cc[VINTR] = _POSIX_VDISABLE;
term.c_cc[VQUIT] = _POSIX_VDISABLE;
term.c_lflag &= ~IEXTEN;
tcsetattr(0, TCSANOW, &term);
#endif
/* now ncurses init stuff... */
initscr();
@@ -1711,44 +1872,14 @@ int main(int argc, char *argv[])
shortcut_init();
init_help_msg();
help_init();
/* Trap SIGINT and SIGQUIT cuz we want them to do useful things. */
memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = SIG_IGN;
sigaction(SIGINT, &act, NULL);
sigaction(SIGQUIT, &act, NULL);
if (!ISSET(SUSPEND))
sigaction(SIGTSTP, &act, NULL);
/* Trap SIGHUP cuz we want to write the file out. */
act.sa_handler = handle_hup;
sigaction(SIGHUP, &act, NULL);
act.sa_handler = handle_sigwinch;
sigaction(SIGWINCH, &act, NULL);
signal_init();
#ifdef DEBUG
fprintf(stderr, _("Main: set up windows\n"));
#endif
/* Setup up the main text window */
edit = newwin(editwinrows, COLS, 2, 0);
keypad(edit, TRUE);
#ifndef NANO_SMALL
#ifdef NCURSES_MOUSE_VERSION
if (ISSET(USE_MOUSE)) {
mousemask(BUTTON1_RELEASED, NULL);
mouseinterval(50);
}
#endif
#endif
/* And the other windows */
topwin = newwin(2, COLS, 0, 0);
bottomwin = newwin(3 - no_help(), COLS, LINES - 3 + no_help(), 0);
keypad(bottomwin, TRUE);
window_init();
mouse_init();
#ifdef DEBUG
fprintf(stderr, _("Main: bottom win\n"));
@@ -1775,12 +1906,107 @@ int main(int argc, char *argv[])
reset_cursor();
while (1) {
#ifndef _POSIX_VDISABLE
/* We're going to have to do it the old way, i.e. on cygwin */
raw();
#endif
kbinput = wgetch(edit);
if (kbinput == 27) { /* Grab Alt-key stuff first */
switch (kbinput = wgetch(edit)) {
/* Alt-O, suddenly very important ;) */
case 79:
kbinput = wgetch(edit);
if (kbinput <= 'S' && kbinput >= 'P')
kbinput = KEY_F(kbinput - 79);
#ifdef DEBUG
else {
fprintf(stderr, _("I got Alt-O-%c! (%d)\n"),
kbinput, kbinput);
break;
}
#endif
break;
case 91:
switch (kbinput = wgetch(edit)) {
case '1': /* Alt-[-1-[0-5,7-9] = F1-F8 in X at least */
kbinput = wgetch(edit);
if (kbinput >= '1' && kbinput <= '5') {
kbinput = KEY_F(kbinput - 48);
wgetch(edit);
}
else if (kbinput >= '7' && kbinput <= '9') {
kbinput = KEY_F(kbinput - 49);
wgetch(edit);
}
else if (kbinput == 126)
kbinput = KEY_HOME;
#ifdef DEBUG
else {
fprintf(stderr, _("I got Alt-[-1-%c! (%d)\n"),
kbinput, kbinput);
break;
}
#endif
break;
case '2': /* Alt-[-2-[0,1,3,4] = F9-F12 in many terms */
kbinput = wgetch(edit);
switch (kbinput) {
case '0':
kbinput = KEY_F(9);
wgetch(edit);
break;
case '1':
kbinput = KEY_F(10);
wgetch(edit);
break;
case '3':
kbinput = KEY_F(11);
wgetch(edit);
break;
case '4':
kbinput = KEY_F(12);
wgetch(edit);
break;
case 126: /* Hack, make insert key do something
usefile, like insert file */
do_insertfile();
keyhandled = 1;
break;
#ifdef DEBUG
default:
fprintf(stderr, _("I got Alt-[-2-%c! (%d)\n"),
kbinput, kbinput);
break;
#endif
}
break;
case '3': /* Alt-[-3 = Delete? */
kbinput = NANO_DELETE_KEY;
wgetch(edit);
break;
case '4': /* Alt-[-4 = End? */
kbinput = NANO_END_KEY;
wgetch(edit);
break;
case '5': /* Alt-[-5 = Page Up */
kbinput = KEY_PPAGE;
wgetch(edit);
break;
case '6': /* Alt-[-6 = Page Down */
kbinput = KEY_NPAGE;
wgetch(edit);
break;
case '[': /* Alt-[-[-[A-E], F1-F5 in linux console */
kbinput = wgetch(edit);
if (kbinput >= 'A' && kbinput <= 'E')
kbinput = KEY_F(kbinput - 64);
break;
case 'A':
kbinput = KEY_UP;
break;
@@ -1799,30 +2025,6 @@ int main(int argc, char *argv[])
case 'F':
kbinput = KEY_END;
break;
case 49: /* X window F-keys */
tmpkey = wgetch(edit);
kbinput = KEY_F(tmpkey) - 48;
wgetch(edit); /* Junk character */
break;
case 53: /* page up */
kbinput = KEY_PPAGE;
if ((kbinput = wgetch(edit)) == 126)
kbinput = KEY_PPAGE; /* Ignore extra tilde */
else { /* I guess this could happen ;-) */
ungetch(kbinput);
continue;
}
break;
case 54: /* page down */
kbinput = KEY_NPAGE;
if ((kbinput = wgetch(edit)) == 126)
kbinput = KEY_NPAGE; /* Same thing here */
else {
ungetch(kbinput);
continue;
}
break;
default:
#ifdef DEBUG
fprintf(stderr, _("I got Alt-[-%c! (%d)\n"),
@@ -1837,9 +2039,19 @@ int main(int argc, char *argv[])
for (i = 0; i <= MAIN_LIST_LEN - 1; i++)
if (kbinput == main_list[i].altval ||
kbinput == main_list[i].altval - 32) {
kbinput = main_list[i].val;
break;
kbinput = main_list[i].val;
break;
}
#ifndef NANO_SMALL
/* And for toggle switches */
for (i = 0; i <= TOGGLE_LEN - 1 && !keyhandled; i++)
if (kbinput == toggles[i].val ||
kbinput == toggles[i].val - 32) {
do_toggle(i);
keyhandled = 1;
break;
}
#endif
#ifdef DEBUG
fprintf(stderr, _("I got Alt-%c! (%d)\n"), kbinput,
kbinput);
@@ -1849,7 +2061,7 @@ int main(int argc, char *argv[])
}
/* Look through the main shortcut list to see if we've hit a
shortcut key */
for (i = 0; i < MAIN_LIST_LEN; i++) {
for (i = 0; i < MAIN_LIST_LEN && !keyhandled; i++) {
if (kbinput == main_list[i].val ||
(main_list[i].misc1 && kbinput == main_list[i].misc1) ||
(main_list[i].misc2 && kbinput == main_list[i].misc2)) {
@@ -1860,6 +2072,19 @@ int main(int argc, char *argv[])
keyhandled = 1;
}
}
#ifndef _POSIX_VDISABLE
/* Since we're in raw mode, we have to catch ^Q and ^S */
if (kbinput == 17 || kbinput == 19)
keyhandled = 1;
/* And catch ^Z by hand when triggered */
if (kbinput == 26) {
if (ISSET(SUSPEND))
do_suspend(0);
keyhandled = 1;
}
#endif
/* Last gasp, stuff that's not in the main lists */
if (!keyhandled)
switch (kbinput) {
@@ -1890,8 +2115,12 @@ int main(int argc, char *argv[])
}
do_char(kbinput);
}
if (ISSET(CONSTUPDATE))
do_cursorpos();
if (ISSET(CONSTUPDATE)) {
if (ISSET(DISABLE_CURPOS))
UNSET(DISABLE_CURPOS);
else
do_cursorpos();
}
reset_cursor();
wrefresh(edit);

26
nano.h
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* nano.h *
* *
@@ -81,6 +82,14 @@ typedef struct shortcut {
char *help; /* Help file entry text */
} shortcut;
typedef struct toggle {
int val; /* Sequence to toggle the key. Should only need 1 */
char *desc; /* Description for when toggle is, uh, toggled,
e.g. "Pico Messages", we'll append Enabled or
Disabled */
int flag; /* What flag actually gets toggled */
} toggle;
/* Bitwise flags so we can save space (or more correctly, not waste it) */
#define MODIFIED (1<<0)
@@ -101,6 +110,7 @@ typedef struct shortcut {
#define REGEXP_COMPILED (1<<15)
#define TEMP_OPT (1<<16)
#define CUT_TO_END (1<<17)
#define DISABLE_CURPOS (1<<18)
/* Control key sequences, chaning these would be very very bad */
@@ -216,6 +226,16 @@ know what you're doing */
#define NANO_ENTER_KEY NANO_CONTROL_M
#define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T
#define TOGGLE_CONST_KEY NANO_ALT_C
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
#define TOGGLE_SUSPEND_KEY NANO_ALT_Z
#define TOGGLE_NOHELP_KEY NANO_ALT_X
#define TOGGLE_PICOMODE_KEY NANO_ALT_P
#define TOGGLE_MOUSE_KEY NANO_ALT_M
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
#define TOGGLE_REGEXP_KEY NANO_ALT_E
#define TOGGLE_WRAP_KEY NANO_ALT_W
#define MAIN_LIST_LEN 26
#define MAIN_VISIBLE 12
#define WHEREIS_LIST_LEN 6
@@ -225,6 +245,12 @@ know what you're doing */
#define HELP_LIST_LEN 3
#define SPELL_LIST_LEN 3
#ifdef HAVE_REGEX_H
#define TOGGLE_LEN 9
#else
#define TOGGLE_LEN 8
#endif
#define VIEW 1
#define NOVIEW 0

View File

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

View File

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

View File

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

View File

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

BIN
po/de.gmo

Binary file not shown.

478
po/de.po

File diff suppressed because it is too large Load Diff

BIN
po/es.gmo

Binary file not shown.

470
po/es.po

File diff suppressed because it is too large Load Diff

BIN
po/fi.gmo

Binary file not shown.

442
po/fi.po

File diff suppressed because it is too large Load Diff

BIN
po/fr.gmo

Binary file not shown.

443
po/fr.po

File diff suppressed because it is too large Load Diff

BIN
po/id.gmo

Binary file not shown.

442
po/id.po

File diff suppressed because it is too large Load Diff

BIN
po/it.gmo

Binary file not shown.

446
po/it.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

15
proto.h
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* proto.h *
* *
@@ -21,7 +22,11 @@
/* Externs */
#include <sys/stat.h>
#ifdef HAVE_REGEX_H
#include <regex.h>
#endif
#include "nano.h"
extern int center_x, center_y, editwinrows;
@@ -32,7 +37,8 @@ extern int totsize, temp_opt;
extern int fill, flags,tabsize;
extern WINDOW *edit, *topwin, *bottomwin;
extern char *filename, *answer, *last_search, *last_replace;
extern char filename[PATH_MAX];
extern char answer[132];
extern char *hblank, *help_text;
extern struct stat fileinfo;
extern filestruct *current, *fileage, *edittop, *editbot, *filebot;
@@ -42,9 +48,14 @@ extern shortcut main_list[MAIN_LIST_LEN], whereis_list[WHEREIS_LIST_LEN];
extern shortcut replace_list[REPLACE_LIST_LEN], goto_list[GOTO_LIST_LEN];
extern shortcut writefile_list[WRITEFILE_LIST_LEN], help_list[HELP_LIST_LEN];
extern shortcut spell_list[SPELL_LIST_LEN];
#ifdef HAVE_REGEX_H
extern int use_regexp, regexp_compiled;
extern regex_t search_regexp;
extern regmatch_t regmatches[10];
#endif
extern toggle toggles[TOGGLE_LEN];
/* Programs we want available */
@@ -79,7 +90,7 @@ void blank_bottombars(void);
void check_wrap(filestruct * inptr, char ch);
void dump_buffer(filestruct * inptr);
void align(char **strp);
void edit_refresh(void);
void edit_refresh(void), edit_refresh_clearok(void);
void edit_update(filestruct * fileptr, int topmidbot);
void update_cursor(void);
void delete_node(filestruct * fileptr);

View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* search.c *
* *
@@ -33,9 +34,12 @@
#define _(string) (string)
#endif
static char last_search[132]; /* Last string we searched for */
static char last_replace[132]; /* Last replacement string */
/* Regular expression helper functions */
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
void regexp_init(const char *regexp)
{
regcomp(&search_regexp, regexp, ISSET(CASE_SENSITIVE) ? 0 : REG_ICASE);
@@ -91,13 +95,13 @@ int search_init(int replacing)
return -1;
} else if (i == -2) { /* Same string */
strncpy(answer, last_search, 132);
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP))
regexp_init(answer);
#endif
} else if (i == 0) { /* They entered something new */
strncpy(last_search, answer, 132);
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP))
regexp_init(answer);
#endif
@@ -158,22 +162,23 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
if (past_editbot)
edit_update(current, CENTER);
placewewant = xplustabs();
reset_cursor();
} else { /* We're at EOF, go back to the top, once */
fileptr = fileage;
while (fileptr != current && fileptr != begin &&
while (fileptr != begin->next &&
(found = strstrwrapper(fileptr->data, needle)) == NULL)
fileptr = fileptr->next;
if (fileptr == begin) {
if (fileptr == begin->next) {
if (!quiet)
statusbar(_("\"%s\" not found"), needle);
return NULL;
}
if (fileptr != current) { /* We found something */
else { /* We found something */
current = fileptr;
current_x = 0;
for (tmp = fileptr->data; tmp != found; tmp++)
@@ -184,12 +189,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
if (!quiet)
statusbar(_("Search Wrapped"));
} else { /* Nada */
if (!quiet)
statusbar(_("\"%s\" not found"), needle);
return NULL;
}
}
}
return fileptr;
@@ -200,8 +200,10 @@ void search_abort(void)
UNSET(KEEP_CUTBUFFER);
display_main_list();
wrefresh(bottomwin);
if (ISSET(MARK_ISSET))
edit_refresh_clearok();
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
if (ISSET(REGEXP_COMPILED))
regexp_cleanup();
#endif
@@ -250,7 +252,7 @@ void replace_abort(void)
search_abort();
}
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
int replace_regexp(char *string, int create_flag)
{
/* split personality here - if create_flag is null, just calculate
@@ -320,7 +322,7 @@ char *replace_line()
int search_match_count;
/* Calculate size of new line */
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP)) {
search_match_count = regmatches[0].rm_eo -
regmatches[0].rm_so;
@@ -348,7 +350,7 @@ char *replace_line()
/* Replacement Text */
if (!ISSET(USE_REGEXP))
strcat(copy, last_replace);
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
else
(void)replace_regexp(copy + current_x, 1);
#endif

View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* utils.c *
* *
@@ -81,7 +82,7 @@ char *strcasestr(char *haystack, char *needle)
char *strstrwrapper(char *haystack, char *needle)
{
#ifdef _POSIX_VERSION
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP)) {
int result=regexec(&search_regexp, haystack, 10, regmatches, 0);
if (!result)

29
winio.c
View File

@@ -1,3 +1,4 @@
/* $Id$ */
/**************************************************************************
* winio.c *
* *
@@ -461,7 +462,7 @@ void onekey(char *keystroke, char *desc)
{
char description[80];
snprintf(description, 12, " %-11s", desc);
snprintf(description, 12, " %-10s", desc);
wattron(bottomwin, A_REVERSE);
waddstr(bottomwin, keystroke);
wattroff(bottomwin, A_REVERSE);
@@ -779,6 +780,11 @@ void update_line(filestruct * fileptr, int index)
virt_cur_x--;
if (i < mark_beginx)
virt_mark_beginx--;
}
else if (realdata[i] >= 1 && realdata[i] <= 26) {
/* Treat control characters as ^letter */
fileptr->data[pos++] = '^';
fileptr->data[pos++] = realdata[i] + 64;
} else {
fileptr->data[pos++] = realdata[i];
}
@@ -861,6 +867,16 @@ void edit_refresh(void)
editbot = temp;
}
/*
* Same as above, but touch the window first so everything is redrawn.
*/
void edit_refresh_clearok(void)
{
clearok(edit, TRUE);
edit_refresh();
clearok(edit, FALSE);
}
/*
* Nice generic routine to update the edit buffer given a pointer to the
* file struct =)
@@ -1073,7 +1089,8 @@ int total_refresh(void)
clearok(edit, FALSE);
clearok(topwin, FALSE);
clearok(bottomwin, FALSE);
edit_refresh();
titlebar();
return 1;
}
@@ -1177,7 +1194,8 @@ int do_help(void)
for (i = 1; i < page; i++) {
row = 0;
j = 0;
while (row < editwinrows && *ptr != '\0') {
while (row < editwinrows - 2 && *ptr != '\0') {
if (*ptr == '\n' || j == COLS - 5) {
j = 0;
row++;
@@ -1187,6 +1205,10 @@ int do_help(void)
}
}
if (i > 1) {
}
i = 0;
j = 0;
while (i < editwinrows && *ptr != '\0') {
@@ -1215,7 +1237,6 @@ int do_help(void)
continue;
}
} while ((kbinput = wgetch(edit)) != NANO_EXIT_KEY);
if (no_help_flag) {
werase(bottomwin);
wrefresh(bottomwin);