Compare commits

...

57 Commits

Author SHA1 Message Date
Chris Allegretta
7bf2509a70 GNU nano 1.1.4 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@923 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-12-12 02:44:40 +00:00
Chris Allegretta
9c23a44907 Remove some debug code and update to mutt's gettext.m4
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@922 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-12-12 01:45:01 +00:00
Chris Allegretta
7dd7768bb6 Fix the ifdefs in winio.c
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@921 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-12-08 19:52:28 +00:00
Jordi Mallach
df59ae64e9 French update, by Michel Robitaille <robitail@IRO.UMontreal.CA>
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@920 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-12-07 14:00:56 +00:00
Jordi Mallach
b439622d3a Fixed typos.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@918 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-12-05 17:51:02 +00:00
Chris Allegretta
8083827088 do_spell() - Dont prompt for replace if we don't change the word in question (Rocco Corsi).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@917 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-12-02 06:03:22 +00:00
Chris Allegretta
db4c08e8f9 stoopid unused variable
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@916 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-12-02 05:13:34 +00:00
Chris Allegretta
2fa11b836d Two fixes, create new colorstrings array for each regex, allows proper order of highlighting, second make color work with the marker
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@915 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-12-02 04:55:44 +00:00
Chris Allegretta
86c9676f7a Fix leftover variable
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@914 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-11-29 03:52:21 +00:00
Chris Allegretta
81cbfad086 Comment out more debugging code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@913 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-11-29 03:49:09 +00:00
Chris Allegretta
2084acc37d At LONG last committed David's patch
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@912 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-11-29 03:43:08 +00:00
Chris Allegretta
3795e5fc76 Damn newline code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@911 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-11-29 03:03:18 +00:00
Chris Allegretta
08893e08e3 Preliminary syntax highlighting support. New functions colortoint() and parse_color() in rcfile.c, new code in edit_add() in winio.c to actually do the highlighting. It's not even close to pretty yet :P
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@910 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-11-29 02:42:27 +00:00
Jordi Mallach
feebeb90ea Danish and Spanish updates.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@909 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-11-19 12:09:51 +00:00
Chris Allegretta
9b8b370132 Put 1.0 Hurd fixes in 1.1 tree (function keys, SIGTSTP sigaction
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@908 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-11-19 05:09:15 +00:00
Jordi Mallach
8c9c572309 Updated German, Swedish and Russian translations.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@904 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-31 13:02:12 +00:00
Jordi Mallach
33088740da Added aclocal.m4, config.in.h.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@900 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-29 13:32:06 +00:00
Jordi Mallach
1fa00797ef Removing autogenerated files.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@899 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-29 13:29:19 +00:00
Jordi Mallach
6859079638 Added nano.info.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@898 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-29 13:27:12 +00:00
Jordi Mallach
773623c066 Typo fixes in help strings.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@896 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-28 21:00:49 +00:00
Chris Allegretta
0567bfe14c files.c:add_open_file() - Get rid of unsetting MARK_ISSET because otherwise writing marked text will automatically unset the marker with multibuffer enabled
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@894 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-28 14:42:18 +00:00
Chris Allegretta
8c8d370470 global.c: - Define currshortcut and currslen when either DISABLE_MOUSE or DISABLE_HELP or DISABLE_BROWSER is not defined (Silvan Minghetti)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@893 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-28 05:00:39 +00:00
Chris Allegretta
22ec59a073 global.c: - Define currshortcut and currslen when either DISABLE_MOUSE or DISABLE_BROWSER is not defined (Silvan Minghetti)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@892 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-28 04:56:08 +00:00
Chris Allegretta
f3e80adbe4 Oops, typo in dec there, it's Alt-[-whatever
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@891 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-28 04:49:10 +00:00
Chris Allegretta
7bf7274d9f nano.c:main() - Add Esc-[IGL] keys for FreeBSD Console (PgUp,PgDn,Insert)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@890 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-28 04:29:55 +00:00
Chris Allegretta
7b409bd6b6 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@889 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-26 16:15:58 +00:00
Chris Allegretta
dc57bbab7a Nano 1.1.3 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@887 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-26 16:14:45 +00:00
Chris Allegretta
6d0aa9f3b7 More do_prev_word() fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@886 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-26 15:21:41 +00:00
Chris Allegretta
e59fc829d8 Okay, now fix do_prev_word so it doesn't crash when it hits a blank line, it's still not perfect =/
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@884 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-24 18:07:58 +00:00
Chris Allegretta
a1a6a7fda6 Oopos, wrote the test backwards :-)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@880 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-24 17:34:29 +00:00
Chris Allegretta
107864058b nano.h: Additional #define, SMALL_TOO to determine how long MAIN_LIST_LEN is. We need this because of the find matching bracket code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@879 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-24 17:27:46 +00:00
Chris Allegretta
2cd72b6aa2 Back out off by one fix that's not actually off by one, it was a different bug :-)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@878 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-24 17:25:36 +00:00
Chris Allegretta
3a24f3f780 Changed header comments to say "version 2" instead of "version 1" as the COPYING file is actually version 2 of the GPL (bug noticed by Jordi Mallach)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@873 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-24 11:33:54 +00:00
Chris Allegretta
347c184b6f nano.c:main() - Moved #ifndef NANO_SMALL down past the case 0: line so control-space doesn't insert a \0 (ack!)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@872 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-24 01:37:13 +00:00
Chris Allegretta
48ebb81fb2 nano.c:main() - Fixed off by one when checking for MAIN_LIST_LEN. Ugh.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@871 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-24 01:34:15 +00:00
Chris Allegretta
abf22a8fb2 - nano.c: - Added the #ifdefs around do_prev_word the code in main()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@870 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-24 00:58:19 +00:00
Chris Allegretta
e7ee63f271 - cut.c: cut_marked_segment() - Fix off-by one in mem allocation
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@868 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-23 12:58:42 +00:00
Chris Allegretta
fa0c6963ce Fixed null_at to ACTUALLY DO SOMETHING with its arg. Again, this was causing nasty errors if the call to nrealloc moved where the data was located
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@866 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-22 23:22:19 +00:00
Chris Allegretta
878ced39bf - nano.c:do_prev_word() - Fixed goofy logic setting x pos to value of last line when hitting the beginning of first line, prog should simply abort.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@865 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-22 20:05:34 +00:00
Chris Allegretta
b3655b4c5e DLR's cut and miscellaneous fixes, my cut fixes, and context-sensitive help, woohoo
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@864 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-22 03:15:31 +00:00
Jordi Mallach
fac011a5e1 I mean add, not replace... duh.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@863 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-20 12:30:46 +00:00
Jordi Mallach
9f4e583e52 Added stamp-h1
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@862 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-20 12:30:12 +00:00
Chris Allegretta
beead28619 - faq.html - Removed nano-editor.org FTP site address [deprecated] and added the GNU one
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@860 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-18 14:15:28 +00:00
Jordi Mallach
eb94b9edcd Updated Ukrainian translation (Sergey A. Ribalchenko).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@859 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-15 14:26:48 +00:00
Chris Allegretta
76e291beee Added conversion messages for DOS and Mac files, and Alt-space as do-previous-word
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@858 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-14 19:05:10 +00:00
Jordi Mallach
ab23fbd019 Updated Russian translation (Sergey A. Ribalchenko).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@856 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-08 14:05:36 +00:00
Jordi Mallach
26f4603a89 Style updates for Spanish, by Santiago Vila.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@855 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-07 15:53:27 +00:00
Jordi Mallach
2476ebd31b Updated Danish translation (Keld Simonsen).
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@854 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-07 00:26:26 +00:00
Jordi Mallach
482d165ab5 Updated Swedish translation (Christian Rose).
Updated gl.po from TP.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@853 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-06 02:36:25 +00:00
Jordi Mallach
02a24525c5 Small typo fix.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@852 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-05 10:58:07 +00:00
Jordi Mallach
cdcac1ccc2 And what if I actually fix it?
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@851 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-05 03:26:52 +00:00
Jordi Mallach
633dab0340 Darn, that %s vs %d bug again.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@850 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-05 03:26:00 +00:00
Jordi Mallach
14a0e55bc9 Getting rid of Makefile.in too, autogenerated file.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@849 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-04 01:54:03 +00:00
Jordi Mallach
8fd15e2672 Oops, m4 stuff is in m4/ in nano 1.1.x...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@848 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-04 01:44:06 +00:00
Jordi Mallach
19aad376ef Added script to get working configure, etc.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@845 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-04 01:37:36 +00:00
Jordi Mallach
c17aa63200 Bye bye you too. To the Attic! (replaced by autogen.sh)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@844 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-04 01:34:13 +00:00
Chris Allegretta
9a39789cb6 Back to CVS version
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@843 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2001-10-04 01:25:43 +00:00
42 changed files with 8633 additions and 12780 deletions

View File

@@ -1,10 +1,14 @@
Makefile
Makefile.in
aclocal.m4
confdefs.h
config.cache
config.h
config.h.in
config.log
config.status
configure
nano
nano.info
stamp-h
stamp-h1

106
ChangeLog
View File

@@ -1,3 +1,109 @@
nano-1.1.4 - 12/11/2001
- General
- Preliminary syntax highlighting support. New functions
colortoint() and parse_color() in rcfile.c, new code in
edit_add() in winio.c to actually do the highlighting. It's
not even close to pretty yet :P
- Many int/long alignments (David Lawrence Ramsey).
- files.c:
- Fixes for tab completion and screen refresh (David Lawrence
Ramsey).
add_open_file()
- Get rid of unsetting MARK_ISSET because otherwise writing
marked text will automatically unset the marker with
multibuffer enabled.
- global.c:
- Define currshortcut and currslen when either DISABLE_MOUSE
or DISABLE_HELP or DISABLE_BROWSER is not defined (Silvan
Minghetti).
- nano.c:
main()
- Add Esc-[-[IGL] keys for FreeBSD Console (PgUp,PgDn,Insert).
- Added better Hurd support for function keys (Alt-V,U,9,@,F).
signal_init()
- do SIG_IGN for the SIGTSTP sigaction regardless of whether
we have _POSIX_VDISABLE or not (more Hurd fixes)
help_init()
- Typo fixes and additions to the new help texts.
do_curpos()
- Now takes arg for constant updating to always show the cursor
position (David Lawrence Ramsey).
do_wrap()
- Many fixes (David Lawrence Ramsey).
do_spell()
- Dont prompt for replace if we don't change the word in
question (Rocco Corsi).
- po/de.po:
- German translation updates (Karl Eichwalder).
- po/ru.po:
- Russian translation updates (Sergey A. Ribalchenko).
- po/sv.po:
- Swedish translation updates (Christian Rose).
- po/da.po:
- Danish translation updates (Keld Simonse).
- po/es.po:
- Spanish translation updates (Jordi).
- po/fr.po:
- French translation updates (Michel Robitaille).
- m4/gettext.m4:
- diff against mutt 1.2.5's gettext.m4.
nano-1.1.3 - 10/26/2001
- General
- Finally wrote function-specific help mode. Changes to
nano.c:help_init() and winio.c:do_help(). Changed
currshortcut and currslen #ifdefs to depend on both
DISABLE_HELP and DISABLE_MOUSE being defined to not
include. Changed all the shortcuts and lengths.
- Fixed null_at to ACTUALLY DO SOMETHING with its arg. Again,
this was causing nasty errors if the call to nrealloc moved
where the data was located.
- Changed header comments to say "version 2" instead of "version
1" as the COPYING file is actually version 2 of the GPL (bug
noticed by Jordi Mallach).
- cut.c:
do_cut_text()
- Check to see whether marked text is contained within edit
window and if so only do an edit_refresh (variable dontupdate
replaces cuttingpartialline).
do_uncut_text()
- Similar display fixes (David Lawrence Ramsey).
- faq.html
- Removed nano-editor.org FTP site address [deprecated] and added
the GNU one.
- files.c:
- Added status messages for converted DOS and Mac files.
People should know that their file wasnt normally formatted.
load_file()
- Status message when trying to load an already loaded file with multiple
buffers (David Lawrence Ramsey).
read_file()
- Get rid of useless linetemp variable and name num_lines int
(David Lawrence Ramsey).
- nano.c:
- New function do_prev_word, similar to do_next_word. Hard coded as
Alt-space, as next word is hard coded as control-space. Fixed
goofy logic setting x pos to value of last line when hitting the
beginning of first line, prog should simply abort. Added
the #ifdefs around the code in main().
- nano.h:
- Additional #define, SMALL_TOO to determine how long
MAIN_LIST_LEN is. We need this because of the find matching
bracket code.
main()
- Moved #ifndef NANO_SMALL down past the case 0: line so
control-space doesn't insert a \0 (ack!)
- rcfile.c:
- Fix incorrect number of rc options (David Lawrence Ramsey).
- po/sv.po:
- Updated Swedish translation (Christian Rose).
- po/da.po:
- Updated Danish translation (Keld Simonsen).
- po/es.po:
- Style updates to Spanish translation (Santiago Vila).
- po/ru.po, uk.po:
- Updated Russian and Ukrainian translation (Sergey A. Ribalchenko).
nano-1.1.2 - 10/03/2001
- General
- Added BUGS #63 & 64. Fixes in search_init() and nanogetstr(),

View File

@@ -1,647 +0,0 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CURSES_LIB = @CURSES_LIB@
DATADIRNAME = @DATADIRNAME@
GENCAT = @GENCAT@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_CONFIG = @GLIB_CONFIG@
GLIB_LIBS = @GLIB_LIBS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_LOCALE_DIR = @GNU_LOCALE_DIR@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LOCALE_DIR = @LOCALE_DIR@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
l = @l@
AUTOMAKE_OPTIONS = gnu no-dependencies
M4DIR = $(srcdir)/m4
ACLOCAL_AMFLAGS = -I $(M4DIR)
ACINCLUDE_INPUTS = $(M4DIR)/gettext.m4 $(M4DIR)/largefile.m4 $(M4DIR)/lcmessage.m4 $(M4DIR)/progtest.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
man_MANS = nano.1
nano_LDADD = @GLIB_LIBS@ @INTLLIBS@
info_TEXINFOS = nano.texi
MAKEINFO = makeinfo --no-split
EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS TODO install-sh missing mkinstalldirs nano.1 nano.1.html faq.html nanorc.sample $(ACINCLUDE_INPUTS)
SUBDIRS = po intl
localedir = @LOCALE_DIR@
INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
PROGRAMS = $(bin_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir) -I.
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
nano_OBJECTS = color.o cut.o files.o global.o move.o nano.o rcfile.o \
search.o utils.o winio.o
nano_DEPENDENCIES =
nano_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
TEXI2DVI = texi2dvi
INFO_DEPS = nano.info
DVIS = nano.dvi
TEXINFOS = nano.texi
man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \
INSTALL Makefile.am Makefile.in NEWS THANKS TODO acconfig.h aclocal.m4 \
config.guess config.h.in config.sub configure configure.in install-sh \
missing mkinstalldirs texinfo.tex
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
SOURCES = $(nano_SOURCES)
OBJECTS = $(nano_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): configure.in
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
@if test ! -f $@; then \
rm -f stamp-h; \
$(MAKE) stamp-h; \
else :; fi
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h:config.h.in \
$(SHELL) ./config.status
@echo timestamp > stamp-h 2> /dev/null
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/stamp-h.in; \
$(MAKE) $(srcdir)/stamp-h.in; \
else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
-rm -f config.h
maintainer-clean-hdr:
mostlyclean-binPROGRAMS:
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
distclean-binPROGRAMS:
maintainer-clean-binPROGRAMS:
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
done
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
nano: $(nano_OBJECTS) $(nano_DEPENDENCIES)
@rm -f nano
$(LINK) $(nano_LDFLAGS) $(nano_OBJECTS) $(nano_LDADD) $(LIBS)
nano.info: nano.texi
nano.dvi: nano.texi
DVIPS = dvips
.texi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texi.dvi:
TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.dvi:
TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.txi.dvi:
TEXINPUTS=.:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.dvi.ps:
$(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(infodir)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
d=$(srcdir); \
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
uninstall-info:
$(PRE_UNINSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
ii=yes; \
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
test -z "$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
list='$(INFO_DEPS)'; \
for file in $$list; do \
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done
dist-info: $(INFO_DEPS)
list='$(INFO_DEPS)'; \
for base in $$list; do \
d=$(srcdir); \
for file in `cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done; \
done
mostlyclean-aminfo:
-rm -f nano.aux nano.cp nano.cps nano.dvi nano.fn nano.fns nano.ky \
nano.kys nano.ps nano.log nano.pg nano.toc nano.tp nano.tps \
nano.vr nano.vrs nano.op nano.tr nano.cv nano.cn
clean-aminfo:
distclean-aminfo:
maintainer-clean-aminfo:
cd $(srcdir) && for i in $(INFO_DEPS); do \
rm -f $$i; \
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
rm -f $$i-[0-9]*; \
fi; \
done
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@list='$(man1_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
done
uninstall-man1:
@list='$(man1_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
rm -f $(DESTDIR)$(man1dir)/$$inst; \
done
install-man: $(MANS)
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-man1
uninstall-man:
@$(NORMAL_UNINSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-man1
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
$(mkinstalldirs) $(distdir)/$(M4DIR)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
info-am: $(INFO_DEPS)
info: info-recursive
dvi-am: $(DVIS)
dvi: dvi-recursive
check-am: all-am
check: check-recursive
installcheck-am:
installcheck: installcheck-recursive
all-recursive-am: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
install-exec-am: install-binPROGRAMS
install-exec: install-exec-recursive
install-data-am: install-info-am install-man
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am: uninstall-binPROGRAMS uninstall-info uninstall-man
uninstall: uninstall-recursive
all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h
all-redirect: all-recursive-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) \
$(DESTDIR)$(mandir)/man1
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
mostlyclean-compile mostlyclean-aminfo mostlyclean-tags \
mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo \
clean-tags clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \
distclean-aminfo distclean-tags distclean-generic \
clean-am
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-aminfo \
maintainer-clean-tags maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile install-info-am uninstall-info \
mostlyclean-aminfo distclean-aminfo clean-aminfo \
maintainer-clean-aminfo install-man1 uninstall-man1 install-man \
uninstall-man install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \
installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all installdirs-am \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
$(srcdir)/acinclude.m4: $(ACINCLUDE_INPUTS)
cat $(ACINCLUDE_INPUTS) > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

31
NEWS
View File

@@ -1,3 +1,34 @@
12/11/2001 - GNU nano 1.1.4 is released. This release contains
rudimentary color syntax support (but it's still
broken), compatibility fixes for the Hurd and FreeBSD,
spell checker and wrapping fixes, and more. It seems
that the amount of interest in the code is inversely
proportional to the amount of time since last release,
so it's time to show the world all the changes since
1.1.3 ;) Have fun with it!
10/26/2001 - GNU nano 1.1.3 is released. As far as new features go,
the help system is now available for all functions in the
editor. Also, nano will also now print a message on
the status bar when it automatically converts a file from
Mac or DOS format, and trying to load a file that
has already been loaded in multibuffer mode will now also
cause an error message. There is now a "goto previous
word" which you can use by hitting Meta-Space Bar.
As for fixes, a SEVERE bug in the
null_at code which discarded the memory address of
reallocated memory has been fixed. This is probably
the biggest bug fix in well over the last year of
development. There are also some display fixes for when
the screen shouldn't center itself on cut or uncut text.
Also, the comments in the header files incorectly said
that nano was distributed under version 1 of the GPL when
the accompanying license was the GPLv2.
If you're using nano-1.1, it is highly
recommeneded you upgrade to this release. If using 1.0,
wait for version 1.0.6 which should be available early
next week. Enjoy!
10/03/2001 - GNU nano 1.1.2 is out there. Many new features in this
release, including support for auto-converting from
DOS and Mac formatted files, as well as toggles for

1
THANKS
View File

@@ -11,6 +11,7 @@ Eivind Kj
Florian König <floki@bigfoot.com> German Translator
Clement Laforet <clem_laf@wanadoo.fr> French Translator
Sergey A. Ribalchenko <fisher@obu.ck.ua> Russian, Ukrainian Translator
Michel Robitaille <robitail@IRO.UMontreal.CA> French Translator
Christian Rose <menthos@menthos.com> Swedish Translator
Keld Simonsen <keld@dkuug.dk> Danish Translator
Guus Sliepen <guus@nl.linux.org> Dutch Translator

866
aclocal.m4 vendored
View File

@@ -1,866 +0,0 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
if test "[$]*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
if test "[$]*" != "X $srcdir/configure conftestfile" \
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "[$]2" = conftestfile
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if ($2 --version) < /dev/null > /dev/null 2>&1; then
$1=$2
AC_MSG_RESULT(found)
else
$1="$3/missing $2"
AC_MSG_RESULT(missing)
fi
AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
dnl This file resides in the same directory as the config header
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/".
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
<<am_indx=1
for am_file in <<$1>>; do
case " <<$>>CONFIG_HEADERS " in
*" <<$>>am_file "*<<)>>
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
;;
esac
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>)
changequote([,]))])
#serial 19
dnl By default, many hosts won't let programs access large files;
dnl one must use special compiler options to get large-file access to work.
dnl For more details about this brain damage please see:
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
dnl Written by Paul Eggert <eggert@twinsun.com>.
dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_TEST_INCLUDES
AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
[[#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply "#define LARGE_OFF_T 9223372036854775807",
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
]])
dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY)
AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
[AC_CACHE_CHECK([for $1 value needed for large files], $3,
[$3=no
AC_TRY_COMPILE([$5],
[$6],
,
[AC_TRY_COMPILE([#define $1 $2]
[$5]
,
[$6],
[$3=$2])])])
if test "[$]$3" != no; then
AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
fi])
AC_DEFUN(NANO_AC_SYS_LARGEFILE,
[AC_REQUIRE([AC_PROG_CC])
AC_ARG_ENABLE(largefile,
[ --disable-largefile omit support for large files])
if test "$enable_largefile" != no; then
AC_CACHE_CHECK([for special C compiler options needed for large files],
ac_cv_sys_largefile_CC,
[ac_cv_sys_largefile_CC=no
if test "$GCC" != yes; then
# IRIX 6.2 and later do not support large files by default,
# so use the C compiler's -n32 option if that helps.
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
[ac_save_CC="$CC"
CC="$CC -n32"
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
ac_cv_sys_largefile_CC=' -n32')
CC="$ac_save_CC"])
fi])
if test "$ac_cv_sys_largefile_CC" != no; then
CC="$CC$ac_cv_sys_largefile_CC"
fi
AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
ac_cv_sys_file_offset_bits,
[Number of bits in a file offset, on hosts where this is settable.],
AC_SYS_LARGEFILE_TEST_INCLUDES)
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
ac_cv_sys_large_files,
[Define for large files, on AIX-style hosts.],
AC_SYS_LARGEFILE_TEST_INCLUDES)
fi
])
AC_DEFUN(AC_FUNC_FSEEKO,
[AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
ac_cv_sys_largefile_source,
[Define to make fseeko visible on some hosts (e.g. glibc 2.2).],
[#include <stdio.h>], [return !fseeko;])
# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
# in glibc 2.1.3, but that breaks too many other things.
# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko,
[ac_cv_func_fseeko=no
AC_TRY_LINK([#include <stdio.h>],
[return fseeko && fseeko (stdin, 0, 0);],
[ac_cv_func_fseeko=yes])])
if test $ac_cv_func_fseeko != no; then
AC_DEFINE(HAVE_FSEEKO, 1,
[Define if fseeko (and presumably ftello) exists and is declared.])
fi])
# Configure paths for GLIB
# Owen Taylor 97-11-3
dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
dnl gthread is specified in MODULES, pass to glib-config
dnl
AC_DEFUN(AM_PATH_GLIB,
[dnl
dnl Get the cflags and libraries from the glib-config script
dnl
AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
glib_config_prefix="$withval", glib_config_prefix="")
AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
, enable_glibtest=yes)
if test x$glib_config_exec_prefix != x ; then
glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
if test x${GLIB_CONFIG+set} != xset ; then
GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
fi
fi
if test x$glib_config_prefix != x ; then
glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
if test x${GLIB_CONFIG+set} != xset ; then
GLIB_CONFIG=$glib_config_prefix/bin/glib-config
fi
fi
for module in . $4
do
case "$module" in
gmodule)
glib_config_args="$glib_config_args gmodule"
;;
gthread)
glib_config_args="$glib_config_args gthread"
;;
esac
done
AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
min_glib_version=ifelse([$1], ,0.99.7,$1)
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
no_glib=""
if test "$GLIB_CONFIG" = "no" ; then
no_glib=yes
else
GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_glibtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$GLIB_LIBS $LIBS"
dnl
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
dnl checks the results of glib-config to some extent
dnl
rm -f conf.glibtest
AC_TRY_RUN([
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.glibtest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_glib_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_glib_version");
exit(1);
}
if ((glib_major_version != $glib_config_major_version) ||
(glib_minor_version != $glib_config_minor_version) ||
(glib_micro_version != $glib_config_micro_version))
{
printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
printf ("*** was found! If glib-config was correct, then it is best\n");
printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
(glib_minor_version != GLIB_MINOR_VERSION) ||
(glib_micro_version != GLIB_MICRO_VERSION))
{
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
glib_major_version, glib_minor_version, glib_micro_version);
}
else
{
if ((glib_major_version > major) ||
((glib_major_version == major) && (glib_minor_version > minor)) ||
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
glib_major_version, glib_minor_version, glib_micro_version);
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the glib-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
printf("*** correct copy of glib-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_glib" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GLIB_CONFIG" = "no" ; then
echo "*** The glib-config script installed by GLIB could not be found"
echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GLIB_CONFIG environment variable to the"
echo "*** full path to glib-config."
else
if test -f conf.glibtest ; then
:
else
echo "*** Could not run GLIB test program, checking why..."
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
AC_TRY_LINK([
#include <glib.h>
#include <stdio.h>
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
echo "***"
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
echo "*** came with the system with the command"
echo "***"
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GLIB_CFLAGS=""
GLIB_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
rm -f conf.glibtest
])
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 108
AC_PREREQ(2.13) dnl Minimum Autoconf version required.
AC_DEFUN(NANO_AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
USE_INCLUDED_LIBINTL=no
AC_ARG_WITH(locale-dir,
[ --with-locale-dir=DIR specify locale directory],
LOCALE_DIR=$withval)
test -z "$LOCALE_DIR" && LOCALE_DIR='$(datadir)/locale'
AC_SUBST(LOCALE_DIR)
AC_ARG_WITH(gnu-locale-dir,
[ --with-gnu-locale-dir=DIR specify GNU locale directory],
GNU_LOCALE_DIR=$withval)
test -z "$GNU_LOCALE_DIR" && GNU_LOCALE_DIR='$(prefix)/share/locale'
AC_SUBST(GNU_LOCALE_DIR)
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested.])
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If gettext or catgets are available (in this order) we
dnl use this. Else we have to fall back to GNU NLS library.
dnl catgets is only used if permitted by option --with-catgets.
nls_cv_header_intl=
nls_cv_header_libgt=
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CHECK_LIB(intl, gettext)])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$ac_cv_lib_intl_gettext" = "yes"; then
AC_DEFINE(HAVE_GETTEXT, 1,
[Define to 1 if you have gettext and don't want to use GNU gettext.])
NANO_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
NANO_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
fi
])
if test "$CATOBJEXT" = "NONE"; then
AC_MSG_CHECKING([whether catgets can be used])
AC_ARG_WITH(catgets,
[ --with-catgets use catgets functions if available],
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
AC_MSG_RESULT($nls_cv_use_catgets)
if test "$nls_cv_use_catgets" = "yes"; then
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
[AC_DEFINE(HAVE_CATGETS, 1,
[Define as 1 if you have catgets and don't want to use GNU gettext.])
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
if test "$GENCAT" != "no"; then
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
if test "$GMSGFMT" = "no"; then
NANO_AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
fi
NANO_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.cat
INSTOBJEXT=.cat
DATADIRNAME=lib
INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi])
fi
fi
if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
NANO_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
NANO_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_SUBST(MSGFMT)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
else
DATADIRNAME=share
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
if test -z "$nls_cv_header_intl"; then
# Clean out junk possibly left behind by a previous configuration.
rm -f intl/libintl.h
fi
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT_COMMANDS(
[case "$CONFIG_FILES" in *po/Makefile.in*)
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
esac])
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
if test "$PACKAGE" = gettext; then
USE_NLS=yes
USE_INCLUDED_LIBINTL=yes
fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(DATADIRNAME)
AC_SUBST(GMOFILES)
AC_SUBST(INSTOBJEXT)
AC_SUBST(INTLDEPS)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
])
AC_DEFUN(NANO_AM_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
strdup __argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
AC_DEFINE(HAVE_STPCPY, 1, [Define to 1 if you have the stpcpy function.])
fi
NANO_AM_LC_MESSAGES
NANO_AM_WITH_NLS
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl The reference to <locale.h> in the installed <libintl.h> file
dnl must be resolved because we cannot expect the users of this
dnl to define HAVE_LOCALE_H.
if test $ac_cv_header_locale_h = yes; then
INCLUDE_LOCALE_H="#include <locale.h>"
else
INCLUDE_LOCALE_H="\
/* The system does not provide the header <locale.h>. Take care yourself. */"
fi
AC_SUBST(INCLUDE_LOCALE_H)
dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats:
dnl Linux libc-5 and the normal X/Open format
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
dnl Transform the SED scripts while copying because some dumb SEDs
dnl cannot handle comments.
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
fi
dnl po2tbl.sed is always needed.
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
dnl In the intl/Makefile.in we have a special dependency which makes
dnl only sense for gettext. We comment this out for non-gettext
dnl packages.
if test "$PACKAGE" = "gettext"; then
GT_NO="#NO#"
GT_YES=
else
GT_NO=
GT_YES="#YES#"
fi
AC_SUBST(GT_NO)
AC_SUBST(GT_YES)
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl *** For now the libtool support in intl/Makefile is not for real.
l=
AC_SUBST(l)
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
case "$srcdir" in
.)
posrcprefix="../" ;;
/* | [[A-Za-z]]:*)
posrcprefix="$srcdir/" ;;
*)
posrcprefix="../$srcdir/" ;;
esac
rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(NANO_AM_PATH_PROG_WITH_TEST,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 2
AC_PREREQ(2.13) dnl Minimum Autoconf version required.
AC_DEFUN(NANO_AM_LC_MESSAGES,
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES, 1,
[Define if your locale.h file contains LC_MESSAGES.])
fi
fi])

7
autogen.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
# Generate configure & friends for CVS users.
aclocal -I ./m4
automake --add-missing
autoheader
autoconf

67
color.c
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *
@@ -98,14 +98,73 @@ void colorinit_one(int colortoset, short fg, short bg, int bold)
int do_colorinit(void)
{
int i;
colortype *tmpcolor = NULL, *beforenow = NULL;
int defok = 0;
if (has_colors()) {
start_color();
/* Add in colors, if available */
#ifdef HAVE_USE_DEFAULT_COLORS
/* Use if at all possible for transparent terminals =-) */
use_default_colors();
if (use_default_colors() != ERR) {
defok = 1;
#endif
/* Some defaults values to play with */
i = 1;
for (tmpcolor = colorstrings; tmpcolor != NULL;
tmpcolor = tmpcolor->next) {
for (beforenow = colorstrings; beforenow != NULL
&& beforenow != tmpcolor &&
(beforenow->fg != tmpcolor->fg || beforenow->bg != tmpcolor->bg
|| beforenow->bright != tmpcolor->bright);
beforenow = beforenow->next)
;
if (beforenow != NULL && beforenow != tmpcolor) {
tmpcolor->pairnum = beforenow->pairnum;
continue;
}
if (defok && tmpcolor->bg == -1)
init_pair(i, tmpcolor->fg, -1);
else if (tmpcolor->bg == -1)
init_pair(i, tmpcolor->fg, COLOR_BLACK);
else /* They picked a fg and bg color */
init_pair(i, tmpcolor->fg, tmpcolor->bg);
#ifdef DEBUG
fprintf(stderr, "Running init_pair with fg = %d and bg = %d\n", tmpcolor->fg, tmpcolor->bg);
#endif
tmpcolor->pairnum = i;
i++;
}
}
/*
if (use_default_colors() != ERR) {
init_pair(COLOR_BLACK, -1, -1);
init_pair(COLOR_GREEN, COLOR_GREEN, -1);
init_pair(COLOR_WHITE, COLOR_WHITE, -1);
init_pair(COLOR_RED, COLOR_RED, -1);
init_pair(COLOR_CYAN, COLOR_CYAN, -1);
init_pair(COLOR_MAGENTA, COLOR_MAGENTA, -1);
init_pair(COLOR_BLUE, COLOR_BLUE, -1);
init_pair(COLOR_YELLOW, COLOR_YELLOW, -1);
} else {
init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK);
init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK);
init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK);
init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK);
init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK);
init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK);
init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK);
init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK);
}
*/
/* Okay I'll be nice and comment these out for the commit =)
colorinit_one(COLOR_TITLEBAR, COLOR_GREEN, COLOR_BLUE, 1);

View File

@@ -1,240 +0,0 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define this if you have the wresize function in your ncurses-type library */
#undef HAVE_WRESIZE
/* Define this if you have the resizeterm function in your ncurses-type library */
#undef HAVE_RESIZETERM
/* Define this if your curses lib has the _use_keypad flag */
#undef HAVE_USEKEYPAD
/* Define this to make the nano executable as small as possible */
#undef NANO_SMALL
/* Define to use the slang wrappers for curses instead of native curses */
#undef USE_SLANG
/* Define this to enable the extra stuff */
#undef NANO_EXTRA
/* Define to disable the tab completion code Chris worked so hard on! */
#undef DISABLE_TABCOMP
/* Define this to disable the justify routine */
#undef DISABLE_JUSTIFY
/* Define this to disable the use(full|less) spelling functions */
#undef DISABLE_SPELLER
/* Define this to disable the ^G help menu */
#undef DISABLE_HELP
/* Define this to disable the built-in (crappy) file browser */
#undef DISABLE_BROWSER
/* Define this to disable any and all text wrapping */
#undef DISABLE_WRAPPING
/* Define this to disable the mouse functions */
#undef DISABLE_MOUSE
/* Define this to disable setting of the operating directory (chroot of sorts) */
#undef DISABLE_OPERATINGDIR
/* Define this to enable multiple file buffers; this is disabled if NANO_SMALL is defined */
#undef ENABLE_MULTIBUFFER
/* Define this to use the .nanorc file */
#undef ENABLE_NANORC
/* Define this if your curses library has the use_default_colors command */
#undef HAVE_USE_DEFAULT_COLORS
/* Define this to have syntax hilighting, requires ENABLE_NANORC too! */
#undef ENABLE_COLOR
/* Define this to enable undoing....something */
#undef ENABLE_UNDO
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
/* Define if you have the __argz_next function. */
#undef HAVE___ARGZ_NEXT
/* Define if you have the __argz_stringify function. */
#undef HAVE___ARGZ_STRINGIFY
/* Define if you have the dcgettext function. */
#undef HAVE_DCGETTEXT
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
/* Define if you have the getopt_long function. */
#undef HAVE_GETOPT_LONG
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the munmap function. */
#undef HAVE_MUNMAP
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
/* Define if you have the setenv function. */
#undef HAVE_SETENV
/* Define if you have the setlocale function. */
#undef HAVE_SETLOCALE
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the strchr function. */
#undef HAVE_STRCHR
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define if you have the <curses.h> header file. */
#undef HAVE_CURSES_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <ncurses.h> header file. */
#undef HAVE_NCURSES_H
/* 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
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define if you have the <termio.h> header file. */
#undef HAVE_TERMIO_H
/* Define if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the i library (-li). */
#undef HAVE_LIBI
/* Define if you have the intl library (-lintl). */
#undef HAVE_LIBINTL
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define to 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
/* Define to 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
#undef HAVE_CATGETS

5212
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
# $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(nano.c)
AM_INIT_AUTOMAKE(nano, 1.1.2)
AM_INIT_AUTOMAKE(nano, 1.1.4)
AM_CONFIG_HEADER(config.h:config.h.in)
ALL_LINGUAS="es de fr it id fi hu ca cs gl uk ru sv no nl da"

48
cut.c
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *
@@ -141,7 +141,7 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
/* Now, paste bot[bot_x] into top[top_x] */
if (destructive) {
tmpstr = charalloc(strlen(top->data) + strlen(&bot->data[bot_x]));
tmpstr = charalloc(top_x + strlen(&bot->data[bot_x]) + 1);
strncpy(tmpstr, top->data, top_x);
strcpy(&tmpstr[top_x], &bot->data[bot_x]);
free(top->data);
@@ -157,7 +157,7 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
screwed somewhere. Not doing this causes update_line to annihilate
the last line copied into the cutbuffer when the mark is set ?!?!? */
botcopy = copy_node(bot);
null_at(botcopy->data, bot_x);
null_at(&botcopy->data, bot_x);
next = botcopy->next;
add_to_cutbuffer(botcopy);
@@ -187,6 +187,7 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
if (top->lineno < edittop->lineno)
edit_update(top, CENTER);
}
}
#endif
@@ -194,7 +195,7 @@ int do_cut_text(void)
{
filestruct *tmp, *fileptr = current;
#ifndef NANO_SMALL
int cuttingpartialline = 0;
int dontupdate = 0;
int cuttingtoend = 0;
#endif
@@ -252,25 +253,40 @@ int do_cut_text(void)
cuttingtoend = 1;
}
}
if (ISSET(MARK_ISSET)) {
if (current->lineno <= mark_beginbuf->lineno) {
if (current->lineno == mark_beginbuf->lineno)
cuttingpartialline = 1;
/* Don't do_update and move the screen position if the marked
area lies entirely within the screen buffer */
if (current->lineno == mark_beginbuf->lineno
|| (current->lineno >= edittop->lineno
&& mark_beginbuf->lineno <= editbot->lineno))
dontupdate = 1;
cut_marked_segment(current, current_x, mark_beginbuf,
mark_beginx, 1);
}
else
else {
/* Same as above, easier logic since we know it's a multi-line
cut and mark_beginbuf is before current */
if (mark_beginbuf->lineno >= edittop->lineno
&& current->lineno <= editbot->lineno)
dontupdate = 1;
cut_marked_segment(mark_beginbuf, mark_beginx, current,
current_x, 1);
}
placewewant = xplustabs();
UNSET(MARK_ISSET);
marked_cut = 1;
set_modified();
if (cuttingpartialline || cuttingtoend)
if (dontupdate || cuttingtoend) {
fix_editbot();
edit_refresh();
else
} else
edit_update(current, CENTER);
return 1;
@@ -417,8 +433,12 @@ int do_uncut_text(void)
i = editbot->lineno;
current = newend;
if (i <= newend->lineno)
if (i < newend->lineno) {
edit_update(current, CENTER);
}
else {
edit_refresh();
}
}
/* If marked cut == 2, that means that we're doing a cut to end
@@ -431,7 +451,7 @@ int do_uncut_text(void)
tmp->data = charalloc(strlen(&current->data[current_x]) + 1);
strcpy(tmp->data, &current->data[current_x]);
splice_node(current, tmp, current->next);
null_at(current->data, current_x);
null_at(&current->data, current_x);
current = current->next;
current_x = 0;
placewewant = 0;
@@ -476,8 +496,12 @@ int do_uncut_text(void)
i = editbot->lineno;
renumber(newbuf);
if (i < newend->lineno)
if (i < newend->lineno) {
edit_update(fileptr, CENTER);
}
else {
edit_refresh();
}
dump_buffer_reverse(fileptr);

View File

@@ -203,7 +203,7 @@ nano was developed).</font></blockquote>
of nano?</font></h2>
<blockquote><font color="#330000">The current version of nano *should*
be 1.1.2.&nbsp; Of course you should always check the nano hompage to
be 1.1.4.&nbsp; Of course you should always check the nano hompage to
see what the latest and greatest version is.</font></blockquote>
<h2>
@@ -229,9 +229,9 @@ at the following fine web and ftp sites:</font>
<li>
<font color="#330000"><a href="http://www.ewtoo.org/~astyanax/nano/dist">http://www.ewtoo.org/~astyanax/nano/dist</a></font></li>
<li>
<font color="#330000"><a href="ftp://ftp.nano-editor.org/pub/nano">ftp://ftp.nano-editor.org/pub/nano</a></font></li>
<font color="#330000"><a href="ftp://ftp.gnu.org/pub/gnu/nano">ftp://ftp.gnu.org/pub/gnu/nano</a></font></li>
</ul>
</blockquote>
@@ -247,8 +247,6 @@ packages.</font></h2>
<li>
<font color="#330000"><a href="http://www.ewtoo.org/~astyanax/nano/dist/RPMS">http://www.ewtoo.org/~astyanax/nano/dist/RPMS</a></font></li>
<li>
<font color="#330000"><a href="ftp://ftp.nano-editor.org/pub/nano/RPMS">ftp://ftp.nano-editor.org/pub/nano/RPMS</a></font></li>
</ul>
<font color="#330000">Additionally, check out the Redhat contribs section
at:</font>
@@ -396,7 +394,7 @@ try:
3.7. Tell me more about this multibuffer stuff!</font></h2>
<blockquote><font color="#330000"> To use multiple file buffers, you must
be using nano 1.1.2 or newer, and you must have configured nano with
be using nano 1.1.4 or newer, and you must have configured nano with
<b>--enable-multibuffer</b> or <b>--enable-extra</b> (use nano -V to check).
Then when you want to enable inserting a file into its own buffer instead of
into the current file, just hit <b>Meta-F</b>, then insert the file as normal
@@ -416,7 +414,7 @@ buffer is open.
<blockquote><font color="#330000"> It's not hard at all! But, your version
of nano must have beem compiled with <b>--enable-nanorc</b>, and again must
be version 1.1.2 or newer (use nano -V to check your version and compiled
be version 1.1.4 or newer (use nano -V to check your version and compiled
features). Then simply copy the <b>nanorc.sample</b>
that came with the nano source or your nano package (most likely in
/usr/doc/nano) to .nanorc in your home directory. If you didn't get one,

93
files.c
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *
@@ -43,6 +43,11 @@
#define _(string) (string)
#endif
/* statics for here */
#ifndef NANO_SMALL
static int fileformat = 0; /* 0 = *nix, 1 = DOS, 2 = Mac */
#endif
/* Load file into edit buffer - takes data from file struct */
void load_file(int quiet)
{
@@ -57,8 +62,10 @@ void load_file(int quiet)
duplicate handling) */
if (quiet != 0)
quiet = 1;
if (add_open_file(quiet, 1 - quiet) == 2)
if (add_open_file(quiet, 1 - quiet) == 2) {
load_open_file();
statusbar(_("File already loaded"));
}
#endif
wmove(edit, current_y, current_x);
@@ -130,6 +137,9 @@ filestruct *read_line(char *buf, filestruct * prev, int *line1ins)
if (buf[strlen(buf) - 1] == '\r') {
fileptr->data[strlen(buf) - 1] = 0;
totsize--;
if (!fileformat)
fileformat = 1;
}
#endif
@@ -164,7 +174,8 @@ filestruct *read_line(char *buf, filestruct * prev, int *line1ins)
int read_file(int fd, char *filename, int quiet)
{
long size, num_lines = 0, linetemp = 0;
long size;
int num_lines = 0;
char input[2]; /* buffer */
char *buf;
long i = 0, bufx = 128;
@@ -185,7 +196,6 @@ int read_file(int fd, char *filename, int quiet)
input[1] = 0;
/* Read the entire file into file struct */
while ((size = read_byte(fd, filename, input)) > 0) {
linetemp = 0;
if (input[0] == '\n') {
fileptr = read_line(buf, fileptr, &line1ins);
@@ -195,6 +205,7 @@ int read_file(int fd, char *filename, int quiet)
#ifndef NANO_SMALL
/* If it's a Mac file (no LF just a CR), handle it! */
} else if (i > 0 && buf[i-1] == '\r') {
fileformat = 2;
fileptr = read_line(buf, fileptr, &line1ins);
num_lines++;
buf[0] = input[0];
@@ -245,7 +256,16 @@ int read_file(int fd, char *filename, int quiet)
/* Update the edit buffer */
load_file(quiet);
}
statusbar(_("Read %d lines"), num_lines);
#ifndef NANO_SMALL
if (fileformat == 2)
statusbar(_("Read %d lines (Converted Mac format)"), num_lines);
else if (fileformat == 1)
statusbar(_("Read %d lines (Converted DOS format)"), num_lines);
else
#endif
statusbar(_("Read %d lines"), num_lines);
totlines += num_lines;
free(buf);
@@ -305,7 +325,7 @@ int do_insertfile(int loading_file)
wrap_reset();
#ifndef DISABLE_MOUSE
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE)
currshortcut = insertfile_list;
currslen = INSERTFILE_LIST_LEN;
#endif
@@ -328,7 +348,7 @@ int do_insertfile(int loading_file)
if (i == NANO_TOFILES_KEY) {
char *tmp = do_browse_from(realname);
#ifndef DISABLE_MOUSE
#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
currshortcut = insertfile_list;
currslen = INSERTFILE_LIST_LEN;
#endif
@@ -360,7 +380,7 @@ int do_insertfile(int loading_file)
that could create them are taken care of elsewhere) */
add_open_file(1, 0);
free_filestruct(current);
free_filestruct(fileage);
new_file();
UNSET(MODIFIED);
}
@@ -441,7 +461,7 @@ int add_open_file(int update, int dup_fix)
{
filestruct *tmp;
if (!current || !filename)
if (!fileage || !current || !filename)
return 1;
/* first, if duplicate checking is allowed, do it */
@@ -457,8 +477,8 @@ int add_open_file(int update, int dup_fix)
open_files = make_new_node(NULL);
/* if open_files->file is NULL at the nrealloc() below, we get a
segfault */
open_files->file = open_files;
segfault
open_files->file = open_files; */
}
else if (!update) {
@@ -475,8 +495,8 @@ int add_open_file(int update, int dup_fix)
open_files = open_files->next;
/* if open_files->file is NULL at the nrealloc() below, we get a
segfault */
open_files->file = open_files;
segfault
open_files->file = open_files; */
}
/* save current filename */
@@ -503,11 +523,9 @@ int add_open_file(int update, int dup_fix)
/* save current line number */
open_files->lineno = current->lineno;
/* save current filestruct */
open_files->file = nrealloc(open_files->file, sizeof(filestruct));
while (current->prev)
current = current->prev;
open_files->file = copy_filestruct(current);
/* save current filestruct and restore full file position afterward */
open_files->file = nmalloc(sizeof(filestruct));
open_files->file = copy_filestruct(fileage);
do_gotopos(open_files->lineno, open_files->file_current_x, open_files->file_current_y, open_files->file_placewewant);
/* save current modification status */
@@ -556,10 +574,19 @@ int load_open_file(void)
totlines = open_files->file_totlines;
totsize = open_files->file_totsize;
/* Unset the marker because nano can't (yet) handle marked text flipping between
open files */
UNSET(MARK_ISSET);
/* restore full file position: line number, x-coordinate, y-
coordinate, place we want */
do_gotopos(open_files->lineno, open_files->file_current_x, open_files->file_current_y, open_files->file_placewewant);
/* restore the bottom of the file */
filebot = current;
while (filebot->next)
filebot = filebot->next;
/* set up modification status and update the titlebar */
if (open_files->file_modified)
SET(MODIFIED);
@@ -568,9 +595,11 @@ int load_open_file(void)
clearok(topwin, FALSE);
titlebar(NULL);
/* if we're constantly displaying the cursor position, update it */
/* if we're constantly displaying the cursor position, update it (and do so
unconditionally, in the rare case that the character count is the same
but the line count isn't) */
if (ISSET(CONSTUPDATE))
do_cursorpos();
do_cursorpos(0);
/* now we're done */
return 0;
@@ -884,7 +913,7 @@ char *get_full_path(char *origpath)
/* otherwise, remove all non-path elements from d_there
(i. e. everything after the last slash) */
last_slash_index = strlen(d_there) - strlen(last_slash);
null_at(d_there, last_slash_index + 1);
null_at(&d_there, last_slash_index + 1);
/* and remove all non-file elements from d_there_file (i. e.
everything before and including the last slash); if we
@@ -1263,7 +1292,7 @@ int do_writeout(char *path, int exiting, int append)
static int did_cred = 0;
#endif
#ifndef DISABLE_MOUSE
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE)
currshortcut = writefile_list;
currslen = WRITEFILE_LIST_LEN;
#endif
@@ -1314,7 +1343,7 @@ int do_writeout(char *path, int exiting, int append)
char *tmp = do_browse_from(answer);
#ifndef DISABLE_MOUSE
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE)
currshortcut = writefile_list;
currslen = WRITEFILE_LIST_LEN;
#endif
@@ -1683,7 +1712,7 @@ char **cwd_tab_completion(char *buf, int *num_matches)
/* This function now has an arg which refers to how much the
* statusbar (place) should be advanced, i.e. the new cursor pos.
*/
char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
char *input_tab(char *buf, int place, int *lastWasTab, int *newplace, int *list)
{
/* Do TAB completion */
static int num_matches = 0, match_matches = 0;
@@ -1692,6 +1721,8 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
int longestname = 0, is_dir = 0;
char *foo;
*list = 0;
if (*lastWasTab == FALSE) {
char *tmp, *copyto, *matchBuf;
@@ -1822,7 +1853,7 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
/* Ok -- the last char was a TAB. Since they
* just hit TAB again, print a list of all the
* available choices... */
if (matches && num_matches > 0) {
if (matches && num_matches > 1) {
/* Blank the edit window, and print the matches out there */
blank_edit();
@@ -1871,12 +1902,16 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace)
}
free(foo);
wrefresh(edit);
*list = 1;
} else
beep();
}
edit_refresh();
/* Only refresh the edit window if we don't have a list of filename
matches on it */
if (*list == 0)
edit_refresh();
curs_set(1);
return buf;
}
@@ -2058,7 +2093,7 @@ char *do_browser(char *inpath)
blank_statusbar_refresh();
#ifndef DISABLE_MOUSE
#if !defined DISABLE_HELP || !defined(DISABLE_MOUSE)
currshortcut = browser_list;
currslen = BROWSER_LIST_LEN;
#endif
@@ -2169,6 +2204,10 @@ char *do_browser(char *inpath)
else
selected = numents - 1;
break;
case NANO_HELP_KEY:
case NANO_HELP_FKEY:
do_help();
break;
case KEY_ENTER:
case NANO_ENTER_KEY:
case 's': /* More Pico compatibility */

118
global.c
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *
@@ -60,7 +60,7 @@ filestruct *open_files = NULL; /* The list of open files */
char *answer = NULL; /* 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 */
long totsize = 0; /* Total number of bytes in the file */
int placewewant = 0; /* The column we'd like the cursor
to jump to when we go to the
next or previous line */
@@ -100,9 +100,10 @@ shortcut browser_list[BROWSER_LIST_LEN];
#ifdef ENABLE_COLOR
colorstruct colors[NUM_NCOLORS];
colortype *colorstrings = NULL;
#endif
#ifndef DISABLE_MOUSE
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE) || !defined (DISABLE_HELP)
shortcut *currshortcut = main_list; /* Current shortcut list we're using */
int currslen = MAIN_VISIBLE; /* Length of current shortcut list */
#endif
@@ -362,7 +363,7 @@ void shortcut_init(int unjustify)
sc_init_one(&main_list[10], NANO_CURSORPOS_KEY, _("Cur Pos"),
nano_cursorpos_msg,
0, NANO_CURSORPOS_FKEY, 0, VIEW, do_cursorpos);
0, NANO_CURSORPOS_FKEY, 0, VIEW, do_cursorpos_void);
sc_init_one(&main_list[11], NANO_SPELL_KEY, _("To Spell"),
nano_spell_msg, 0, NANO_SPELL_FKEY, 0, NOVIEW, do_spell);
@@ -426,85 +427,98 @@ void shortcut_init(int unjustify)
NANO_BRACKET_KEY, 0, 0, VIEW, do_find_bracket);
#endif
sc_init_one(&whereis_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
sc_init_one(&whereis_list[0], NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
sc_init_one(&whereis_list[1], NANO_CANCEL_KEY,
_("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&whereis_list[2], NANO_FIRSTLINE_KEY, _("First Line"),
nano_firstline_msg, 0, 0, 0, VIEW, do_first_line);
sc_init_one(&whereis_list[1], NANO_LASTLINE_KEY, _("Last Line"),
sc_init_one(&whereis_list[3], NANO_LASTLINE_KEY, _("Last Line"),
nano_lastline_msg, 0, 0, 0, VIEW, do_last_line);
sc_init_one(&whereis_list[2], NANO_OTHERSEARCH_KEY, _("Replace"),
sc_init_one(&whereis_list[4], NANO_OTHERSEARCH_KEY, _("Replace"),
nano_replace_msg, 0, 0, 0, VIEW, do_replace);
sc_init_one(&whereis_list[3], NANO_FROMSEARCHTOGOTO_KEY,
sc_init_one(&whereis_list[5], NANO_FROMSEARCHTOGOTO_KEY,
_("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
do_gotoline_void);
#ifndef NANO_SMALL
sc_init_one(&whereis_list[4], TOGGLE_CASE_KEY, _("Case Sens"),
sc_init_one(&whereis_list[6], TOGGLE_CASE_KEY, _("Case Sens"),
nano_case_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&whereis_list[5], TOGGLE_BACKWARDS_KEY, _("Direction"),
sc_init_one(&whereis_list[7], TOGGLE_BACKWARDS_KEY, _("Direction"),
nano_reverse_msg, 0, 0, 0, VIEW, 0);
#ifdef HAVE_REGEX_H
sc_init_one(&whereis_list[REPLACE_LIST_LEN - 2], TOGGLE_REGEXP_KEY,
sc_init_one(&whereis_list[REPLACE_LIST_LEN - 1], TOGGLE_REGEXP_KEY,
_("Regexp"), nano_regexp_msg, 0, 0, 0, VIEW, 0);
#endif
#endif /* NANO_SMALL */
sc_init_one(&whereis_list[REPLACE_LIST_LEN - 1], NANO_CANCEL_KEY,
sc_init_one(&replace_list[0], NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
sc_init_one(&replace_list[1], NANO_CANCEL_KEY,
_("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&replace_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
sc_init_one(&replace_list[2], NANO_FIRSTLINE_KEY, _("First Line"),
nano_firstline_msg, 0, 0, 0, VIEW, do_first_line);
sc_init_one(&replace_list[1], NANO_LASTLINE_KEY, _("Last Line"),
sc_init_one(&replace_list[3], NANO_LASTLINE_KEY, _("Last Line"),
nano_lastline_msg, 0, 0, 0, VIEW, do_last_line);
sc_init_one(&replace_list[2], NANO_OTHERSEARCH_KEY, _("No Replace"),
sc_init_one(&replace_list[4], NANO_OTHERSEARCH_KEY, _("No Replace"),
nano_whereis_msg, 0, 0, 0, VIEW, do_search);
sc_init_one(&replace_list[3], NANO_FROMSEARCHTOGOTO_KEY,
sc_init_one(&replace_list[5], NANO_FROMSEARCHTOGOTO_KEY,
_("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
do_gotoline_void);
#ifndef NANO_SMALL
sc_init_one(&replace_list[4], TOGGLE_CASE_KEY, _("Case Sens"),
sc_init_one(&replace_list[6], TOGGLE_CASE_KEY, _("Case Sens"),
nano_case_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&replace_list[5], TOGGLE_BACKWARDS_KEY, _("Direction"),
sc_init_one(&replace_list[7], TOGGLE_BACKWARDS_KEY, _("Direction"),
nano_reverse_msg, 0, 0, 0, VIEW, 0);
#ifdef HAVE_REGEX_H
sc_init_one(&replace_list[REPLACE_LIST_LEN - 2], TOGGLE_REGEXP_KEY,
sc_init_one(&replace_list[REPLACE_LIST_LEN - 1], TOGGLE_REGEXP_KEY,
_("Regexp"), nano_regexp_msg, 0, 0, 0, VIEW, 0);
#endif
#endif /* NANO_SMALL */
sc_init_one(&replace_list[REPLACE_LIST_LEN - 1], NANO_CANCEL_KEY,
sc_init_one(&replace_list_2[0], NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
sc_init_one(&replace_list_2[1], NANO_CANCEL_KEY,
_("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&replace_list_2[0], NANO_FIRSTLINE_KEY, _("First Line"),
sc_init_one(&replace_list_2[2], NANO_FIRSTLINE_KEY, _("First Line"),
nano_firstline_msg, 0, 0, 0, VIEW, do_first_line);
sc_init_one(&replace_list_2[1], NANO_LASTLINE_KEY, _("Last Line"),
sc_init_one(&replace_list_2[3], NANO_LASTLINE_KEY, _("Last Line"),
nano_lastline_msg, 0, 0, 0, VIEW, do_last_line);
sc_init_one(&replace_list_2[2], NANO_CANCEL_KEY, _("Cancel"),
sc_init_one(&goto_list[0], NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
sc_init_one(&goto_list[1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&goto_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
sc_init_one(&goto_list[2], NANO_FIRSTLINE_KEY, _("First Line"),
nano_firstline_msg, 0, 0, 0, VIEW, &do_first_line);
sc_init_one(&goto_list[1], NANO_LASTLINE_KEY, _("Last Line"),
sc_init_one(&goto_list[3], NANO_LASTLINE_KEY, _("Last Line"),
nano_lastline_msg, 0, 0, 0, VIEW, &do_last_line);
sc_init_one(&goto_list[2], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&help_list[0], NANO_PREVPAGE_KEY, _("Prev Page"),
nano_prevpage_msg,
@@ -518,44 +532,60 @@ void shortcut_init(int unjustify)
nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit);
sc_init_one(&writefile_list[0], NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
sc_init_one(&writefile_list[1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
#ifndef DISABLE_BROWSER
sc_init_one(&writefile_list[0], NANO_TOFILES_KEY, _("To Files"),
sc_init_one(&writefile_list[2], NANO_TOFILES_KEY, _("To Files"),
nano_tofiles_msg, 0, 0, 0, NOVIEW, 0);
#endif
sc_init_one(&writefile_list[WRITEFILE_LIST_LEN - 2], NANO_APPEND_KEY, _("Append"),
sc_init_one(&writefile_list[WRITEFILE_LIST_LEN - 1], NANO_APPEND_KEY, _("Append"),
nano_append_msg, 0, 0, 0, NOVIEW, 0);
sc_init_one(&writefile_list[WRITEFILE_LIST_LEN - 1], NANO_CANCEL_KEY, _("Cancel"),
sc_init_one(&insertfile_list[0], NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
sc_init_one(&insertfile_list[1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
#ifndef DISABLE_BROWSER
sc_init_one(&insertfile_list[0], NANO_TOFILES_KEY, _("To Files"),
sc_init_one(&insertfile_list[2], NANO_TOFILES_KEY, _("To Files"),
nano_tofiles_msg, 0, 0, 0, NOVIEW, 0);
#endif
sc_init_one(&insertfile_list[INSERTFILE_LIST_LEN - 1], NANO_CANCEL_KEY, _("Cancel"),
sc_init_one(&spell_list[0], NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
sc_init_one(&spell_list[1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&spell_list[0], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
#ifndef DISABLE_BROWSER
sc_init_one(&browser_list[0], NANO_PREVPAGE_KEY, _("Prev Page"),
sc_init_one(&browser_list[0], NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
sc_init_one(&browser_list[1], NANO_EXIT_KEY, _("Exit"),
nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, 0);
sc_init_one(&browser_list[2], NANO_PREVPAGE_KEY, _("Prev Page"),
nano_prevpage_msg,
0, NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, 0);
sc_init_one(&browser_list[1], NANO_NEXTPAGE_KEY, _("Next Page"),
sc_init_one(&browser_list[3], NANO_NEXTPAGE_KEY, _("Next Page"),
nano_nextpage_msg,
0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, 0);
sc_init_one(&browser_list[2], NANO_GOTO_KEY, _("Goto"),
sc_init_one(&browser_list[4], NANO_GOTO_KEY, _("Goto"),
nano_gotodir_msg, 0, NANO_GOTO_FKEY, 0, VIEW, 0);
sc_init_one(&browser_list[3], NANO_EXIT_KEY, _("Exit"),
nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, 0);
sc_init_one(&gotodir_list[0], NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
sc_init_one(&gotodir_list[0], NANO_CANCEL_KEY, _("Cancel"),
sc_init_one(&gotodir_list[1], NANO_CANCEL_KEY, _("Cancel"),
nano_cancel_msg, 0, 0, 0, VIEW, 0);
#endif

View File

@@ -21,21 +21,9 @@ AC_DEFUN(NANO_AM_WITH_NLS,
USE_INCLUDED_LIBINTL=no
AC_ARG_WITH(locale-dir,
[ --with-locale-dir=DIR specify locale directory],
LOCALE_DIR=$withval)
test -z "$LOCALE_DIR" && LOCALE_DIR='$(datadir)/locale'
AC_SUBST(LOCALE_DIR)
AC_ARG_WITH(gnu-locale-dir,
[ --with-gnu-locale-dir=DIR specify GNU locale directory],
GNU_LOCALE_DIR=$withval)
test -z "$GNU_LOCALE_DIR" && GNU_LOCALE_DIR='$(prefix)/share/locale'
AC_SUBST(GNU_LOCALE_DIR)
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested.])
AC_DEFINE(ENABLE_NLS)
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
@@ -60,13 +48,18 @@ AC_DEFUN(NANO_AM_WITH_NLS,
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CHECK_LIB(intl, gettext)])
[AC_CHECK_LIB(intl, gettext,
gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)])
fi
if test "$gt_cv_func_gettext_libintl" = yes; then
LIBS="$LIBS -lintl"
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$ac_cv_lib_intl_gettext" = "yes"; then
AC_DEFINE(HAVE_GETTEXT, 1,
[Define to 1 if you have gettext and don't want to use GNU gettext.])
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
NANO_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then

2
move.c
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *

370
nano.c
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *
@@ -235,6 +235,7 @@ void global_init(int save_cutbuffer)
hblank = charalloc(COLS + 1);
memset(hblank, ' ', COLS);
hblank[COLS] = 0;
}
#ifndef DISABLE_HELP
@@ -259,7 +260,6 @@ void init_help_msg(void)
"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
@@ -393,10 +393,12 @@ void align(char **strp)
}
/* Null a string at a certain index and align it */
void null_at(char *data, int index)
void null_at(char **data, int index)
{
data[index] = 0;
align(&data);
/* Ahh! Damn dereferencing */
(*data)[index] = 0;
align(data);
}
void usage(void)
@@ -817,6 +819,79 @@ void do_next_word(void)
update_line(current, current_x);
}
}
/* the same thing for backwards */
void do_prev_word(void)
{
filestruct *fileptr, *old;
int i;
if (current == NULL)
return;
old = current;
i = current_x;
for (fileptr = current; fileptr != NULL; fileptr = fileptr->prev) {
if (fileptr == current) {
while (isalnum((int) fileptr->data[i])
&& i != 0)
i--;
if (i == 0) {
if (fileptr->prev != NULL)
i = strlen(fileptr->prev->data);
else if (fileptr == fileage && filebot != NULL) {
current_x = 0;
return;
}
continue;
}
}
while (!isalnum((int) fileptr->data[i]) && i != 0)
i--;
if (i > 0) {
i--;
while (isalnum((int) fileptr->data[i]) && i != 0)
i--;
if (!isalnum((int) fileptr->data[i]))
i++;
if (i != 0 || i != current_x)
break;
}
if (fileptr->prev != NULL)
i = strlen(fileptr->prev->data);
else if (fileptr == fileage && filebot != NULL) {
current_x = 0;
return;
}
}
if (fileptr == NULL)
current = fileage;
else
current = fileptr;
current_x = i;
placewewant = xplustabs();
if (current->lineno <= edittop->lineno)
edit_update(current, CENTER);
else {
/* If we've jumped lines, refresh the old line. We can't just use
* current->prev here, because we may have skipped over some blank
* lines, in which case the previous line is the wrong one.
*/
if (current != old)
update_line(old, 0);
update_line(current, current_x);
}
}
#endif /* NANO_SMALL */
@@ -921,10 +996,18 @@ void do_wrap(filestruct * inptr, char input_char)
down = 1;
}
/* Subtract length of original line, plus one for the newline, from
totsize. */
totsize -= (strlen(inptr->data) + 1);
temp->data = charalloc(strlen(&inptr->data[current_word_start]) + 1);
strcpy(temp->data, &inptr->data[current_word_start]);
inptr->data = nrealloc(inptr->data, last_word_end + 2);
inptr->data[last_word_end + 1] = 0;
/* Now add lengths of new lines, plus two for the newlines, to totsize. */
totsize += (strlen(inptr->data) + strlen(temp->data) + 2);
} else
/* Category 1b: one word on the line and word not taking up whole line
(i.e. there are spaces at the beginning of the line) */
@@ -936,9 +1019,6 @@ void do_wrap(filestruct * inptr, char input_char)
if (current_x >= current_word_start) {
right = current_x - current_word_start;
/* Decrease totsize by the number of spaces we removed, less
one for the new line we're replacing the spaces with. */
totsize -= (current_word_start - 1);
current_x = 0;
#ifndef NANO_SMALL
if (ISSET(AUTOINDENT)) {
@@ -953,7 +1033,14 @@ void do_wrap(filestruct * inptr, char input_char)
down = 1;
}
null_at(inptr->data, current_x);
/* Subtract length of original line, plus one for the newline, from
totsize. */
totsize -= (strlen(inptr->data) + 1);
null_at(&inptr->data, current_x);
/* Now add lengths of new lines, plus two for the newlines, to totsize. */
totsize += (strlen(inptr->data) + strlen(temp->data) + 2);
if (ISSET(MARK_ISSET) && (mark_beginbuf == inptr)) {
mark_beginbuf = temp;
@@ -972,22 +1059,25 @@ void do_wrap(filestruct * inptr, char input_char)
if (!isspace((int) input_char)) {
i = current_word_start - 1;
/* Decrement totsize each time we remove a space. */
while (isspace((int) inptr->data[i])) {
i--;
totsize--;
assert(i >= 0);
}
/* And increment it to account for the blank line we're
replacing the spaces with. */
totsize++;
} else if (current_x <= last_word_end)
i = last_word_end - 1;
else
i = current_x;
/* Subtract length of original line, plus one for the newline, from
totsize. */
totsize -= (strlen(inptr->data) + 1);
inptr->data = nrealloc(inptr->data, i + 2);
inptr->data[i + 1] = 0;
/* Now add lengths of new lines, plus two for the newlines, to totsize. */
totsize += (strlen(inptr->data) + strlen(temp->data) + 2);
}
@@ -1014,12 +1104,14 @@ void do_wrap(filestruct * inptr, char input_char)
i = current_word_start - 1;
current_x = current_word_start;
null_at(inptr->data, current_word_start);
/* Subtract length of original line, plus one for the newline, from
totsize. */
totsize -= (strlen(inptr->data) + 1);
/* Increment totsize to account for the new line that
will be added below, so that it won't end up being
short by one. */
totsize++;
null_at(&inptr->data, current_word_start);
/* Now add lengths of new lines, plus two for the newlines, to totsize. */
totsize += (strlen(inptr->data) + strlen(temp->data) + 2);
}
@@ -1035,17 +1127,20 @@ void do_wrap(filestruct * inptr, char input_char)
current_x = current_word_start;
i = current_word_start - 1;
/* Decrement totsize each time we remove a space. */
while (isspace((int) inptr->data[i])) {
i--;
totsize--;
assert(i >= 0);
inptr->data = nrealloc(inptr->data, i + 2);
inptr->data[i + 1] = 0;
}
/* And increment it to account for the blank line we're
replacing the spaces with. */
totsize++;
/* Subtract length of original line, plus one for the newline, from
totsize. */
totsize -= (strlen(inptr->data) + 1);
inptr->data = nrealloc(inptr->data, i + 2);
inptr->data[i + 1] = 0;
/* Now add lengths of new lines, plus two for the newlines, to totsize. */
totsize += (strlen(inptr->data) + strlen(temp->data) + 2);
}
}
@@ -1284,6 +1379,12 @@ int do_delete(void)
{
filestruct *foo;
/* blbf -> blank line before filebot (see below) */
int blbf = 0;
if (current->next == filebot && !strcmp(current->data, ""))
blbf = 1;
if (current_x != strlen(current->data)) {
/* Let's get dangerous */
memmove(&current->data[current_x], &current->data[current_x + 1],
@@ -1291,9 +1392,11 @@ int do_delete(void)
align(&current->data);
/* Now that we have a magic lnie again, we can check for both being
on the line before filebot as well as at filebot */
} else if (current->next != NULL && current->next != filebot) {
/* Now that we have a magic line again, we can check for both being
on the line before filebot as well as at filebot; it's a special
case if we're on the line before filebot and it's blank, since we
should be able to delete it */
} else if (current->next != NULL && (current->next != filebot || blbf)) {
current->data = nrealloc(current->data,
strlen(current->data) +
strlen(current->next->data) + 1);
@@ -1379,8 +1482,10 @@ int do_int_spell_fix(char *word)
search_last_line = FALSE;
j = i;
do_replace_loop(prevanswer, fileage, &beginx_top, TRUE, &j);
if (strcmp(prevanswer,answer) != 0) {
j = i;
do_replace_loop(prevanswer, fileage, &beginx_top, TRUE, &j);
}
}
/* restore the search/replace strings */
@@ -1528,10 +1633,11 @@ int do_int_speller(char *tempfile_name)
/* External spell checking */
int do_alt_speller(char *file_name)
{
int alt_spell_status, x_cur = current_x, y_cur = current_y, pww_cur = placewewant;
int alt_spell_status, lineno_cur = current->lineno;
int x_cur = current_x, y_cur = current_y, pww_cur = placewewant;
pid_t pid_spell;
char *ptr;
long lineno_cur = current->lineno;
static int arglen = 3;
static char **spellargs = (char **) NULL;
@@ -1934,10 +2040,11 @@ void signal_init(void)
tcgetattr(0, &term);
term.c_cc[VSUSP] = _POSIX_VDISABLE;
tcsetattr(0, TCSANOW, &term);
#else
#endif
/* The HURD seems to need this anyway! */
act.sa_handler = SIG_IGN;
sigaction(SIGTSTP, &act, NULL);
#endif
} else {
/* if we don't do this, it seems other stuff interrupts the
@@ -2262,20 +2369,101 @@ void help_init(void)
{
int i, sofar = 0;
long allocsize = 1; /* How much space we're gonna need for the help text */
char buf[BUFSIZ] = "";
char buf[BUFSIZ] = "", *ptr = NULL;
/* First set up the initial help text for the current function */
if (currshortcut == whereis_list || currshortcut == replace_list
|| currshortcut == replace_list_2)
ptr = _("Search Command Help Text\n\n "
"Enter the words or characters you would like to search "
"for, then hit enter. If there is a match for the text you "
"entered, the screen will be updated to the location of the "
"nearest match for the search string.\n\n "
"If using Pico Mode via the -p or --pico flags, using the "
"Meta-P toggle or using a nanorc file, the previous search "
"string will be shown in brackets after the Search: prompt. "
"Hitting enter without entering any text will preform the "
"previous search. Otherwise, the previous string will be "
"placed in front of the cursor, and can be edited or deleted "
"before hitting enter.\n\n The following functions keys are "
"available in Search mode:\n\n");
else if (currshortcut == goto_list)
ptr = _("Goto Line Help Text\n\n "
"Enter the line number that you wish to go to and hit "
"Enter. If there are fewer lines of text than the "
"number you entered, you will be brought to the last line "
"of the file.\n\n The following functions keys are "
"available in Goto Line mode:\n\n");
else if (currshortcut == insertfile_list)
ptr = _("Insert File Help Text\n\n "
"Type in the name of a file to be inserted into the current "
"file buffer at the current cursor location.\n\n "
"If you have compiled nano with multiple file buffer "
"support, and enable multiple buffers with the -F "
"or --multibuffer command line flags, the Meta-F toggle or "
"using a nanorc file, inserting a file will cause it to be "
"loaded into a separate buffer (use Ctrl-< and > to switch "
"between file buffers).\n\n The following function keys are "
"available in Insert File mode:\n\n");
else if (currshortcut == writefile_list)
ptr = _("Write File Help Text\n\n "
"Type the name that you wish to save the current file "
"as and hit enter to save the file.\n\n "
"If you are using the marker code with Ctrl-^ and have "
"selected text, you will be prompted to save only the "
"selected portion to a separate file. To reduce the "
"chance of overwriting the current file with just a portion "
"of it, the current filename is not the default in this "
"mode.\n\n The following function keys are available in "
"Write File mode:\n\n");
#ifndef DISABLE_BROWSER
else if (currshortcut == browser_list)
ptr = _("File Browser Help Text\n\n "
"The file browser is used to visually browse the "
"directory structure to select a file for reading "
"or writing. You may use the arrow keys or Page Up/"
"Down to browse through the files, and S or Enter to "
"choose the selected file or enter the selected "
"directory. To move up one level, select the directory "
"called \"..\" at the top of the file list.\n\n The "
"following functions keys are available in the file "
"browser:\n\n");
else if (currshortcut == gotodir_list)
ptr = _("Browser Goto Directory Help Text\n\n "
"Enter the name of the directory you would like to "
"browse to.\n\n If tab completion has not been disabled, "
"you can use the TAB key to (attempt to) automatically "
"complete the directory name. The following function "
"keys are available in Browser GotoDir mode:\n\n");
#endif
else if (currshortcut == spell_list)
ptr = _("Spell Check Help Text\n\n "
"The spell checker checks the spelling of all text "
"in the current file. When an unknown word is "
"encountered, it is highlighted and a replacement can "
"be edited. It will then prompt to replace every "
"instance of the given misspelled word in the "
"current file.\n\n The following other functions are "
"available in Spell Check mode:\n\n");
else /* Default to the main help list */
ptr = help_text_init;
/* Compute the space needed for the shortcut lists - we add 15 to
have room for the shortcut abbrev and its possible alternate keys */
for (i = 0; i <= MAIN_LIST_LEN - 1; i++)
if (main_list[i].help != NULL)
allocsize += strlen(main_list[i].help) + 15;
for (i = 0; i <= currslen - 1; i++)
if (currshortcut[i].help != NULL)
allocsize += strlen(currshortcut[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;
/* If we're on the main list, we also allocate space for toggle help text. */
if (currshortcut == main_list) {
for (i = 0; i <= TOGGLE_LEN - 1; i++)
if (toggles[i].desc != NULL)
allocsize += strlen(toggles[i].desc) + 30;
}
allocsize += strlen(ptr);
allocsize += strlen(help_text_init);
if (help_text != NULL)
free(help_text);
@@ -2284,33 +2472,37 @@ void help_init(void)
help_text = charalloc(allocsize);
/* Now add the text we want */
strcpy(help_text, help_text_init);
strcpy(help_text, ptr);
/* Now add our shortcut info */
for (i = 0; i <= MAIN_LIST_LEN - 1; i++) {
if (main_list[i].val > 0)
sofar = snprintf(buf, BUFSIZ, "^%c ", main_list[i].val + 64);
for (i = 0; i <= currslen - 1; i++) {
if (currshortcut[i].val > 0 && currshortcut[i].val < 'a')
sofar = snprintf(buf, BUFSIZ, "^%c ", currshortcut[i].val + 64);
else
sofar = snprintf(buf, BUFSIZ, " ");
if (main_list[i].misc1 > KEY_F0 && main_list[i].misc1 <= KEY_F(64))
if (currshortcut[i].misc1 > KEY_F0 && currshortcut[i].misc1 <= KEY_F(64))
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(F%d) ",
main_list[i].misc1 - KEY_F0);
currshortcut[i].misc1 - KEY_F0);
else
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, " ");
if (main_list[i].altval > 0 && main_list[i].altval < 91)
if (currshortcut[i].altval > 0 && currshortcut[i].altval < 91)
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(M-%c) ",
main_list[i].altval - 32);
else if (main_list[i].altval > 0)
currshortcut[i].altval - 32);
else if (currshortcut[i].altval > 0)
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(M-%c) ",
main_list[i].altval);
currshortcut[i].altval);
/* Hack */
else if (currshortcut[i].val >= 'a')
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(M-%c) ",
currshortcut[i].val - 32);
else
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, " ");
if (main_list[i].help != NULL)
snprintf(&buf[sofar], BUFSIZ - sofar, "%s", main_list[i].help);
if (currshortcut[i].help != NULL)
snprintf(&buf[sofar], BUFSIZ - sofar, "%s", currshortcut[i].help);
strcat(help_text, buf);
@@ -2318,20 +2510,21 @@ void help_init(void)
}
/* And the toggles... */
for (i = 0; i <= TOGGLE_LEN - 1; i++) {
if (toggles[i].override_ch != 0)
sofar = snprintf(buf, BUFSIZ,
if (currshortcut == main_list)
for (i = 0; i <= TOGGLE_LEN - 1; i++) {
if (toggles[i].override_ch != 0)
sofar = snprintf(buf, BUFSIZ,
"M-%c ", toggles[i].override_ch);
else
sofar = snprintf(buf, BUFSIZ,
else
sofar = snprintf(buf, BUFSIZ,
"M-%c ", toggles[i].val - 32);
if (toggles[i].desc != NULL) {
if (toggles[i].flag != 0)
snprintf(&buf[sofar], BUFSIZ - sofar, _("%s enable/disable"),
if (toggles[i].desc != NULL) {
if (toggles[i].flag != 0)
snprintf(&buf[sofar], BUFSIZ - sofar, _("%s enable/disable"),
toggles[i].desc);
else
snprintf(&buf[sofar], BUFSIZ - sofar, "%s",
else
snprintf(&buf[sofar], BUFSIZ - sofar, "%s",
toggles[i].desc);
}
@@ -2448,7 +2641,6 @@ int main(int argc, char *argv[])
int keyhandled; /* Have we handled the keystroke yet? */
int i, modify_control_seq;
char *argv0;
long constcheck; /* Check to constantly update */
#ifdef _POSIX_VDISABLE
struct termios term;
@@ -2708,13 +2900,14 @@ int main(int argc, char *argv[])
fprintf(stderr, _("Main: set up windows\n"));
#endif
#ifdef ENABLE_COLOR
do_colorinit();
#endif /* ENABLE_COLOR */
window_init();
mouse_init();
#ifdef ENABLE_COLOR
do_colorinit();
#endif /* ENABLE_COLOR */
#ifdef DEBUG
fprintf(stderr, _("Main: bottom win\n"));
#endif
@@ -2751,7 +2944,6 @@ int main(int argc, char *argv[])
reset_cursor();
while (1) {
constcheck = current->lineno + current_x + totsize;
#ifndef DISABLE_MOUSE
currshortcut = main_list;
@@ -2794,6 +2986,13 @@ int main(int argc, char *argv[])
modify_control_seq = 1;
keyhandled = 1;
break;
#ifndef NANO_SMALL
case ' ':
/* If control-space is next word, Alt-space should be previous word */
do_prev_word();
keyhandled = 1;
break;
#endif
case '[':
switch (kbinput = wgetch(edit)) {
case '1': /* Alt-[-1-[0-5,7-9] = F1-F8 in X at least */
@@ -2858,10 +3057,18 @@ int main(int argc, char *argv[])
kbinput = KEY_PPAGE;
wgetch(edit);
break;
case 'V': /* Alt-[-V = Page Up in Hurd Console */
case 'I': /* Alt-[-I = Page Up - FreeBSD Console */
kbinput = KEY_PPAGE;
break;
case '6': /* Alt-[-6 = Page Down */
kbinput = KEY_NPAGE;
wgetch(edit);
break;
case 'U': /* Alt-[-U = Page Down in Hurd Console */
case 'G': /* Alt-[-G = Page Down - FreeBSD Console */
kbinput = KEY_NPAGE;
break;
case '7':
kbinput = KEY_HOME;
wgetch(edit);
@@ -2870,6 +3077,18 @@ int main(int argc, char *argv[])
kbinput = KEY_END;
wgetch(edit);
break;
case '9': /* Alt-[-9 = Delete in Hurd Console */
kbinput = KEY_DC;
break;
case '@': /* Alt-[-9 = Insert in Hurd Console */
case 'L': /* Insert Key - FreeBSD Console */
#ifdef ENABLE_MULTIBUFFER
do_insertfile(ISSET(MULTIBUFFER));
#else
do_insertfile(0);
#endif
keyhandled = 1;
break;
case '[': /* Alt-[-[-[A-E], F1-F5 in linux console */
kbinput = wgetch(edit);
if (kbinput >= 'A' && kbinput <= 'E')
@@ -2889,6 +3108,7 @@ int main(int argc, char *argv[])
kbinput = KEY_HOME;
break;
case 'F':
case 'Y': /* End Key in Hurd Console */
kbinput = KEY_END;
break;
default:
@@ -3000,14 +3220,15 @@ int main(int argc, char *argv[])
#endif
#endif
#ifndef NANO_SMALL
case 0: /* Erg */
#ifndef NANO_SMALL
do_next_word();
break;
#endif
case -1: /* Stuff that we don't want to do squat */
case 410: /* Must ignore this, it gets sent when we resize */
case 29: /* Ctrl-] */
#ifdef PDCURSES
case 541: /* ???? */
case 542: /* Control and alt in Windows *shrug* */
@@ -3033,8 +3254,7 @@ int main(int argc, char *argv[])
if (ISSET(DISABLE_CURPOS))
UNSET(DISABLE_CURPOS);
else if (ISSET(CONSTUPDATE))
if (constcheck != current->lineno + current_x + totsize)
do_cursorpos();
do_cursorpos(1);
reset_cursor();
wrefresh(edit);

57
nano.h
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *
@@ -82,10 +82,10 @@ typedef struct filestruct {
char *file_path; /* Current file's full path location */
int file_placewewant; /* Current file's place we want */
int file_totlines; /* Current file's total number of lines */
int file_totsize; /* Current file's total size */
long file_totsize; /* Current file's total size */
#endif
long lineno; /* The line number */
int lineno; /* The line number */
} filestruct;
typedef struct shortcut {
@@ -117,6 +117,27 @@ typedef struct rcoption {
#endif /* ENABLE_NANORC */
#ifdef ENABLE_COLOR
#define COLORSTRNUM 16
typedef struct colorstr {
char *val;
struct colorstr *next;
} colorstr;
typedef struct colortype {
int fg;
int bg;
int bright;
int pairnum;
colorstr *str;
struct colortype *next;
} colortype;
#endif /* ENABLE_COLOR */
/* Bitwise flags so we can save space (or more correctly, not waste it) */
#define MODIFIED (1<<0)
@@ -287,9 +308,15 @@ know what you're doing */
#ifndef HAVE_REGEX_H
#define NO_REGEX 1
#define SMALL_TOO 0
#else
#define NO_REGEX 0
#endif
#ifdef NANO_SMALL
#define SMALL_TOO 1
#else
#define SMALL_TOO 0
#endif /* NANO_SMALL */
#endif /* HAVE_REGEX_H */
#ifdef DISABLE_BROWSER
#define NO_BROWSER 1
@@ -313,21 +340,19 @@ know what you're doing */
#define MULTI_TOGGLES 0
#endif
#define WHEREIS_LIST_LEN (8 - NO_REGEX - NO_TOGGLES)
#define REPLACE_LIST_LEN (8 - NO_REGEX - NO_TOGGLES)
#define WHEREIS_LIST_LEN (9 - NO_REGEX - NO_TOGGLES)
#define REPLACE_LIST_LEN (9 - NO_REGEX - NO_TOGGLES)
#define TOGGLE_LEN (14 - NO_REGEX + MULTI_TOGGLES)
#define WRITEFILE_LIST_LEN (3 - NO_BROWSER)
#define INSERTFILE_LIST_LEN (2 - NO_BROWSER)
#define BROWSER_LIST_LEN 4
#define MAIN_LIST_LEN (27 - NO_REGEX)
#define WRITEFILE_LIST_LEN (4 - NO_BROWSER)
#define INSERTFILE_LIST_LEN (3 - NO_BROWSER)
#define BROWSER_LIST_LEN 5
#define MAIN_LIST_LEN (27 - NO_REGEX - SMALL_TOO)
#define MAIN_VISIBLE 12
#define REPLACE_LIST_2_LEN 3
#define GOTO_LIST_LEN 3
#define GOTODIR_LIST_LEN 1
#define REPLACE_LIST_2_LEN 4
#define GOTO_LIST_LEN 4
#define GOTODIR_LIST_LEN 2
#define HELP_LIST_LEN 3
#define SPELL_LIST_LEN 1
#define SPELL_LIST_LEN 2
#define VIEW 1

View File

@@ -8,7 +8,7 @@
@c Run `makeinfo' rather than `texinfo-format-buffer'.
@smallbook
@set EDITION 0.1
@set VERSION 1.1.2
@set VERSION 1.1.4
@set UPDATED 3 Oct 2001
@dircategory Editors
@@ -23,7 +23,7 @@
@titlepage
@title GNU @code{nano}
@subtitle a small and friendly text editor.
@subtitle version 1.1.2
@subtitle version 1.1.4
@author Chris Allegretta
@page

View File

@@ -55,3 +55,26 @@
# this to work
#
# set multibuffer
#
# Color setup
# Format: color foreground,background regex [regex...]
#
# Legal colors are: white, black, red, blue, green, yellow, purple, cyan
# You may use the prefix "bright" to mean a stronger color highlight
#
# 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.
#
#color brightred float\ char\ int\ void\ NULL [A-Z_]\{2,\} static
#color brightred [\ ]struct ^struct if\ while[\ \n\(] do[\ \n\(] else[\ \n] case\ switch\ break;
#color brightcyan #define #include #ifn*def #endif #elif #else
# 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 <.*> ".*"
#color brightblue /\*.**/
# multi-line comment hack
#color brightblue /\*.* [^\/][^\*]*\*\/ ^.*\*+*\**$ ^\ *\*\{1,\}\/$ \/\/.*

679
po/ca.po

File diff suppressed because it is too large Load Diff

649
po/cs.po

File diff suppressed because it is too large Load Diff

909
po/da.po

File diff suppressed because it is too large Load Diff

1105
po/de.po

File diff suppressed because it is too large Load Diff

896
po/es.po

File diff suppressed because it is too large Load Diff

673
po/fi.po

File diff suppressed because it is too large Load Diff

1511
po/fr.po

File diff suppressed because it is too large Load Diff

673
po/gl.po

File diff suppressed because it is too large Load Diff

649
po/hu.po

File diff suppressed because it is too large Load Diff

649
po/id.po

File diff suppressed because it is too large Load Diff

673
po/it.po

File diff suppressed because it is too large Load Diff

649
po/nl.po

File diff suppressed because it is too large Load Diff

649
po/no.po

File diff suppressed because it is too large Load Diff

919
po/ru.po

File diff suppressed because it is too large Load Diff

888
po/sv.po

File diff suppressed because it is too large Load Diff

845
po/uk.po

File diff suppressed because it is too large Load Diff

25
proto.h
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *
@@ -33,7 +33,8 @@ extern int editwinrows;
extern int current_x, current_y, posible_max, totlines;
extern int placewewant;
extern int mark_beginx, samelinewrap;
extern int totsize, temp_opt;
extern long totsize;
extern int temp_opt;
extern int fill, wrap_at, flags,tabsize;
extern int search_last_line;
extern int currslen;
@@ -58,6 +59,10 @@ extern filestruct *cutbuffer, *mark_beginbuf;
extern filestruct *open_files;
#endif
#ifdef ENABLE_COLOR
colortype *colorstrings;
#endif
extern shortcut *shortcut_list;
extern shortcut main_list[MAIN_LIST_LEN], whereis_list[WHEREIS_LIST_LEN];
extern shortcut replace_list[REPLACE_LIST_LEN], goto_list[GOTO_LIST_LEN];
@@ -108,13 +113,13 @@ int check_operating_dir(char *currpath, int allow_tabcomp);
#endif
int do_writeout(char *path, int exiting, int append);
int do_gotoline(long line, int save_pos);
int do_gotoline(int line, int save_pos);
int do_replace_loop(char *prevanswer, filestruct *begin, int *beginx,
int wholewords, int *i);
int do_find_bracket(void);
#if defined (ENABLE_MULTIBUFFER) || !defined (DISABLE_SPELLER)
void do_gotopos(long line, int pos_x, int pos_y, int pos_placewewant);
void do_gotopos(int line, int pos_x, int pos_y, int pos_placewewant);
#endif
/* Now in move.c */
@@ -124,7 +129,7 @@ int do_left(void);
int do_right(void);
int check_wildcard_match(const char *text, const char *pattern);
char *input_tab(char *buf, int place, int *lastWasTab, int *newplace);
char *input_tab(char *buf, int place, int *lastWasTab, int *newplace, int *list);
char *real_dir_from_tilde(char *buf);
void shortcut_init(int unjustify);
@@ -164,7 +169,7 @@ void die_save_file(char *die_filename);
void new_file(void);
void new_magicline(void);
void splice_node(filestruct *begin, filestruct *newnode, filestruct *end);
void null_at(char *data, int index);
void null_at(char **data, int index);
void page_up(void);
void blank_edit(void);
void search_init_globals(void);
@@ -196,7 +201,7 @@ int load_open_file(void), close_open_file(void);
#endif
int do_page_up(void), do_page_down(void);
int do_cursorpos(void), do_spell(void);
int do_cursorpos(int constant), do_cursorpos_void(void), do_spell(void);
int do_up(void), do_down (void), do_right(void), do_left (void);
int do_home(void), do_end(void), total_refresh(void), do_mark(void);
int do_delete(void), do_backspace(void), do_tab(void), do_justify(void);
@@ -240,3 +245,9 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin,
#ifdef ENABLE_MULTIBUFFER
filestruct *open_file_dup_search(int update);
#endif
#ifndef DISABLE_HELP
void help_init(void);
#endif

159
rcfile.c
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *
@@ -39,7 +39,12 @@
#define _(string) (string)
#endif
#define NUM_RCOPTS 18
#ifndef DISABLE_WRAPJUSTIFY
#define NUM_RCOPTS 18
#else
#define NUM_RCOPTS 17
#endif
/* Static stuff for the nanorc file */
rcoption rcopts[NUM_RCOPTS] =
{
@@ -102,18 +107,157 @@ void rcfile_msg(int *errors, char *msg, ...)
/* Parse the next word from the string. Returns NULL if we hit EOL */
char *parse_next_word(char *ptr)
{
while (*ptr != ' ' && *ptr != '\n' && ptr != '\0')
while (*ptr != ' ' && *ptr != '\t' && *ptr != '\n' && ptr != '\0')
ptr++;
if (*ptr == '\0')
if (*ptr == '\0' || *ptr == '\n')
return NULL;
/* Null terminate and advance ptr */
*ptr++ = 0;
while ((*ptr == ' ' || *ptr == '\t') && *ptr != '\0')
ptr++;
return ptr;
}
int colortoint(char *colorname, int *bright, char *filename, int *lineno)
{
int mcolor = 0;
if (colorname == NULL)
return -1;
if (strcasestr(colorname, "bright")) {
*bright = 1;
colorname += 6;
}
if (!strcasecmp(colorname, "green"))
mcolor += COLOR_GREEN;
else if (!strcasecmp(colorname, "red"))
mcolor += COLOR_RED;
else if (!strcasecmp(colorname, "blue"))
mcolor += COLOR_BLUE;
else if (!strcasecmp(colorname, "white"))
mcolor += COLOR_WHITE;
else if (!strcasecmp(colorname, "yellow"))
mcolor += COLOR_YELLOW;
else if (!strcasecmp(colorname, "cyan"))
mcolor += COLOR_CYAN;
else if (!strcasecmp(colorname, "magenta"))
mcolor += COLOR_MAGENTA;
else if (!strcasecmp(colorname, "black"))
mcolor += COLOR_BLACK;
else {
printf("Error in %s on line %d: color %s not understood.\n",
filename, *lineno, colorname);
printf("Valid colors are \"green\", \"red\", \"blue\", "
"\"white\", \"yellow\", \"cyan\", \"magenta\" and "
"\"black\", with the optional prefix \"bright\".\n");
exit(1);
}
return mcolor;
}
#ifdef ENABLE_COLOR
/* Parse the color stuff into the colorstrings array */
void parse_colors(FILE *rcstream, char *filename, int *lineno, char *buf, char *ptr)
{
int i = 0, fg, bg, bright = 0;
char prev = '\\';
char *tmp = NULL, *beginning, *fgstr, *bgstr;
colortype *tmpcolor = NULL;
fgstr = ptr;
ptr = parse_next_word(ptr);
if (ptr == NULL) {
printf("Error in %s on line %d: Missing color name.\n",
filename, *lineno);
exit(1);
}
if (strstr(fgstr, ",")) {
strtok(fgstr, ",");
bgstr = strtok(NULL, ",");
} else
bgstr = NULL;
fg = colortoint(fgstr, &bright, filename, lineno);
bg = colortoint(bgstr, &bright, filename, lineno);
/* Now the fun part, start adding regexps to individual strings
in the colorstrings array, woo! */
i = 0;
beginning = ptr;
while (*ptr != '\0') {
switch (*ptr) {
case '\n':
*ptr = ' ';
/* i++; */
case ' ':
if (prev != '\\') {
/* This is the end of the regex, uh I guess.
Add it to the colorstrings array for this color */
tmp = NULL;
tmp = charalloc(i + 1);
strncpy(tmp, beginning, i);
tmp[i] = '\0';
ptr = parse_next_word(ptr);
if (ptr == NULL)
return;
if (colorstrings == NULL) {
colorstrings = nmalloc(sizeof(colortype));
colorstrings->fg = fg;
colorstrings->bg = bg;
colorstrings->bright = bright;
colorstrings->str = NULL;
colorstrings->str = nmalloc(sizeof(colorstr));
colorstrings->str->val = tmp;
colorstrings->str->next = NULL;
colorstrings->next = NULL;
} else {
for (tmpcolor = colorstrings; tmpcolor->next != NULL;
tmpcolor = tmpcolor->next)
;
#ifdef DEBUG
fprintf(stderr, "Adding new entry for fg %d bg %d\n", fg, bg);
#endif
tmpcolor->next = nmalloc(sizeof(colortype));
tmpcolor->next->fg = fg;
tmpcolor->next->bg = bg;
tmpcolor->next->bright = bright;
tmpcolor->next->str = nmalloc(sizeof(colorstr));
tmpcolor->next->str->val = tmp;
tmpcolor->next->str->next = NULL;
tmpcolor->next->next = NULL;
}
i = 0;
beginning = ptr;
break;
}
/* Else drop through to the default case */
default:
i++;
prev = *ptr;
ptr++;
break;
}
}
}
#endif /* ENABLE_COLOR */
/* Parse the RC file, once it has been opened successfully */
void parse_rcfile(FILE *rcstream, char *filename)
{
@@ -150,6 +294,10 @@ void parse_rcfile(FILE *rcstream, char *filename)
set = 1;
else if (!strcasecmp(keyword, "unset"))
set = -1;
#ifdef ENABLE_COLOR
else if (!strcasecmp(keyword, "color"))
parse_colors(rcstream, filename, &lineno, buf, ptr);
#endif /* ENABLE_COLOR */
else {
rcfile_msg(&errors, _("Error in %s on line %d: command %s not understood"),
filename, lineno, keyword);
@@ -243,6 +391,7 @@ void do_rcfile(void)
struct stat fileinfo;
FILE *rcstream;
if (getenv("HOME") == NULL)
return;

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2000 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 1, or (at your option) *
* 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, *
@@ -289,7 +289,7 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
/* We found an instance */
current_x_find = found - fileptr->data;
#if 0
#if 1
/* Ensure we haven't wrapped around again! */
if ((search_last_line) && (current_x_find >= beginx)) {
if (!quiet)
@@ -308,7 +308,7 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
search_last_line = 1;
/* Make sure we haven't passed the begining of the string */
#if 0 /* Is this required here ? */
#if 1 /* Is this required here ? */
if (!(&fileptr->data[current_x_find] - fileptr->data))
current_x_find++;
#endif
@@ -352,7 +352,7 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
/* We found an instance */
current_x_find = found - fileptr->data;
#if 0
#if 1
/* Ensure we haven't wrapped around again! */
if ((search_last_line) && (current_x_find < beginx)) {
if (!quiet)
@@ -651,8 +651,10 @@ int do_replace_loop(char *prevanswer, filestruct *begin, int *beginx,
}
/* Cleanup */
totsize -= strlen(current->data);
free(current->data);
current->data = copy;
totsize += strlen(current->data);
/* Stop bug where we replace a substring of the replacement text */
current_x += strlen(last_replace) - 1;
@@ -768,13 +770,13 @@ void goto_abort(void)
display_main_list();
}
int do_gotoline(long line, int save_pos)
int do_gotoline(int line, int save_pos)
{
long i = 1;
int i = 1;
if (line <= 0) { /* Ask for it */
long j = 0;
int j = 0;
j = statusq(0, goto_list, GOTO_LIST_LEN, "", _("Enter line number"));
if (j != 0) {
@@ -815,13 +817,21 @@ int do_gotoline_void(void)
}
#if (defined ENABLE_MULTIBUFFER || !defined DISABLE_SPELLER)
void do_gotopos(long line, int pos_x, int pos_y, int pos_placewewant)
void do_gotopos(int line, int pos_x, int pos_y, int pos_placewewant)
{
/* since do_gotoline() resets the x-coordinate but not the
y-coordinate, set the coordinates up this way */
current_y = pos_y;
do_gotoline(line, 1);
/* recalculate the x-coordinate and place we want, just in case their
values are insane; if they aren't, they won't be changed by this */
current_x = pos_x;
pos_placewewant = xplustabs();
pos_x = actual_x(current, pos_placewewant);
/* set the rest of the coordinates up */
current_x = pos_x;
placewewant = pos_placewewant;
update_line(current, pos_x);

View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *

248
winio.c
View File

@@ -5,7 +5,7 @@
* Copyright (C) 1999 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 1, or (at your option) *
* 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, *
@@ -229,6 +229,8 @@ void nanoget_repaint(char *buf, char *inputbuf, int x)
#ifdef ENABLE_COLOR
color_on(bottomwin, COLOR_STATUSBAR);
#else
wattron(bottomwin, A_REVERSE);
#endif
blank_statusbar();
@@ -251,12 +253,14 @@ void nanoget_repaint(char *buf, char *inputbuf, int x)
#ifdef ENABLE_COLOR
color_off(bottomwin, COLOR_STATUSBAR);
#else
wattroff(bottomwin, A_REVERSE);
#endif
}
/* Get the input from the kb; this should only be called from statusq */
int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
int start_x)
int start_x, int list)
{
int kbinput = 0, j = 0, x = 0, xend;
int x_left = 0, inputlen, tabbed = 0;
@@ -271,7 +275,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
x_left = strlen(buf);
x = strlen(def) + x_left;
#ifndef DISABLE_MOUSE
#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
currshortcut = s;
currslen = slen;
#endif
@@ -293,6 +297,15 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
if (kbinput == s[j].val && kbinput < 32) {
#ifndef DISABLE_HELP
/* Have to do this here, it would be too late to do it in statusq */
if (kbinput == NANO_HELP_KEY
|| kbinput == NANO_HELP_FKEY) {
do_help();
break;
}
#endif
/* We shouldn't discard the answer it gave, just because
we hit a keystroke, GEEZ! */
answer = mallocstrcpy(answer, inputbuf);
@@ -376,7 +389,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
if (allowtabs) {
shift = 0;
inputbuf = input_tab(inputbuf, (x - x_left),
&tabbed, &shift);
&tabbed, &shift, &list);
x += shift;
if (x - x_left > strlen(inputbuf))
x = strlen(inputbuf) + x_left;
@@ -728,9 +741,6 @@ void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
sel_data_len = end - begin;
post_data_len = this_page_end - end;
/* Paint this line! */
mvwaddnstr(edit, y, 0, &fileptr->data[this_page_start], pre_data_len);
#ifdef ENABLE_COLOR
color_on(edit, COLOR_MARKER);
#else
@@ -746,8 +756,6 @@ void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
wattroff(edit, A_REVERSE);
#endif /* ENABLE_COLOR */
mvwaddnstr(edit, y, end - this_page_start,
&fileptr->data[end], post_data_len);
}
#endif
@@ -759,11 +767,69 @@ void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
int virt_mark_beginx, int this_page)
{
#ifdef ENABLE_COLOR
colortype *tmpcolor = NULL;
colorstr *tmpstr = NULL;
int k, paintlen;
#endif
/* Just paint the string in any case (we'll add color or reverse on
just the text that needs it */
mvwaddnstr(edit, yval, 0, &fileptr->data[start],
get_page_end_virtual(this_page) - start + 1);
#ifdef ENABLE_COLOR
if (colorstrings != NULL)
for (tmpcolor = colorstrings; tmpcolor != NULL; tmpcolor = tmpcolor->next) {
for (tmpstr = tmpcolor->str; tmpstr != NULL; tmpstr = tmpstr->next) {
k = start;
regcomp(&search_regexp, tmpstr->val, 0);
while (!regexec(&search_regexp, &fileptr->data[k], 1,
regmatches, 0)) {
#ifdef DEBUG
fprintf(stderr, "Match! (%d chars) \"%s\"\n",
regmatches[0].rm_eo - regmatches[0].rm_so,
&fileptr->data[k + regmatches[0].rm_so]);
#endif
if (regmatches[0].rm_so < COLS - 1) {
if (tmpcolor->bright)
wattron(edit, A_BOLD);
wattron(edit, COLOR_PAIR(tmpcolor->pairnum));
if (regmatches[0].rm_eo - regmatches[0].rm_so
+ k <= COLS)
paintlen = regmatches[0].rm_eo - regmatches[0].rm_so;
else
paintlen = COLS - (regmatches[0].rm_eo
- regmatches[0].rm_so);
mvwaddnstr(edit, yval, regmatches[0].rm_so + k,
&fileptr->data[k + regmatches[0].rm_so],
paintlen);
}
if (tmpcolor->bright)
wattroff(edit, A_BOLD);
wattroff(edit, COLOR_PAIR(tmpcolor->pairnum));
k += regmatches[0].rm_eo;
}
}
}
#endif /* ENABLE_COLOR */
#ifndef NANO_SMALL
/* There are quite a few cases that could take place; we'll deal
* with them each in turn */
if (ISSET(MARK_ISSET)
&& !((fileptr->lineno > mark_beginbuf->lineno
if (ISSET(MARK_ISSET) &&
!((fileptr->lineno > mark_beginbuf->lineno
&& fileptr->lineno > current->lineno)
|| (fileptr->lineno < mark_beginbuf->lineno
&& fileptr->lineno < current->lineno))) {
@@ -818,23 +884,11 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
#else
wattron(edit, A_REVERSE);
#endif /* ENABLE_COLOR */
}
target =
(virt_mark_beginx <
COLS - 1) ? virt_mark_beginx : COLS - 1;
target =
(virt_mark_beginx < COLS - 1) ? virt_mark_beginx : COLS - 1;
mvwaddnstr(edit, yval, 0, fileptr->data, target);
if (mark_beginbuf->lineno < current->lineno) {
#ifdef ENABLE_COLOR
color_on(edit, COLOR_MARKER);
#else
wattron(edit, A_REVERSE);
#endif /* ENABLE_COLOR */
} else {
mvwaddnstr(edit, yval, 0, fileptr->data, target);
#ifdef ENABLE_COLOR
color_off(edit, COLOR_MARKER);
@@ -842,16 +896,23 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
wattroff(edit, A_REVERSE);
#endif /* ENABLE_COLOR */
}
target = (COLS - 1) - virt_mark_beginx;
if (target < 0)
target = 0;
mvwaddnstr(edit, yval, virt_mark_beginx,
&fileptr->data[virt_mark_beginx], target);
if (mark_beginbuf->lineno < current->lineno) {
#ifdef ENABLE_COLOR
color_on(edit, COLOR_MARKER);
#else
wattron(edit, A_REVERSE);
#endif /* ENABLE_COLOR */
target = (COLS - 1) - virt_mark_beginx;
if (target < 0)
target = 0;
mvwaddnstr(edit, yval, virt_mark_beginx,
&fileptr->data[virt_mark_beginx], target);
#ifdef ENABLE_COLOR
color_off(edit, COLOR_MARKER);
@@ -875,14 +936,19 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
wattron(edit, A_REVERSE);
#endif /* ENABLE_COLOR */
}
if (virt_cur_x > COLS - 2) {
mvwaddnstr(edit, yval, 0,
if (virt_cur_x > COLS - 2) {
mvwaddnstr(edit, yval, 0,
&fileptr->data[this_page_start],
virt_cur_x - this_page_start);
} else {
mvwaddnstr(edit, yval, 0, fileptr->data, virt_cur_x);
} else
mvwaddnstr(edit, yval, 0, fileptr->data, virt_cur_x);
#ifdef ENABLE_COLOR
color_off(edit, COLOR_MARKER);
#else
wattroff(edit, A_REVERSE);
#endif /* ENABLE_COLOR */
}
if (mark_beginbuf->lineno > current->lineno) {
@@ -893,26 +959,14 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
wattron(edit, A_REVERSE);
#endif /* ENABLE_COLOR */
} else {
#ifdef ENABLE_COLOR
color_off(edit, COLOR_MARKER);
#else
wattroff(edit, A_REVERSE);
#endif /* ENABLE_COLOR */
}
if (virt_cur_x > COLS - 2)
mvwaddnstr(edit, yval, virt_cur_x - this_page_start,
if (virt_cur_x > COLS - 2)
mvwaddnstr(edit, yval, virt_cur_x - this_page_start,
&fileptr->data[virt_cur_x],
this_page_end - virt_cur_x);
else
mvwaddnstr(edit, yval, virt_cur_x,
else
mvwaddnstr(edit, yval, virt_cur_x,
&fileptr->data[virt_cur_x], COLS - virt_cur_x);
if (mark_beginbuf->lineno > current->lineno) {
#ifdef ENABLE_COLOR
color_off(edit, COLOR_MARKER);
#else
@@ -921,12 +975,9 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
}
}
} else
}
#endif
/* Just paint the string (no mark on this line) */
mvwaddnstr(edit, yval, 0, &fileptr->data[start],
get_page_end_virtual(this_page) - start + 1);
}
/*
@@ -976,7 +1027,7 @@ 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) {
} else if (realdata[i] < 32) {
/* Treat control characters as ^letter */
fileptr->data[pos++] = '^';
fileptr->data[pos++] = realdata[i] + 64;
@@ -1058,6 +1109,10 @@ void edit_refresh(void)
editbot = hold;
else
editbot = temp;
/* What the hell are we expecting to update the screen if this isn't
here? luck?? */
wrefresh(edit);
}
/*
@@ -1137,6 +1192,10 @@ int statusq(int tabs, shortcut s[], int slen, char *def, char *msg, ...)
char foo[133];
int ret;
#ifndef DISABLE_TABCOMP
int list;
#endif
bottombars(s, slen);
va_start(ap, msg);
@@ -1151,7 +1210,13 @@ int statusq(int tabs, shortcut s[], int slen, char *def, char *msg, ...)
#endif
ret = nanogetstr(tabs, foo, def, s, slen, (strlen(foo) + 3));
#ifndef DISABLE_TABCOMP
ret = nanogetstr(tabs, foo, def, s, slen, (strlen(foo) + 3), list);
#else
/* if we've disabled tab completion, the value of list won't be
used at all, so it's safe to use 0 (NULL) as a placeholder */
ret = nanogetstr(tabs, foo, def, s, slen, (strlen(foo) + 3), 0);
#endif
#ifdef ENABLE_COLOR
color_off(bottomwin, COLOR_STATUSBAR);
@@ -1169,6 +1234,13 @@ int statusq(int tabs, shortcut s[], int slen, char *def, char *msg, ...)
do_last_line();
break;
case NANO_CANCEL_KEY:
#ifndef DISABLE_TABCOMP
/* if we've done tab completion, there might be a list of
filename matches on the edit window at this point; make sure
they're cleared off */
if (list)
edit_refresh();
#endif
return -1;
default:
blank_statusbar();
@@ -1404,11 +1476,12 @@ void previous_line(void)
current_y--;
}
int do_cursorpos(void)
int do_cursorpos(int constant)
{
filestruct *fileptr;
float linepct = 0.0, bytepct = 0.0;
int i = 0;
long i = 0;
static long old_i = -1, old_totsize = -1;
if (current == NULL || fileage == NULL)
return 0;
@@ -1422,6 +1495,12 @@ int do_cursorpos(void)
i += current_x;
if (old_i == -1)
old_i = i;
if (old_totsize == -1)
old_totsize = totsize;
if (totlines > 0)
linepct = 100 * current->lineno / totlines;
@@ -1433,29 +1512,50 @@ int do_cursorpos(void)
linepct, bytepct);
#endif
statusbar(_("line %d of %d (%.0f%%), character %d of %d (%.0f%%)"),
current->lineno, totlines, linepct, i, totsize, bytepct);
/* if constant is zero, display the position on the statusbar
unconditionally; otherwise, only display the position when the
character values have changed */
if (!constant || (old_i != i || old_totsize != totsize)) {
statusbar(_("line %d of %d (%.0f%%), character %ld of %ld (%.0f%%)"),
current->lineno, totlines, linepct, i, totsize, bytepct);
}
old_i = i;
old_totsize = totsize;
reset_cursor();
return 1;
}
int do_cursorpos_void(void)
{
return do_cursorpos(0);
}
/* Our broken, non-shortcut list compliant help function.
But, hey, it's better than nothing, and it's dynamic! */
int do_help(void)
{
#ifndef DISABLE_HELP
char *ptr = help_text, *end;
char *ptr, *end;
int i, j, row = 0, page = 1, kbinput = 0, no_more = 0, kp, kp2;
int no_help_flag = 0;
shortcut *oldshortcut;
int oldslen;
blank_edit();
curs_set(0);
wattroff(bottomwin, A_REVERSE);
blank_statusbar();
#ifndef DISABLE_MOUSE
help_init();
ptr = help_text;
oldshortcut = currshortcut;
oldslen = currslen;
currshortcut = help_list;
currslen = HELP_LIST_LEN;
#endif
kp = keypad_on(edit, 1);
kp2 = keypad_on(bottomwin, 1);
@@ -1550,13 +1650,17 @@ int do_help(void)
} while ((kbinput = wgetch(edit)) != NANO_EXIT_KEY &&
kbinput != NANO_EXIT_FKEY);
currshortcut = oldshortcut;
currslen = oldslen;
if (no_help_flag) {
blank_bottombars();
wrefresh(bottomwin);
SET(NO_HELP);
window_init();
}
display_main_list();
else
bottombars(currshortcut, currslen);
curs_set(1);
edit_refresh();
@@ -1585,7 +1689,7 @@ void dump_buffer(filestruct * inptr)
fileptr = inptr;
while (fileptr != NULL) {
fprintf(stderr, "(%ld) %s\n", fileptr->lineno, fileptr->data);
fprintf(stderr, "(%d) %s\n", fileptr->lineno, fileptr->data);
fflush(stderr);
fileptr = fileptr->next;
}
@@ -1599,7 +1703,7 @@ void dump_buffer_reverse(filestruct * inptr)
fileptr = filebot;
while (fileptr != NULL) {
fprintf(stderr, "(%ld) %s\n", fileptr->lineno, fileptr->data);
fprintf(stderr, "(%d) %s\n", fileptr->lineno, fileptr->data);
fflush(stderr);
fileptr = fileptr->prev;
}