Compare commits
206 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03260b40fa | ||
|
|
58a3353307 | ||
|
|
4c6438be6f | ||
|
|
780f3205f1 | ||
|
|
8a9863736b | ||
|
|
cdbabfd4fc | ||
|
|
7d589ca5fa | ||
|
|
ca1a82ecab | ||
|
|
f57b886bed | ||
|
|
22262441c7 | ||
|
|
b97bedafe8 | ||
|
|
31b2b81e53 | ||
|
|
5e4b1085b4 | ||
|
|
b516d8e3f3 | ||
|
|
66c33b8731 | ||
|
|
dc2ca88718 | ||
|
|
a2d849bcd4 | ||
|
|
14b0accd81 | ||
|
|
b26cb39296 | ||
|
|
e10f389e9c | ||
|
|
ad3f478452 | ||
|
|
59121a9aaf | ||
|
|
92f5fdc230 | ||
|
|
386e0518b5 | ||
|
|
1c27d3e875 | ||
|
|
7fdbd05b41 | ||
|
|
d948edc4f3 | ||
|
|
222a0863fa | ||
|
|
1e36fd8f69 | ||
|
|
f727da88b0 | ||
|
|
73889487f0 | ||
|
|
200b27e33e | ||
|
|
10398ade49 | ||
|
|
1b3381bee8 | ||
|
|
2bef18210a | ||
|
|
352801cf4c | ||
|
|
c1917e7b66 | ||
|
|
acf4b16b72 | ||
|
|
475f96d0b3 | ||
|
|
a951f21c59 | ||
|
|
26a86e350c | ||
|
|
9519eb0c88 | ||
|
|
759d3523fc | ||
|
|
56214c6aef | ||
|
|
5050d35e87 | ||
|
|
ecc1933c14 | ||
|
|
c1968a0795 | ||
|
|
99e30e1bee | ||
|
|
ce78c1eb88 | ||
|
|
beb5497530 | ||
|
|
96bd4e4ed8 | ||
|
|
8d990b5e8b | ||
|
|
6f6aba0350 | ||
|
|
3e3ae94084 | ||
|
|
0319176f2d | ||
|
|
960a8635bc | ||
|
|
995177f2d9 | ||
|
|
8fa1e28681 | ||
|
|
7004c289f8 | ||
|
|
6414b40d3d | ||
|
|
91841895e0 | ||
|
|
5d25f06e3b | ||
|
|
128e95ffdc | ||
|
|
e09cd1d4d1 | ||
|
|
e1f1452eb5 | ||
|
|
b6c89eed9f | ||
|
|
0357c4d552 | ||
|
|
68532c37ef | ||
|
|
ff98983602 | ||
|
|
6c49b3f32c | ||
|
|
4d69d4313f | ||
|
|
90bbdd3c40 | ||
|
|
d1625cdfe6 | ||
|
|
c6c35eafc8 | ||
|
|
b1aaa27c10 | ||
|
|
2cde0a24d4 | ||
|
|
7dd1869713 | ||
|
|
96eef7332b | ||
|
|
9b3c7e8be7 | ||
|
|
c2acb81782 | ||
|
|
c1049aced1 | ||
|
|
372b1a0939 | ||
|
|
47a2686e41 | ||
|
|
0e8c8d8cdc | ||
|
|
41ed01632f | ||
|
|
4839d23b11 | ||
|
|
279aaa9bdb | ||
|
|
ef8f98d0c8 | ||
|
|
e642197ff7 | ||
|
|
5cce53b5a8 | ||
|
|
5f36c3760f | ||
|
|
f372bd9f8c | ||
|
|
307d4c8f6b | ||
|
|
47f77b4715 | ||
|
|
9a74860957 | ||
|
|
355fbe5770 | ||
|
|
a212acf100 | ||
|
|
9cf9e06003 | ||
|
|
802c6ef076 | ||
|
|
819e3db74d | ||
|
|
2d7893d086 | ||
|
|
240998b25f | ||
|
|
df7d8b2e57 | ||
|
|
b26ecb597e | ||
|
|
052f9d238e | ||
|
|
049149f1da | ||
|
|
a2c02e9c8d | ||
|
|
df20e83412 | ||
|
|
33db9bf473 | ||
|
|
1a8b296adf | ||
|
|
ac899e5f80 | ||
|
|
d173c15ce5 | ||
|
|
521e00d761 | ||
|
|
7fde37f006 | ||
|
|
34319a1ff7 | ||
|
|
efd2236319 | ||
|
|
500b5e3539 | ||
|
|
40f45c8689 | ||
|
|
68b3dfb431 | ||
|
|
658399aeb9 | ||
|
|
e4933a393a | ||
|
|
a75bc41faf | ||
|
|
1cde322359 | ||
|
|
cf785632ed | ||
|
|
3ba29535a3 | ||
|
|
0241d19e4c | ||
|
|
ecc3d7f39e | ||
|
|
d21195f882 | ||
|
|
34654ab41a | ||
|
|
de3d800e67 | ||
|
|
c4e1a131d3 | ||
|
|
cc197ef0ea | ||
|
|
43fee64400 | ||
|
|
b4d6ad0ef6 | ||
|
|
d46156258b | ||
|
|
6fe61499e8 | ||
|
|
9a46f3cf56 | ||
|
|
1e43a12b49 | ||
|
|
dd0491380a | ||
|
|
53ea9d162b | ||
|
|
3b41212d61 | ||
|
|
8d848afb89 | ||
|
|
88b091510b | ||
|
|
9fe015cca3 | ||
|
|
63ba2d63ff | ||
|
|
92b3bd2de6 | ||
|
|
611e98be29 | ||
|
|
5c27385a16 | ||
|
|
99afb85752 | ||
|
|
64bacd20b5 | ||
|
|
3bf6bf45b7 | ||
|
|
4cb991dda1 | ||
|
|
b10283c4e8 | ||
|
|
f3fde7c2fc | ||
|
|
5f07180e8a | ||
|
|
051fc6e05a | ||
|
|
88520c93be | ||
|
|
a9434800df | ||
|
|
4e18b8f9ce | ||
|
|
725490495c | ||
|
|
09898d99d4 | ||
|
|
0bafa91096 | ||
|
|
b0bce4b429 | ||
|
|
8ce2413feb | ||
|
|
465f1e305d | ||
|
|
3f8db49622 | ||
|
|
4be36bf1d4 | ||
|
|
9634571dd6 | ||
|
|
6cb4e885f2 | ||
|
|
6efda54a6c | ||
|
|
316e4d9a67 | ||
|
|
18d70f1478 | ||
|
|
5050aa6ae7 | ||
|
|
4dfaf93bcd | ||
|
|
7a50009b1f | ||
|
|
03bf98015d | ||
|
|
bf521fabaa | ||
|
|
2fe0ddeab4 | ||
|
|
1f0ab55e6d | ||
|
|
528310223b | ||
|
|
cbee08f335 | ||
|
|
cc0da8ab53 | ||
|
|
819d46ac71 | ||
|
|
b881d3ea57 | ||
|
|
8d8e01224b | ||
|
|
12f294c651 | ||
|
|
ea066c8413 | ||
|
|
84de552b28 | ||
|
|
235ab192af | ||
|
|
6b58acd377 | ||
|
|
ac840eb42b | ||
|
|
6e2853705a | ||
|
|
9afd119dd5 | ||
|
|
38068cd152 | ||
|
|
60c65424c3 | ||
|
|
90d307413b | ||
|
|
b2c4cbebab | ||
|
|
cef7fbb41a | ||
|
|
a0238ed022 | ||
|
|
1c9d7f9f5d | ||
|
|
1bacd2f8c7 | ||
|
|
0876dc9860 | ||
|
|
49805175e3 | ||
|
|
4bf831ff39 | ||
|
|
3948bae1e1 | ||
|
|
2071207e84 |
84
BUGS
84
BUGS
@@ -6,20 +6,20 @@
|
||||
- edit_refresh() and update_line() do not handle selecting text when the
|
||||
cursor is beyond COLS (10) [FIXED]
|
||||
- no way to do a replace with the empty string (11) [FIXED, yay!]
|
||||
- Spelling support is not elegant like pico's integration of the 'spell'
|
||||
- Spelling support is not elegant like Pico's integration of the 'spell'
|
||||
program. Nano only uses ispell (for now) (12) [FIXED]
|
||||
- Moving to the end of a line when close to a multiple of COLS and at
|
||||
least COLS * 2 does not make the screen jump early like it would for
|
||||
if we were around COLS (bugs in edit_refresh, update_line) (13)
|
||||
[FIXED, mostly]
|
||||
- When at the very bottom of the edit window, do_wrap goes berzerk and
|
||||
puts the curor somewhere bad, subsequent keystrokes crash the program
|
||||
- When at the very bottom of the edit window, do_wrap goes berserk and
|
||||
puts the cursor somewhere bad; subsequent keystrokes crash the program
|
||||
(14) [FIXED, mostly]
|
||||
- Doing a replacement of a substring of the replace string (e.g. replacing
|
||||
"ed" with "fred" causes an infinite loop. (15) [FIXED]
|
||||
"ed" with "fred" causes an infinite loop). (15) [FIXED]
|
||||
- Cutting a file with marked text and both marker ends on the same line
|
||||
causes a random segfault (16) [FIXED]
|
||||
- Cutting more than one line resets the KEEP_CUTBUFFER flag in 0.9.3
|
||||
- Cutting more than one line resets the KEEP_CUTBUFFER flag in 0.9.3.
|
||||
Error is in bitwise assignment (nano.h). (17) [FIXED]
|
||||
- The wrapping code does not work right for lines like the following:
|
||||
* *
|
||||
@@ -27,9 +27,10 @@
|
||||
- Nano fails to follow symlinks, even though -l isn't being used (20).
|
||||
[Bug in global flag init, FIXED]
|
||||
- When using --help or --version, the SIGINT character gets lost. (21) [FIXED]
|
||||
- edit_refresh() and update_line() (and related functions), have
|
||||
trouble when a tab is the character that is the boundry at COLS (23) [FIXED]
|
||||
- there is an off-by-one error in keeping track of totsize. It is caused
|
||||
- edit_refresh() and update_line() (and related functions) have
|
||||
trouble when a tab is the character that is the boundary at COLS (23)
|
||||
[FIXED]
|
||||
- There is an off-by-one error in keeping track of totsize. It is caused
|
||||
by the fact that we count the newline at the end when we read in a file
|
||||
but we do not, in fact, display this newline. This should go away
|
||||
implicitly when the "Magic Line" returns, but it is noted here for
|
||||
@@ -41,50 +42,52 @@
|
||||
a dialog about not being able to write the file, and it will not let the
|
||||
user exit (29, discovered by Joshua Jensen) [FIXED]
|
||||
- Using nano -k, marked text is not cut properly. (31) [FIXED]
|
||||
- Invoking -t or -k has the effect of invoking both option. (32) [FIXED]
|
||||
- Invoking -t or -k has the effect of invoking both options. (32) [FIXED]
|
||||
- totsize becomes incorrect after word-wrapping (25) [FIXED]
|
||||
- Wrapping a line with autoindent mode sometimes causes a segfault (19)[FIXED]
|
||||
- Wrapping a line with autoindent mode sometimes causes a segfault (19)
|
||||
[FIXED]
|
||||
- When inserting files, the display sometimes fails to display properly
|
||||
until a pageup/down occurs (22)[FIXED]
|
||||
- In search/replace code there is too much refreshing in bottomwin (26)
|
||||
[FIXED]
|
||||
until a pageup/down occurs (22) [FIXED]
|
||||
- In search/replace code, there is too much refreshing in bottomwin (26)
|
||||
[FIXED]
|
||||
- In replace, there is no way to accept the default replace string. (27)
|
||||
[FIXED]
|
||||
[FIXED]
|
||||
- Using nano -t, user can not exit until a filename is given via ^O. (30)
|
||||
[FIXED]
|
||||
[FIXED]
|
||||
- totsize problems still abound in do_justify (33) [FIXED]
|
||||
- Using -k cut text is not pasted properly. (34) [FIXED].
|
||||
- Using -k pasted text is not updated properly if it goes beyond editbot. (35)
|
||||
[FIXED]
|
||||
- Doing a cut with -k can screw up the filestruct, fault is in cutting
|
||||
- Using -k, cut text is not pasted properly. (34) [FIXED].
|
||||
- Using -k, pasted text is not updated properly if it goes beyond editbot. (35)
|
||||
[FIXED]
|
||||
- Doing a cut with -k can screw up the filestruct; fault is in cutting
|
||||
code. (36) [FIXED]
|
||||
- Hitting enter on the magic line makes new lines, but they are not
|
||||
written out to disk when saved..... (37). [FIXED]
|
||||
- Page up and page down do not work the same way as Pico (# of lines). (38)
|
||||
[FIXED]
|
||||
- Page up and page down do not work the same way as in Pico (# of lines). (38)
|
||||
[FIXED]
|
||||
- When doing a search and the marker is set, the screen does not always
|
||||
properly update the inverted text (39). [FIXED]
|
||||
- Searches for a string that only exist on one line multiple times will
|
||||
fail after finding the last occurance (discovered by Ken Tyler) (40). [FIXED]
|
||||
- Alt-Z is current broken to toggle suspend. I guess I still don't know
|
||||
- Searches for a string that only exists on one line multiple times will
|
||||
fail after finding the last occurrence (discovered by Ken Tyler) (40).
|
||||
[FIXED]
|
||||
- Alt-Z is currently broken to toggle suspend. I guess I still don't know
|
||||
signals very well =-) (41) [FIXED].
|
||||
- Unable to cut the entire file using the marker (discovered by Kev Tyler)
|
||||
(42). [FIXED]
|
||||
- The keypad does not work when nano runs in the Gnome terminal (43). [FIXED]
|
||||
- When reading in a file, if the file is a directory the contents of the
|
||||
- When reading in a file, if the file is a directory, the contents of the
|
||||
file being edited are blown away (discovered by Chris Pimlot) (44). [FIXED]
|
||||
- in certain terms, nano will leave a "ghost" of screen upon exit
|
||||
when called from inside mutt (among other settings) (45). [FIXED]
|
||||
- In replace, hitting the Goto line shortcut key does nothing after a
|
||||
search string is entered (discovered by Rocco Corsi) (46) [FIXED].
|
||||
- When typing in a string in serahc or replace and hitting CASE_SENSITVE
|
||||
- When typing in a string in search or replace and hitting CASE_SENSITIVE
|
||||
or the other search string, the current string edit is blown away in
|
||||
favor of the last stored search (47) [FIXED]
|
||||
- If nano fails to open a file when it starts up,doing almost anything
|
||||
- If nano fails to open a file when it starts up, doing almost anything
|
||||
causes a segfault (discovered by Ben Roberts) (48). [FIXED]
|
||||
- In certain terminals, nano would not work properly with keypad().
|
||||
Turned out to be the silly timeout(0) call which is completely
|
||||
unneeded anyway. (49) [FIXED]
|
||||
Turned out to be the silly timeout(0) call, which is completely
|
||||
unneeded, anyway. (49) [FIXED]
|
||||
- With less than a page of text, doing a page down will move the
|
||||
current line to the top of the screen, which it shouldn't do. (50)
|
||||
[FIXED]
|
||||
@@ -97,12 +100,33 @@
|
||||
- Cut to end cutting (-k) causes segfaults (try cutting "- Backup making
|
||||
(filename~)?" line in TODO file) (discovered by
|
||||
higuita@cadernoverde.com) (54) [FIXED].
|
||||
- When using autoindent (-i), wrapped text does not get auto-indented
|
||||
- When using autoindent (-i), wrapped text does not get autoindented
|
||||
(55, discovered by Mark Senior) [FIXED].
|
||||
- When using -R (regex) and -p (pico mode), subsequent searches after
|
||||
the first fail if no string is entered (56) [FIXED].
|
||||
- Page down on a file of editwinrows fails (again). Reported by Ryan
|
||||
Krebs (57) [FIXED].
|
||||
- File browser aborts on Solaris in qsort() call. (Reported by
|
||||
Matthias Andree) (58) [FIXED].
|
||||
- Can modify the current file in view mode with ^W^R (discovered by Rocco
|
||||
Corsi) (58) [FIXED].
|
||||
- When page up is used after two page down's, the screen doesn't update
|
||||
properly (discovered by David Lawrence Ramsey) (59) [FIXED].
|
||||
- On BSD systems, marked cutting sna paste often screws up the
|
||||
last line in the cutbuffer (discovered by Barry Pederson) (60) [FIXED]
|
||||
- Blank lines are not kept when cutting with -k (discovered by Rocco)
|
||||
(61) [FIXED].
|
||||
- Nano will not suspend properly inside of mutt (62) [FIXED].
|
||||
- When switching from Pico mode to normal mode, the previous search is
|
||||
not displayed until cancelling the search (63) [FIXED].
|
||||
- If you change search options but don't change the search string in
|
||||
normal mode, hitting enter causes the search/replace to abort (64)
|
||||
(Jordi Mallach) [FIXED].
|
||||
- Cutting one line of text causes the screen to recenter the line
|
||||
(reported and fixed by David Lawrence Ramsey) (65) [FIXED].
|
||||
- When cutting marked text including the bottom of the file, a new
|
||||
"magic line" is not created" (reported by David Lawrence
|
||||
Ramsey, fixed by David Lawrence Ramsey & Chris) (66) [FIXED].
|
||||
|
||||
** Open BUGS **
|
||||
|
||||
|
||||
558
ChangeLog
558
ChangeLog
@@ -1,3 +1,369 @@
|
||||
nano-1.1.2 - 10/03/2001
|
||||
- General
|
||||
- Added BUGS #63 & 64. Fixes in search_init() and nanogetstr(),
|
||||
new flag CLEAR_BACKUPSTRING because there's no easy way to
|
||||
clear the backupstring without making it global (messy), so we
|
||||
use a flag instead (just as messy?)
|
||||
- --enable-tiny now leaves out the Auto Indent code, do you really
|
||||
need that on a bootdisk? =-)
|
||||
- New flag -o, --operatingdir, similar to Pico's -o mode. New
|
||||
function check_operating_dir(), changes to load_file (arg),
|
||||
open_file_dup_search (arg), new function do_gotopos for -F
|
||||
(David Lawrence Ramsey).
|
||||
- Code to read/write dos formatted files. Massive amounts of
|
||||
new code in read_line and write_file. New cmdline flag
|
||||
(-D --dos) to automatically write the file in DOS format,
|
||||
regardless of the original format.
|
||||
- Mac file writing supported too. Flag -M, --mac. Toggle
|
||||
Meta-O (MacOS? OS-X? =-)
|
||||
- New smooth scroll code by Ken Tyler. New flag -S, --smooth,
|
||||
changes to page_up() and page_down(). Many fixes to paging by
|
||||
David Lawrence Ramsey.
|
||||
- Bracket (brace, parens, etc) matching code by Ken Tyler.
|
||||
New functions do_find_bracket(), changes to findnextstr(),
|
||||
command is Meta-] (hope you dont mind since I already sold off
|
||||
Meta-O to the MacOS file code Ken...) Fixes to bracket_msg
|
||||
by DLR.
|
||||
- Call do_gotopos from do_alt_spell() to keep position
|
||||
consistent when invoking alt speller (DLR).
|
||||
- Readded DISABLE_CURPOS because in certain instances (like
|
||||
all the "Search Wrapped" lines) the cursor position will
|
||||
be different yet we don't want the cursor position displayed.
|
||||
- Take control-space out of -tiny build, unneeded.
|
||||
- cut.c:
|
||||
cut_marked_segment()
|
||||
- Add magic line when cutting a selection including filebot
|
||||
(discovered by DLR, fixed by DLR & Chris, fixes BUG #66).
|
||||
do_cut_text()
|
||||
- Don't recenter the line when cutting one line (DLR) (Bug #65).
|
||||
- faq.html:
|
||||
- Notes about the Free Translation Project.
|
||||
- Debian additions.
|
||||
- files.c:
|
||||
do_writeout()
|
||||
- Expanded strings to not use %s and ?: to determine
|
||||
write/append string to be nice to translators.
|
||||
new_file()
|
||||
- Initialize totsize (DLR).
|
||||
- nano.c:
|
||||
main()
|
||||
- Added var constcheck as a CRC-like check of whether cursor
|
||||
pos has changed and if so update the pos with -c.
|
||||
- Many tweaks and changes from numerics to char equivs
|
||||
(David Lawrence Ramsey).
|
||||
- Fix the KEY_IC being undefined when using slang.
|
||||
do_mouse()
|
||||
- Send 27 when the menu item clicked is an alt key seq... The
|
||||
lines aren't lined up since the menu width changed though,
|
||||
this breakage depends on whether the new widths will be kept
|
||||
or not (FEEDBACK!!)
|
||||
- Change k based on currslen to allow the new widths in
|
||||
bottombars().
|
||||
do_wrap()
|
||||
- Fixes for Pico incompatibility in cases 2b and 2c.
|
||||
(David Lawrence Ramsey).
|
||||
global_init()
|
||||
- New arg save_cutbuffer, allows cutbuffer to not be lost when
|
||||
using multibuffer.
|
||||
- nano.1:
|
||||
- Added new features, fixed some typos (Jordi).
|
||||
- nano.texi:
|
||||
- Corrected the Mouse Toggle section, noticed by Daniel Bonniot.
|
||||
- Added many command line options, toggles and other additions
|
||||
(Jordi).
|
||||
- rcfile.c:
|
||||
- NUM_RCOPTS fix (DLR).
|
||||
- Add tabsize support to rc file (Nathan Heagy).
|
||||
- Fix incorrect argument in fill and tabsize error message
|
||||
(Nathan Heagy)
|
||||
- search.c:
|
||||
- Changed search prompt to "Search" followed by a list of
|
||||
bracketed, free-standing modifiers that do not imply a grammar,
|
||||
and the (to replace) string separately. Hopefully this resolves
|
||||
the i18n problems that this provoked.
|
||||
findnextstr()
|
||||
- Various fixes that need testing (Ken Tyler).
|
||||
- winio.c:
|
||||
- Add David Lawrence Ramsey to credits.
|
||||
bottombars()
|
||||
- Spread out the menu items, feedback definitely needed on this.
|
||||
nanogetstr()
|
||||
- More key fixes (David Lawrence Ramsey)
|
||||
- Don't be clever and wasteful, just repaint every iteration.
|
||||
- po/nl.po:
|
||||
- New Dutch translation, by Guus Sliepen <guus@nl.linux.org>.
|
||||
- po/ca.po, po/es.po:
|
||||
- Updated Catalan and Spanish translation (Jordi).
|
||||
- po/gl.po:
|
||||
- Updated Galician translation (Jacobo Tarrío).
|
||||
- po/da.po:
|
||||
- New Danish translation, by Keld Simonsen <keld@dkuug.dk>.
|
||||
- po/sv.po:
|
||||
- Updated Swedish translation (Christian Rose).
|
||||
- po/it.po:
|
||||
- Updated Italian translation (Marco Colombo).
|
||||
- po/fi.po:
|
||||
- Updated Finnish translation (Pauli Virtanen).
|
||||
|
||||
nano-1.1.1 - 07/28/2001
|
||||
- General
|
||||
- Reverted included gettext from 0.10.38 to 0.10.35 in intl/ dir.
|
||||
- Added m4/ directory to allow rebuilding using only the internal
|
||||
version of gettext.m4 (Albert Chin).
|
||||
- nano.c:
|
||||
main()
|
||||
- Change the multibuffer getopt option to 'F' (David Lawrence
|
||||
Ramsey)
|
||||
do_mark()
|
||||
- Temporarily disable cursorpos when enabled to be able to see
|
||||
the mark (un)set message (Ken Tyler).
|
||||
- nanorc.sample
|
||||
- Typo fixes and updates (David Lawrence Ramsey)
|
||||
- files.c:
|
||||
new_file()
|
||||
- Do add_open_files if there aren't any open yet (David Lawrence
|
||||
Ramsey).
|
||||
close_open_file()
|
||||
- Try to open the next file first, then the previous one
|
||||
(David Lawrence Ramsey).
|
||||
- global.c:
|
||||
shortcut_init()
|
||||
- Rewrote the whereis and replace lists to put CANCEL at the end
|
||||
of the list, and not include the toggle functions when using
|
||||
NANO_SMALL.
|
||||
- nano.h:
|
||||
- Fix type in INSERTFILE_LIST_LEN.
|
||||
- Rewrote all the macro definitions to be a little less messy,
|
||||
for the #ifdefs anyway.
|
||||
- rcfile.c:
|
||||
- Update for the multibuffer option (oops) (David Lawrence Ramsey).
|
||||
- search.c:
|
||||
- Added #ifdef NANO_SMALLs around the REVERSE_SEARCH code.
|
||||
search_init()
|
||||
- add #ifdef NANO_SMALL around toggles code.
|
||||
- winio.c:
|
||||
bottombars()
|
||||
- Fixed an off by one that wasn't letting lines with odd #
|
||||
shortcuts work in certain cases.
|
||||
|
||||
nano-1.1.0 - 07/15/2001
|
||||
- General
|
||||
- New global variables currshortcut and currslen to support using
|
||||
the mouse with the shortcuts. Also supports clicking on files
|
||||
in browser. Added #ifdef DISABLE_MOUSE around this code also.
|
||||
- Changed mouse disabling code from depending on --enable-tiny
|
||||
to its own flag, --disable-mouse. The --tiny option defines
|
||||
this automatically, but now just mouse support can be disabled
|
||||
if desired.
|
||||
- File Browser supports the "Goto Directory"
|
||||
- Added rcfile.c source file. Only includes much of anything when
|
||||
--enable-nanorc is used. Tons of new funcs, most notably
|
||||
do_rcfile() called from nano.c:main(). Added much needed
|
||||
function ncalloc(), will have to go through source code later
|
||||
and change the aproproate calls which used nmalloc for lack of
|
||||
an apropriate calloc function *** FIXME ***
|
||||
- After "Alternate" spell checker is called, cursor is repositioned on
|
||||
the same line as before ^T was pressed.
|
||||
- Moved config.h up in all .c files #include list (Albert Chin).
|
||||
- Added config.guess and config.sub to distribution because,
|
||||
apparently, newer autoconf/automakes can't live without them.
|
||||
- Various spelling updates by David Lawrence Ramsey.
|
||||
- Changed all string allocations to charalloc(), new function
|
||||
designed to take nmalloc argument but call calloc based on
|
||||
(char *) size.
|
||||
- New macro DISABLE_WRAPJUSTIFY to easily check for both wrapping
|
||||
and justify being disabled. This allows us to compile out the
|
||||
-r flag if neither are set, and will also allow us to comment
|
||||
out -W when it is written.
|
||||
- Allow fill to take a negative value ot signify a "from right side"
|
||||
value. This allows the value to vary with the screen size yet
|
||||
still be correct. New static value wrap_at to minimize code
|
||||
inpact. Updated man page and info file.
|
||||
- Allow file appending. New shortcut list nano_insertfile_list (since
|
||||
insert and write routines can't share shortcut lists anymore),
|
||||
new args to do_writeout and write_file called append, and of source
|
||||
code changes to those functions.
|
||||
- Allow backwards searching. Drastic rewrite of the search prompt
|
||||
string by Chris. All other code by Ken Tyler. New globals
|
||||
nano_reverse_msg, new functions revstrstr and revstrcasestr,
|
||||
many changes to search functions. Not too big a code size
|
||||
increase!
|
||||
- Moved extension functions (Case Sensitive, Regexp, and Backwards
|
||||
Search, Append key in write file function) to Meta keys, as
|
||||
people are complaining loudly about nano not being control-key
|
||||
compatible with Pico, which is a Bag Thing (TM). Changes to
|
||||
shortcut_init, toggle_init, new toggles for backwards and regexp
|
||||
(and you can now toggle all search options including regexp at
|
||||
the Search: prompt!) Changes to nanogetstr to enable Meta
|
||||
keys to be grabbed, changes to onekey to print M-style shortcuts.
|
||||
- New macro TOGGLE which just toggles, no more silly checking
|
||||
ISSET and then using SET or UNSET when we want a simple toggle
|
||||
for a flag.
|
||||
- Added multiple buffer capability (God help us). New configure
|
||||
option --enable-multibuffer (-F), changes to do_insertfile(),
|
||||
do_insertfile_void(), toggle_init(), do_gotoline(), edit_update(),
|
||||
and write_file(), new functions add_open_file(),
|
||||
open_file_change_name(), load_open_file(), open_file_dup_search(),
|
||||
open_file_dup_fix(), open_prevfile(), open_nextfile(),
|
||||
close_open_file(), get_full_path(), die_save_file(), etc.
|
||||
(David Lawrence Ramsey).
|
||||
- Using --enable-extra automatically defines --enable-multibuffer
|
||||
changes to version() and configure.in.
|
||||
- Moved to gettext 0.10.38 at the last second, sure to break
|
||||
something, but at least I can run make distcheck!
|
||||
- Makefile.am:
|
||||
- Include ABOUT-NLS and the new THANKS files to the distributed list.
|
||||
- THANKS:
|
||||
- Initial, incomplete list of people to thank.
|
||||
- Added some more people.
|
||||
- configure.in:
|
||||
- New option, --enable-nanorc, which allows people to have a .nanorc
|
||||
initialization file and set options normally used on the command
|
||||
line, and color later on.
|
||||
- Added --enable-color option to allow color and syntax highlighting
|
||||
(stub as of now).
|
||||
- cut.c:
|
||||
add_to_cutbuffer()
|
||||
- Remove useless statements (Rocco).
|
||||
cut_marked_segment()
|
||||
- Add bizarre copy of bot node, else *BSD goes ballistic (fixes
|
||||
BUG #60).
|
||||
- Added 'destructive' argument. Allows the selected text to be
|
||||
added to the cutbuffer without changing the contents of the
|
||||
file. This allows writing selection to separate files.
|
||||
do_cut_text()
|
||||
- If the line is empty when using -k and wasn't already added,
|
||||
create a dummy line and add it to the cutbuffer (fixes bug #61)
|
||||
- Reset marked_cut if we blow away the cutbuffer.
|
||||
- Moved the case of current == mark_beginbuf into cut_marked
|
||||
segment, so do_writeout could call it when writing selection to
|
||||
file.
|
||||
do_uncut_text()
|
||||
- Reset cutbuffer even if we're uncutting marked or cut to end text!
|
||||
- faq.html:
|
||||
- Brought the FAQ up to date, many little changes (Jordi).
|
||||
- Added sections 3.7 and 3.8 for the multibuffer and nanorc support.
|
||||
- files.c:
|
||||
do_browser()
|
||||
- Minor fixes to the processing of SELECT function (Rocco)
|
||||
- Added the "Goto Directory" code (Rocco)
|
||||
- Don't shift the size of the file is it's less than 1K. Fixed
|
||||
files less than 1K being displayed as 0B (Rocco).
|
||||
- More Picoish keystrokes for the browser, ^P, ^N, etc, for up,
|
||||
down, etc, and add the consistent ^C to exit (Jim Knoble).
|
||||
do_writeout()
|
||||
- New code to allow writing selected text to a separate file.
|
||||
When this is done, the current state is prserved.
|
||||
write_file()
|
||||
- New arg, nonamechange, means whether or not to update the
|
||||
current filename after writing the file out.
|
||||
- Increment lineswritten when the very last line isn't null.
|
||||
Fixes off by one count when writing selection to file.
|
||||
- global.c:
|
||||
- Updated some of the lists for the "Goto Directory" code (Rocco)
|
||||
- move.c:
|
||||
page_up()
|
||||
- Rewritten with a loop to make screen updates work when
|
||||
mark is set (fixes bug #59).
|
||||
do_home(), do_end()
|
||||
- Don't keep cutbuffer.
|
||||
- nano.1:
|
||||
- Added the missing -r flag (Jordi).
|
||||
- nano.c:
|
||||
do_alt_speller()
|
||||
- Reposition cursor on same line as before ^T was called (Rocco)
|
||||
ABCD(), main()
|
||||
- Add Alt-whatever-[a-d] support as well as Alt-whatever-[A-D].
|
||||
main()
|
||||
- Code to silently process "-g" and "-j" (Rocco)
|
||||
- Added Alt-[-7,8 support for home/end keys (Jeff Teunissen).
|
||||
signal_init()
|
||||
- Reorder sigaction calls, use sigfillset() to stop SIGTSTP and
|
||||
SIGCONT from being interrupted, allows suspending nano
|
||||
to work more reliably, esp. with mutt, etc.
|
||||
do_suspend()
|
||||
- Don't try to play with the handler inside the handler. Just
|
||||
raise a SIGSTOP. We also now write the "use "fg"" message to
|
||||
stdout instead of stderr.
|
||||
- Added _POSIX_VDISABLE macro to fully ignore suspend keystroke.
|
||||
Eliminates the possibility that nano can be suspended when
|
||||
it's not supposed to be. Many many many thanks to Jordi and
|
||||
Tom Lear for helping out finding and fixing this bug!
|
||||
do_cont()
|
||||
- Now just does a refresh call instead of playing with the SIGTSTP
|
||||
handler.
|
||||
- nano.h:
|
||||
- Updated the BROWSER_LIST_LEN for the "Goto Directory" code (Rocco)
|
||||
- proto.h:
|
||||
- New shortcut list added: gotodir_list (Rocco).
|
||||
- search.c:
|
||||
do_gotoline()
|
||||
- Optimizations, remove "$" goes-to-last-line, less messages (Rocco)
|
||||
do_replace()
|
||||
- If we manage to make it in somehow with VIEW_MODE on, abort
|
||||
nicely (fixes BUG #59).
|
||||
- utils.c
|
||||
strcasestr()
|
||||
- Replaced by mutt's mutt_stristr function, because the thought
|
||||
of dynamically allocating memory and copying each line in a file
|
||||
to do a search or replace was causing me to lose sleep.
|
||||
- winio.c:
|
||||
actual_x()
|
||||
- Remove inline from function decl (Albert Chin).
|
||||
- po/POTFILES.in:
|
||||
- Added utils.c to the list.
|
||||
- po/es.po, po/ca.po:
|
||||
- Updated (Jordi).
|
||||
- po/gl.po:
|
||||
- Galician translation by Jacobo Tarrío.
|
||||
- po/uk.po, po/ru.po:
|
||||
- New Ukrainian and Russian translations by Sergey A. Ribalchenko
|
||||
<fisher@obu.ck.ua>, thanks!
|
||||
- po/id.po:
|
||||
- Updated Indonesian translation by Tedi Heriyanto.
|
||||
- po/it.po
|
||||
- Updated Italian translation by Marco Colombo.
|
||||
- po/no.po:
|
||||
- New Norwegian translation by Eivind Kjørstad <ekj@vestdata.no>.
|
||||
- po/sv.po:
|
||||
- New Swedish translation by Christian Rose <menthos@menthos.com>.
|
||||
|
||||
nano 1.1 tree forked here 04/07/2001
|
||||
|
||||
nano 1.0.1 - 04/06/2001
|
||||
- General:
|
||||
- added configure option --disable-wrapping. Does what it says,
|
||||
no wrapping or checks are done. Separate from --enable-tiny,
|
||||
some may want a bare-bones Pico clone that does wrap text.
|
||||
Affects configure, nano.c:do_char() and check_wrap() obviously,
|
||||
version(), and do_char().
|
||||
- aclocal.m4:
|
||||
- Minor patch for intl check (really this time) (Albert Chin)
|
||||
- faq.html:
|
||||
- Fixed typo in section 6.1 (discovered by Bob Farmer).
|
||||
- files.c:
|
||||
- fix two typos in comments, one in ChangeLog (Matthias Andree)
|
||||
diralphasort()
|
||||
- Stop abort on symlinks (Matthias Andree)
|
||||
- use strcasecmp to sort directory if available, pilot does that
|
||||
as well (Matthias Andree)
|
||||
filestat(), do_browse()
|
||||
- Changed lstat calls to stat, which fixes the browser not
|
||||
following links to directories. We only use lstat() when
|
||||
printing the details of the file, and if it is a link, then
|
||||
check via lstat() for link to a directory. If it is
|
||||
a directory, display (dir), else use the normal "--".
|
||||
do_browser()
|
||||
- Fix broken size suffix off-by-one errors (Matthias Andree)
|
||||
cwd_tab_completion(), do_browse_from()
|
||||
- Use PATH_MAX instead of 0 arg to getcwd (Matthias Andree).
|
||||
- Changed above to use PATH_MAX only when defined on the
|
||||
system, as the HURD e.g. does not support it.
|
||||
- intl/Makefile.in:
|
||||
distclean
|
||||
- added intl/libintl.h to the rm -f rule, should fix the unresolved
|
||||
gettext symbols problem (Jordi).
|
||||
|
||||
nano-1.0.0 - 03/22/2001
|
||||
- General
|
||||
- Added void to functions declared as () args, nano.c:do_mark()
|
||||
@@ -6,8 +372,6 @@ nano-1.0.0 - 03/22/2001
|
||||
the "new" C++ reserved word, even though there is likely no way
|
||||
nano will EVER be compilable with a C++ compiler. (suggested by
|
||||
Rocco Corsi).
|
||||
- aclocal.m4:
|
||||
- Minor patch for intl check (Christian Weisgerber)
|
||||
- ca.po, es.po:
|
||||
- Final tweaks for Nano 1.0.
|
||||
- cs.po:
|
||||
@@ -26,7 +390,7 @@ nano-1.0.0 - 03/22/2001
|
||||
2b for placement of cursor.
|
||||
- move.c:
|
||||
page_down()
|
||||
- Check for totlines < editwinrows in check for superflous
|
||||
- Check for totlines < editwinrows in check for superfluous
|
||||
edit update (fixed BUG #57).
|
||||
- search.c:
|
||||
print_replaced()
|
||||
@@ -55,11 +419,11 @@ nano-0.9.99pre3 - 02/19/2001
|
||||
- nano.c:
|
||||
do_delete()
|
||||
- Added check for current->next == fileptr, as we have a magic
|
||||
line code again, fixes sillyness at the end of the last line
|
||||
line code again, fixes silliness at the end of the last line
|
||||
before the magic line (reported by J.A. Neitzel).
|
||||
do_justify()
|
||||
- If the keystroke after the justify is not the unjustify key,
|
||||
blank the statsubar (bug reported by Neil Parks).
|
||||
blank the statusbar (bug reported by Neil Parks).
|
||||
main()
|
||||
- Added ENABLE_NLS check around gettext stuff.
|
||||
- winio.c:
|
||||
@@ -100,7 +464,8 @@ General
|
||||
- Rewritten using getpwent (suggested by Rocco).
|
||||
- Removed redundant conditional (Rocco).
|
||||
real_dir_from_tilde()
|
||||
- Rewritten using getpwent (suggested by Adam, much optimized by Rocco).
|
||||
- Rewritten using getpwent (suggested by Adam, much optimized by
|
||||
Rocco).
|
||||
- global.c:
|
||||
- Don't define toggles global or toggle_init_one if using --tiny.
|
||||
- nano.c:
|
||||
@@ -129,13 +494,13 @@ General
|
||||
- Various #ifdef & #ifndef cleanups. (Rocco)
|
||||
- Added message for when keypad goes awry. Added code in main and
|
||||
function print_numlock_warning() to notify user, and added an
|
||||
apropriate section in the faq to refer to this brokenness.
|
||||
appropriate section in the faq to refer to this brokenness.
|
||||
- Added macros in nano.h for magic values that might be unclear in
|
||||
nano.c:global_init(). (Rocco)
|
||||
- configure.in:
|
||||
- Fix for _use_keypad check breaking slang support (Christian
|
||||
Weisgerber).
|
||||
- Changed to automatically define the 5 DISABLE varibles when
|
||||
- Changed to automatically define the 5 DISABLE variables when
|
||||
NANO_SMALL (enable-tiny) is requested at configure.
|
||||
- faq.html:
|
||||
- Added some info on making the binary smaller with the configure
|
||||
@@ -168,7 +533,7 @@ General
|
||||
- When NANO_SMALL (enable-tiny) is defined, the 5 main DISABLE
|
||||
variables (SPELLER, HELP, JUSTIFY, BROWSER, TABCOMP) are not
|
||||
reported as enabled when Nano is called with -V (--version)
|
||||
command-line option. (Rocco)
|
||||
command line option. (Rocco)
|
||||
usage()
|
||||
- Alternate speller option no longer valid if DISABLE_SPELLER is
|
||||
active. (Rocco)
|
||||
@@ -193,8 +558,8 @@ General -
|
||||
- Keypad code has been changed slightly. Now checks for
|
||||
_use_keypad flag in window to see whether or not to turn
|
||||
the keypad() back off when finished (taken from aumix). Moved
|
||||
to winio.c where it should probably be anyway. New confgure
|
||||
check for _use_keypad in window sstruct. This will have to do
|
||||
to winio.c where it should probably be anyway. New configure
|
||||
check for _use_keypad in window struct. This will have to do
|
||||
for now.
|
||||
- Moved keypad() calls for PDCURSES from main() to window_init()
|
||||
so the keypad continues to work after a Meta-X, for example.
|
||||
@@ -215,7 +580,7 @@ General -
|
||||
do_browser()
|
||||
- Don't decrement longest by the length of path. Fixes crashes
|
||||
on entering various dirs (Rocco).
|
||||
- Don't ungetch() the exit key, unneeded, fixes inerting a file
|
||||
- Don't ungetch() the exit key, unneeded, fixes inserting a file
|
||||
causes exit code.
|
||||
- move.c:
|
||||
page_down()
|
||||
@@ -272,7 +637,7 @@ General
|
||||
- Added check for S_ISBLK and S_ISCHR, don't open device files!
|
||||
- nano.c:
|
||||
renumber()
|
||||
- Dont stupidly assign the value of prev->lineno if prev == NULL!
|
||||
- Don't stupidly assign the value of prev->lineno if prev == NULL!
|
||||
main()
|
||||
- Added code to check for Alt-Alt (27-27) keystrokes and set the
|
||||
next keystroke as a control sequence. New variable
|
||||
@@ -305,7 +670,7 @@ General
|
||||
"speller" for -s, so it should be --disable-speller.
|
||||
- files.c:
|
||||
write_file()
|
||||
- Added tmp check to TMP_OPT section (how apropriate).
|
||||
- Added tmp check to TMP_OPT section (how appropriate).
|
||||
- Added new consistency checking code from securityfocus
|
||||
article by Oliver Friedrichs, and use O_EXCL if tmp == 1.
|
||||
- We now run check on result of lstat(), not stat(), to be
|
||||
@@ -320,7 +685,7 @@ General
|
||||
edit_add()
|
||||
- Off by one display error (fix by Rocco Corsi).
|
||||
do_replace_highlight()
|
||||
- New code to handle being past COLS (Roco Corsi).
|
||||
- New code to handle being past COLS (Rocco Corsi).
|
||||
- Moved from search.c, as it's definitely a winio function now =)
|
||||
update_line()
|
||||
- More '$' display fixes (Rocco Corsi).
|
||||
@@ -335,15 +700,15 @@ nano 0.9.22 - 12/02/2000
|
||||
- Took out help from spell_list and changed SPELL_LIST_LEN to 1.
|
||||
Is using a spell checker THAT difficult? =-)
|
||||
- New function nano_disabled_msg(), to alert that certain
|
||||
functions have been disabled, similaer to nano_tiny feature.
|
||||
functions have been disabled, similar to nano_tiny feature.
|
||||
- New configure options:
|
||||
- Added configure argument --disable-tabcomp. Affects
|
||||
bottom of files.c and write_file, utils.c:check_wildcard_match()
|
||||
and winio.c:nanogettsr().
|
||||
and winio.c:nanogetstr().
|
||||
- New options --enable-extra. New code in nano.c:version() to
|
||||
print out various options from ./configure, function do_credits().
|
||||
- Added --disable-spell option for those who want to just disable
|
||||
the spell check feature. Affects the spellinf fucntions
|
||||
the spell check feature. Affects the spelling functions
|
||||
do_spell, do_int_speller and do_alt_speller.
|
||||
- Added --disable-justify to get rid of the justify function.
|
||||
Affects do_justify() (not surprisingly).
|
||||
@@ -359,8 +724,8 @@ nano 0.9.22 - 12/02/2000
|
||||
- global.c:
|
||||
shortcut_init()
|
||||
- Now takes an argument as to whether to display the unjustify
|
||||
shortcut or the normal uncut text one. Needed to accomodate
|
||||
the klugey unjustify code.
|
||||
shortcut or the normal uncut text one. Needed to accommodate
|
||||
the kludgey unjustify code.
|
||||
- nano.1, nano.1.html:
|
||||
- Updated date on pages because of -p changes.
|
||||
- Added "NOTES" section, where I explain what nano.save & friends
|
||||
@@ -396,11 +761,11 @@ nano 0.9.22 - 12/02/2000
|
||||
handle_sighup()
|
||||
- Now calls die instead of writing on its own and exiting normally.
|
||||
- search.c:
|
||||
do_replace_hilight()
|
||||
- New function, displays the currently selected word as hilighted
|
||||
do_replace_highlight()
|
||||
- New function, displays the currently selected word as highlighted
|
||||
in the spell check. Called from do_replace_loop (Rocco Corsi).
|
||||
- Added calls to curs_set(0) and (1) to diable the cursor when
|
||||
hilighting, looks much better.
|
||||
- Added calls to curs_set(0) and (1) to disable the cursor when
|
||||
highlighting, looks much better.
|
||||
- es.po:
|
||||
- Traditional Spanish strings updates.
|
||||
|
||||
@@ -413,7 +778,7 @@ nano 0.9.21 - 11/23/2000
|
||||
whether or not to display "New File" in the statusbar.
|
||||
- search.c:
|
||||
findnextstr()
|
||||
- Fix curent_x increment bug by using another variable (Rocco Corsi).
|
||||
- Fix current_x increment bug by using another variable (Rocco Corsi).
|
||||
search_init()
|
||||
- Silly typo in our "one simple call" of statusq. Stopped
|
||||
previous search string from being displayed.
|
||||
@@ -422,7 +787,8 @@ nano 0.9.21 - 11/23/2000
|
||||
using PICO_MODE and answer == ""
|
||||
- winio.c:
|
||||
do_up()
|
||||
- Deleted first update_line() call, screws up display when marker is set.
|
||||
- Deleted first update_line() call, screws up display when marker is
|
||||
set.
|
||||
- nano.1, nano.1.html
|
||||
- Updated man page for new -p definition.
|
||||
|
||||
@@ -435,12 +801,13 @@ nano 0.9.20 - 11/18/2000
|
||||
changed code in search_init(), do_replace(), nanogetstr (see
|
||||
below).
|
||||
- Added some missing gettext calls here and there (Jordi).
|
||||
- Revamped nanogetsr() and calls to it to use variable length strings.
|
||||
- Revamped nanogetstr() and calls to it to use variable length
|
||||
strings.
|
||||
MANY changes in nanogetstr(), many chances in search.c, new
|
||||
function mallocstrcpy which is sure to be a programmatic
|
||||
nightmare, changed last_search, last_replace, answer to
|
||||
pointers. New function not_found_msg in search.c for displaying
|
||||
truncated strings in satusbar when the string is not found
|
||||
truncated strings in statusbar when the string is not found
|
||||
(-pedantic fixes by Rocco Corsi). We disable this feature when
|
||||
using PICO_MODE (-p).
|
||||
- New spelling code by Rocco Corsi. New functions
|
||||
@@ -464,7 +831,7 @@ nano 0.9.20 - 11/18/2000
|
||||
- global.c
|
||||
- New global replace_list_2, for 2nd half of the replace dialog
|
||||
("Replace with:"), has fewer options than first half because
|
||||
they were inapropriate.
|
||||
they were inappropriate.
|
||||
toggle_init()
|
||||
- Added #ifdef around toggle_regex_msg to get rid of compiler
|
||||
warning.
|
||||
@@ -474,7 +841,7 @@ nano 0.9.20 - 11/18/2000
|
||||
- New function, toggles turning the keypad on and off in edit and
|
||||
bottomwin(). Added call to this in finish(), fixes bug #45.
|
||||
- search.c
|
||||
findnexstr()
|
||||
findnextstr()
|
||||
- New arg for begin_x variable, basically a rewrite that
|
||||
makes a little more sense and isn't quite as messy (Rocco Corsi).
|
||||
- Update the line we're checking if not the whole screen, because
|
||||
@@ -486,7 +853,7 @@ nano 0.9.20 - 11/18/2000
|
||||
do_replace()
|
||||
- Added code for Gotoline key after entering the search term.
|
||||
Fixes bug #46.
|
||||
- Removed redundant code involving processing replacemenet string.
|
||||
- Removed redundant code involving processing replacement string.
|
||||
Converted if statements to switch statements.
|
||||
- Optimizations by Rocco Corsi.
|
||||
- Removed code for deleted shortcuts from in replace_list_2.
|
||||
@@ -556,12 +923,12 @@ nano 0.9.18 - 09/18/2000
|
||||
keypad in many terms, which is very bad.
|
||||
- Made insert key call do_insertfile().
|
||||
do_toggle()
|
||||
- Rewrote function to allow NOHELP toggle to wotk on systems
|
||||
- Rewrote function to allow NOHELP toggle to work on systems
|
||||
without a working resizewin(). New function window_init().
|
||||
mouse_init()
|
||||
- Add keypad only if mouse support is on, otherwise mouse doesn't
|
||||
work. I guess you have to choose between having the mouse and
|
||||
having a working keypad for the time being (thank god for Meta-m).
|
||||
having a working keypad for the time being (thank god for Meta-M).
|
||||
- winio.c:
|
||||
total_refresh()
|
||||
- Added titlebar() call.
|
||||
@@ -587,7 +954,7 @@ nano-0.9.17 - 09/04/2000
|
||||
nano.c.
|
||||
- Changed from Alt-key symbol (@) which is completely nonstandard
|
||||
to the *nix "Meta" symbol (M-). Changed help_init to show
|
||||
the M-key usage and the help text to explain keys whcih generate
|
||||
the M-key usage and the help text to explain keys which generate
|
||||
Meta. Moved the toggle Meta keystrokes to the first column
|
||||
instead of the third as they are the primary keystrokes for the
|
||||
functions. Thanks Mini editor team :->
|
||||
@@ -671,7 +1038,7 @@ nano-0.9.15 - 08/03/2000
|
||||
- Fixed typo (?) in check for inptr->next. Caused lots of
|
||||
grief for editing lines at filebot.
|
||||
main()
|
||||
- Removed now useless usrtabsize variable (Christian Weisgerber).
|
||||
- Removed now useless usertabsize variable (Christian Weisgerber).
|
||||
- search.c:
|
||||
replace_abort()
|
||||
- redundant, now just calls search abort until it does something
|
||||
@@ -733,8 +1100,8 @@ nano-0.9.13 - 07/23/2000
|
||||
die():
|
||||
- More intelligent emergency-save filename selection (Rob)
|
||||
do_spell():
|
||||
- Changed exit semantincs a bit so that aspell wouldn't get
|
||||
all screwy (bug disovered by Joshua Jensen.
|
||||
- Changed exit semantics a bit so that aspell wouldn't get
|
||||
all screwy (bug discovered by Joshua Jensen.
|
||||
- files.c:
|
||||
read_file():
|
||||
- Added init of buf variable, hopefully this will stop the
|
||||
@@ -757,7 +1124,7 @@ nano-0.9.13 - 07/23/2000
|
||||
the opposite function.
|
||||
- Fixed bug #28.
|
||||
findnextstr()
|
||||
- do not center string found if it is currently visable. (Adam)
|
||||
- do not center string found if it is currently visible. (Adam)
|
||||
- fr.po:
|
||||
- French update by Clement Laforet <clem_laf@wanadoo.fr>.
|
||||
- es.po:
|
||||
@@ -825,21 +1192,21 @@ nano-0.9.12 - 07/07/2000
|
||||
nano-0.9.11 - 06/20/2000
|
||||
- New flag "-T" or "--tabsize" to specify how to display tab widths.
|
||||
Affects main() in nano.c, strlenpt(), xpt() and actual_x() (et al) in
|
||||
winio.c, and nano.h. Many harcoded "8"s have been changed to the
|
||||
winio.c, and nano.h. Many hardcoded "8"s have been changed to the
|
||||
TABSIZE int. Added changes to nano.1 and nano.1.html.
|
||||
- id.po:
|
||||
- Indonesian translation by Tedi Heriyanto.
|
||||
- es.po:
|
||||
- Updated translation (Jordi Mallach).
|
||||
- winio.c
|
||||
- Rewrite of display functions to correct the display problems
|
||||
- Rewrite of display functions to correct the display problems
|
||||
we had been seeing. Affects: add_marked_sameline, edit_add,
|
||||
and many others. (Rob Siemborski)
|
||||
- totsize fixes (Rob Siemborski)
|
||||
total_refresh():
|
||||
- Cut dispaly_main_list call, as this function is only supposed to refresh
|
||||
what's already on the screen, not go through the process of adding the
|
||||
text again.
|
||||
- Cut display_main_list call, as this function is only supposed to
|
||||
refresh what's already on the screen, not go through the process
|
||||
of adding the text again.
|
||||
- cut.c:
|
||||
- totsize fixes (Rob Siemborski)
|
||||
- nano.c:
|
||||
@@ -849,13 +1216,14 @@ nano-0.9.11 - 06/20/2000
|
||||
- Removed all functions that were split into other files.
|
||||
Affects LOTS of funcs.
|
||||
do_enter():
|
||||
- Added reset of placewewant to end.
|
||||
- Added reset of placewewant to end.
|
||||
do_insertfile():
|
||||
- Fix display problem when using ctrl-r to load a file
|
||||
into the buffer (Rob Siemborski)
|
||||
handle_sigwinch():
|
||||
- Added titlebar(), edit_refresh() and display_main_list() calls because
|
||||
a resize wasn't picking up on possible different width correctly.
|
||||
- Added titlebar(), edit_refresh() and display_main_list() calls
|
||||
because a resize wasn't picking up on possible different width
|
||||
correctly.
|
||||
- utils.c:
|
||||
- Moved nmalloc() and nrealloc() here.
|
||||
- move.c:
|
||||
@@ -880,14 +1248,14 @@ nano-0.9.10 - 06/04/2000
|
||||
exit nano before it runs (--version, --help, etc).
|
||||
|
||||
nano-0.9.9 - 05/31/2000
|
||||
- Makeile.am:
|
||||
- Makefile.am:
|
||||
- Added proper lines for defining LOCALEDIR.
|
||||
- configure.in:
|
||||
- Spelling fixes (Jordi Mallach)
|
||||
- Removed CFLAGS changes for gcc, reduces portability according to
|
||||
some, and it certainly doesn't seem to decrease exe size.
|
||||
- es.po:
|
||||
- Spanish ranslation updates (Jordi Mallach)
|
||||
- Spanish translation updates (Jordi Mallach)
|
||||
- POTFILES.in:
|
||||
- Added global.c file, was screwing up translations (i.e. they
|
||||
weren't getting done).
|
||||
@@ -910,7 +1278,7 @@ nano-0.9.9 - 05/31/2000
|
||||
renumber(), renumber_all():
|
||||
- Removed totsize-- and totsize init in renumber_all.
|
||||
do_mouse():
|
||||
- Added edit_refresh() call to show hilight updates. Removed
|
||||
- Added edit_refresh() call to show highlight updates. Removed
|
||||
unnecessary wrefresh(edit).
|
||||
main():
|
||||
- Moved up locale calls so that translated --help messages would
|
||||
@@ -924,7 +1292,7 @@ nano-0.9.9 - 05/31/2000
|
||||
- malloc call changed to nmalloc (Rob Siemborski).
|
||||
- winio.c:
|
||||
total_refresh():
|
||||
- Completely rewrote function, not quite so braindamaged now.
|
||||
- Completely rewrote function, not quite so brain-damaged now.
|
||||
|
||||
nano-0.9.8 - 05/18/2000
|
||||
- nano.c:
|
||||
@@ -933,7 +1301,7 @@ nano-0.9.8 - 05/18/2000
|
||||
character (Adam Rogoyski). Removed raw()/noraw() calls so that
|
||||
nano gets input in 'normal' mode, which is the Right Way(tm) to
|
||||
do it. ^S, ^Z and ^Q now work properly as a result, as well as
|
||||
^C. New variable term, global bariable oldterm to save previous
|
||||
^C. New variable term, global variable oldterm to save previous
|
||||
term settings, and changes to finish() and die().
|
||||
- Added extra #ifdefs in getopt code, so that above code and
|
||||
flag init is run even if GETOPT_LONG is not #defined.
|
||||
@@ -947,8 +1315,8 @@ nano-0.9.8 - 05/18/2000
|
||||
loop.
|
||||
- global.c:
|
||||
shortcut_init():
|
||||
- Removed suspend sc_init call and suspend message because suspend is no
|
||||
longer needed in the shortcut list to work properly.
|
||||
- Removed suspend sc_init call and suspend message because suspend
|
||||
is no longer needed in the shortcut list to work properly.
|
||||
|
||||
nano-0.9.7 - 05/14/2000
|
||||
- nano.c:
|
||||
@@ -983,7 +1351,7 @@ nano-0.9.6 - 05/08/2000
|
||||
edit_update():
|
||||
- Removed yucky code that didn't work, this function now just
|
||||
computes edittop and editbot and calls edit_refresh() to do the
|
||||
rest, which removes a lot of dupliicate code..
|
||||
rest, which removes a lot of duplicate code..
|
||||
|
||||
nano-0.9.5 - 05/01/2000
|
||||
- Removed bytes from file struct because it was computationally wasteful.
|
||||
@@ -1048,14 +1416,14 @@ nano-0.9.4 - 04/25/2000
|
||||
of do_down before setting current_x = 0 (discovered by Adam).
|
||||
do_justify():
|
||||
- Fixed segfault when reaching the last line (tried to assign
|
||||
currrent->next->data when current->next == NULL) (discovered
|
||||
current->next->data when current->next == NULL) (discovered
|
||||
by Adam).
|
||||
- utils.c:
|
||||
- Removed extra macro defs that are now in nano.h.
|
||||
- nano.h:
|
||||
- Changed macro SET() to use |= instead of ^=. Fixes bug in
|
||||
cut code when cutting more than one line, and cutbuffer gets
|
||||
blown away when it shouldnt.
|
||||
blown away when it shouldn't.
|
||||
|
||||
nano-0.9.3 - 04/29/2000
|
||||
- cut.c:
|
||||
@@ -1070,28 +1438,29 @@ nano-0.9.3 - 04/29/2000
|
||||
- nano.c:
|
||||
do_backspace(), do_char():
|
||||
- Removed "magic line" code. It was basically causing more bugs
|
||||
than it was helping for the sake of compatibillity. This fixes
|
||||
than it was helping for the sake of compatibility. This fixes
|
||||
at least one known segfault condition.
|
||||
do_enter():
|
||||
- Added setting editbot to new node if the new node is the last
|
||||
node in the file.
|
||||
write_file():
|
||||
- Changed writing file bahavior. Now, if last line of the file
|
||||
has any data on it, we write a newline on it, else we dont.
|
||||
- Changed writing file behavior. Now, if last line of the file
|
||||
has any data on it, we write a newline on it, else we don't.
|
||||
- winio.c:
|
||||
add_marked_sameline():
|
||||
- New code that checks for whether the begin and end of the marker
|
||||
are on different lines. Missing previously.
|
||||
edit_add():
|
||||
- added some more checks for text length. Cleaned up some mvwaddnstrs that
|
||||
could be written more simply as waddnstrs.
|
||||
- added some more checks for text length. Cleaned up some
|
||||
mvwaddnstrs that could be written more simply as waddnstrs.
|
||||
edit_refresh():
|
||||
- Removed check for temp == filebot, it is now treated like any other line.
|
||||
Fixes a bug where selected text on the last line shows normally.
|
||||
- Removed check for temp == filebot, it is now treated like any other
|
||||
line. Fixes a bug where selected text on the last line shows
|
||||
normally.
|
||||
xpt():
|
||||
- Removed an extra computation for tabs variable that was incorrect.
|
||||
xplustabs():
|
||||
- Since xpt now actualy works, this func is now just a wrapper for
|
||||
- Since xpt now actually works, this func is now just a wrapper for
|
||||
xpt(current, current_x)
|
||||
- nano.1, nano.1.html:
|
||||
- Added -l option to man pages.
|
||||
@@ -1113,7 +1482,7 @@ nano-0.9.1 - 04/14/2000
|
||||
- Added pico compatibility for ^T when in search or switch to switch
|
||||
to the opposite function. Added one to REPLACE_LIST_LEN and
|
||||
WHEREIS_LIST_LEN in nano.h, new args to sc_init_one in global.c and
|
||||
new strings that will have to be gettex()ed. New argument 'replacing'
|
||||
new strings that will have to be gettext()ed. New argument 'replacing'
|
||||
to search_init(). Handlers in do_replace and do_search().
|
||||
- New write code, now follows symbolic links instead of replacing them
|
||||
with the new file. New option (-l, --nofollow) to enable the old
|
||||
@@ -1124,7 +1493,7 @@ nano-0.9.1 - 04/14/2000
|
||||
a segfault *sigh*.
|
||||
do_replace():
|
||||
- Incremented current_x by the length of the replacement
|
||||
text inside the main repalce loop. Fixes bug #15.
|
||||
text inside the main replace loop. Fixes bug #15.
|
||||
add_marked_sameline():
|
||||
- New function, handles marked text when start & end of marker is
|
||||
on one line, also supports most marked text when cursor > COLS.
|
||||
@@ -1142,7 +1511,7 @@ nano-0.9.0 - 04/07/2000
|
||||
- Removed inner loop code, now calls update_line() for each line
|
||||
in question, MUCH nicer.
|
||||
- xplustabs(), xpt():
|
||||
- Removed redundant increment of tabs when collumn no % 8 == 0.
|
||||
- Removed redundant increment of tabs when column no % 8 == 0.
|
||||
- Added check for data[i] < 32, most of such bits are 2 chars wide.
|
||||
- update_line():
|
||||
- Fixed a stupid call to strlenpt with col when we should have
|
||||
@@ -1160,7 +1529,7 @@ nano-0.8.8 - 03/12/2000
|
||||
New dirs po/ and intl/, changes to configure.in and Automake.am to
|
||||
support i18n.
|
||||
- nano.c:
|
||||
includes: Ddded sys/param.h and limits.h. (Adam Rogoyski).
|
||||
includes: Added sys/param.h and limits.h. (Adam Rogoyski).
|
||||
statics: Changed some things that were not necessarily static
|
||||
(Adam Rogoyski).
|
||||
nrealloc(): New function, similar to nmalloc(). Changed calls from
|
||||
@@ -1174,21 +1543,22 @@ nano-0.8.8 - 03/12/2000
|
||||
|
||||
nano-0.8.7 - 03/01/2000
|
||||
- main.c:
|
||||
do_wrap(): Better fix for segfaults, and fix for lisnes being wrapped
|
||||
do_wrap(): Better fix for segfaults, and fix for lines being wrapped
|
||||
to a single character on one line when no good place to
|
||||
break the line exists, and for wrapping lines longer than COLS.
|
||||
break the line exists, and for wrapping lines longer than
|
||||
COLS.
|
||||
- nano.1.html:
|
||||
Html version of man page, now included in dist. For
|
||||
the benefit of nano packages in Linux distributions.
|
||||
|
||||
nano-0.8.6 - 02/24/2000
|
||||
- gobal.c:
|
||||
- global.c:
|
||||
shortcut_init():
|
||||
Added shortcuts for goto_line and do_replace when using
|
||||
pico_msgs. Oops.
|
||||
- nano.c:
|
||||
statics: Changed fill back to 0 from 71 by default (Adam Rogoyski).
|
||||
do_wrap(): Added check for backing up past tabs, which we shouldnt do.
|
||||
do_wrap(): Added check for backing up past tabs, which we shouldn't do.
|
||||
Removed check for backing up past spaces first.
|
||||
main(): Added for loop to check for alt keys instead of hard list.
|
||||
do_enter(): Fix for bug #14, added call to reset_cursor and messed
|
||||
@@ -1210,7 +1580,7 @@ nano-0.8.5 - 02/18/2000
|
||||
- winio.c:
|
||||
edit_refresh():
|
||||
Temporary fix for selecting text when temp == current.
|
||||
edit_refresh() is now unmanagably complex, and must be
|
||||
edit_refresh() is now unmanageably complex, and must be
|
||||
revamped.
|
||||
check_statblank():
|
||||
Added check for constupdate, makes things less choppy
|
||||
@@ -1246,7 +1616,7 @@ nano-0.8.3 - 02/08/2000
|
||||
main():
|
||||
Removed case for ignoring char 126 (~). That's kind of
|
||||
important, we'll have to fix handling that sequence when
|
||||
pageing up/down on a terminal some other way... Revamped
|
||||
paging up/down on a terminal some other way... Revamped
|
||||
main switch loop in much snazzier fashion based on the
|
||||
shortcut list.
|
||||
- winio.c:
|
||||
@@ -1274,7 +1644,7 @@ nano-0.8.2 - 02/02/2000
|
||||
- Added initial mouse (-m, --mouse) support. New global variable
|
||||
use_mouse. (Adam Rogoyski)
|
||||
|
||||
- nano.c: Set intial value of fill to COLS - 8 rather than just 72
|
||||
- nano.c: Set initial value of fill to COLS - 8 rather than just 72
|
||||
regardless. (Adam Rogoyski).
|
||||
do_delete():
|
||||
Deleted call to do_backspace() when on the end of a line,
|
||||
@@ -1300,7 +1670,7 @@ do_goto():
|
||||
bottombars() with replace_list instead of goto_list.
|
||||
- nano.h:
|
||||
New char *help in shortcut structure for help
|
||||
feature. Added NANO_*_MSG and NANO_*_HELP #deifnes
|
||||
feature. Added NANO_*_MSG and NANO_*_HELP #defines
|
||||
for help function and i18n.
|
||||
- global.c:
|
||||
New functions shortcut_init (called in nano.c) and
|
||||
@@ -1332,7 +1702,7 @@ main():
|
||||
the buffer when we page up/down on a vt terminal.
|
||||
write_file():
|
||||
Fixes for umask (Adam Rogoyski). Renamed tmpfile
|
||||
variable to tmp. Documented the tmp opttion
|
||||
variable to tmp. Documented the tmp option
|
||||
better in the function comments. Fixed my
|
||||
stupidly commented out check for tmp on setting
|
||||
umask which I really like =>
|
||||
@@ -1345,7 +1715,8 @@ write_file():
|
||||
New checks for getopt_long, getopt.h, removed
|
||||
CFLAGS and LDFLAGS changes. Gonna have to run
|
||||
strip manually now =-) (Andy Kahn)
|
||||
Added check for HAVE_WRESIZE, new file acconfig.h (me).
|
||||
Added check for HAVE_WRESIZE, new file acconfig.h
|
||||
(me).
|
||||
|
||||
nano-0.7.9 - 01/24/2000
|
||||
- New autoindent feature. Command flag 'i' or '--autoindent'. New
|
||||
@@ -1370,7 +1741,7 @@ nano-0.7.9 - 01/24/2000
|
||||
|
||||
nano-0.7.8 - 01/23/2000
|
||||
- Stubbed justify function. Affects main() in nano.c and nano.h defines.
|
||||
- Added Fkey equivalents for Pico compatibilty. Affects nano.h defines
|
||||
- Added Fkey equivalents for Pico compatibility. Affects nano.h defines
|
||||
and main() in nano.c
|
||||
- Removed redundant reset_cursor() calls from the blank() routines.
|
||||
- nano.c:
|
||||
@@ -1449,7 +1820,7 @@ nano 0.7.6 - 01/15/2000
|
||||
0.7.3 Fixed a double blank_statusbar() when jumping to first and last
|
||||
lines. Took out unnecessary updates in load_file. Bug fix in
|
||||
do_left. Missing updates to totlines, fixed bug #7 (last line not
|
||||
having a newline at the end doesnt get read, bugfix in do_replace
|
||||
having a newline at the end doesn't get read, bugfix in do_replace
|
||||
with replace all, more/better comments (Robert Siemborski)
|
||||
0.7.2 Our first patch accepted into the source! configure fixes
|
||||
and optimizations (Erik Anderson). Added missing stdarg.h to winio.c.
|
||||
@@ -1490,35 +1861,36 @@ nano 0.7.6 - 01/15/2000
|
||||
0.6.1 Starting to implement wrapping toggle. Fix for unhandled control
|
||||
codes being entered into the buffer. Bug fix in actual_x; more
|
||||
> COLS - 1 functionality, especially on lines with TABs. Fixed being
|
||||
locked into cutbuffer when cutting more than one marked screen of text.
|
||||
locked into cutbuffer when cutting more than one marked screen of
|
||||
text.
|
||||
0.6.0 We have TABs!!! To do this, placewewant is now set to the actual
|
||||
width on the screen we want to be, not an index of current->data.
|
||||
New functions xplustabs and actual_x convert the actual place
|
||||
the cursor should be on the screen to and from the place in the
|
||||
string.
|
||||
0.5.5 Changed do_right to test do_down before setting current_x to 0,
|
||||
eliminiating the "looping" on the last line when holding the right
|
||||
eliminating the "looping" on the last line when holding the right
|
||||
arrow. Preliminary support for longer than COLS - 1 lines.
|
||||
Wrote do_delete.
|
||||
0.5.4 Fixed a big in total_update that wasn't repainting the screen properly.
|
||||
tipgetstr is much more messy but text is now more editable ;)
|
||||
Fixed crash on entering a new file, hopefully. Awful stub for tab
|
||||
handling, only in do_right() to save me some sanity.
|
||||
0.5.4 Fixed a bug in total_update that wasn't repainting the screen
|
||||
properly. tipgetstr is much more messy but text is now more
|
||||
editable ;) Fixed crash on entering a new file, hopefully. Awful
|
||||
stub for tab handling, only in do_right() to save me some sanity.
|
||||
0.5.3 Added check for malloc.h. Implementing uncut from marker slowly.
|
||||
Fixed a few bugs in do_uncut when not uncutting from marked text.
|
||||
I would not trust your data with the mark code right now, but then
|
||||
we're not at version 1.0 yet so dont trust anything ;)
|
||||
0.5.2 Added reset_cursor() before end of update_line so cursor doesnt
|
||||
I would not trust your data with the mark code right now, but then
|
||||
we're not at version 1.0 yet so dont trust anything ;)
|
||||
0.5.2 Added reset_cursor() before end of update_line so cursor doesn't
|
||||
jump after each keystroke entered. Select text stubbed. Fixed
|
||||
a bug in total_refresh(). Setting a mark will hilight properly,
|
||||
a bug in total_refresh(). Setting a mark will highlight properly,
|
||||
but does not actually affect what gets put in the cutbuffer (yet).
|
||||
0.5.1 Writing a file out causes modified to be set back to 0. Good.
|
||||
Set_modified function written. Cut and uncut text now set
|
||||
modified when called.
|
||||
0.5.0 Half way there! Implemented write out, save function seems
|
||||
stable. Changed statusbar blank routing to not refresh, a separte
|
||||
stable. Changed statusbar blank routing to not refresh, a separate
|
||||
program calls it and then refreshes. Made the program not clear
|
||||
the srceen on exit, just the bottom two lines (like Pico).
|
||||
the screen on exit, just the bottom two lines (like Pico).
|
||||
0.4.2 Implemented replace all in replace function. Crude exit function
|
||||
(asks yes or no if modified but does not write to file).
|
||||
0.4.1 Implementing search & replace. Fixed crash on deleting at top of
|
||||
@@ -1526,7 +1898,7 @@ nano 0.7.6 - 01/15/2000
|
||||
Implemented ^A and ^E (beginning and end of line).
|
||||
0.4.0 Split code into global.c and proto.h to allow for better multiple
|
||||
file handling. Added #defines for the majority of the shortcut
|
||||
kets in tip.h for easy modification.
|
||||
keys in tip.h for easy modification.
|
||||
0.3.1 Write edit_refresh which doesn't move the screen around, just
|
||||
updates what's there already. do_wrap() and do_enter() added.
|
||||
0.3.0 Preliminary cutbuffer (cut and uncut) support.
|
||||
|
||||
23
Makefile.am
23
Makefile.am
@@ -1,27 +1,38 @@
|
||||
## $Id$
|
||||
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 = cut.c \
|
||||
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 = @INTLLIBS@
|
||||
nano_LDADD = @GLIB_LIBS@ @INTLLIBS@
|
||||
|
||||
info_TEXINFOS = nano.texi
|
||||
MAKEINFO = makeinfo --no-split
|
||||
|
||||
EXTRA_DIST = AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README \
|
||||
TODO install-sh missing mkinstalldirs nano.1 nano.1.html \
|
||||
faq.html
|
||||
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 = $(datadir)/locale
|
||||
localedir = @LOCALE_DIR@
|
||||
INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
|
||||
|
||||
$(srcdir)/acinclude.m4: $(ACINCLUDE_INPUTS)
|
||||
cat $(ACINCLUDE_INPUTS) > $@
|
||||
|
||||
34
Makefile.in
34
Makefile.in
@@ -68,6 +68,7 @@ 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@
|
||||
@@ -75,6 +76,7 @@ INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
LOCALE_DIR = @LOCALE_DIR@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -86,22 +88,28 @@ 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 = cut.c files.c global.c move.c nano.c nano.h proto.h search.c utils.c winio.c
|
||||
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 = @INTLLIBS@
|
||||
nano_LDADD = @GLIB_LIBS@ @INTLLIBS@
|
||||
|
||||
info_TEXINFOS = nano.texi
|
||||
MAKEINFO = makeinfo --no-split
|
||||
|
||||
EXTRA_DIST = AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README TODO install-sh missing mkinstalldirs nano.1 nano.1.html faq.html
|
||||
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 = $(datadir)/locale
|
||||
localedir = @LOCALE_DIR@
|
||||
INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
@@ -114,8 +122,8 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I.
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
nano_OBJECTS = cut.o files.o global.o move.o nano.o search.o utils.o \
|
||||
winio.o
|
||||
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@
|
||||
@@ -131,9 +139,9 @@ MANS = $(man_MANS)
|
||||
|
||||
NROFF = nroff
|
||||
DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \
|
||||
INSTALL Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 \
|
||||
config.h.in configure configure.in install-sh missing mkinstalldirs \
|
||||
texinfo.tex
|
||||
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)
|
||||
@@ -154,7 +162,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): configure.in
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
@@ -519,10 +527,11 @@ 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 $$d/$$file $(distdir)/$$file; \
|
||||
cp -pr $$/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
@@ -630,6 +639,9 @@ 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:
|
||||
|
||||
119
NEWS
119
NEWS
@@ -1,3 +1,50 @@
|
||||
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
|
||||
writing out files in these formats. Pico's -o flag has
|
||||
been implemented, as has some new smooth scrolling code
|
||||
(which can be used in place of the default jerky scrolling
|
||||
behavior). Also, there is now a "find matching
|
||||
bracket/brace/etc" feature (Meta-]). The .nanorc file
|
||||
now accepts setting the tabsize, and the help text at the
|
||||
bottom of the editor is now better spaced out in the
|
||||
search/replace prompts. There are also the usual helping
|
||||
of bugfixes, translation updates and, surely a bug or two.
|
||||
You better get ready!
|
||||
|
||||
07/28/2001 - GNU nano 1.1.1 is released. Our second 1.1 unstable release
|
||||
features many bugfixes from the initial release, in
|
||||
particular fixs for the multibuffer code, and various
|
||||
compiler macro fixes. The shortcut lists for
|
||||
the search and replace prompts are a little more logical
|
||||
(with cancel the last option again), and the included
|
||||
gettext was re-downgraded to 0.10.35 due to problems
|
||||
on the PPC platform. GNU nano now includes its own
|
||||
aclocal macros in the m4/ directory to allow rebuilding
|
||||
the configure script to work on platforms regardless of
|
||||
their gettext version.
|
||||
|
||||
07/15/2001 - GNU nano 1.1.0 is released. This is the first release
|
||||
in the 1.1.x unstable series of GNU nano. It
|
||||
incorporates all changes up to the 1.0.3 release,
|
||||
and also includes many many new features, including
|
||||
appending to as well as overwriting files, writing
|
||||
marked text to a separate file, dynamic wrap length,
|
||||
lots more compatibility with Pico, and new optional
|
||||
features like .nanorc file support and multiple file
|
||||
buffers! All in all, plenty of new stuff that's sure
|
||||
to introduce lots of bugs ;-) Have fun with it, but
|
||||
be careful, unstable means unstable.
|
||||
|
||||
04/06/2001 - GNU nano 1.0.1 is out there. The only new feature is a
|
||||
configure option for those who want to disable all
|
||||
word wrapping from nano, --disable-wrapping. Bug fixes
|
||||
this release include some bugs with autoconf and i18n,
|
||||
and several fixes in the file browser including a
|
||||
segfault on Solaris, symlinks to directories now work
|
||||
properly, and nano now sorts files case insensitively
|
||||
like pilot. Have fun with it.
|
||||
|
||||
03/22/2001 - GNU Nano 1.0 is released! The autoindent wrapping bug
|
||||
has been fixed, as well as strange bug when using Pico
|
||||
mode and regex search. There have also been some minor
|
||||
@@ -14,11 +61,11 @@
|
||||
default list of shortcuts, "^G Get Help" is now Listed and
|
||||
"^_ Goto Line" is not). The Yes/No/All keys have
|
||||
finally been internationalized also. All in all, quite
|
||||
a few changes considering nano is supposed to be in a code
|
||||
freeze. But there are the usual helping of bugfixes, a
|
||||
a few changes, considering nano is supposed to be in a code
|
||||
freeze. But there are the usual helping of bugfixes, a
|
||||
nasty bug when cutting text in -k mode and some
|
||||
compatibility with older ncurses libraries have also been
|
||||
fixed. All in all, a lot to see.
|
||||
compatibility issues with older ncurses libraries have also
|
||||
been fixed. All in all, a lot to see.
|
||||
|
||||
01/31/2001 - Nano 0.9.99pre2 is released. Not surprisingly, all that is
|
||||
new is bugfixes, bugfixes, bugfixes. There were a few
|
||||
@@ -51,7 +98,7 @@
|
||||
tab completion in certain instances. Have fun and Happy
|
||||
New Year!
|
||||
|
||||
12/18/2000 - Nano 0.9.24 is released. This versions contains the last of
|
||||
12/18/2000 - Nano 0.9.24 is released. This version contains the last of
|
||||
the security fixes for writing files, as well as for a
|
||||
nasty segfault when nano is unable to open a file for
|
||||
reading, among other fixes. Nano also now cowardly
|
||||
@@ -65,7 +112,7 @@
|
||||
12/08/2000 - Nano 0.9.23 is the "race conditions bite" release. The
|
||||
main reason for this release is the less-than-optimal
|
||||
fix for the security issue in nano with following symbolic
|
||||
links. Hopefully this will fix the probelm permanently.
|
||||
links. Hopefully this will fix the problem permanently.
|
||||
The --nofollow option also works again for those who
|
||||
are real security nuts. There are also some display and
|
||||
search fixes, and the --disable-spell function was renamed
|
||||
@@ -105,10 +152,10 @@
|
||||
(courtesy of Mr. Rocco Corsi) and tab completion when
|
||||
reading in or writing out files! There's also the usual
|
||||
billion or so bug fixes. Feedback on this release is
|
||||
welcome because so much much has changed, especially with
|
||||
the previous string display in search and replace. Email
|
||||
-> nano@nano-editor.org <-. If you like something, don't
|
||||
like something, or just want to order a pizza, let us know!
|
||||
welcome because so much has changed, especially with the
|
||||
previous string display in search and replace. Email ->
|
||||
nano@nano-editor.org <-. If you like something, don't like
|
||||
something, or just want to order a pizza, let us know!
|
||||
|
||||
10/02/2000 - Nano 0.9.19 is the "Chris is getting married in less than
|
||||
a week and needs a distraction" release. There are only
|
||||
@@ -134,16 +181,16 @@
|
||||
flags (M-c, M-i, M-z, M-x, M-p, M-w, M-m, M-k and M-e for
|
||||
-c, -i, -x, -p, -w, -k, and -R).
|
||||
|
||||
08/09/2000 - Nano 0.9.16, after some struggling, is release. This release
|
||||
08/09/2000 - Nano 0.9.16, after some struggling, is released. This release
|
||||
should fix a few of the holes that 0.9.15 dug. The
|
||||
"cutting text on the first line" bug is fixed, as is the
|
||||
"cutting text on the last line" bug. Nice symmetry there
|
||||
huh? Also the --tabsize argument should now work as well
|
||||
as by using -T.
|
||||
|
||||
08/03/2000 - Nano 0.9.15 is the "I cant think of a release description"
|
||||
08/03/2000 - Nano 0.9.15 is the "I can't think of a release description"
|
||||
release. There are the usual gala of display bugfixes,
|
||||
a for the the nasty bug in -k mode that could create a
|
||||
a fix for the the nasty bug in -k mode that could create a
|
||||
loop in the file being edited, and some other code
|
||||
cleanup. Also, the -T option should now work regardless
|
||||
of the curses library used. Yay.
|
||||
@@ -152,7 +199,7 @@
|
||||
be skipped as a version number" release. One typo
|
||||
caused unending problems (calling nano with either -t or
|
||||
-k caused both flags to be used). The -k code is also now
|
||||
closer in functionality to Pico's -k mode, please
|
||||
closer in functionality to Pico's -k mode; please
|
||||
note that this code is not finished yet. Working on this
|
||||
code has made me realize that there is not enough
|
||||
abstraction in the code, and I will be working on that
|
||||
@@ -161,7 +208,7 @@
|
||||
|
||||
07/23/2000 - Nano 0.9.13 has a few new bits and bobs, most notably the
|
||||
-k option from Pico (cut to end of line). The majority
|
||||
of changes in this release are bugfixes however, including
|
||||
of changes in this release are bugfixes, however, including
|
||||
the usual display fixes and fixes for writing to symbolic
|
||||
links and un-writeable files. Barring any other major
|
||||
changes, this should be the feature set for nano 1.0,
|
||||
@@ -170,12 +217,12 @@
|
||||
07/07/2000 - Nano 0.9.12 (The "lucky day" release) is bursting with new
|
||||
features, bug fixes, and yummy fruit flavor. For
|
||||
changes, the alternate replace keystroke ^W^T is now
|
||||
^W^R to be compatible with later version of Pico.
|
||||
^W^R to be compatible with later versions of Pico.
|
||||
^W^T is now goto line, again for Pico compatibility.
|
||||
As for new features, the wonderful/hated magic line
|
||||
code has returned with a vengeance! Also, regular
|
||||
expression searches and replaces have been incorporated
|
||||
via the -R flag. And of course there are the usual
|
||||
via the -R flag. And, of course, there are the usual
|
||||
helping of display and other bug fixes to top it all
|
||||
off.
|
||||
|
||||
@@ -189,8 +236,8 @@
|
||||
this function just changes the way tabs LOOK in the
|
||||
editor, the tabs you input are still real tabs of normal
|
||||
width (usually 8 characters); nano just makes them look
|
||||
smaller or bigger whlie in the editor. New in the
|
||||
translation department is an indonesian translation (id).
|
||||
smaller or bigger while in the editor. New in the
|
||||
translation department is an Indonesian translation (id).
|
||||
|
||||
06/06/2000 - Nano 0.9.10 is primarily a bugfix for the loss of SIGINT when
|
||||
using "run and terminate" flags (for example, --help).
|
||||
@@ -209,7 +256,7 @@
|
||||
the resize crash people have been experiencing. It also
|
||||
offers a new input method that should allow nano to do
|
||||
things the right way (like ^S, ^Q, custom suspend keys)
|
||||
and hopefully wont break with non-US keyboards. There
|
||||
and hopefully won't break with non-US keyboards. There
|
||||
are also the obligatory display fixes and speedups. Have
|
||||
fun with it.
|
||||
|
||||
@@ -230,7 +277,7 @@
|
||||
05/01/2000 - Nano 0.9.5 attempts to speed up the display of text
|
||||
to be at least somewhat reasonable. Much
|
||||
code profiling has been done to reduce the
|
||||
rediculous number of redundant display updates. This
|
||||
ridiculous number of redundant display updates. This
|
||||
will probably expose a lot of bugs that can then be
|
||||
fixed, so this release is probably not for the faint
|
||||
of heart. For anyone curious, I would call nano 0.9.2
|
||||
@@ -256,7 +303,7 @@
|
||||
so it is being removed for the time being, and perhaps
|
||||
indefinitely.
|
||||
|
||||
Other new stuff includes a --emable-tiny option to make
|
||||
Other new stuff includes an --enable-tiny option to make
|
||||
nano ultra small (disabling i18n, detailed help and the
|
||||
marker and mouse code), and --with-slang to use the
|
||||
slang libraries instead of ncurses.
|
||||
@@ -283,7 +330,7 @@
|
||||
|
||||
04/07/2000 - Nano 0.9.0 has some updates, new language support and
|
||||
a much better refresh setup (It's still not great, but...)
|
||||
There should also be more stabillity editing long lines,
|
||||
There should also be more stability editing long lines,
|
||||
as there was a stupid mistake in the update_line
|
||||
call. Silly me =)
|
||||
|
||||
@@ -292,13 +339,13 @@
|
||||
Most things work, the rest doesn't doesn't work because
|
||||
(a) I can't fix it or I would have already done so, and
|
||||
(b) the amount of patches I'm receiving right now is quite
|
||||
negligible. Forrunately this release marks the first
|
||||
negligible. Fortunately, this release marks the first
|
||||
release since I have acquired ownership of the nano pages
|
||||
on SourceForge. Here's hoping SF will get us some more
|
||||
visibilitiy, translators and patches.
|
||||
visibility, translators and patches.
|
||||
|
||||
03/12/2000 - After a hiatus, I have finally moved (not unpacked though)
|
||||
to my new home into albany. Thus I should now have more
|
||||
to my new home into Albany. Thus I should now have more
|
||||
time to work on nano. Nano 0.8.8, the "dear god what
|
||||
broke this time?" release, incorporates patches for both
|
||||
i18n and many bugfixes. It is VERY likely something broke
|
||||
@@ -307,8 +354,8 @@
|
||||
|
||||
I would like to announce that I'm going to need
|
||||
translations soonish, so if you are fluent in other
|
||||
languages than english (or even better, if your native
|
||||
language is not english) and you would like to submit a
|
||||
languages than English (or even better, if your native
|
||||
language is not English) and you would like to submit a
|
||||
translation file to me, please feel free to do so. If you
|
||||
do, I will list your name and email in the AUTHORS file as
|
||||
the maintainer of the .po file, and from then on it is
|
||||
@@ -316,9 +363,9 @@
|
||||
|
||||
03/01/2000 - Well, to continue my trend of going back on my previous
|
||||
release's comments, nano 0.8.7 is released. The crashing
|
||||
behavior was still occuring, and this most recent fix also
|
||||
behavior was still occurring, and this most recent fix also
|
||||
fixes some other wrapping problems, so here you go.
|
||||
There may be another relase soon, there may not be, is
|
||||
There may be another release soon, there may not be, is
|
||||
that vague enough? =)
|
||||
|
||||
02/25/2000 - More minor bugfixes in 0.8.6, the bizarre behavior at the end
|
||||
@@ -345,11 +392,11 @@
|
||||
but I may be changing jobs very soon. I will release
|
||||
version 0.8.2 as is (no i18n, no help menu (yet). I
|
||||
expect things to settle down by the end of next week, and
|
||||
then I can try to start on the i18n support and help menu,
|
||||
then I can try to start on the i18n support and help menu;
|
||||
look for these new features in version 0.8.5 to 0.9.0.
|
||||
|
||||
01/28/2000 - Nano 0.8.1 marks our first official step toward
|
||||
internationaliation (i18n) and the help system (^G). I
|
||||
internationalization (i18n) and the help system (^G). I
|
||||
will be merging in Jordi's patches for initial i18n in the
|
||||
next version, and will implement the help system with
|
||||
i18n built into it shortly after that. Please don't
|
||||
@@ -358,14 +405,14 @@
|
||||
|
||||
01/25/2000 - Nano 0.8.0 is officially the 'let's try and be at least a
|
||||
little portable, mmmmkay?' release. There are many
|
||||
portability checks and fixes, many thanks to Andy Kahn for
|
||||
portability checks and fixes; many thanks to Andy Kahn for
|
||||
his patches. I removed the broken do_spell behavior with
|
||||
the 'spell' program, for now we only try to call 'ispell'
|
||||
the 'spell' program; for now, we only try to call 'ispell'
|
||||
until I write a better method to handle the output of the
|
||||
normal 'spell' command.
|
||||
|
||||
01/24/2000 - Nano 0.7.9 features many new features. Among them are a
|
||||
new autoindent feature (-i, --autoondent), tempfile
|
||||
new autoindent feature (-i, --autoindent), tempfile
|
||||
flag like Pico's -t flag (-t, --tempfile), and preliminary
|
||||
spelling program support. The spelling function tries
|
||||
to run 'spell' and then 'ispell' in that order, but you
|
||||
@@ -378,7 +425,7 @@
|
||||
all the changes in this release will cause a few bugs, so
|
||||
0.7.8 will primarily be about fixing those bugs.
|
||||
|
||||
Things added this release include resizeability (kinda),
|
||||
Things added this release include resizability (kinda),
|
||||
new -x and -c flags (see nano -h for help), long command
|
||||
line flag support, and the usual array of bugfixes.
|
||||
|
||||
|
||||
39
README
39
README
@@ -1,6 +1,6 @@
|
||||
|
||||
GNU nano - an enhanced clone of the Pico text editor.
|
||||
|
||||
|
||||
Overview
|
||||
|
||||
The nano project was started because of a few "problems" with the
|
||||
@@ -11,10 +11,10 @@ Overview
|
||||
redistribution. Because of this, Pine and Pico are not included with
|
||||
many GNU/Linux distributions. Also, other features (like goto line
|
||||
number or search and replace) were unavailable until recently or
|
||||
require a command-line flag. Yuck.
|
||||
require a command line flag. Yuck.
|
||||
|
||||
nano aims to solve these problems by emulating the functionality of
|
||||
Pico as closely as possible while adressing the problems above and
|
||||
Pico as closely as possible while addressing the problems above and
|
||||
perhaps providing other extra functionality.
|
||||
|
||||
The nano editor is now an official GNU package. For more information
|
||||
@@ -29,7 +29,7 @@ How to compile and install nano
|
||||
make
|
||||
make install
|
||||
|
||||
It's that simple. Use --prefix with configutr to override the
|
||||
It's that simple. Use --prefix with configure to override the
|
||||
default installation directory of /usr/local.
|
||||
|
||||
Web Page
|
||||
@@ -53,11 +53,32 @@ Mailing List and Bug Reports
|
||||
|
||||
Current Status
|
||||
|
||||
GNU nano has finally reached its first stable release (1.0).
|
||||
The development tree will fork soon and it will be called 1.1.x,
|
||||
in the Linux kernel naming style. Many thanks to all of our
|
||||
bug reporters and contributors of code to get nano where it is
|
||||
today.
|
||||
This is the 1.1 or unstable branch of nano. New features
|
||||
will be added and things will be changed around and basically
|
||||
stability is not guaranteed. If this is not what you're
|
||||
interested in, please use the latest 1.0.x release of nano.
|
||||
|
||||
New features in this branch include:
|
||||
+ .nanorc file support (--enable-nanorc configure option,
|
||||
see sample.nanorc file)
|
||||
+ Negative -r value for "#cols from right", allows dynamic adjustment
|
||||
of wrap margin based on window size.
|
||||
+ Write marked text to separate file (^O after selecting with ^^).
|
||||
+ Append to file (Meta-A at write file menu).
|
||||
+ Multiple file buffers! (--enable-multibuffer configure option,
|
||||
--multibuffer, -F cmdline flag, Meta-F toggle, then ^R to load).
|
||||
+ Better compatibility with Pico. Mouse mode now supports clicking
|
||||
shortcuts and files in browser, search toggles that are Pico
|
||||
extensions moved to Meta keys so as to not interfere with Pico
|
||||
control sequences.
|
||||
+ Smooth scrolling through files, instead of the jerky half-page
|
||||
down, half-page up method. This is available by using the
|
||||
-S or --smooth switch, or the Meta-S toggle.
|
||||
+ Better non-*nix file support. GNU nano now automatically
|
||||
converts files from DOS format or Mac format to standard file
|
||||
format. It can also write files in either format by using the
|
||||
appropriate command line (-D, --dos or -M, --mac) or toggle
|
||||
(Meta-D, Meta-O).
|
||||
|
||||
Chris Allegretta (chrisa@asty.org)
|
||||
|
||||
|
||||
37
THANKS
Normal file
37
THANKS
Normal file
@@ -0,0 +1,37 @@
|
||||
The following people have helped GNU nano in some way or another.
|
||||
If we missed you here, let us now!
|
||||
|
||||
Marco Colombo <magicdice@inwind.it> Italian Translator
|
||||
Karl Eichwalder <keichwa@gmx.net> German Translator
|
||||
Tedi Heriyanto <tedi_h@gmx.net> Indonesian Translator
|
||||
Václav Haisman <V.Haisman@sh.cvut.cz> Czech Translator
|
||||
Szabolcs Horvath <horvaths@janus.gimsz.sulinet.hu>
|
||||
Hungarian Translator
|
||||
Eivind Kjørstad <ekj@vestdata.no> Norwegian (Bokmål) Translator
|
||||
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
|
||||
Christian Rose <menthos@menthos.com> Swedish Translator
|
||||
Keld Simonsen <keld@dkuug.dk> Danish Translator
|
||||
Guus Sliepen <guus@nl.linux.org> Dutch Translator
|
||||
Pierre Tane <tanep@bigfoot.com> French Translator
|
||||
Jacobo Tarrío <jtarrio@trasno.net> Galician Translator
|
||||
Miquel Vidal <miquel@sindominio.net> Catalan Translator
|
||||
Pauli Virtanen <pauli.virtanen@saunalahti.fi> Finnish Translator
|
||||
|
||||
Jim Knoble <jmknoble@pobox.com> Pico compat for browser
|
||||
Thomas Dickey <dickey@herndon4.his.com> Curses help and advice
|
||||
Ryan Krebs <fluffy@highwire.stanford.edu> Many bug fixes and testing
|
||||
Ken Tyler <kent@werple.net.au> Super bug tester and advice
|
||||
David Lawrence Ramsey <pooka_regent@sluggy.net> Patches galore
|
||||
Bill Soudan <wes0472@rit.edu> Regex code, etc
|
||||
Ben Armstrong <synrg@sanctuary.nslug.ns.ca> Negative -r value idea, code
|
||||
Jeremy Robichaud <robicj@yahoo.com> Beta tester
|
||||
Roy Lanek <lanek@ranahminang.net> Advice and advocacy
|
||||
Sven Guckes <guckes@math.fu-berlin.de> Advice and Advocacy
|
||||
Neil Parks <nparks@acsmail.com> Bug reports n fixes
|
||||
Chuck Mead <csm@MoonGroup.com> Feedback and RPM stuff
|
||||
Mike Melanson <melanson@pcisys.net> Bugs
|
||||
|
||||
|
||||
$Id$
|
||||
8
TODO
8
TODO
@@ -25,5 +25,13 @@ For Next Version:
|
||||
- .nanorc ?????
|
||||
- Backup making (filename~)?
|
||||
- Search (etc) string history [1.1]
|
||||
- Implement Pico's -j and -g flags, as they are pretty easy to do.
|
||||
- Make mouse support work with clicking on the shortcuts (-m). Must
|
||||
make global variable pointing to current shortcut list to determine what
|
||||
keystroke to ungetch(). [DONE].
|
||||
- Implement -o (chroot of sorts)
|
||||
- Allow -r to take a negative argument, meaning right margin instead of
|
||||
left (allows resizing that way), formerly -W arg. [DONE]
|
||||
- UTF-8 support.
|
||||
|
||||
$Id$
|
||||
|
||||
24
acconfig.h
24
acconfig.h
@@ -47,3 +47,27 @@
|
||||
|
||||
/* 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
|
||||
|
||||
226
aclocal.m4
vendored
226
aclocal.m4
vendored
@@ -125,6 +125,99 @@ for am_file in <<$1>>; do
|
||||
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
|
||||
|
||||
@@ -330,9 +423,11 @@ main ()
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 5
|
||||
# serial 108
|
||||
|
||||
AC_DEFUN(AM_WITH_NLS,
|
||||
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,
|
||||
@@ -343,9 +438,21 @@ AC_DEFUN(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)
|
||||
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],
|
||||
@@ -370,23 +477,19 @@ AC_DEFUN(AM_WITH_NLS,
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" != "yes"; then
|
||||
AC_CHECK_LIB(intl, bindtextdomain,
|
||||
[AC_CACHE_CHECK([for gettext in libintl],
|
||||
gt_cv_func_gettext_libintl,
|
||||
[AC_CHECK_LIB(intl, gettext,
|
||||
gt_cv_func_gettext_libintl=yes,
|
||||
gt_cv_func_gettext_libintl=no)],
|
||||
gt_cv_func_gettext_libintl=no)])
|
||||
[AC_CHECK_LIB(intl, gettext)])
|
||||
fi
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" = "yes" \
|
||||
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETTEXT)
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
|| 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)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
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],
|
||||
@@ -410,16 +513,17 @@ AC_DEFUN(AM_WITH_NLS,
|
||||
dnl No gettext in C library. Try catgets next.
|
||||
AC_CHECK_LIB(i, main)
|
||||
AC_CHECK_FUNC(catgets,
|
||||
[AC_DEFINE(HAVE_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
|
||||
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
|
||||
NANO_AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
|
||||
fi
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
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
|
||||
@@ -444,10 +548,10 @@ AC_DEFUN(AM_WITH_NLS,
|
||||
if test "$nls_cv_use_gnu_gettext" = "yes"; then
|
||||
dnl Mark actions used to generate GNU NLS library.
|
||||
INTLOBJS="\$(GETTOBJS)"
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
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)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
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
|
||||
@@ -481,6 +585,10 @@ AC_DEFUN(AM_WITH_NLS,
|
||||
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*)
|
||||
@@ -517,7 +625,7 @@ AC_DEFUN(AM_WITH_NLS,
|
||||
AC_SUBST(POSUB)
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_GNU_GETTEXT,
|
||||
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
|
||||
@@ -539,11 +647,11 @@ strdup __argz_count __argz_stringify __argz_next])
|
||||
AC_CHECK_FUNCS(stpcpy)
|
||||
fi
|
||||
if test "${ac_cv_func_stpcpy}" = "yes"; then
|
||||
AC_DEFINE(HAVE_STPCPY)
|
||||
AC_DEFINE(HAVE_STPCPY, 1, [Define to 1 if you have the stpcpy function.])
|
||||
fi
|
||||
|
||||
AM_LC_MESSAGES
|
||||
AM_WITH_NLS
|
||||
NANO_AM_LC_MESSAGES
|
||||
NANO_AM_WITH_NLS
|
||||
|
||||
if test "x$CATOBJEXT" != "x"; then
|
||||
if test "x$ALL_LINGUAS" = "x"; then
|
||||
@@ -624,15 +732,14 @@ strdup __argz_count __argz_stringify __argz_next])
|
||||
dnl Generate list of files to be processed by xgettext which will
|
||||
dnl be included in po/Makefile.
|
||||
test -d po || mkdir po
|
||||
if test "x$srcdir" != "x."; then
|
||||
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
|
||||
posrcprefix="$srcdir/"
|
||||
else
|
||||
posrcprefix="../$srcdir/"
|
||||
fi
|
||||
else
|
||||
posrcprefix="../"
|
||||
fi
|
||||
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
|
||||
@@ -648,6 +755,54 @@ strdup __argz_count __argz_stringify __argz_next])
|
||||
|
||||
# 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,
|
||||
@@ -694,15 +849,18 @@ AC_SUBST($1)dnl
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 1
|
||||
# serial 2
|
||||
|
||||
AC_DEFUN(AM_LC_MESSAGES,
|
||||
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)
|
||||
AC_DEFINE(HAVE_LC_MESSAGES, 1,
|
||||
[Define if your locale.h file contains LC_MESSAGES.])
|
||||
fi
|
||||
fi])
|
||||
|
||||
|
||||
123
color.c
Normal file
123
color.c
Normal file
@@ -0,0 +1,123 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* color.c *
|
||||
* *
|
||||
* 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) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
#include <libintl.h>
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
void color_on(WINDOW *win, int whatever)
|
||||
{
|
||||
/* Temporary fallback, if the color value hasn't been set,
|
||||
turn on hilighting */
|
||||
if (!colors[whatever - FIRST_COLORNUM].set) {
|
||||
wattron(win, A_REVERSE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (colors[whatever - FIRST_COLORNUM].bold)
|
||||
wattron(win, A_BOLD);
|
||||
|
||||
/* If the foreground color is black, we've switched fg and bg (see
|
||||
the comment in colorinit_one() about this) so turn on reverse so
|
||||
it looks like it's supposed to */
|
||||
if (colors[whatever - FIRST_COLORNUM].fg == COLOR_BLACK)
|
||||
wattron(win, A_REVERSE);
|
||||
|
||||
wattron(win, COLOR_PAIR(whatever));
|
||||
|
||||
}
|
||||
|
||||
void color_off(WINDOW *win, int whatever)
|
||||
{
|
||||
if (!colors[whatever - FIRST_COLORNUM].set) {
|
||||
wattroff(win, A_REVERSE);
|
||||
return;
|
||||
}
|
||||
|
||||
wattroff(win, COLOR_PAIR(whatever));
|
||||
|
||||
if (colors[whatever - FIRST_COLORNUM].fg == COLOR_BLACK)
|
||||
wattroff(win, A_REVERSE);
|
||||
|
||||
if (colors[whatever - FIRST_COLORNUM].bold)
|
||||
wattroff(win, A_BOLD);
|
||||
}
|
||||
|
||||
|
||||
void colorinit_one(int colortoset, short fg, short bg, int bold)
|
||||
{
|
||||
colors[colortoset - FIRST_COLORNUM].fg = fg;
|
||||
colors[colortoset - FIRST_COLORNUM].bg = bg;
|
||||
colors[colortoset - FIRST_COLORNUM].bold = bold;
|
||||
colors[colortoset - FIRST_COLORNUM].set = 1;
|
||||
|
||||
/* Okay, so if they want a black foreground, do a switch on the fg
|
||||
and bg, because specifying black as the foreground color gives
|
||||
this ugly grey color. Then in color_on we will turn A_REVERSE
|
||||
which is probably what they want it to look like... */
|
||||
if (fg == COLOR_BLACK)
|
||||
init_pair(colortoset, bg, fg);
|
||||
else
|
||||
init_pair(colortoset, fg, bg);
|
||||
}
|
||||
|
||||
int do_colorinit(void)
|
||||
{
|
||||
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();
|
||||
#endif
|
||||
/* Some defaults values to play with */
|
||||
|
||||
/* Okay I'll be nice and comment these out for the commit =)
|
||||
colorinit_one(COLOR_TITLEBAR, COLOR_GREEN, COLOR_BLUE, 1);
|
||||
colorinit_one(COLOR_BOTTOMBARS, COLOR_GREEN, COLOR_BLUE, 1);
|
||||
colorinit_one(COLOR_STATUSBAR, COLOR_BLACK, COLOR_CYAN, 0);
|
||||
colorinit_one(COLOR_TEXT, COLOR_WHITE, COLOR_BLACK, 0);
|
||||
colorinit_one(COLOR_MARKER, COLOR_BLACK, COLOR_CYAN, 0);
|
||||
*/
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
1183
config.guess
vendored
Normal file
1183
config.guess
vendored
Normal file
File diff suppressed because it is too large
Load Diff
63
config.h.in
63
config.h.in
@@ -61,21 +61,6 @@
|
||||
/* Define this if your curses lib has the _use_keypad flag */
|
||||
#undef HAVE_USEKEYPAD
|
||||
|
||||
/* Define this if you have NLS */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define this is you have the catgets command */
|
||||
#undef HAVE_CATGETS
|
||||
|
||||
/* Define this is you have GNU gettext */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Define this for HAVE_LC_MESSAGES */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
||||
/* Define this if you have the stpcpy function (cool) */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define this to make the nano executable as small as possible */
|
||||
#undef NANO_SMALL
|
||||
|
||||
@@ -100,6 +85,30 @@
|
||||
/* 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
|
||||
|
||||
@@ -199,9 +208,33 @@
|
||||
/* 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
|
||||
|
||||
|
||||
1268
config.sub
vendored
Normal file
1268
config.sub
vendored
Normal file
File diff suppressed because it is too large
Load Diff
72
configure.in
72
configure.in
@@ -1,13 +1,14 @@
|
||||
# $Id$
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(nano.c)
|
||||
AM_INIT_AUTOMAKE(nano, 1.0.0)
|
||||
AM_INIT_AUTOMAKE(nano, 1.1.2)
|
||||
AM_CONFIG_HEADER(config.h:config.h.in)
|
||||
ALL_LINGUAS="es de fr it id fi hu ca cs"
|
||||
ALL_LINGUAS="es de fr it id fi hu ca cs gl uk ru sv no nl da"
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_ISC_POSIX
|
||||
NANO_AC_SYS_LARGEFILE
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
@@ -15,7 +16,7 @@ AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h
|
||||
|
||||
dnl options
|
||||
AC_ARG_ENABLE(tiny,
|
||||
[ --enable-tiny Disables features for the sake of size
|
||||
[ --enable-tiny Disable features for the sake of size
|
||||
(currently disables detailed help and i18n)],
|
||||
[if test x$enableval = xyes; then
|
||||
AC_DEFINE(NANO_SMALL) tiny_support=yes
|
||||
@@ -24,16 +25,52 @@ AC_ARG_ENABLE(tiny,
|
||||
AC_DEFINE(DISABLE_HELP)
|
||||
AC_DEFINE(DISABLE_JUSTIFY)
|
||||
AC_DEFINE(DISABLE_BROWSER)
|
||||
AC_DEFINE(DISABLE_MOUSE)
|
||||
AC_DEFINE(DISABLE_OPERATINGDIR)
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(extra,
|
||||
[ --enable-extra Enable extra (optional) functions, including easter eggs],
|
||||
[if test x$enableval = xyes; then
|
||||
AC_DEFINE(NANO_EXTRA) extra_support=yes
|
||||
AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes
|
||||
AC_DEFINE(ENABLE_UNDO) undo_support=yes
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(undo,
|
||||
[ --enable-undo Enable undo support],
|
||||
[if test x$enableval = xyes && test x$tiny_support != xyes; then
|
||||
AC_DEFINE(ENABLE_UNDO) undo_support=yes
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(multibuffer,
|
||||
[ --enable-multibuffer Enable multiple file buffers; this is disabled if --enable-tiny is used],
|
||||
[if test x$enableval = xyes && test x$tiny_support != xyes; then
|
||||
AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(nanorc,
|
||||
[ --enable-nanorc Enable use of .nanorc file],
|
||||
[if test x$enableval = xyes; then
|
||||
AC_DEFINE(ENABLE_NANORC) nanorc_support=yes
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(color,
|
||||
[ --enable-color Enable color and syntax highlighting],
|
||||
[if test x$enableval = xyes; then
|
||||
AC_DEFINE(ENABLE_NANORC) nanorc_support=yes
|
||||
AC_DEFINE(ENABLE_COLOR) color_support=yes
|
||||
AC_MSG_WARN([
|
||||
|
||||
***********************************************************************
|
||||
*** WARNING: Color support is currently BROKEN. Don't expect it to ***
|
||||
*** work AT ALL until more is implemented. ***
|
||||
***********************************************************************
|
||||
])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(tabcomp,
|
||||
[ --disable-tabcomp Disables tab completion code for a smaller binary],
|
||||
[ --disable-tabcomp Disable tab completion code for a smaller binary],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_TABCOMP)
|
||||
fi])
|
||||
@@ -45,23 +82,41 @@ AC_ARG_ENABLE(justify,
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(speller,
|
||||
[ --disable-speller Disables spell checker function],
|
||||
[ --disable-speller Disable spell checker function],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_SPELLER)
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(help,
|
||||
[ --disable-help Disables help function (^G)],
|
||||
[ --disable-help Disable help function (^G)],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_HELP)
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(browser,
|
||||
[ --disable-browser Disables mini file browser],
|
||||
[ --disable-browser Disable mini file browser],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_BROWSER)
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(wrapping,
|
||||
[ --disable-wrapping Disable all wrapping of text (and -w flag)],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_WRAPPING)
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(mouse,
|
||||
[ --disable-mouse Disable mouse support (and -m flag)],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_MOUSE)
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(operatingdir,
|
||||
[ --disable-operatingdir Disable setting of operating directory (chroot of sorts)],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_OPERATINGDIR)
|
||||
fi])
|
||||
|
||||
AC_MSG_CHECKING([whether to use slang])
|
||||
CURSES_LIB_NAME=""
|
||||
AC_ARG_WITH(slang,
|
||||
@@ -211,6 +266,7 @@ else
|
||||
fi
|
||||
|
||||
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [AC_DEFINE(HAVE_USE_DEFAULT_COLORS)])
|
||||
if test x$slang_support != xyes; then
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, [AC_DEFINE(HAVE_WRESIZE)])
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [AC_DEFINE(HAVE_RESIZETERM)])
|
||||
@@ -248,6 +304,6 @@ then
|
||||
fi
|
||||
|
||||
dnl i18n stuff - pretty incomplete for now
|
||||
AM_GNU_GETTEXT
|
||||
NANO_AM_GNU_GETTEXT
|
||||
|
||||
AC_OUTPUT([Makefile intl/Makefile po/Makefile.in])
|
||||
|
||||
222
cut.c
222
cut.c
@@ -19,10 +19,11 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "config.h"
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
@@ -38,15 +39,12 @@ static filestruct *cutbottom = NULL; /* Pointer to end of cutbuffer */
|
||||
|
||||
void add_to_cutbuffer(filestruct * inptr)
|
||||
{
|
||||
filestruct *tmp;
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("add_to_cutbuffer called with inptr->data = %s\n"),
|
||||
inptr->data);
|
||||
#endif
|
||||
|
||||
totsize -= strlen(inptr->data);
|
||||
tmp = cutbuffer;
|
||||
if (cutbuffer == NULL) {
|
||||
cutbuffer = inptr;
|
||||
inptr->prev = NULL;
|
||||
@@ -60,28 +58,76 @@ void add_to_cutbuffer(filestruct * inptr)
|
||||
}
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Cut a marked segment instead of a whole line. Only called from
|
||||
do_cut_text().
|
||||
destructive is whether to actually modify the file structure, if not then
|
||||
just copy the buffer into cutbuffer and don't pull it from the file */
|
||||
|
||||
void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
|
||||
int bot_x)
|
||||
int bot_x, int destructive)
|
||||
{
|
||||
filestruct *tmp, *next;
|
||||
filestruct *tmp, *next, *botcopy;
|
||||
char *tmpstr;
|
||||
int newsize;
|
||||
|
||||
/* Special case for cutting part of one line */
|
||||
if (top == bot) {
|
||||
int swap;
|
||||
|
||||
tmp = copy_node(top);
|
||||
newsize = abs(bot_x - top_x) + 1;
|
||||
tmpstr = charalloc(newsize + 1);
|
||||
|
||||
/* Make top_x always be before bot_x */
|
||||
if (top_x > bot_x) {
|
||||
swap = top_x;
|
||||
top_x = bot_x;
|
||||
bot_x = swap;
|
||||
}
|
||||
|
||||
strncpy(tmpstr, &top->data[top_x], newsize);
|
||||
|
||||
if (destructive) {
|
||||
memmove(&top->data[top_x], &top->data[bot_x],
|
||||
strlen(&top->data[bot_x]) + 1);
|
||||
align(&top->data);
|
||||
current_x = top_x;
|
||||
update_cursor();
|
||||
}
|
||||
tmpstr[newsize - 1] = 0;
|
||||
tmp->data = tmpstr;
|
||||
add_to_cutbuffer(tmp);
|
||||
dump_buffer(cutbuffer);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set up the beginning of the cutbuffer */
|
||||
tmp = copy_node(top);
|
||||
tmpstr = nmalloc(strlen(&top->data[top_x]) + 1);
|
||||
tmpstr = charalloc(strlen(&top->data[top_x]) + 1);
|
||||
strcpy(tmpstr, &top->data[top_x]);
|
||||
free(tmp->data);
|
||||
tmp->data = tmpstr;
|
||||
|
||||
/* Chop off the end of the first line */
|
||||
tmpstr = nmalloc(top_x + 1);
|
||||
tmpstr = charalloc(top_x + 1);
|
||||
strncpy(tmpstr, top->data, top_x);
|
||||
free(top->data);
|
||||
top->data = tmpstr;
|
||||
|
||||
if (destructive) {
|
||||
free(top->data);
|
||||
top->data = tmpstr;
|
||||
}
|
||||
|
||||
do {
|
||||
next = tmp->next;
|
||||
add_to_cutbuffer(tmp);
|
||||
if (destructive)
|
||||
add_to_cutbuffer(tmp);
|
||||
else {
|
||||
filestruct *tmpcopy = NULL;
|
||||
|
||||
tmpcopy = copy_node(tmp);
|
||||
add_to_cutbuffer(tmpcopy);
|
||||
}
|
||||
totlines--;
|
||||
totsize--; /* newline (add_to_cutbuffer doesn't count newlines) */
|
||||
tmp = next;
|
||||
@@ -91,40 +137,56 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
|
||||
dump_buffer(cutbuffer);
|
||||
if (next == NULL)
|
||||
return;
|
||||
|
||||
/* Now, paste bot[bot_x] into top[top_x] */
|
||||
tmpstr = nmalloc(strlen(top->data) + strlen(&bot->data[bot_x]));
|
||||
strncpy(tmpstr, top->data, top_x);
|
||||
strcpy(&tmpstr[top_x], &bot->data[bot_x]);
|
||||
free(top->data);
|
||||
top->data = tmpstr;
|
||||
if (destructive) {
|
||||
|
||||
null_at(bot->data, bot_x);
|
||||
next = bot->next;
|
||||
tmpstr = charalloc(strlen(top->data) + strlen(&bot->data[bot_x]));
|
||||
strncpy(tmpstr, top->data, top_x);
|
||||
strcpy(&tmpstr[top_x], &bot->data[bot_x]);
|
||||
free(top->data);
|
||||
top->data = tmpstr;
|
||||
|
||||
/* We explicitly don't decrement totlines here because we don't snarf
|
||||
* up a newline when we're grabbing the last line of the mark. For
|
||||
* the same reason we don't do an extra totsize decrement */
|
||||
|
||||
add_to_cutbuffer(bot);
|
||||
top->next = next;
|
||||
if (next != NULL)
|
||||
next->prev = top;
|
||||
|
||||
dump_buffer(cutbuffer);
|
||||
renumber(top);
|
||||
current = top;
|
||||
current_x = top_x;
|
||||
|
||||
/* If we're hitting the end of the buffer we should clean that up. */
|
||||
if (bot == filebot) {
|
||||
if (next != NULL) {
|
||||
filebot = next;
|
||||
} else {
|
||||
filebot = top;
|
||||
}
|
||||
/* We explicitly don't decrement totlines here because we don't snarf
|
||||
* up a newline when we're grabbing the last line of the mark. For
|
||||
* the same reason, we don't do an extra totsize decrement. */
|
||||
}
|
||||
|
||||
/* I honestly do not know why this is needed. After many hours of
|
||||
using gdb on an OpenBSD box, I can honestly say something is
|
||||
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);
|
||||
next = botcopy->next;
|
||||
add_to_cutbuffer(botcopy);
|
||||
|
||||
|
||||
if (destructive) {
|
||||
free(bot);
|
||||
|
||||
top->next = next;
|
||||
if (next != NULL)
|
||||
next->prev = top;
|
||||
|
||||
dump_buffer(cutbuffer);
|
||||
renumber(top);
|
||||
current = top;
|
||||
current_x = top_x;
|
||||
|
||||
/* If we're hitting the end of the buffer, we should clean that up. */
|
||||
if (bot == filebot) {
|
||||
if (next != NULL) {
|
||||
filebot = next;
|
||||
} else {
|
||||
filebot = top;
|
||||
if (top_x > 0)
|
||||
new_magicline();
|
||||
}
|
||||
}
|
||||
if (top->lineno < edittop->lineno)
|
||||
edit_update(top, CENTER);
|
||||
}
|
||||
if (top->lineno < edittop->lineno)
|
||||
edit_update(top, CENTER);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -132,10 +194,11 @@ int do_cut_text(void)
|
||||
{
|
||||
filestruct *tmp, *fileptr = current;
|
||||
#ifndef NANO_SMALL
|
||||
char *tmpstr;
|
||||
int newsize, cuttingtoend = 0;
|
||||
int cuttingpartialline = 0;
|
||||
int cuttingtoend = 0;
|
||||
#endif
|
||||
|
||||
|
||||
check_statblank();
|
||||
if (fileptr == NULL || fileptr->data == NULL)
|
||||
return 0;
|
||||
@@ -146,6 +209,7 @@ int do_cut_text(void)
|
||||
free_filestruct(cutbuffer);
|
||||
cutbuffer = NULL;
|
||||
|
||||
marked_cut = 0;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("Blew away cutbuffer =)\n"));
|
||||
#endif
|
||||
@@ -158,6 +222,23 @@ int do_cut_text(void)
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(CUT_TO_END) && !ISSET(MARK_ISSET)) {
|
||||
if (current_x == strlen(current->data)) {
|
||||
|
||||
/* If the line is empty and we didn't just cut a non-blank
|
||||
line, create a dummy line and add it to the cutbuffer */
|
||||
if (marked_cut != 1 && current->next != filebot) {
|
||||
|
||||
filestruct *junk;
|
||||
|
||||
junk = NULL;
|
||||
junk = make_new_node(current);
|
||||
junk->data = nmalloc(1 * sizeof (char));
|
||||
junk->data[0] = 0;
|
||||
|
||||
add_to_cutbuffer(junk);
|
||||
dump_buffer(cutbuffer);
|
||||
|
||||
}
|
||||
|
||||
do_delete();
|
||||
SET(KEEP_CUTBUFFER);
|
||||
marked_cut = 2;
|
||||
@@ -172,42 +253,22 @@ int do_cut_text(void)
|
||||
}
|
||||
}
|
||||
if (ISSET(MARK_ISSET)) {
|
||||
if (current->lineno == mark_beginbuf->lineno) {
|
||||
tmp = copy_node(current);
|
||||
newsize = abs(mark_beginx - current_x) + 1;
|
||||
|
||||
tmpstr = nmalloc(newsize + 1);
|
||||
if (current_x < mark_beginx) {
|
||||
strncpy(tmpstr, ¤t->data[current_x], newsize);
|
||||
memmove(¤t->data[current_x],
|
||||
¤t->data[mark_beginx],
|
||||
strlen(¤t->data[mark_beginx]) + 1);
|
||||
} else {
|
||||
strncpy(tmpstr, ¤t->data[mark_beginx], newsize);
|
||||
memmove(¤t->data[mark_beginx],
|
||||
¤t->data[current_x],
|
||||
strlen(¤t->data[current_x]) + 1);
|
||||
current_x = mark_beginx;
|
||||
update_cursor();
|
||||
}
|
||||
tmpstr[newsize - 1] = 0;
|
||||
tmp->data = tmpstr;
|
||||
add_to_cutbuffer(tmp);
|
||||
dump_buffer(cutbuffer);
|
||||
align(¤t->data);
|
||||
} else if (current->lineno < mark_beginbuf->lineno)
|
||||
if (current->lineno <= mark_beginbuf->lineno) {
|
||||
if (current->lineno == mark_beginbuf->lineno)
|
||||
cuttingpartialline = 1;
|
||||
cut_marked_segment(current, current_x, mark_beginbuf,
|
||||
mark_beginx);
|
||||
mark_beginx, 1);
|
||||
}
|
||||
else
|
||||
cut_marked_segment(mark_beginbuf, mark_beginx, current,
|
||||
current_x);
|
||||
current_x, 1);
|
||||
|
||||
placewewant = xplustabs();
|
||||
UNSET(MARK_ISSET);
|
||||
|
||||
marked_cut = 1;
|
||||
set_modified();
|
||||
if (cuttingtoend)
|
||||
if (cuttingpartialline || cuttingtoend)
|
||||
edit_refresh();
|
||||
else
|
||||
edit_update(current, CENTER);
|
||||
@@ -231,7 +292,7 @@ int do_cut_text(void)
|
||||
} else {
|
||||
add_to_cutbuffer(fileptr);
|
||||
fileage = make_new_node(NULL);
|
||||
fileage->data = nmalloc(1);
|
||||
fileage->data = charalloc(1);
|
||||
fileage->data[0] = '\0';
|
||||
current = fileage;
|
||||
}
|
||||
@@ -294,7 +355,7 @@ int do_uncut_text(void)
|
||||
/* If there's only one line in the cutbuffer */
|
||||
if (cutbuffer->next == NULL) {
|
||||
tmpstr =
|
||||
nmalloc(strlen(current->data) + strlen(cutbuffer->data) +
|
||||
charalloc(strlen(current->data) + strlen(cutbuffer->data) +
|
||||
1);
|
||||
strncpy(tmpstr, current->data, current_x);
|
||||
strcpy(&tmpstr[current_x], cutbuffer->data);
|
||||
@@ -303,19 +364,21 @@ int do_uncut_text(void)
|
||||
current->data = tmpstr;
|
||||
current_x += strlen(cutbuffer->data);
|
||||
totsize += strlen(cutbuffer->data);
|
||||
if (strlen(cutbuffer->data) == 0)
|
||||
totlines++;
|
||||
|
||||
placewewant = xplustabs();
|
||||
update_cursor();
|
||||
} else { /* yuck -- no kidding! */
|
||||
tmp = current->next;
|
||||
/* New beginning */
|
||||
tmpstr = nmalloc(current_x + strlen(newbuf->data) + 1);
|
||||
tmpstr = charalloc(current_x + strlen(newbuf->data) + 1);
|
||||
strncpy(tmpstr, current->data, current_x);
|
||||
strcpy(&tmpstr[current_x], newbuf->data);
|
||||
totsize += strlen(newbuf->data) + strlen(newend->data) + 1;
|
||||
|
||||
/* New end */
|
||||
tmpstr2 = nmalloc(strlen(newend->data) +
|
||||
tmpstr2 = charalloc(strlen(newend->data) +
|
||||
strlen(¤t->data[current_x]) + 1);
|
||||
strcpy(tmpstr2, newend->data);
|
||||
strcat(tmpstr2, ¤t->data[current_x]);
|
||||
@@ -334,7 +397,7 @@ int do_uncut_text(void)
|
||||
newend->next = tmp;
|
||||
|
||||
/* If tmp isn't null, we're in the middle: update the
|
||||
* prev pointer. If it IS null, we're at the end, update
|
||||
* prev pointer. If it IS null, we're at the end; update
|
||||
* the filebot pointer */
|
||||
|
||||
if (tmp != NULL)
|
||||
@@ -363,15 +426,19 @@ int do_uncut_text(void)
|
||||
screw up all the work we just did and separate the line. There
|
||||
must be a better way to do this, but not at 1AM on a work night. */
|
||||
|
||||
if (marked_cut == 2 && current_x != strlen(current->data)) {
|
||||
if (marked_cut == 2) {
|
||||
tmp = make_new_node(current);
|
||||
tmp->data = nmalloc(strlen(¤t->data[current_x]) + 1);
|
||||
tmp->data = charalloc(strlen(¤t->data[current_x]) + 1);
|
||||
strcpy(tmp->data, ¤t->data[current_x]);
|
||||
splice_node(current, tmp, current->next);
|
||||
null_at(current->data, current_x);
|
||||
current = current->next;
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
|
||||
/* Extra line added, update stuff */
|
||||
totlines++;
|
||||
totsize++;
|
||||
}
|
||||
/* Renumber from BEFORE where we pasted ;) */
|
||||
renumber(hold);
|
||||
@@ -380,6 +447,7 @@ int do_uncut_text(void)
|
||||
dump_buffer(cutbuffer);
|
||||
set_modified();
|
||||
edit_refresh();
|
||||
UNSET(KEEP_CUTBUFFER);
|
||||
return 0;
|
||||
#else
|
||||
if (0) {
|
||||
|
||||
178
faq.html
178
faq.html
@@ -24,7 +24,7 @@ nano?</a></font>
|
||||
TIP?</a></font>
|
||||
<br><font color="#330000"><a href="#1.6">1.6. What is the current version
|
||||
of nano?</a></font>
|
||||
<br><font color="#330000"><a href="#1.7">1.7. I want to read the man page
|
||||
<br><font color="#330000"><a href="#1.7">1.7. I want to read the manpage
|
||||
without having to download the program!</a></font></blockquote>
|
||||
|
||||
<h2>
|
||||
@@ -52,7 +52,11 @@ THE HECK DO I DO NOW?</a></font>
|
||||
<br><font color="#330000"><a href="#3.5">3.5. Nano should automatically
|
||||
run strip on the binary when installing it!</a></font>
|
||||
<br><font color="#330000"><a href="#3.6">3.6. How can I make the
|
||||
executable smaller? This is too bloated!</a></font></blockquote>
|
||||
executable smaller? This is too bloated!</a></font>
|
||||
<br><font color="#330000"><a href="#3.7">3.7. Tell me more about this
|
||||
multibuffer stuff!</a></font>
|
||||
<br><font color="#330000"><a href="#3.8">3.8. How do I make a .nanorc file
|
||||
that nano will read when I start it?</a></font></blockquote>
|
||||
|
||||
<h2>
|
||||
<font color="#330000"><a href="#4">4. Running</a></font></h2>
|
||||
@@ -63,11 +67,11 @@ bucky/meta key doesn't seem to work! What can I do?</a></font>
|
||||
<insert keystroke here>!</a></font>
|
||||
<br><font color="#330000"><a href="#4.3">4.3. Nano crashes when I resize
|
||||
my window. How can I fix that?</a></font>
|
||||
<br><font color="#330000"><a href="#4.4">4.4. Why does nano show ^\ and
|
||||
^_ in the shortcut list instead of ^G and ^J?</a></font>
|
||||
<br><font color="#330000"><a href="#4.4">4.4. Why does nano show ^\
|
||||
in the shortcut list instead of ^J?</a></font>
|
||||
<br><font color="#330000"><a href="#4.5">4.5. When I type in a
|
||||
search string, the string I last searched for is already in front of
|
||||
my cursor! !What happened?!</a></font>
|
||||
my cursor! What happened?!</a></font>
|
||||
<br><font color="#330000"><a href="#4.6">4.6. I get the message "NumLock
|
||||
glitch detected. Keypad will malfunction with NumLock off." What
|
||||
gives?</a></font>
|
||||
@@ -156,8 +160,8 @@ to Unix flocked to Pico and Pine because of their well organized, easy
|
||||
to use interfaces. With the proliferation of GNU/Linux in the mid to
|
||||
late 90's, many University students became intimately familiar with the
|
||||
strengths (and weaknesses) of Pine and Pico.</font>
|
||||
<p><b><font color="#330000">Then came debian...</font></b>
|
||||
<p><font color="#330000">The <a href="http://www.debian.org">debian GNU/Linux</a>
|
||||
<p><b><font color="#330000">Then came Debian...</font></b>
|
||||
<p><font color="#330000">The <a href="http://www.debian.org">Debian GNU/Linux</a>
|
||||
distribution, known for its strict standards in distributing truly "free"
|
||||
software (i.e. had no restrictions on redistribution), would not include
|
||||
a binary package for Pine or Pico. Many people had a serious dilemma:
|
||||
@@ -167,9 +171,9 @@ sense of the word.</font>
|
||||
<p><b><font color="#330000">The event...</font></b>
|
||||
<p><font color="#330000">It was in late 1999 when Chris Allegretta (our
|
||||
hero) was yet again complaining to himself about the less-than-perfect
|
||||
license Pico was distributed under, the 10000 makefiles that came with
|
||||
license Pico was distributed under, the 1000 makefiles that came with
|
||||
it and how just a few small improvements could make it the Best Editor
|
||||
in the World (TM). Having been a convert from Slackware to debian,
|
||||
in the World (TM). Having been a convert from Slackware to Debian,
|
||||
he missed having a simple binary package that included Pine and Pico, and
|
||||
had grown tired of downloading them himself.</font>
|
||||
<p><font color="#330000">Finally something snapped inside and Chris coded
|
||||
@@ -177,12 +181,11 @@ and hacked like a madman for many hours straight one weekend to make a
|
||||
(barely usable) Pico clone, at the time called TIP (Tip Isn't Pico).
|
||||
The program could not be invoked without a filename, could not save files,
|
||||
had no help menu, spell checker, and so forth. But over time it improved,
|
||||
and with the help of a few great coders it matured to the almost stable
|
||||
and with the help of a few great coders it matured to the (hopefully) stable
|
||||
state it is today.
|
||||
<p><font color="#330000">In February 2001, nano has been declared an
|
||||
official GNU program by Richard Stallman. Nano is also nearing its 1.0
|
||||
release as of this writing (Valentine's Day 2001).
|
||||
</font></blockquote>
|
||||
official GNU program by Richard Stallman. Nano also reached it's first
|
||||
production release on March 22, 2001.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="1.5"></a><font color="#330000">1.5. Why the name change from TIP?</font></h2>
|
||||
@@ -200,7 +203,7 @@ nano was developed).</font></blockquote>
|
||||
of nano?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The current version of nano *should*
|
||||
be 1.0.0. Of course you should always check the nano hompage to
|
||||
be 1.1.2. Of course you should always check the nano hompage to
|
||||
see what the latest and greatest version is.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
@@ -229,9 +232,6 @@ at the following fine web and ftp sites:</font>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="ftp://ftp.nano-editor.org/pub/nano">ftp://ftp.nano-editor.org/pub/nano</a></font></li>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="ftp://nano.sourceforge.net/pub/nano/">ftp://nano.sourceforge.net/pub/nano</a></font></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
|
||||
@@ -249,9 +249,6 @@ packages.</font></h2>
|
||||
|
||||
<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>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="ftp://nano.sourceforge.net/pub/nano/RPMS">ftp://nano.sourceforge.net/pub/nano/RPMS</a></font></li>
|
||||
</ul>
|
||||
<font color="#330000">Additionally, check out the Redhat contribs section
|
||||
at:</font>
|
||||
@@ -267,19 +264,25 @@ at:</font>
|
||||
<h2>
|
||||
<a NAME="2.3"></a><font color="#330000">2.3. Debian (.deb) packages.</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">For debian users, you can check out the
|
||||
<blockquote><font color="#330000">For Debian users, you can check out the
|
||||
current nano packages for:</font>
|
||||
<ul>
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.debian.org/Packages/stable/editors/nano.html">stable</a></font></li>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.debian.org/Packages/testing/editors/nano.html">testing</a></font></li>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.debian.org/Packages/unstable/editors/nano.html">unstable</a></font></li>
|
||||
</ul>
|
||||
<p><font color="#330000">You can also have a look at the</font>
|
||||
<font color="#330000"><a href="ftp://ftp.debian.org/debian/pool/main/n/nano/">Package Pool</a> to see all the available binary and source packages.</font></p>
|
||||
|
||||
<font color="#330000">Note that versions < 0.9.10 are probably not for
|
||||
those wanting to get serious work done, so until the stable distribution
|
||||
has an updated version of nano, you are best off using the one in unstable
|
||||
for now.</font></blockquote>
|
||||
those wanting to get serious work done, so if you are using Debian 2.2, check
|
||||
that you have updated to 2.2r3, which comes with nano 0.9.23. If you're
|
||||
tracking unstable, you probably have the newest version already.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="2.4"></a><font color="#330000">2.4. By CVS (for the brave).</font></h2>
|
||||
@@ -367,6 +370,9 @@ list:
|
||||
<b>--disable-speller</b> Disables spell checker function
|
||||
<b>--disable-help</b> Disables help function (^G)
|
||||
<b>--disable-browser</b> Disables mini file browser
|
||||
<b>--disable-wrapping</b> Disables all wrapping of text (and -w flag)
|
||||
<b>--disable-mouse</b> Disables mouse support (and -m flag)
|
||||
<b>--disable-operatingdir</b> Disable setting of operating directory
|
||||
</pre><br>
|
||||
There's also the <b>--enable-tiny</b> option which disables everything
|
||||
above, as well as some larger chunks of the program (like the marker code
|
||||
@@ -376,8 +382,49 @@ disable internationalization and save a few K to a few dozen K depending
|
||||
on if you have locale support on your system. And finally there's always
|
||||
good old <b>strip</b> to strip all debugging code and code that exists in
|
||||
libraries on your system.
|
||||
</font></blockquote> <hr WIDTH="100%"> <h1>
|
||||
<a NAME="4"></a><font color="#330000">4. Running</font></h1>
|
||||
<p>If, in the other hand, you can't live without bells and whistles, you could
|
||||
try:
|
||||
<pre>
|
||||
<b>--enable-extra</b> Enable extra functions, including easter eggs
|
||||
<b>--enable-nanorc</b> Enable use of .nanorc file
|
||||
<b>--enable-color</b> Enables color and syntax highlighting
|
||||
<b>--enable-multibuffer</b> Enables having multiple file buffers open
|
||||
</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.7"></a><font color="#330000">
|
||||
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
|
||||
<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
|
||||
with <b>^R</b>. If you always want files to be loaded into their own buffers,
|
||||
use the <b>--multibuffer</b> or <b>-F</b> flag when you invoke nano. <P>
|
||||
|
||||
You can move between the buffers you have open with the <b>Meta-<</b> and
|
||||
<b>Meta-></b> keys, or more easily with <b>Meta-,</b> and <b>Meta-.</b>
|
||||
(clear as mud, right? =-). When you have more than one file buffer open,
|
||||
the ^X shortcut will say "Close", instead of the normal "Exit" when only one
|
||||
buffer is open.
|
||||
</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.8"></a><font color="#330000">
|
||||
3.8. How do I make a .nanorc file that nano will read when I start it?</font></h2>
|
||||
|
||||
<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
|
||||
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,
|
||||
the syntax is simple. Flags are turned on and off by using the word
|
||||
<b>set</b> and the getopt_long flag for the feature, for example "set
|
||||
pico" or "set nowrap". </font></blockquote> <hr WIDTH="100%">
|
||||
|
||||
<h1><a NAME="4"></a><font color="#330000">4. Running</font></h1>
|
||||
|
||||
<h2>
|
||||
<a NAME="4.1"></a><font color="#330000">4.1. Ack! My backspace/delete/enter/double
|
||||
@@ -395,7 +442,8 @@ keystroke here>!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">If you aren't trying some bizarre keystroke
|
||||
combination with some bizarre $TERM entry, chances are you have found a
|
||||
bug. You are welcome to submit it to the nano-devel list or
|
||||
bug. You are welcome to submit it to the
|
||||
<a href="mailto:nano-devel@lists.sourceforge.net">nano-devel</a> list or
|
||||
to <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
@@ -407,19 +455,21 @@ please upgrade to a newer version (at least 0.9.9 would be great, 0.9.12
|
||||
is recommended).</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="4.4"></a><font color="#330000">4.4. Why does nano show ^\ and
|
||||
^_ in the shortcut list instead of ^G and ^J?</font></h2>
|
||||
<a NAME="4.4"></a><font color="#330000">4.4. Why does nano show ^\ in the
|
||||
shortcut list instead of ^J?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The help (^G) and justify (^J) functions
|
||||
<blockquote><font color="#330000">The help (^G) and justify (^J) function
|
||||
were among the last to be written. To show the improvements that
|
||||
nano had over Pico (goto line # and replace), ^_ and ^\ were put on the
|
||||
shortcut list. If you use the <b>-p</b> option to nano you
|
||||
will get the same shortcuts at the bottom as Pico.</font></blockquote>
|
||||
shortcut list. Later, ^G came back in place of ^_ as it proved
|
||||
to be very valuable for new UNIX users. If you use the <b>-p</b> option to
|
||||
nano (or hit Meta-P) you will get the same shortcuts at the bottom as
|
||||
Pico.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a name="4.5"><font color="#330000">4.5. When I type in a search
|
||||
string, the string I last searched for is already in front of my
|
||||
cursor! !What happened?!</font></h2>
|
||||
cursor! What happened?!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">In nano version 0.9.20, the default is
|
||||
to have a completely consistent user interface across all user input
|
||||
@@ -455,7 +505,7 @@ mutt, etc)?</h2>
|
||||
|
||||
<blockquote>You need to make nano your $EDITOR. If you want this
|
||||
to be saved, you should put a line like this in your <b>.bashrc</b> if
|
||||
you use bash:
|
||||
you use bash (or <b>.zshrc</b> if you believe in zsh):
|
||||
<p><b>export EDITOR=/usr/local/bin/nano</b>
|
||||
<p>or if you use tcsh put this in your <b>.cshrc</b> file:
|
||||
<p><b>setenv EDITOR /usr/local/bin/nano</b>
|
||||
@@ -484,20 +534,32 @@ this in your <b>.muttrc</b>:
|
||||
<a NAME="5.1"></a><font color="#330000">5.1. There's no translation for
|
||||
my language!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">So, uh, get someone who speaks your native
|
||||
language to write one =-). Just grab the <b>nano.pot</b> file from
|
||||
the latest and greatest nano distribution (it's in the <b>po/</b> directory)
|
||||
and translate each line into your native language on the <b>msgstr</b>
|
||||
line. Then send it to the nano devel list or <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.</font></blockquote>
|
||||
<blockquote><font color="#330000">On June of 2001, GNU nano entered the
|
||||
<a href="www.iro.umontreal.ca/contrib/po/HTML">Free Translation Project</a>
|
||||
and since then, translations should be managed from there.
|
||||
<p>If there isn't a translation for your language, you could ask
|
||||
<a href="http://www.iro.umontreal.ca/contrib/po/HTML/teams.html">your language
|
||||
team</a> to tranlate nano, or better still, join your team and do it yourself.
|
||||
Joining a team is easy. You just need to ask the
|
||||
<a href="mailto:translation@iro.umontreal.ca">TP coordinator</a> to add you
|
||||
to your team, and send a <a href="http://www.iro.umontreal.ca/contrib/po/HTML/disclaim.html">translation disclaimer to the FSF</a> (this is necessary as
|
||||
nano is an official GNU package, but it does <strong>not</strong> mean that
|
||||
you transfer the rights of your work to the FSF, it's just so the FSF can
|
||||
legaly manage them).</p>
|
||||
<p>In any case, translating nano is very easy. Just grab the
|
||||
<b>nano.pot</b> file from the latest and greatest nano distribution
|
||||
(it's in the <b>po/</b> directory) and translate each line into your native
|
||||
language on the <b>msgstr</b> line. When you're done, you should
|
||||
send it to the TP's central po repository.
|
||||
|
||||
<h2>
|
||||
<a NAME="5.2"></a><font color="#330000">5.2. I don't like the translation
|
||||
for <x> in my language. How can I fix it?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The best way would probably be to e-mail
|
||||
the person listed in the <b><your_language>.po</b> file with your suggested
|
||||
corrections and they can in turn forward it to the nano email address,
|
||||
or the devel list.</font></blockquote>
|
||||
the person listed in the <code>Last-Translator:</code> field in
|
||||
<b><your_language>.po</b> file with your suggested corrections and
|
||||
they can make the changes reach the nano devel list.</font></blockquote>
|
||||
|
||||
<hr WIDTH="100%">
|
||||
<h1>
|
||||
@@ -508,7 +570,7 @@ or the devel list.</font></blockquote>
|
||||
of Pico?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">There are many reasons to use nano instead
|
||||
of Pico, a more complete list can be found at the <a href="http://www.nano-edior.org">nano
|
||||
of Pico, a more complete list can be found at the <a href="http://www.nano-editor.org">nano
|
||||
homepage</a>.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
@@ -521,7 +583,7 @@ of personal preference as to which editor you should use. If you're
|
||||
the type of person who likes using the original version of a program, then
|
||||
Pico is the editor for you. If you're looking for a few more
|
||||
features and a 'better' license as far as adding your own changes (sacrificing
|
||||
mailer integration and a little stability), nano is the way to go.
|
||||
mailer integration with Pine), nano is the way to go.
|
||||
</blockquote>
|
||||
|
||||
<h2>
|
||||
@@ -542,7 +604,7 @@ both, i.e. distribute modified binaries.</blockquote>
|
||||
should I use then?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000"> If you are looking to use a Free
|
||||
Software program similar to PINE and emacs is not your things, you should
|
||||
Software program similar to PINE and emacs is not your thing, you should
|
||||
definitely take a look at <a href="http://www.mutt.org">mutt</a>. It
|
||||
is a full-screen, console based mail program that actually has a lot more
|
||||
flexibility than Pine, but has a keymap included in the distribution that
|
||||
@@ -580,7 +642,7 @@ any changes in the past few years in a positive direction.</font></blockquote>
|
||||
hosted at <a href="http://www.sourceforge.net">SourceForge</a>, nano-announce
|
||||
and nano-devel. Nano-announce is a very low traffic list where new
|
||||
versions of nano are announced (surprise!) Nano-devel is a normally
|
||||
low, sometimes very high traffic list for dicussing the present and future
|
||||
low, sometimes high traffic list for discussing the present and future
|
||||
development of nano. Here are links to where you can sign up for
|
||||
a given list:</font><font color="#330000"></font>
|
||||
<p><font color="#330000">nano-announce - <a href="http://lists.sourceforge.net/mailman/listinfo/nano-announce">http://lists.sourceforge.net/mailman/listinfo/nano-announce</a></font>
|
||||
@@ -618,10 +680,28 @@ to your resume.</font></blockquote>
|
||||
<blockquote><font color="#330000">Re-read Section </font><a href="#7.4">7.4</a><font color="#330000">
|
||||
and you should know the answer.</font></blockquote>
|
||||
|
||||
<h1>
|
||||
<a NAME="8"></a>8. ChangeLog</h1>
|
||||
<h2>
|
||||
<a NAME="8"></a><font color="#330000">8. ChangeLog</font>
|
||||
</h2>
|
||||
|
||||
<blockquote>06/31/2000 - Initial framework.</blockquote>
|
||||
<blockquote>2001/10/02 - Update for Free Translation Project.</blockquote>
|
||||
<blockquote>2001/10/02 - Assorted fixes, Debian additions.</blockquote>
|
||||
<blockquote>2001/06/30 - Silly typo fix.</blockquote>
|
||||
<blockquote>2001/05/05 - Spelling fixes by David Lawrence Ramsey.</blockquote>
|
||||
<blockquote>2001/05/02 - Misc fixes.</blockquote>
|
||||
<blockquote>2001/03/26 - Typo fix in an URL.</blockquote>
|
||||
<blockquote>2001/02/17 - Advocacy updates.</blockquote>
|
||||
<blockquote>2001/02/15 - Added GNU notes for 0.9.99pre3.</blockquote>
|
||||
<blockquote>2001/02/06 - Typo fixes.</blockquote>
|
||||
<blockquote>2001/01/14 - Added note about numlock glitch.</blockquote>
|
||||
<blockquote>2001/01/10 - Linux --> GNU/Linux.</blockquote>
|
||||
<blockquote>2001/01/09 - Added "making exe smaller section.</blockquote>
|
||||
<blockquote>2000/12/19 - Typo and assorted error fixes.</blockquote>
|
||||
<blockquote>2000/11/28 - Added blurb about make install-strip.</blockquote>
|
||||
<blockquote>2000/11/19 - Changed Debian frozen to stable.</blockquote>
|
||||
<blockquote>2000/11/18 - Previous string display (4.5).</blockquote>
|
||||
<blockquote>2000/09/27 - Moved addresses to nano-editor.org.</blockquote>
|
||||
<blockquote>2000/06/31 - Initial framework.</blockquote>
|
||||
<P>
|
||||
$Id$
|
||||
</body>
|
||||
|
||||
215
global.c
215
global.c
@@ -19,8 +19,9 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include "nano.h"
|
||||
#include "proto.h"
|
||||
|
||||
@@ -34,7 +35,7 @@
|
||||
/*
|
||||
* Global variables
|
||||
*/
|
||||
int flags = 0; /* Our new flag containig many options */
|
||||
int flags = 0; /* Our new flag containing many options */
|
||||
WINDOW *edit; /* The file portion of the editor */
|
||||
WINDOW *topwin; /* Top line of screen */
|
||||
WINDOW *bottomwin; /* Bottom buffer */
|
||||
@@ -53,10 +54,14 @@ filestruct *editbot = NULL; /* Same for the bottom */
|
||||
filestruct *filebot = NULL; /* Last node in the file struct */
|
||||
filestruct *cutbuffer = NULL; /* A place to store cut text */
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
filestruct *open_files = NULL; /* The list of open files */
|
||||
#endif
|
||||
|
||||
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 */
|
||||
int placewewant = 0; /* The collum we'd like the cursor
|
||||
int placewewant = 0; /* The column we'd like the cursor
|
||||
to jump to when we go to the
|
||||
next or previous line */
|
||||
|
||||
@@ -70,18 +75,38 @@ char *help_text; /* The text in the help window */
|
||||
filestruct *mark_beginbuf; /* the begin marker buffer */
|
||||
int mark_beginx; /* X value in the string to start */
|
||||
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
char *operating_dir = NULL; /* Operating directory, which we can't go
|
||||
higher than */
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_SPELLER
|
||||
char *alt_speller; /* Alternative spell command */
|
||||
#endif
|
||||
|
||||
shortcut main_list[MAIN_LIST_LEN];
|
||||
shortcut whereis_list[WHEREIS_LIST_LEN];
|
||||
shortcut replace_list[REPLACE_LIST_LEN];
|
||||
shortcut replace_list_2[REPLACE_LIST_LEN]; /* 2nd half of replace dialog */
|
||||
shortcut goto_list[GOTO_LIST_LEN];
|
||||
shortcut gotodir_list[GOTODIR_LIST_LEN];
|
||||
shortcut writefile_list[WRITEFILE_LIST_LEN];
|
||||
shortcut insertfile_list[INSERTFILE_LIST_LEN];
|
||||
shortcut help_list[HELP_LIST_LEN];
|
||||
shortcut spell_list[SPELL_LIST_LEN];
|
||||
#ifndef DISABLE_BROWSER
|
||||
shortcut browser_list[BROWSER_LIST_LEN];
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
colorstruct colors[NUM_NCOLORS];
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_MOUSE
|
||||
shortcut *currshortcut = main_list; /* Current shortcut list we're using */
|
||||
int currslen = MAIN_VISIBLE; /* Length of current shortcut list */
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
toggle toggles[TOGGLE_LEN];
|
||||
#endif
|
||||
@@ -110,11 +135,13 @@ void sc_init_one(shortcut * s, int key, char *desc, char *help, int alt,
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Initialize the toggles in the same manner */
|
||||
void toggle_init_one(toggle * t, int val, char *desc, int flag)
|
||||
void toggle_init_one(toggle * t, int val, char *desc, int flag,
|
||||
char override_ch)
|
||||
{
|
||||
t->val = val;
|
||||
t->desc = desc;
|
||||
t->flag = flag;
|
||||
t->override_ch = override_ch;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -123,11 +150,19 @@ void toggle_init(void)
|
||||
#ifndef NANO_SMALL
|
||||
char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg,
|
||||
*toggle_nohelp_msg, *toggle_picomode_msg, *toggle_mouse_msg,
|
||||
*toggle_cuttoend_msg, *toggle_wrap_msg;
|
||||
*toggle_cuttoend_msg, *toggle_wrap_msg, *toggle_case_msg,
|
||||
*toggle_backwards_msg, *toggle_dos_msg, *toggle_mac_msg,
|
||||
*toggle_smooth_msg;
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
char *toggle_load_msg, *nano_openprev_msg, *nano_opennext_msg;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
char *toggle_regexp_msg;
|
||||
#endif
|
||||
|
||||
|
||||
toggle_const_msg = _("Constant cursor position");
|
||||
toggle_autoindent_msg = _("Auto indent");
|
||||
toggle_suspend_msg = _("Suspend");
|
||||
@@ -135,30 +170,62 @@ void toggle_init(void)
|
||||
toggle_picomode_msg = _("Pico mode");
|
||||
toggle_mouse_msg = _("Mouse support");
|
||||
toggle_cuttoend_msg = _("Cut to end");
|
||||
toggle_backwards_msg = _("Backwards search");
|
||||
toggle_case_msg = _("Case sensitive search");
|
||||
toggle_dos_msg = _("Writing file in DOS format");
|
||||
toggle_mac_msg = _("Writing file in Mac format");
|
||||
toggle_smooth_msg = _("Smooth scrolling");
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
toggle_regexp_msg = _("Regular expressions");
|
||||
#endif
|
||||
toggle_wrap_msg = _("Auto wrap");
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
toggle_load_msg = _("Multiple file buffers");
|
||||
nano_openprev_msg = _("Open previously loaded file");
|
||||
nano_opennext_msg = _("Open next loaded file");
|
||||
#endif
|
||||
|
||||
toggle_init_one(&toggles[0], TOGGLE_CONST_KEY, toggle_const_msg,
|
||||
CONSTUPDATE);
|
||||
CONSTUPDATE, 0);
|
||||
toggle_init_one(&toggles[1], TOGGLE_AUTOINDENT_KEY,
|
||||
toggle_autoindent_msg, AUTOINDENT);
|
||||
toggle_autoindent_msg, AUTOINDENT, 0);
|
||||
toggle_init_one(&toggles[2], TOGGLE_SUSPEND_KEY, toggle_suspend_msg,
|
||||
SUSPEND);
|
||||
SUSPEND, 0);
|
||||
toggle_init_one(&toggles[3], TOGGLE_NOHELP_KEY, toggle_nohelp_msg,
|
||||
NO_HELP);
|
||||
NO_HELP, 0);
|
||||
toggle_init_one(&toggles[4], TOGGLE_PICOMODE_KEY, toggle_picomode_msg,
|
||||
PICO_MODE);
|
||||
PICO_MODE, 0);
|
||||
toggle_init_one(&toggles[5], TOGGLE_WRAP_KEY, toggle_wrap_msg,
|
||||
NO_WRAP);
|
||||
NO_WRAP, 0);
|
||||
toggle_init_one(&toggles[6], TOGGLE_MOUSE_KEY, toggle_mouse_msg,
|
||||
USE_MOUSE);
|
||||
USE_MOUSE, 0);
|
||||
toggle_init_one(&toggles[7], TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg,
|
||||
CUT_TO_END);
|
||||
CUT_TO_END, 0);
|
||||
toggle_init_one(&toggles[8], TOGGLE_BACKWARDS_KEY, toggle_backwards_msg,
|
||||
REVERSE_SEARCH, 0);
|
||||
toggle_init_one(&toggles[9], TOGGLE_CASE_KEY, toggle_case_msg,
|
||||
CASE_SENSITIVE, 0);
|
||||
toggle_init_one(&toggles[10], TOGGLE_DOS_KEY, toggle_dos_msg,
|
||||
DOS_FILE, 0);
|
||||
toggle_init_one(&toggles[11], TOGGLE_MAC_KEY, toggle_mac_msg,
|
||||
MAC_FILE, 0);
|
||||
toggle_init_one(&toggles[12], TOGGLE_SMOOTH_KEY, toggle_smooth_msg,
|
||||
SMOOTHSCROLL, 0);
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
toggle_init_one(&toggles[13], TOGGLE_LOAD_KEY, toggle_load_msg,
|
||||
MULTIBUFFER, 0);
|
||||
toggle_init_one(&toggles[14], NANO_OPENPREV_KEY, nano_openprev_msg,
|
||||
0, '<');
|
||||
toggle_init_one(&toggles[15], NANO_OPENNEXT_KEY, nano_opennext_msg,
|
||||
0, '>');
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
toggle_init_one(&toggles[8], TOGGLE_REGEXP_KEY, toggle_regexp_msg,
|
||||
USE_REGEXP);
|
||||
toggle_init_one(&toggles[TOGGLE_LEN - 1], TOGGLE_REGEXP_KEY,
|
||||
toggle_regexp_msg, USE_REGEXP, 0);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
@@ -176,15 +243,25 @@ void shortcut_init(int unjustify)
|
||||
"", *nano_lastline_msg = "", *nano_refresh_msg =
|
||||
"", *nano_mark_msg = "", *nano_delete_msg =
|
||||
"", *nano_backspace_msg = "", *nano_tab_msg =
|
||||
"", *nano_enter_msg = "", *nano_case_msg =
|
||||
"", *nano_cancel_msg = "", *nano_unjustify_msg = "";
|
||||
"", *nano_enter_msg = "", *nano_cancel_msg =
|
||||
"", *nano_unjustify_msg = "", *nano_append_msg = "";
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
char *nano_tofiles_msg = "";
|
||||
char *nano_tofiles_msg = "", *nano_gotodir_msg = "", *nano_case_msg =
|
||||
"", *nano_reverse_msg = "";
|
||||
#ifdef HAVE_REGEX_H
|
||||
char *nano_regexp_msg = "", *nano_bracket_msg = "";
|
||||
#endif
|
||||
|
||||
nano_help_msg = _("Invoke the help menu");
|
||||
nano_writeout_msg = _("Write the current file to disk");
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
nano_exit_msg = _("Close currently loaded file/Exit from nano");
|
||||
#else
|
||||
nano_exit_msg = _("Exit from nano");
|
||||
#endif
|
||||
|
||||
nano_goto_msg = _("Goto a specific line number");
|
||||
nano_justify_msg = _("Justify the current paragraph");
|
||||
nano_unjustify_msg = _("Unjustify after a justify");
|
||||
@@ -195,7 +272,7 @@ void shortcut_init(int unjustify)
|
||||
nano_nextpage_msg = _("Move to the next screen");
|
||||
nano_cut_msg = _("Cut the current line and store it in the cutbuffer");
|
||||
nano_uncut_msg = _("Uncut from the cutbuffer into the current line");
|
||||
nano_cursorpos_msg = _("Show the posititon of the cursor");
|
||||
nano_cursorpos_msg = _("Show the position of the cursor");
|
||||
nano_spell_msg = _("Invoke the spell checker (if available)");
|
||||
nano_up_msg = _("Move up one line");
|
||||
nano_down_msg = _("Move down one line");
|
||||
@@ -215,13 +292,26 @@ void shortcut_init(int unjustify)
|
||||
nano_case_msg =
|
||||
_("Make the current search or replace case (in)sensitive");
|
||||
nano_tofiles_msg = _("Go to file browser");
|
||||
nano_gotodir_msg = _("Goto Directory");
|
||||
nano_cancel_msg = _("Cancel the current function");
|
||||
nano_append_msg = _("Append to the current file");
|
||||
nano_reverse_msg = _("Search backwards");
|
||||
#ifdef HAVE_REGEX_H
|
||||
nano_regexp_msg = _("Use Regular expressions");
|
||||
nano_bracket_msg = _("Find other bracket");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
sc_init_one(&main_list[0], NANO_HELP_KEY, _("Get Help"),
|
||||
nano_help_msg, 0, NANO_HELP_FKEY, 0, VIEW, do_help);
|
||||
|
||||
sc_init_one(&main_list[1], NANO_EXIT_KEY, _("Exit"),
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
if (open_files != NULL && (open_files->prev || open_files->next))
|
||||
sc_init_one(&main_list[1], NANO_EXIT_KEY, _("Close"),
|
||||
nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit);
|
||||
else
|
||||
#endif
|
||||
sc_init_one(&main_list[1], NANO_EXIT_KEY, _("Exit"),
|
||||
nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit);
|
||||
|
||||
sc_init_one(&main_list[2], NANO_WRITEOUT_KEY, _("WriteOut"),
|
||||
@@ -235,13 +325,13 @@ void shortcut_init(int unjustify)
|
||||
else
|
||||
sc_init_one(&main_list[3], NANO_INSERTFILE_KEY, _("Read File"),
|
||||
nano_insert_msg,
|
||||
0, NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile);
|
||||
0, NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile_void);
|
||||
|
||||
|
||||
if (ISSET(PICO_MODE))
|
||||
sc_init_one(&main_list[4], NANO_INSERTFILE_KEY, _("Read File"),
|
||||
nano_insert_msg,
|
||||
0, NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile);
|
||||
0, NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile_void);
|
||||
else
|
||||
sc_init_one(&main_list[4], NANO_REPLACE_KEY, _("Replace"),
|
||||
nano_replace_msg,
|
||||
@@ -253,11 +343,11 @@ void shortcut_init(int unjustify)
|
||||
|
||||
sc_init_one(&main_list[6], NANO_PREVPAGE_KEY, _("Prev Page"),
|
||||
nano_prevpage_msg,
|
||||
0, NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, page_up);
|
||||
0, NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, do_page_up);
|
||||
|
||||
sc_init_one(&main_list[7], NANO_NEXTPAGE_KEY, _("Next Page"),
|
||||
nano_nextpage_msg,
|
||||
0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, page_down);
|
||||
0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, do_page_down);
|
||||
|
||||
sc_init_one(&main_list[8], NANO_CUT_KEY, _("Cut Text"),
|
||||
nano_cut_msg, 0, NANO_CUT_FKEY, 0, NOVIEW, do_cut_text);
|
||||
@@ -330,7 +420,11 @@ void shortcut_init(int unjustify)
|
||||
nano_goto_msg,
|
||||
NANO_ALT_G, NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
|
||||
|
||||
|
||||
#if (!defined NANO_SMALL) && (defined HAVE_REGEX_H)
|
||||
sc_init_one(&main_list[26], -9, _("Find Other Bracket"),
|
||||
nano_bracket_msg,
|
||||
NANO_BRACKET_KEY, 0, 0, VIEW, do_find_bracket);
|
||||
#endif
|
||||
|
||||
sc_init_one(&whereis_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
|
||||
nano_firstline_msg, 0, 0, 0, VIEW, do_first_line);
|
||||
@@ -338,19 +432,28 @@ void shortcut_init(int unjustify)
|
||||
sc_init_one(&whereis_list[1], NANO_LASTLINE_KEY, _("Last Line"),
|
||||
nano_lastline_msg, 0, 0, 0, VIEW, do_last_line);
|
||||
|
||||
sc_init_one(&whereis_list[2], NANO_CASE_KEY, _("Case Sens"),
|
||||
nano_case_msg, 0, 0, 0, VIEW, 0);
|
||||
|
||||
|
||||
sc_init_one(&whereis_list[3], NANO_OTHERSEARCH_KEY, _("Replace"),
|
||||
sc_init_one(&whereis_list[2], NANO_OTHERSEARCH_KEY, _("Replace"),
|
||||
nano_replace_msg, 0, 0, 0, VIEW, do_replace);
|
||||
|
||||
sc_init_one(&whereis_list[4], NANO_FROMSEARCHTOGOTO_KEY,
|
||||
sc_init_one(&whereis_list[3], NANO_FROMSEARCHTOGOTO_KEY,
|
||||
_("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
|
||||
do_gotoline_void);
|
||||
|
||||
sc_init_one(&whereis_list[5], NANO_CANCEL_KEY, _("Cancel"),
|
||||
nano_cancel_msg, 0, 0, 0, VIEW, 0);
|
||||
#ifndef NANO_SMALL
|
||||
sc_init_one(&whereis_list[4], TOGGLE_CASE_KEY, _("Case Sens"),
|
||||
nano_case_msg, 0, 0, 0, VIEW, 0);
|
||||
|
||||
sc_init_one(&whereis_list[5], 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,
|
||||
_("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,
|
||||
_("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0);
|
||||
|
||||
|
||||
sc_init_one(&replace_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
|
||||
@@ -359,19 +462,28 @@ void shortcut_init(int unjustify)
|
||||
sc_init_one(&replace_list[1], NANO_LASTLINE_KEY, _("Last Line"),
|
||||
nano_lastline_msg, 0, 0, 0, VIEW, do_last_line);
|
||||
|
||||
sc_init_one(&replace_list[2], NANO_CASE_KEY, _("Case Sens"),
|
||||
nano_case_msg, 0, 0, 0, VIEW, 0);
|
||||
|
||||
sc_init_one(&replace_list[3], NANO_OTHERSEARCH_KEY, _("No Replace"),
|
||||
sc_init_one(&replace_list[2], NANO_OTHERSEARCH_KEY, _("No Replace"),
|
||||
nano_whereis_msg, 0, 0, 0, VIEW, do_search);
|
||||
|
||||
sc_init_one(&replace_list[4], NANO_FROMSEARCHTOGOTO_KEY,
|
||||
sc_init_one(&replace_list[3], NANO_FROMSEARCHTOGOTO_KEY,
|
||||
_("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
|
||||
do_gotoline_void);
|
||||
|
||||
sc_init_one(&replace_list[5], NANO_CANCEL_KEY, _("Cancel"),
|
||||
nano_cancel_msg, 0, 0, 0, VIEW, 0);
|
||||
#ifndef NANO_SMALL
|
||||
sc_init_one(&replace_list[4], TOGGLE_CASE_KEY, _("Case Sens"),
|
||||
nano_case_msg, 0, 0, 0, VIEW, 0);
|
||||
|
||||
sc_init_one(&replace_list[5], 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,
|
||||
_("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,
|
||||
_("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0);
|
||||
|
||||
|
||||
sc_init_one(&replace_list_2[0], NANO_FIRSTLINE_KEY, _("First Line"),
|
||||
@@ -396,11 +508,11 @@ void shortcut_init(int unjustify)
|
||||
|
||||
sc_init_one(&help_list[0], NANO_PREVPAGE_KEY, _("Prev Page"),
|
||||
nano_prevpage_msg,
|
||||
0, NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, page_up);
|
||||
0, NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, do_page_up);
|
||||
|
||||
sc_init_one(&help_list[1], NANO_NEXTPAGE_KEY, _("Next Page"),
|
||||
nano_nextpage_msg,
|
||||
0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, page_down);
|
||||
0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, do_page_down);
|
||||
|
||||
sc_init_one(&help_list[2], NANO_EXIT_KEY, _("Exit"),
|
||||
nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit);
|
||||
@@ -411,9 +523,20 @@ void shortcut_init(int unjustify)
|
||||
nano_tofiles_msg, 0, 0, 0, NOVIEW, 0);
|
||||
#endif
|
||||
|
||||
sc_init_one(&writefile_list[WRITEFILE_LIST_LEN - 2], 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"),
|
||||
nano_cancel_msg, 0, 0, 0, VIEW, 0);
|
||||
|
||||
#ifndef DISABLE_BROWSER
|
||||
sc_init_one(&insertfile_list[0], 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"),
|
||||
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);
|
||||
|
||||
@@ -426,9 +549,15 @@ void shortcut_init(int unjustify)
|
||||
nano_nextpage_msg,
|
||||
0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, 0);
|
||||
|
||||
sc_init_one(&browser_list[2], NANO_EXIT_KEY, _("Exit"),
|
||||
sc_init_one(&browser_list[2], 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_CANCEL_KEY, _("Cancel"),
|
||||
nano_cancel_msg, 0, 0, 0, VIEW, 0);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ mostlyclean:
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile ID TAGS po2msg.sed po2tbl.sed
|
||||
rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
|
||||
329
m4/gettext.m4
Normal file
329
m4/gettext.m4
Normal file
@@ -0,0 +1,329 @@
|
||||
# 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
|
||||
])
|
||||
92
m4/largefile.m4
Normal file
92
m4/largefile.m4
Normal file
@@ -0,0 +1,92 @@
|
||||
#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])
|
||||
22
m4/lcmessage.m4
Normal file
22
m4/lcmessage.m4
Normal file
@@ -0,0 +1,22 @@
|
||||
# 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])
|
||||
47
m4/progtest.m4
Normal file
47
m4/progtest.m4
Normal file
@@ -0,0 +1,47 @@
|
||||
# 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
|
||||
])
|
||||
64
move.c
64
move.c
@@ -19,10 +19,11 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "config.h"
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
@@ -33,20 +34,24 @@
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
void page_down_center(void)
|
||||
void page_down(void)
|
||||
{
|
||||
if (editbot != filebot) {
|
||||
edit_update(editbot->next, CENTER);
|
||||
center_cursor();
|
||||
if (!ISSET(SMOOTHSCROLL)) {
|
||||
if (editbot != filebot) {
|
||||
edit_update(editbot->next, CENTER);
|
||||
center_cursor();
|
||||
} else {
|
||||
while (current != filebot)
|
||||
current = current->next;
|
||||
edit_update(current, CENTER);
|
||||
}
|
||||
} else {
|
||||
while (current != filebot)
|
||||
current = current->next;
|
||||
edit_update(current, CENTER);
|
||||
edit_update(editbot, NONE);
|
||||
}
|
||||
update_cursor();
|
||||
}
|
||||
|
||||
int page_down(void)
|
||||
int do_page_down(void)
|
||||
{
|
||||
wrap_reset();
|
||||
current_x = 0;
|
||||
@@ -55,7 +60,7 @@ int page_down(void)
|
||||
if (current == filebot)
|
||||
return 0;
|
||||
|
||||
/* AHEM, if we only have a screen or less of text, DONT do an
|
||||
/* AHEM, if we only have a screen or less of text, DON'T do an
|
||||
edit_update, just move the cursor to editbot! */
|
||||
if (edittop == fileage && editbot == filebot && totlines < editwinrows) {
|
||||
current = editbot;
|
||||
@@ -85,6 +90,7 @@ int page_down(void)
|
||||
|
||||
int do_home(void)
|
||||
{
|
||||
UNSET(KEEP_CUTBUFFER);
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
update_line(current, current_x);
|
||||
@@ -93,6 +99,7 @@ int do_home(void)
|
||||
|
||||
int do_end(void)
|
||||
{
|
||||
UNSET(KEEP_CUTBUFFER);
|
||||
current_x = strlen(current->data);
|
||||
placewewant = xplustabs();
|
||||
update_line(current, current_x);
|
||||
@@ -121,7 +128,7 @@ int do_down(void)
|
||||
if (current_y < editwinrows - 1 && current != editbot)
|
||||
current_y++;
|
||||
else
|
||||
page_down_center();
|
||||
page_down();
|
||||
|
||||
update_cursor();
|
||||
update_line(current->prev, 0);
|
||||
@@ -131,11 +138,23 @@ int do_down(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void page_up_center(void)
|
||||
void page_up(void)
|
||||
{
|
||||
if (edittop != fileage) {
|
||||
edit_update(edittop, CENTER);
|
||||
center_cursor();
|
||||
if (!ISSET(SMOOTHSCROLL)) {
|
||||
edit_update(edittop, CENTER);
|
||||
/* Now that we've updated the edit window, edittop might be
|
||||
at the top of the file; if so, just move the cursor up one
|
||||
line and don't center it. */
|
||||
if (edittop != fileage)
|
||||
center_cursor();
|
||||
else {
|
||||
current = current->prev;
|
||||
reset_cursor();
|
||||
}
|
||||
} else {
|
||||
edit_update(edittop->prev, NONE);
|
||||
}
|
||||
} else
|
||||
current_y = 0;
|
||||
|
||||
@@ -143,9 +162,10 @@ void page_up_center(void)
|
||||
|
||||
}
|
||||
|
||||
int page_up(void)
|
||||
int do_page_up(void)
|
||||
{
|
||||
filestruct *fileptr = edittop;
|
||||
int i;
|
||||
|
||||
wrap_reset();
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
@@ -154,13 +174,11 @@ int page_up(void)
|
||||
return 0;
|
||||
|
||||
current_y = 0;
|
||||
if (fileptr->next != NULL)
|
||||
fileptr = fileptr->next;
|
||||
if (fileptr->next != NULL)
|
||||
fileptr = fileptr->next;
|
||||
|
||||
current = edittop;
|
||||
edit_update(fileptr, BOTTOM);
|
||||
for (i = 0; i <= editwinrows - 3 && current->prev != NULL; i++)
|
||||
current = current->prev;
|
||||
|
||||
edit_update(current, TOP);
|
||||
update_cursor();
|
||||
|
||||
UNSET(KEEP_CUTBUFFER);
|
||||
@@ -182,7 +200,7 @@ int do_up(void)
|
||||
if (current_y > 0)
|
||||
current_y--;
|
||||
else
|
||||
page_up_center();
|
||||
page_up();
|
||||
|
||||
update_cursor();
|
||||
update_line(current->next, 0);
|
||||
|
||||
62
nano.1
62
nano.1
@@ -5,10 +5,8 @@
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH NANO 1 "December 2, 2000"
|
||||
.\" $Id$
|
||||
.TH NANO 1 "October 3, 2001"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.SH NAME
|
||||
@@ -23,7 +21,7 @@ This manual page documents briefly the
|
||||
command.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
|
||||
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
|
||||
.\" respectively.
|
||||
\fBnano\fP is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
@@ -33,46 +31,68 @@ also implements some missing (or disabled by default) features in Pico,
|
||||
such as "search and replace" and "goto line number".
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-T (\-\-tabsize)
|
||||
Set the size (width) of a tab.
|
||||
.B \-D (\-\-dos)
|
||||
Write file in DOS format.
|
||||
.TP
|
||||
.B \-F (\-\-multibuffer)
|
||||
Enable multiple file buffers (if available).
|
||||
.TP
|
||||
.B \-M (\-\-mac)
|
||||
Write file in Mac format.
|
||||
.TP
|
||||
.B \-R (\-\-regexp)
|
||||
Enable regular expression matching for search strings, as well as
|
||||
\\n subexpression replacement for replace strings, if available.
|
||||
.TP
|
||||
.B \-S (\-\-smooth)
|
||||
Enable smooth scrolling. Text will scroll line-by-line, instead of the
|
||||
usual chunk-by-chunk behaviour.
|
||||
.TP
|
||||
.B \-T [num] (\-\-tabsize=[num])
|
||||
Set the size (width) of a tab.
|
||||
.TP
|
||||
.B \-V (\-\-version)
|
||||
Show the current version number and author.
|
||||
.TP
|
||||
.B \-h (\-\-help)
|
||||
Display a summary of commandline options.
|
||||
.TP
|
||||
.B \-c (\-\-const)
|
||||
Constantly show the cursor position.
|
||||
.TP
|
||||
.B \-k (\-\-cut)
|
||||
Enable cut from cursor to end of line with ^K.
|
||||
.B \-h (\-\-help)
|
||||
Display a summary of command line options.
|
||||
.TP
|
||||
.B \-i (\-\-autoindent)
|
||||
Indent new lines to the previous line's indentation. Useful when editing
|
||||
source code.
|
||||
.TP
|
||||
.B \-k (\-\-cut)
|
||||
Enable cut from cursor to end of line with ^K.
|
||||
.TP
|
||||
.B \-l (\-\-nofollow)
|
||||
If the file being edited is a symbolic link, replace the link with a
|
||||
a new file, do not follow it. Good for editing files in /tmp perhaps?
|
||||
a new file, do not follow it. Good for editing files in /tmp, perhaps?
|
||||
.TP
|
||||
.B \-m (\-\-mouse)
|
||||
Enable mouse support (if available for your system).
|
||||
.TP
|
||||
.B \-o [dir] (\-\-operatingdir=[dir])
|
||||
Set operating directory. Makes nano set up something similar to a chroot.
|
||||
.TP
|
||||
.B \-p (\-\-pico)
|
||||
Emulate Pico as closely as possible. This affects both the "shortcut list"
|
||||
at the bottom of the screen, as well as the display and entry of previous
|
||||
search and replace strings.
|
||||
.TP
|
||||
.B \-s (\-\-speller)
|
||||
.B \-r [#cols] (\-\-fill=[#cols])
|
||||
Wrap lines at column #cols. By default, this is the width of the screen,
|
||||
less eight. If this value is negative, wrapping will occur at #cols from
|
||||
the right of the screen, allowing it to vary along with the screen width
|
||||
if the screen is resized.
|
||||
.TP
|
||||
.B \-s [prog] (\-\-speller=[prog])
|
||||
Enable alternative spell checker command.
|
||||
.TP
|
||||
.B \-t (\-\-tempfile)
|
||||
Always save changed buffer without prompting. Same as Pico -t option.
|
||||
Always save changed buffer without prompting. Same as Pico -t option.
|
||||
.TP
|
||||
.B \-v (\-\-view)
|
||||
View file (read only) mode.
|
||||
@@ -86,18 +106,19 @@ Disable help screen at bottom of editor.
|
||||
.B \-z (\-\-suspend)
|
||||
Enable suspend ability.
|
||||
.TP
|
||||
.B \-b, \-e, \-f
|
||||
.B \-a, \-b, \-e, \-f, \-g, \-j
|
||||
Ignored, for compatibility with Pico.
|
||||
.TP
|
||||
.B \+LINE
|
||||
Places cursor at LINE on startup.
|
||||
.SH NOTES
|
||||
Nano will try to dump the buffer into an emergency file in some cases.
|
||||
Mainly, this will happen if Nano recieves a SIGHUP or runs out of
|
||||
Mainly, this will happen if Nano receives a SIGHUP or runs out of
|
||||
memory, when it will write the buffer into a file named "nano.save" if the
|
||||
buffer didn't have a name already, or will add a ".save" suffix to the
|
||||
current finename. Nano will \fBnot\fP write this file if a previous one
|
||||
exists in the current directory.
|
||||
current filename. In multibuffer mode, nano will write all the open buffers to
|
||||
the respective emergency files. Nano will \fBnot\fP write this file if a
|
||||
previous one exists in the current directory.
|
||||
.SH BUGS
|
||||
Please send any comments or bug reports to
|
||||
.br
|
||||
@@ -111,7 +132,8 @@ subject of "subscribe".
|
||||
.SH HOMEPAGE
|
||||
http://www.nano-editor.org
|
||||
.SH AUTHOR
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see AUTHORS for details).
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see AUTHORS and THANKS for
|
||||
details).
|
||||
This manual page was originally written by Jordi Mallach
|
||||
<jordi@sindominio.net>, for the Debian GNU/Linux system (but may be
|
||||
used by others).
|
||||
|
||||
66
nano.1.html
66
nano.1.html
@@ -3,7 +3,7 @@ Content-type: text/html
|
||||
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
|
||||
</HEAD><BODY>
|
||||
<H1>NANO</H1>
|
||||
Section: User Commands (1)<BR>Updated: December 2, 2000<BR><A HREF="#index">Index</A>
|
||||
Section: User Commands (1)<BR>Updated: October 3, 2001<BR><A HREF="#index">Index</A>
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
||||
|
||||
|
||||
@@ -44,59 +44,87 @@ such as "search and replace" and "goto line number".
|
||||
<H2>OPTIONS</H2>
|
||||
|
||||
<DL COMPACT>
|
||||
<DT><B>-T (--tabsize)</B>
|
||||
<DT><B>-D (--dos)</B>
|
||||
|
||||
<DD>
|
||||
Set the size (width) of a tab.
|
||||
Write file in DOS format.
|
||||
<DT><B>-F (--multibuffer)</B>
|
||||
|
||||
<DD>
|
||||
Enable multiple file buffers (if available).
|
||||
<DT><B>-M (--mac)</B>
|
||||
|
||||
<DD>
|
||||
Write file in Mac format.
|
||||
<DT><B>-R (--regexp)</B>
|
||||
|
||||
<DD>
|
||||
Enable regular expression matching for search strings, as well as
|
||||
\n subexpression replacement for replace strings, if available.
|
||||
<DT><B>-S (--smooth)</B>
|
||||
|
||||
<DD>
|
||||
Enable smooth scrolling. Text will scroll line-by-line, instead of the
|
||||
usual chunk-by-chunk behaviour.
|
||||
<DT><B>-T [num] (--tabsize=[num])</B>
|
||||
|
||||
<DD>
|
||||
Set the size (width) of a tab.
|
||||
<DT><B>-V (--version)</B>
|
||||
|
||||
<DD>
|
||||
Show the current version number and author.
|
||||
<DT><B>-h (--help)</B>
|
||||
|
||||
<DD>
|
||||
Display a summary of commandline options.
|
||||
<DT><B>-c (--const)</B>
|
||||
|
||||
<DD>
|
||||
Constantly show the cursor position.
|
||||
<DT><B>-k (--cut)</B>
|
||||
<DT><B>-h (--help)</B>
|
||||
|
||||
<DD>
|
||||
Enable cut from cursor to end of line with ^K.
|
||||
Display a summary of command line options.
|
||||
<DT><B>-i (--autoindent)</B>
|
||||
|
||||
<DD>
|
||||
Indent new lines to the previous line's indentation. Useful when editing
|
||||
source code.
|
||||
<DT><B>-k (--cut)</B>
|
||||
|
||||
<DD>
|
||||
Enable cut from cursor to end of line with ^K.
|
||||
<DT><B>-l (--nofollow)</B>
|
||||
|
||||
<DD>
|
||||
If the file being edited is a symbolic link, replace the link with a
|
||||
a new file, do not follow it. Good for editing files in /tmp perhaps?
|
||||
a new file, do not follow it. Good for editing files in /tmp, perhaps?
|
||||
<DT><B>-m (--mouse)</B>
|
||||
|
||||
<DD>
|
||||
Enable mouse support (if available for your system).
|
||||
<DT><B>-o [dir] (--operatingdir=[dir])</B>
|
||||
|
||||
<DD>
|
||||
Set operating directory. Makes nano set up something similar to a chroot.
|
||||
<DT><B>-p (--pico)</B>
|
||||
|
||||
<DD>
|
||||
Emulate Pico as closely as possible. This affects both the "shortcut list"
|
||||
at the bottom of the screen, as well as the display and entry of previous
|
||||
search and replace strings.
|
||||
<DT><B>-s (--speller)</B>
|
||||
<DT><B>-r [#cols] (--fill=[#cols])</B>
|
||||
|
||||
<DD>
|
||||
Wrap lines at column #cols. By default, this is the width of the screen,
|
||||
less eight. If this value is negative, wrapping will occur at #cols from
|
||||
the right of the screen, allowing it to vary along with the screen width
|
||||
if the screen is resized.
|
||||
<DT><B>-s [prog] (--speller=[prog])</B>
|
||||
|
||||
<DD>
|
||||
Enable alternative spell checker command.
|
||||
<DT><B>-t (--tempfile)</B>
|
||||
|
||||
<DD>
|
||||
Always save changed buffer without prompting. Same as Pico -t option.
|
||||
Always save changed buffer without prompting. Same as Pico -t option.
|
||||
<DT><B>-v (--view)</B>
|
||||
|
||||
<DD>
|
||||
@@ -113,7 +141,7 @@ Disable help screen at bottom of editor.
|
||||
|
||||
<DD>
|
||||
Enable suspend ability.
|
||||
<DT><B>-b, -e, -f</B>
|
||||
<DT><B>-a, -b, -e, -f, -g, -j</B>
|
||||
|
||||
<DD>
|
||||
Ignored, for compatibility with Pico.
|
||||
@@ -126,11 +154,12 @@ Places cursor at LINE on startup.
|
||||
<H2>NOTES</H2>
|
||||
|
||||
Nano will try to dump the buffer into an emergency file in some cases.
|
||||
Mainly, this will happen if Nano recieves a SIGHUP or runs out of
|
||||
Mainly, this will happen if Nano receives a SIGHUP or runs out of
|
||||
memory, when it will write the buffer into a file named "nano.save" if the
|
||||
buffer didn't have a name already, or will add a ".save" suffix to the
|
||||
current finename. Nano will <B>not</B> write this file if a previous one
|
||||
exists in the current directory.
|
||||
current filename. In multibuffer mode, nano will write all the open buffers to
|
||||
the respective emergency files. Nano will <B>not</B> write this file if a
|
||||
previous one exists in the current directory.
|
||||
<A NAME="lbAG"> </A>
|
||||
<H2>BUGS</H2>
|
||||
|
||||
@@ -155,7 +184,8 @@ subject of "subscribe".
|
||||
<A NAME="lbAI"> </A>
|
||||
<H2>AUTHOR</H2>
|
||||
|
||||
Chris Allegretta <<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>>, et al (see AUTHORS for details).
|
||||
Chris Allegretta <<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>>, et al (see AUTHORS and THANKS for
|
||||
details).
|
||||
This manual page was originally written by Jordi Mallach
|
||||
<<A HREF="mailto:jordi@sindominio.net">jordi@sindominio.net</A>>, for the Debian GNU/Linux system (but may be
|
||||
used by others).
|
||||
@@ -177,6 +207,6 @@ used by others).
|
||||
This document was created by
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
|
||||
using the manual pages.<BR>
|
||||
Time: 02:16:52 GMT, December 18, 2000
|
||||
Time: 01:18:43 GMT, October 04, 2001
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
130
nano.h
130
nano.h
@@ -34,6 +34,7 @@
|
||||
#define SET(bit) flags |= bit
|
||||
#define UNSET(bit) flags &= ~bit
|
||||
#define ISSET(bit) (flags & bit)
|
||||
#define TOGGLE(bit) flags ^= bit
|
||||
|
||||
|
||||
#ifdef USE_SLANG /* Slang support enabled */
|
||||
@@ -63,11 +64,27 @@
|
||||
|
||||
#define VERMSG "GNU nano " VERSION
|
||||
|
||||
#if defined(DISABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
|
||||
#define DISABLE_WRAPJUSTIFY 1
|
||||
#endif
|
||||
|
||||
/* Structure types */
|
||||
typedef struct filestruct {
|
||||
char *data;
|
||||
struct filestruct *next; /* Next node */
|
||||
struct filestruct *prev; /* Previous node */
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
struct filestruct *file; /* Current file */
|
||||
int file_current_x; /* Current file's x-coordinate position */
|
||||
int file_current_y; /* Current file's y-coordinate position */
|
||||
int file_modified; /* Current file's modification status */
|
||||
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 */
|
||||
#endif
|
||||
|
||||
long lineno; /* The line number */
|
||||
} filestruct;
|
||||
|
||||
@@ -85,11 +102,21 @@ typedef struct shortcut {
|
||||
typedef struct toggle {
|
||||
int val; /* Sequence to toggle the key. Should only need 1 */
|
||||
char *desc; /* Description for when toggle is, uh, toggled,
|
||||
e.g. "Pico Messages", we'll append Enabled or
|
||||
e.g. "Pico Messages"; we'll append Enabled or
|
||||
Disabled */
|
||||
int flag; /* What flag actually gets toggled */
|
||||
char override_ch; /* The character to display on the help screen,
|
||||
if it isn't NULL */
|
||||
} toggle;
|
||||
|
||||
#ifdef ENABLE_NANORC
|
||||
typedef struct rcoption {
|
||||
char *name;
|
||||
int flag;
|
||||
} rcoption;
|
||||
|
||||
#endif /* ENABLE_NANORC */
|
||||
|
||||
/* Bitwise flags so we can save space (or more correctly, not waste it) */
|
||||
|
||||
#define MODIFIED (1<<0)
|
||||
@@ -110,9 +137,15 @@ typedef struct toggle {
|
||||
#define REGEXP_COMPILED (1<<15)
|
||||
#define TEMP_OPT (1<<16)
|
||||
#define CUT_TO_END (1<<17)
|
||||
#define DISABLE_CURPOS (1<<18)
|
||||
#define REVERSE_SEARCH (1<<18)
|
||||
#define MULTIBUFFER (1<<19)
|
||||
#define CLEAR_BACKUPSTRING (1<<20)
|
||||
#define DOS_FILE (1<<21)
|
||||
#define MAC_FILE (1<<22)
|
||||
#define SMOOTHSCROLL (1<<23)
|
||||
#define DISABLE_CURPOS (1<<24) /* Damn, we still need it */
|
||||
|
||||
/* Control key sequences, chaning these would be very very bad */
|
||||
/* Control key sequences, changing these would be very very bad */
|
||||
|
||||
#define NANO_CONTROL_A 1
|
||||
#define NANO_CONTROL_B 2
|
||||
@@ -172,8 +205,11 @@ typedef struct toggle {
|
||||
#define NANO_ALT_X 'x'
|
||||
#define NANO_ALT_Y 'y'
|
||||
#define NANO_ALT_Z 'z'
|
||||
#define NANO_ALT_LCARAT ','
|
||||
#define NANO_ALT_RCARAT '.'
|
||||
#define NANO_ALT_BRACKET ']'
|
||||
|
||||
/* Some semi-changeable keybindings, dont play with unless you're sure you
|
||||
/* Some semi-changeable keybindings; don't play with unless you're sure you
|
||||
know what you're doing */
|
||||
|
||||
#define NANO_INSERTFILE_KEY NANO_CONTROL_R
|
||||
@@ -208,7 +244,6 @@ know what you're doing */
|
||||
#define NANO_FIRSTLINE_KEY NANO_PREVPAGE_KEY
|
||||
#define NANO_LASTLINE_KEY NANO_NEXTPAGE_KEY
|
||||
#define NANO_CANCEL_KEY NANO_CONTROL_C
|
||||
#define NANO_CASE_KEY NANO_CONTROL_A
|
||||
#define NANO_REFRESH_KEY NANO_CONTROL_L
|
||||
#define NANO_JUSTIFY_KEY NANO_CONTROL_J
|
||||
#define NANO_JUSTIFY_FKEY KEY_F(4)
|
||||
@@ -227,6 +262,10 @@ know what you're doing */
|
||||
#define NANO_ENTER_KEY NANO_CONTROL_M
|
||||
#define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T
|
||||
#define NANO_TOFILES_KEY NANO_CONTROL_T
|
||||
#define NANO_APPEND_KEY NANO_ALT_A
|
||||
#define NANO_OPENPREV_KEY NANO_ALT_LCARAT
|
||||
#define NANO_OPENNEXT_KEY NANO_ALT_RCARAT
|
||||
#define NANO_BRACKET_KEY NANO_ALT_BRACKET
|
||||
|
||||
#define TOGGLE_CONST_KEY NANO_ALT_C
|
||||
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
|
||||
@@ -237,32 +276,64 @@ know what you're doing */
|
||||
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
|
||||
#define TOGGLE_REGEXP_KEY NANO_ALT_E
|
||||
#define TOGGLE_WRAP_KEY NANO_ALT_W
|
||||
#define TOGGLE_BACKWARDS_KEY NANO_ALT_B
|
||||
#define TOGGLE_CASE_KEY NANO_ALT_A
|
||||
#define TOGGLE_LOAD_KEY NANO_ALT_F
|
||||
#define TOGGLE_DOS_KEY NANO_ALT_D
|
||||
#define TOGGLE_MAC_KEY NANO_ALT_O
|
||||
#define TOGGLE_SMOOTH_KEY NANO_ALT_S
|
||||
|
||||
#define MAIN_LIST_LEN 26
|
||||
/* Toggle stuff, these static lengths need to go away RSN */
|
||||
|
||||
#ifndef HAVE_REGEX_H
|
||||
#define NO_REGEX 1
|
||||
#else
|
||||
#define NO_REGEX 0
|
||||
#endif
|
||||
|
||||
#ifdef DISABLE_BROWSER
|
||||
#define NO_BROWSER 1
|
||||
#else
|
||||
#define NO_BROWSER 0
|
||||
#endif
|
||||
|
||||
#ifdef NANO_SMALL
|
||||
#ifdef HAVE_REGEX_H
|
||||
#define NO_TOGGLES 3
|
||||
#else
|
||||
#define NO_TOGGLES 2
|
||||
#endif /* HAVE_REGEX_H */
|
||||
#else
|
||||
#define NO_TOGGLES 0
|
||||
#endif /* NANO_SMALL */
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
#define MULTI_TOGGLES 3
|
||||
#else
|
||||
#define MULTI_TOGGLES 0
|
||||
#endif
|
||||
|
||||
#define WHEREIS_LIST_LEN (8 - NO_REGEX - NO_TOGGLES)
|
||||
#define REPLACE_LIST_LEN (8 - 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 MAIN_VISIBLE 12
|
||||
#define WHEREIS_LIST_LEN 6
|
||||
#define REPLACE_LIST_LEN 6
|
||||
#define REPLACE_LIST_2_LEN 3
|
||||
#define GOTO_LIST_LEN 3
|
||||
#define GOTODIR_LIST_LEN 1
|
||||
#define HELP_LIST_LEN 3
|
||||
#define SPELL_LIST_LEN 1
|
||||
|
||||
#ifndef DISABLE_BROWSER
|
||||
#define WRITEFILE_LIST_LEN 2
|
||||
#define BROWSER_LIST_LEN 3
|
||||
#else
|
||||
#define WRITEFILE_LIST_LEN 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
#define TOGGLE_LEN 9
|
||||
#else
|
||||
#define TOGGLE_LEN 8
|
||||
#endif
|
||||
|
||||
|
||||
#define VIEW 1
|
||||
#define NOVIEW 0
|
||||
|
||||
#define NONE 3
|
||||
#define TOP 2
|
||||
#define CENTER 1
|
||||
#define BOTTOM 0
|
||||
@@ -276,4 +347,25 @@ know what you're doing */
|
||||
/* Minimum fill length (space available for text before wrapping occurs) */
|
||||
#define MIN_FILL_LENGTH 10
|
||||
|
||||
/* Color specific defines */
|
||||
#ifdef ENABLE_COLOR
|
||||
typedef struct colorstruct {
|
||||
int fg;
|
||||
int bg;
|
||||
int bold;
|
||||
int set;
|
||||
} colorstruct;
|
||||
|
||||
#define FIRST_COLORNUM 16
|
||||
|
||||
#define COLOR_TITLEBAR 16
|
||||
#define COLOR_BOTTOMBARS 17
|
||||
#define COLOR_STATUSBAR 18
|
||||
#define COLOR_TEXT 19
|
||||
#define COLOR_MARKER 20
|
||||
|
||||
#define NUM_NCOLORS 5
|
||||
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
#endif /* ifndef NANO_H */
|
||||
|
||||
401
nano.info
401
nano.info
@@ -1,401 +0,0 @@
|
||||
This is nano.info, produced by makeinfo version 4.0 from nano.texi.
|
||||
|
||||
INFO-DIR-SECTION Editors
|
||||
START-INFO-DIR-ENTRY
|
||||
* Nano: (nano). Small and friendly text editor.
|
||||
END-INFO-DIR-ENTRY
|
||||
|
||||
|
||||
File: nano.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
|
||||
|
||||
This manual documents GNU nano, a small and friendly text editor.
|
||||
|
||||
* Menu:
|
||||
|
||||
* Introduction::
|
||||
* Editor Basics::
|
||||
* Online Help::
|
||||
* Feature Toggles::
|
||||
* The File Browser::
|
||||
* Pico Compatibility::
|
||||
* Building and Configure Options::
|
||||
|
||||
|
||||
File: nano.info, Node: Introduction, Next: Editor Basics, Prev: Top, Up: Top
|
||||
|
||||
Introduction
|
||||
************
|
||||
|
||||
GNU `nano' is a small and friendly text editor. Besides basic text
|
||||
editing, `nano' offers many extra features like an interactive search
|
||||
and replace, goto line number, auto-indentation, feature toggles,
|
||||
internationalization support, and filename tab completion.
|
||||
|
||||
* Menu:
|
||||
|
||||
* Overview::
|
||||
* Command Line Options::
|
||||
|
||||
|
||||
File: nano.info, Node: Overview, Next: Command Line Options, Prev: Introduction, Up: Introduction
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
`nano' [GNU long option] [option] +LINE [ FILE ... ]
|
||||
|
||||
The original goal for `nano' was a complete bug-for-bug compatible
|
||||
emulation of Pico, but consistency is now a slightly higher priority.
|
||||
There is a flag to implement (nearly) complete Pico emulation, (option
|
||||
-p or GNU long option -pico). This can also be toggled from within
|
||||
`nano' by typing Meta-P. *Note Pico Compatibility::, for more info.
|
||||
|
||||
Email bug reports to <nano@nano-editor.org>.
|
||||
|
||||
|
||||
File: nano.info, Node: Command Line Options, Prev: Overview, Up: Introduction
|
||||
|
||||
Command Line Options
|
||||
====================
|
||||
|
||||
`nano' takes the following options from the command line:
|
||||
`-T [num, --tabsize=[num]'
|
||||
Set the displayed tab length to [num] columns.
|
||||
|
||||
`-R, --regexp'
|
||||
Turns on regular expression search and search/replace.
|
||||
|
||||
`-V, --version'
|
||||
Print the version number and copyright and quit.
|
||||
|
||||
`-c, --const'
|
||||
Constantly display the cursor posititon and line number on the
|
||||
statusbar.
|
||||
|
||||
`-h, --help'
|
||||
Print the usage and exit.
|
||||
|
||||
`-i, --autoindent'
|
||||
Automatically indent new lines to the same number of spaces and
|
||||
tabs as the previous line.
|
||||
|
||||
`-k, --cut'
|
||||
Makes ^K cut from the current cursor position to the end of the
|
||||
current line.
|
||||
|
||||
`-l, --nofollow'
|
||||
When writing files, if the given file is a symbolic link it is
|
||||
removed and a new file is created.
|
||||
|
||||
`-m, --mouse'
|
||||
Enables the use of the mouse to select text (currently only useful
|
||||
for running under the X window system).
|
||||
|
||||
`-p, --pico'
|
||||
Emulate Pico as closely as possible, sacrificing consistency for
|
||||
correct emulation. *Note Pico Compatibility::, for more info.
|
||||
|
||||
`-r [#cols], --fill=[#cols].'
|
||||
Wrap lines at column #cols. By default this is the width of the
|
||||
screen, less eight.
|
||||
|
||||
`-s [prog], --speller=[prog]'
|
||||
Invoke [prog] as the spell checker. By default, `nano' uses its
|
||||
own interactive spell checker that requires the `spell' program be
|
||||
installed on your system.
|
||||
|
||||
`-t, --tempfile'
|
||||
Do not ask whether or not to save the current contents of the file
|
||||
when exiting, assume yes. This is most useful when using `nano'
|
||||
as the composer of a mailer program.
|
||||
|
||||
`-x, --nohelp'
|
||||
In Expert Mode, the Shortcut Lists will not appear at the bottom
|
||||
of the screen. This affects the location of the statusbar as
|
||||
well, as in Expert Mode it is located at the very bottom of the
|
||||
editor.
|
||||
|
||||
Note: When accesing the help system, Expert Mode is temporarily
|
||||
disabled to display the help system navigation keys.
|
||||
|
||||
`-v, --view'
|
||||
Do not allow the contents of the file to be altered. Note that
|
||||
this flag should NOT be used in place of correct file permissions
|
||||
to implement a read-only file.
|
||||
|
||||
`-w, --nowrap'
|
||||
Do not wrap long lines at any length. This option overrides any
|
||||
value for -r.
|
||||
|
||||
`-z, --suspend'
|
||||
Enable suspend ability of `nano' using the system's suspend
|
||||
keystroke (usually ^Z).
|
||||
|
||||
`+LINE'
|
||||
Start at line number LINE instead of the default of line 1.
|
||||
|
||||
|
||||
File: nano.info, Node: Editor Basics, Next: Online Help, Prev: Introduction, Up: Top
|
||||
|
||||
Editor Basics
|
||||
*************
|
||||
|
||||
* Menu:
|
||||
|
||||
* Entering Text::
|
||||
* Special Functions::
|
||||
* The Titlebar::
|
||||
* The Statusbar::
|
||||
* Shortcut Lists::
|
||||
|
||||
|
||||
File: nano.info, Node: Entering Text, Next: Special Functions, Prev: Editor Basics, Up: Editor Basics
|
||||
|
||||
Entering Text
|
||||
=============
|
||||
|
||||
All key sequences in `nano' are entered using the keyboard. `nano'
|
||||
is a "modeless" editor, all keys with the exception of Control and Meta
|
||||
key sequences will enter text into the file being edited.
|
||||
|
||||
|
||||
File: nano.info, Node: Special Functions, Next: The Titlebar, Prev: Entering Text, Up: Editor Basics
|
||||
|
||||
Special Functions
|
||||
=================
|
||||
|
||||
Special functions use the Control key (displayed in the help and
|
||||
shotcut lists as ^) or the Meta key (displayed as M).
|
||||
|
||||
* Control key sequences are entered by holding down the Control key
|
||||
and pressing the desired letter.
|
||||
|
||||
* Meta key sequences can be entered in a number of possible ways:
|
||||
Pressing the Escape key, then releasing it and pressing the
|
||||
desired key, or holding down the Alt key while pressing the desired
|
||||
key. This varies from keyboard to keyboard, and certain commercial
|
||||
operating systems "swallow" the Alt key so that it never reaches
|
||||
the application. If your operating system does this, you should
|
||||
use the Escape key to generate Meta key sequences.
|
||||
|
||||
|
||||
File: nano.info, Node: The Titlebar, Next: The Statusbar, Prev: Special Functions, Up: Editor Basics
|
||||
|
||||
The Titlebar
|
||||
============
|
||||
|
||||
The titlebar is the line displayed at the top of the editor. There
|
||||
are three sections: left, center and right. The section on the left
|
||||
displays the version of `nano' being used. The center section displays
|
||||
the current file name, or "New Buffer" if the file has not yet been
|
||||
named. The section on the right will display "Modified" if the file
|
||||
has been modified since it ws last saved or opened.
|
||||
|
||||
Special modes: When nano is in "File browser" mode, the center
|
||||
section will display the current directory instead of the filename.
|
||||
*Note The File Browser::.
|
||||
|
||||
|
||||
File: nano.info, Node: The Statusbar, Next: Shortcut Lists, Prev: The Titlebar, Up: Editor Basics
|
||||
|
||||
The Statusbar
|
||||
=============
|
||||
|
||||
The statusbar is located three lines from the bottom of the screen
|
||||
(or the bottom line in Expert Mode. *Note Expert Mode::, for more info.
|
||||
|
||||
The Statusbar shows important and informational messages. Any error
|
||||
messages that occur from using the editor will appear on the statusbar.
|
||||
Any questions that are asked of the user will be asked on the statusbar,
|
||||
and any user input (serch strings, file names, etc) will be input on the
|
||||
statusbar.
|
||||
|
||||
|
||||
File: nano.info, Node: Shortcut Lists, Prev: The Statusbar, Up: Editor Basics
|
||||
|
||||
Shortcut Lists
|
||||
==============
|
||||
|
||||
The Shorcut Lists are the two lines at the bottom of the screen
|
||||
which show some of the more commonly used functions in the editor. The
|
||||
exact functions which are displayed depend on whether Pico
|
||||
Compatibility Mode mode is enabled. *Note Pico Compatibility::, for
|
||||
more info.
|
||||
|
||||
|
||||
File: nano.info, Node: Online Help, Next: Feature Toggles, Prev: Editor Basics, Up: Top
|
||||
|
||||
Online Help
|
||||
***********
|
||||
|
||||
The online help system in `nano' is available by pressing ^G. It is
|
||||
fairly self explanatory, documenting the various parts of the editor
|
||||
and available keystrokes. Navigation is via the ^Y (Page Up) and ^V
|
||||
(Page Down) keys. ^X exits the help system.
|
||||
|
||||
|
||||
File: nano.info, Node: Feature Toggles, Next: The File Browser, Prev: Online Help, Up: Top
|
||||
|
||||
Feature Toggles
|
||||
***************
|
||||
|
||||
Toggles allow you to change certain aspects of the editor that would
|
||||
normally be done via command line flags. They are invoked via certain
|
||||
Meta key sequenced. *Note Special Functions::, for more info. The
|
||||
following toggles are available:
|
||||
|
||||
`Constant Update Toggle (Meta-C)'
|
||||
toggles the -c (-const) command line flag.
|
||||
|
||||
`Regular Expressions Toggle (Meta-E)'
|
||||
toggles the -R (-regexp) command line flag.
|
||||
|
||||
`AutoIndent Toggle (Meta-I)'
|
||||
toggles the -i (-autoindent) command line flag.
|
||||
|
||||
`Cut To End Toggle (Meta-K)'
|
||||
toggles the -k (-cut) command line flag.
|
||||
|
||||
`Cut To End Toggle (Meta-M)'
|
||||
toggles the -m (-mouse) command line flag.
|
||||
|
||||
`Pico Mode Toggle (Meta-P)'
|
||||
toggles the -p (-pico) command line flag. *Note Pico
|
||||
Compatibility::, for more info.
|
||||
|
||||
`AutoWrap Toggle (Meta-W)'
|
||||
toggles the -w (-nowrap) command line flag.
|
||||
|
||||
`Expert/Nohelp Toggle (Meta-X)'
|
||||
toggles the -x (-nohelp) command line flag.
|
||||
|
||||
`Suspend Toggle (Meta-Z)'
|
||||
toggles the -z (-suspend) command line flag.
|
||||
|
||||
|
||||
File: nano.info, Node: The File Browser, Next: Pico Compatibility, Prev: Feature Toggles, Up: Top
|
||||
|
||||
The File Browser
|
||||
****************
|
||||
|
||||
When reading or writilg files, pressing ^T will invoke the file
|
||||
browser. Here, one can navigate directories in a graphical manner in
|
||||
order to find the desired file.
|
||||
|
||||
Basic movement in the file browser is accomplished with he arrow keys
|
||||
and page up/down. The behavior of the enter (or 's') key varies by what
|
||||
is currently selected. If the currently selected object is a directory,
|
||||
the file browser will enter and display the contects of the directory.
|
||||
If the object is a file, this filename and path are copied to the
|
||||
statusbar and the file browser is exited.
|
||||
|
||||
|
||||
File: nano.info, Node: Pico Compatibility, Next: Building and Configure Options, Prev: The File Browser, Up: Top
|
||||
|
||||
Pico Compatibility
|
||||
******************
|
||||
|
||||
Nano does not completely emulate Pico by default. The following
|
||||
differences apply to the default mode and Pico Compatibility mode:
|
||||
|
||||
`Displayed Shortcuts'
|
||||
By default, the following shortcuts are displayed in the Shortcut
|
||||
Lists:
|
||||
|
||||
^G ^O ^\ ^Y ^K ^C
|
||||
^X ^R ^W ^V ^U ^T
|
||||
|
||||
Related functions are listed above or below each other by default.
|
||||
The Justify function is not listed, instead the "Replace"
|
||||
function is displayed. Also, he "Read File" and "WriteOut"
|
||||
functions are aligned for consistency.
|
||||
|
||||
In Pico Compatibility mode, the default Pico shortcuts are
|
||||
displayed:
|
||||
|
||||
^G ^O ^R ^Y ^K ^C
|
||||
^X ^J ^W ^V ^U ^T
|
||||
|
||||
`Previous String Text'
|
||||
By default, previously entered string for a function (search
|
||||
string, file name) will be placed on the statusbar, and is
|
||||
editable. This is done so there is consistency across all
|
||||
functions. For example: even if there is a previous replace
|
||||
string, it can always be deleted if one wishes to perform an empty
|
||||
string replace.
|
||||
|
||||
In Pico Compatibility Mode, the previously entered text in a
|
||||
search or replace will appear in brackets, and is not editable.
|
||||
It is not a simple matter to do an empty string replace when a
|
||||
previous replace string exists, for example. When writing a file,
|
||||
the previous filename will be displayed in the editable text
|
||||
portion of the editor.
|
||||
|
||||
`Interactive Replace and Spell Checker'
|
||||
It is worth noting that the `nano' replace function is interactive,
|
||||
i.e. it does not stop after one search string is found and
|
||||
automatically replace it. The `nano' implementation will stop at
|
||||
each search string found and query whether to replace this
|
||||
instance or not. The internal spell checker operates similarly.
|
||||
Note that these is no way to force these functions to behave in
|
||||
the Pico fashion.
|
||||
|
||||
|
||||
File: nano.info, Node: Building and Configure Options, Prev: Pico Compatibility, Up: Top
|
||||
|
||||
Building and Configure Options
|
||||
******************************
|
||||
|
||||
Building nano from source is fairly straightforward if you are
|
||||
familiar with compiling programs with autoconf support:
|
||||
|
||||
tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano) cd
|
||||
nano-x.y.z/ ./configure make make install
|
||||
|
||||
if you are looking to optimize nano for size, you may want to
|
||||
consider the following command line options:
|
||||
|
||||
`--disable-tabcomp'
|
||||
Disable the tab completion code when reading or writing files.
|
||||
|
||||
`--disable-justify'
|
||||
Disable the justify (^J)/unjustify (^U) functions in the editor.
|
||||
|
||||
`--disable-speller'
|
||||
Disables spell checker abillity.
|
||||
|
||||
`--disable-help'
|
||||
Disables the help function (^G). Disabling this option maks the
|
||||
binary much smaller, but makes it difficult for new users to learn
|
||||
more than very basic things about using the editor.
|
||||
|
||||
`--disable-browser'
|
||||
Disables the mini file browser (^O) when reading or writing files.
|
||||
|
||||
`--enable-tiny'
|
||||
This options disables all the above. It also disables some of the
|
||||
larger internals of the editor, like the marker code (^^) and the
|
||||
cut to line (-k) option which it depends on to work properly. It
|
||||
also disables the function toggles and mouse support.
|
||||
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top199
|
||||
Node: Introduction507
|
||||
Node: Overview933
|
||||
Node: Command Line Options1513
|
||||
Ref: Expert Mode3236
|
||||
Node: Editor Basics4078
|
||||
Node: Entering Text4303
|
||||
Node: Special Functions4643
|
||||
Node: The Titlebar5497
|
||||
Node: The Statusbar6194
|
||||
Node: Shortcut Lists6774
|
||||
Node: Online Help7166
|
||||
Node: Feature Toggles7542
|
||||
Node: The File Browser8685
|
||||
Node: Pico Compatibility9394
|
||||
Node: Building and Configure Options11436
|
||||
|
||||
End Tag Table
|
||||
100
nano.texi
100
nano.texi
@@ -8,8 +8,8 @@
|
||||
@c Run `makeinfo' rather than `texinfo-format-buffer'.
|
||||
@smallbook
|
||||
@set EDITION 0.1
|
||||
@set VERSION 1.0.0
|
||||
@set UPDATED 12 Feb 2001
|
||||
@set VERSION 1.1.2
|
||||
@set UPDATED 3 Oct 2001
|
||||
|
||||
@dircategory Editors
|
||||
@direntry
|
||||
@@ -23,7 +23,7 @@
|
||||
@titlepage
|
||||
@title GNU @code{nano}
|
||||
@subtitle a small and friendly text editor.
|
||||
@subtitle version 1.0.0
|
||||
@subtitle version 1.1.2
|
||||
|
||||
@author Chris Allegretta
|
||||
@page
|
||||
@@ -108,17 +108,29 @@ Email bug reports to @email{nano@@nano-editor.org}.
|
||||
@code{nano} takes the following options from the command line:
|
||||
@table @code
|
||||
|
||||
@item -T [num, --tabsize=[num]
|
||||
Set the displayed tab length to [num] columns.
|
||||
@item -D, --dos
|
||||
Write file in DOS format.
|
||||
|
||||
@item -F, --multibuffer
|
||||
Enable multiple file buffers.
|
||||
|
||||
@item -M, --mac
|
||||
Write file in Mac format.
|
||||
|
||||
@item -R, --regexp
|
||||
Turns on regular expression search and search/replace.
|
||||
|
||||
@item -S, --smooth
|
||||
Enables smooth scrolling.
|
||||
|
||||
@item -T [num], --tabsize=[num]
|
||||
Set the displayed tab length to [num] columns.
|
||||
|
||||
@item -V, --version
|
||||
Print the version number and copyright and quit.
|
||||
|
||||
@item -c, --const
|
||||
Constantly display the cursor posititon and line number on the statusbar.
|
||||
Constantly display the cursor position and line number on the statusbar.
|
||||
|
||||
@item -h, --help
|
||||
Print the usage and exit.
|
||||
@@ -139,13 +151,18 @@ and a new file is created.
|
||||
Enables the use of the mouse to select text (currently only useful for
|
||||
running under the X window system).
|
||||
|
||||
@item -o [dir], --operatingdir=[dir]
|
||||
Set operating directory. Makes nano set up something similar to a chroot.
|
||||
|
||||
@item -p, --pico
|
||||
Emulate Pico as closely as possible, sacrificing consistency for correct
|
||||
emulation. @xref{Pico Compatibility}, for more info.
|
||||
|
||||
@item -r [#cols], --fill=[#cols].
|
||||
Wrap lines at column #cols. By default this is the width of the screen,
|
||||
less eight.
|
||||
less eight. If this value is negative, wrapping will occur at #cols from
|
||||
the right of the screen, allowing it to vary along with the screen width
|
||||
if the screen is resized.
|
||||
|
||||
@item -s [prog], --speller=[prog]
|
||||
Invoke [prog] as the spell checker. By default, @code{nano} uses its
|
||||
@@ -163,7 +180,7 @@ In Expert Mode, the Shortcut Lists will not appear at the bottom of the
|
||||
screen. This affects the location of the statusbar as well, as in Expert
|
||||
Mode it is located at the very bottom of the editor.
|
||||
|
||||
Note: When accesing the help system, Expert Mode is temporarily disabled
|
||||
Note: When accessing the help system, Expert Mode is temporarily disabled
|
||||
to display the help system navigation keys.
|
||||
|
||||
@item -v, --view
|
||||
@@ -179,6 +196,9 @@ Do not wrap long lines at any length. This option overrides any value for
|
||||
Enable suspend ability of @code{nano} using the system's suspend
|
||||
keystroke (usually ^Z).
|
||||
|
||||
@item -a, -b, -e, -f, -g, -j
|
||||
Ignored, for compatibility with Pico.
|
||||
|
||||
@item +LINE
|
||||
Start at line number LINE instead of the default of line 1.
|
||||
@end table
|
||||
@@ -205,7 +225,7 @@ edited.
|
||||
@section Special Functions
|
||||
|
||||
Special functions use the Control key (displayed in the help and
|
||||
shotcut lists as ^) or the Meta key (displayed as M).
|
||||
shortcut lists as ^) or the Meta key (displayed as M).
|
||||
|
||||
@itemize @bullet
|
||||
|
||||
@@ -230,7 +250,7 @@ three sections: left, center and right. The section on the left displays
|
||||
the version of @code{nano} being used. The center section displays the
|
||||
current file name, or "New Buffer" if the file has not yet been named.
|
||||
The section on the right will display "Modified" if the file has been
|
||||
modified since it ws last saved or opened.
|
||||
modified since it was last saved or opened.
|
||||
|
||||
Special modes: When nano is in "File browser" mode, the center section
|
||||
will display the current directory instead of the filename.
|
||||
@@ -245,13 +265,13 @@ bottom line in Expert Mode. @xref{Expert Mode}, for more info.
|
||||
The Statusbar shows important and informational messages. Any error
|
||||
messages that occur from using the editor will appear on the statusbar.
|
||||
Any questions that are asked of the user will be asked on the statusbar,
|
||||
and any user input (serch strings, file names, etc) will be input on the
|
||||
and any user input (search strings, file names, etc) will be input on the
|
||||
statusbar.
|
||||
|
||||
@node Shortcut Lists, , The Statusbar, Editor Basics
|
||||
@section Shortcut Lists
|
||||
|
||||
The Shorcut Lists are the two lines at the bottom of the screen which show
|
||||
The Shortcut Lists are the two lines at the bottom of the screen which show
|
||||
some of the more commonly used functions in the editor. The exact
|
||||
functions which are displayed depend on whether Pico Compatibility Mode mode
|
||||
is enabled. @xref{Pico Compatibility}, for more info.
|
||||
@@ -275,25 +295,43 @@ The following toggles are available:
|
||||
|
||||
@table @code
|
||||
|
||||
@item Case Sensitive Search Toggle (Meta-A)
|
||||
toggles case sensistive searching functionality on/off.
|
||||
|
||||
@item Backwards Search Toggle (Meta-B)
|
||||
toggles backwards searching fuctionality on/off.
|
||||
|
||||
@item Constant Update Toggle (Meta-C)
|
||||
toggles the -c (--const) command line flag.
|
||||
|
||||
@item DOS Format Toggle (Meta-D)
|
||||
toggles the -D (--dos) command line flag.
|
||||
|
||||
@item Regular Expressions Toggle (Meta-E)
|
||||
toggles the -R (--regexp) command line flag.
|
||||
|
||||
@item Multiple Files Toggle (Meta-F)
|
||||
toggles the -F (--multibuffer) command line flag.
|
||||
|
||||
@item AutoIndent Toggle (Meta-I)
|
||||
toggles the -i (--autoindent) command line flag.
|
||||
|
||||
@item Cut To End Toggle (Meta-K)
|
||||
toggles the -k (--cut) command line flag.
|
||||
|
||||
@item Cut To End Toggle (Meta-M)
|
||||
@item Mouse Toggle (Meta-M)
|
||||
toggles the -m (--mouse) command line flag.
|
||||
|
||||
@item Mac Format Toggle (Meta-O)
|
||||
toggles the -M (--mac) command line flag.
|
||||
|
||||
@item Pico Mode Toggle (Meta-P)
|
||||
toggles the -p (--pico) command line flag.
|
||||
@xref{Pico Compatibility}, for more info.
|
||||
|
||||
@item Smooth Scrolling Toggle (Meta-S)
|
||||
toggles the -s (--smooth) command line flag.
|
||||
|
||||
@item AutoWrap Toggle (Meta-W)
|
||||
toggles the -w (--nowrap) command line flag.
|
||||
|
||||
@@ -303,19 +341,26 @@ toggles the -x (--nohelp) command line flag.
|
||||
@item Suspend Toggle (Meta-Z)
|
||||
toggles the -z (--suspend) command line flag.
|
||||
|
||||
@item Open Previous File Toggle (Meta-<)
|
||||
changes buffer to previously loaded file.
|
||||
|
||||
@item Open Next File Toggle (Meta->)
|
||||
changes buffer to next loaded file.
|
||||
|
||||
|
||||
@end table
|
||||
|
||||
@node The File Browser, Pico Compatibility, Feature Toggles, Top
|
||||
@chapter The File Browser
|
||||
|
||||
When reading or writilg files, pressing ^T will invoke the file browser.
|
||||
When reading or writing files, pressing ^T will invoke the file browser.
|
||||
Here, one can navigate directories in a graphical manner in order to find
|
||||
the desired file.
|
||||
|
||||
Basic movement in the file browser is accomplished with he arrow keys
|
||||
and page up/down. The behavior of the enter (or 's') key varies by what
|
||||
is currently selected. If the currently selected object is a directory,
|
||||
the file browser will enter and display the contects of the directory. If
|
||||
the file browser will enter and display the contents of the directory. If
|
||||
the object is a file, this filename and path are copied to the statusbar
|
||||
and the file browser is exited.
|
||||
|
||||
@@ -389,10 +434,10 @@ Disable the tab completion code when reading or writing files.
|
||||
Disable the justify (^J)/unjustify (^U) functions in the editor.
|
||||
|
||||
@item --disable-speller
|
||||
Disables spell checker abillity.
|
||||
Disables spell checker ability.
|
||||
|
||||
@item --disable-help
|
||||
Disables the help function (^G). Disabling this option maks the
|
||||
Disables the help function (^G). Disabling this option makes the
|
||||
binary much smaller, but makes it difficult for new users
|
||||
to learn more than very basic things about using the editor.
|
||||
|
||||
@@ -404,6 +449,27 @@ This options disables all the above. It also disables some of
|
||||
the larger internals of the editor, like the marker code (^^) and
|
||||
the cut to line (-k) option which it depends on to work properly.
|
||||
It also disables the function toggles and mouse support.
|
||||
|
||||
@item --disable-wrapping
|
||||
Disables all word wrapping in the editor. This also eliminates the
|
||||
-w command line flag, as nonwrapping is then the default behavior.
|
||||
|
||||
@item --disable-mouse
|
||||
Disables all mouse functionality. This also disables the -m commands line
|
||||
flag which enables the mouse functions.
|
||||
|
||||
@item --disable-operatingdir
|
||||
Disables setting of operating directory. This also disables the -o command
|
||||
line flag.
|
||||
|
||||
@item --disable-nls
|
||||
Disables Native Language support. This will make the available GNU nano
|
||||
translations unusable.
|
||||
|
||||
@item --with-slang
|
||||
Compiling GNU nano with Slang is supported, and will make the binary notably
|
||||
smaller than if compiled with ncurses or other curses libraries.
|
||||
|
||||
@end table
|
||||
|
||||
@contents
|
||||
|
||||
57
nanorc.sample
Normal file
57
nanorc.sample
Normal file
@@ -0,0 +1,57 @@
|
||||
# Sample initialization file for GNU nano
|
||||
# Please note that you must have configured nano with
|
||||
# --enable-nanorc for this file to be read!
|
||||
|
||||
# Use regular expressions by default
|
||||
# set regexp
|
||||
|
||||
# Constantly update the cursor position
|
||||
# set const
|
||||
|
||||
# Use cut to end of line with ^K by default
|
||||
# set cut
|
||||
|
||||
# Use Auto-indentation
|
||||
# set autoindent
|
||||
|
||||
# Don't follow symlinks when writing files
|
||||
# set nofollow
|
||||
|
||||
# Set operating directory (chroot of sorts)
|
||||
# set operatingdir "~"
|
||||
|
||||
# Use Pico Compatibility mode for the shortcut lists and search text
|
||||
# set pico
|
||||
|
||||
# Use this value instead of the default
|
||||
# set fill -8
|
||||
|
||||
# Use this tab size instead of the default
|
||||
# set tabsize 8
|
||||
|
||||
# Use this spelling checker instead of the default one
|
||||
# set speller aspell
|
||||
|
||||
# Save automatically on exit, don't prompt
|
||||
# set tempfile
|
||||
|
||||
# Disallow file modification, why would you want this in an rc file? ;)
|
||||
# set view
|
||||
|
||||
# Don't wrap text at all
|
||||
# set nowrap
|
||||
|
||||
# Don't display the help lists at the bottom of the screen
|
||||
# set nohelp
|
||||
|
||||
# Allow nano to be suspended with ^Z
|
||||
# set suspend
|
||||
|
||||
# Use smooth scrolling as the default
|
||||
# set smooth
|
||||
|
||||
# Allow multiple file buffers (using ^R inserts into separate buffer)
|
||||
# You must have configured with --enable-multibuffer or --enable-extra for
|
||||
# this to work
|
||||
#
|
||||
# set multibuffer
|
||||
@@ -4,4 +4,5 @@ POTFILES
|
||||
*.gmo
|
||||
*.pot
|
||||
cat-id*
|
||||
messages
|
||||
stamp-cat*
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
# $Id$
|
||||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# This file file be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# be used in projects which are not available under the GNU General Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
# These two variables depend on the location of this directory.
|
||||
subdir = po
|
||||
top_builddir = ..
|
||||
|
||||
SHELL = /bin/sh
|
||||
@SET_MAKE@
|
||||
|
||||
@@ -19,22 +22,20 @@ VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datadir = $(prefix)/@DATADIRNAME@
|
||||
datadir = @datadir@
|
||||
localedir = $(datadir)/locale
|
||||
gnulocaledir = $(prefix)/share/locale
|
||||
gettextsrcdir = $(prefix)/share/gettext/po
|
||||
subdir = po
|
||||
gettextsrcdir = $(datadir)/gettext/po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
|
||||
|
||||
CC = @CC@
|
||||
GENCAT = @GENCAT@
|
||||
GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
MSGFMT = @MSGFMT@
|
||||
XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
|
||||
MSGMERGE = PATH=../src:$$PATH msgmerge
|
||||
XGETTEXT = @XGETTEXT@
|
||||
MSGMERGE = msgmerge
|
||||
|
||||
DEFS = @DEFS@
|
||||
CFLAGS = @CFLAGS@
|
||||
@@ -44,20 +45,17 @@ INCLUDES = -I.. -I$(top_srcdir)/intl
|
||||
|
||||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||
|
||||
SOURCES = cat-id-tbl.c
|
||||
POFILES = @POFILES@
|
||||
GMOFILES = @GMOFILES@
|
||||
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
|
||||
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
|
||||
$(POFILES) $(GMOFILES)
|
||||
|
||||
POTFILES = \
|
||||
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
|
||||
.SUFFIXES: .c .o .po .pox .gmo .mo
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) $<
|
||||
@@ -71,19 +69,19 @@ INSTOBJEXT = @INSTOBJEXT@
|
||||
|
||||
.po.gmo:
|
||||
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
|
||||
&& rm -f $$file && $(GMSGFMT) -o $$file $<
|
||||
|
||||
.po.cat:
|
||||
sed -f ../intl/po2msg.sed < $< > $*.msg \
|
||||
&& rm -f $@ && $(GENCAT) $@ $*.msg
|
||||
&& rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
|
||||
|
||||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
all-yes: cat-id-tbl.c $(CATALOGS)
|
||||
all-yes: $(CATALOGS)
|
||||
all-no:
|
||||
|
||||
$(srcdir)/$(PACKAGE).pot: $(POTFILES)
|
||||
# Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
|
||||
# otherwise packages like GCC can not be built if only parts of the source
|
||||
# have been downloaded.
|
||||
|
||||
$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
|
||||
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
||||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
@@ -91,81 +89,35 @@ $(srcdir)/$(PACKAGE).pot: $(POTFILES)
|
||||
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
|
||||
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
|
||||
|
||||
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
||||
$(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
||||
rm -f cat-id-tbl.tmp
|
||||
sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
|
||||
| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
|
||||
if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
|
||||
rm cat-id-tbl.tmp; \
|
||||
else \
|
||||
echo cat-id-tbl.c changed; \
|
||||
rm -f $(srcdir)/cat-id-tbl.c; \
|
||||
mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
|
||||
fi
|
||||
cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
|
||||
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
|
||||
else \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
|
||||
fi
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
case "$$cat" in \
|
||||
*.gmo) destdir=$(gnulocaledir);; \
|
||||
*) destdir=$(localedir);; \
|
||||
esac; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
dir=$$destdir/$$lang/LC_MESSAGES; \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$$dir; \
|
||||
else \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$$dir; \
|
||||
fi; \
|
||||
if test -r $$cat; then \
|
||||
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $$cat as" \
|
||||
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
else \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat \
|
||||
$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
fi; \
|
||||
if test -r $$cat.m; then \
|
||||
$(INSTALL_DATA) $$cat.m $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $$cat.m as" \
|
||||
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
if test -r $(srcdir)/$$cat.m ; then \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat.m \
|
||||
$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
|
||||
else \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
|
||||
fi; \
|
||||
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
||||
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
||||
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
||||
$(mkinstalldirs) $(DESTDIR)$$dir; \
|
||||
if test -r $$cat; then \
|
||||
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
||||
echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
||||
else \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
@@ -174,76 +126,68 @@ uninstall:
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
|
||||
done
|
||||
rm -f $(gettextsrcdir)/po-Makefile.in.in
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
check: all
|
||||
|
||||
cat-id-tbl.o: ../intl/libgettext.h
|
||||
|
||||
dvi info tags TAGS ID:
|
||||
|
||||
mostlyclean:
|
||||
rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
|
||||
rm -f core core.* *.pox $(PACKAGE).po *.new.po
|
||||
rm -fr *.o
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
|
||||
rm -f Makefile Makefile.in POTFILES *.mo
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f $(GMOFILES)
|
||||
|
||||
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: update-po $(DISTFILES)
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir:
|
||||
$(MAKE) update-po
|
||||
@$(MAKE) dist2
|
||||
# This is a separate target because 'update-po' must be executed before.
|
||||
dist2: $(DISTFILES)
|
||||
dists="$(DISTFILES)"; \
|
||||
for file in $$dists; do \
|
||||
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir); \
|
||||
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
||||
cp -p $$dir/$$file $(distdir); \
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
PATH=`pwd`/../src:$$PATH; \
|
||||
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
|
||||
cd $(srcdir); \
|
||||
catalogs='$(CATALOGS)'; \
|
||||
catalogs='$(GMOFILES)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
mv $$lang.po $$lang.old.po; \
|
||||
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
||||
echo "$$lang:"; \
|
||||
if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
|
||||
rm -f $$lang.old.po; \
|
||||
if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
|
||||
mv -f $$lang.new.po $$lang.po; \
|
||||
else \
|
||||
echo "msgmerge for $$cat failed!"; \
|
||||
rm -f $$lang.po; \
|
||||
mv $$lang.old.po $$lang.po; \
|
||||
rm -f $$lang.new.po; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) update-gmo
|
||||
|
||||
POTFILES: POTFILES.in
|
||||
( if test 'x$(srcdir)' != 'x.'; then \
|
||||
posrcprefix='$(top_srcdir)/'; \
|
||||
else \
|
||||
posrcprefix="../"; \
|
||||
fi; \
|
||||
rm -f $@-t $@ \
|
||||
&& (sed -e '/^#/d' -e '/^[ ]*$$/d' \
|
||||
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
|
||||
| sed -e '$$s/\\$$//') > $@-t \
|
||||
&& chmod a-w $@-t \
|
||||
&& mv $@-t $@ )
|
||||
update-gmo: Makefile $(GMOFILES)
|
||||
@:
|
||||
|
||||
Makefile: Makefile.in.in ../config.status POTFILES
|
||||
cd .. \
|
||||
Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
|
||||
$(SHELL) ./config.status
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ files.c
|
||||
global.c
|
||||
move.c
|
||||
nano.c
|
||||
rcfile.c
|
||||
search.c
|
||||
utils.c
|
||||
winio.c
|
||||
|
||||
# Package header files
|
||||
|
||||
367
po/update.pl
Executable file
367
po/update.pl
Executable file
@@ -0,0 +1,367 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
#
|
||||
# GNOME PO Update Utility
|
||||
#
|
||||
# Copyright (C) 2000 Free Software Foundation.
|
||||
#
|
||||
# This script is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This script is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# Authors: Kenneth Christiansen <kenneth@gnu.org>
|
||||
#
|
||||
|
||||
# NOTICE: Please remember to change the variable $PACKAGE to reflect
|
||||
# the package this script is used within.
|
||||
|
||||
$PACKAGE="nano";
|
||||
|
||||
use File::Basename;
|
||||
|
||||
# Declare global variables
|
||||
#-------------------------
|
||||
my $VERSION = "1.5beta5";
|
||||
my $LANG = $ARGV[0];
|
||||
|
||||
# Always print as the first thing
|
||||
#--------------------------------
|
||||
$| = 1;
|
||||
|
||||
# Figure out what package that is in use
|
||||
#---------------------------------------
|
||||
#open FILE, "../configure.in";
|
||||
# while (<FILE>) {
|
||||
# next if /^dnl/; #ignore comments
|
||||
# if ($_=~/AM_INIT_AUTOMAKE\((.*),(.*)\)/o){
|
||||
# $PACKAGE=$1;
|
||||
# last; #stop when found
|
||||
# }
|
||||
# if ($_=~/PACKAGE\((.*)\)/o){
|
||||
# $PACKAGE=$1;
|
||||
# last; #stop when found
|
||||
# }
|
||||
# }
|
||||
#close FILE;
|
||||
|
||||
|
||||
# Give error if script is run without an argument
|
||||
#------------------------------------------------
|
||||
if (! $LANG){
|
||||
print "update.pl: missing file arguments\n";
|
||||
print "Try `update.pl --help' for more information.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
# Use the supplied arguments
|
||||
#---------------------------
|
||||
if ($LANG=~/^-(.)*/){
|
||||
|
||||
if ("$LANG" eq "--version" || "$LANG" eq "-V"){
|
||||
&Version;
|
||||
}
|
||||
elsif ($LANG eq "--help" || "$LANG" eq "-H"){
|
||||
&Help;
|
||||
}
|
||||
elsif ($LANG eq "--dist" || "$LANG" eq "-D"){
|
||||
&Merging;
|
||||
}
|
||||
elsif ($LANG eq "--pot" || "$LANG" eq "-P"){
|
||||
|
||||
# Check for .headerlock file, so the Makefile
|
||||
# will not generate the header files twise
|
||||
#--------------------------------------------
|
||||
if (-e ".headerlock"){
|
||||
&GeneratePot;
|
||||
}else{
|
||||
&GenHeaders;
|
||||
&GeneratePot;}
|
||||
exit;
|
||||
}
|
||||
elsif ($LANG eq "--headers" || "$LANG" eq "-S"){
|
||||
&GenHeaders;
|
||||
exit;
|
||||
}
|
||||
elsif ($LANG eq "--maintain" || "$LANG" eq "-M"){
|
||||
&Maintain;
|
||||
}
|
||||
else {
|
||||
&InvalidOption;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
# Run standard procedure
|
||||
#-----------------------
|
||||
if(-s "$LANG.po"){
|
||||
&GenHeaders;
|
||||
&GeneratePot;
|
||||
&Merging;
|
||||
&Status;
|
||||
}
|
||||
|
||||
# Report error if the language file supplied
|
||||
# to the command line is non-existent
|
||||
#-------------------------------------------
|
||||
else {
|
||||
&NotExisting;
|
||||
}
|
||||
}
|
||||
|
||||
sub Version{
|
||||
|
||||
# Print version information
|
||||
#--------------------------
|
||||
print "GNOME PO Updater $VERSION\n";
|
||||
print "Written by Kenneth Christiansen <kenneth\@gnome.org>, 2000.\n\n";
|
||||
print "Copyright (C) 2000 Free Software Foundation, Inc.\n";
|
||||
print "This is free software; see the source for copying conditions. There is NO\n";
|
||||
print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
sub Help{
|
||||
|
||||
# Print usage information
|
||||
#------------------------
|
||||
print "Usage: ./update.pl [OPTIONS] ...LANGCODE\n";
|
||||
print "Updates pot files and merge them with the translations.\n\n";
|
||||
print " -H, --help shows this help page\n";
|
||||
print " -P, --pot generate the pot file only\n";
|
||||
print " -S, --headers generate the XML headerfiles in POTFILES.in\n";
|
||||
print " -M, --maintain search for missing files in POTFILES.in\n";
|
||||
print " -V, --version shows the version\n";
|
||||
print "\nExamples of use:\n";
|
||||
print "update.sh --pot just creates a new pot file from the source\n";
|
||||
print "update.sh da created new pot file and updated the da.po file\n\n";
|
||||
print "Report bugs to <kenneth\@gnome.org>.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
sub Maintain{
|
||||
|
||||
# Search and fine, all translatable files
|
||||
# ---------------------------------------
|
||||
$i18nfiles="find ../ -print | egrep '.*\\.(c|y|cc|c++|h|gob)' ";
|
||||
|
||||
open(BUF2, "POTFILES.in") || die "update.pl: there's no POTFILES.in!!!\n";
|
||||
|
||||
print "Searching for missing _(\" \") entries...\n";
|
||||
|
||||
open(BUF1, "$i18nfiles|");
|
||||
|
||||
@buf1_1 = <BUF1>;
|
||||
@buf1_2 = <BUF2>;
|
||||
|
||||
# Check if we should ignore some found files, when
|
||||
# comparing with POTFILES.in
|
||||
#-------------------------------------------------
|
||||
if (-s ".potignore"){
|
||||
open FILE, ".potignore";
|
||||
while (<FILE>) {
|
||||
if ($_=~/^[^#]/o){
|
||||
push @bup, $_;
|
||||
}
|
||||
}
|
||||
print "Found .potignore: Ignoring files...\n";
|
||||
@buf1_2 = (@bup, @buf1_2);
|
||||
}
|
||||
|
||||
foreach my $file (@buf1_1){
|
||||
open FILE, "<$file";
|
||||
while (<FILE>) {
|
||||
if ($_=~/_\(\"/o){
|
||||
$file = unpack("x3 A*",$file) . "\n";
|
||||
push @buf2_1, $file;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@buf3_1 = sort (@buf2_1);
|
||||
@buf3_2 = sort (@buf1_2);
|
||||
|
||||
my %in2;
|
||||
foreach (@buf3_2) {
|
||||
$in2{$_} = 1;
|
||||
}
|
||||
|
||||
foreach (@buf3_1){
|
||||
if (!exists($in2{$_})){
|
||||
push @result, $_
|
||||
}
|
||||
}
|
||||
|
||||
# Save file with information about the files missing
|
||||
# if any, and give information about this proceedier
|
||||
#---------------------------------------------------
|
||||
if(@result){
|
||||
open OUT, ">missing";
|
||||
print OUT @result;
|
||||
print "\nHere is the result:\n\n", @result, "\n";
|
||||
print "The file \"missing\" has been placed in the current directory.\n";
|
||||
print "Files supposed to be ignored should be placed in \".potignore\"\n";
|
||||
}
|
||||
|
||||
# If there is nothing to complain about, notice the user
|
||||
#-------------------------------------------------------
|
||||
else{
|
||||
print "\nWell, it's all perfect! Congratulation!\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub InvalidOption{
|
||||
|
||||
# Handle invalid arguments
|
||||
#-------------------------
|
||||
print "update.pl: invalid option -- $LANG\n";
|
||||
print "Try `update.pl --help' for more information.\n";
|
||||
}
|
||||
|
||||
sub GenHeaders{
|
||||
|
||||
# Generate the .h header files, so we can allow glade and
|
||||
# xml translation support
|
||||
#--------------------------------------------------------
|
||||
if(-s "ui-extract.pl"){
|
||||
|
||||
print "Found ui-extract.pl script\nRunning ui-extract...\n";
|
||||
|
||||
open FILE, "<POTFILES.in";
|
||||
while (<FILE>) {
|
||||
|
||||
# Find .xml files in POTFILES.in and generate the
|
||||
# files with help from the ui-extract.pl script
|
||||
#--------------------------------------------------
|
||||
if ($_=~ /(.*)(\.xml)/o){
|
||||
$filename = "../$1.xml";
|
||||
$xmlfiles="perl \.\/ui-extract.pl --local $filename";
|
||||
system($xmlfiles);
|
||||
}
|
||||
|
||||
# Find .glade files in POTFILES.in and generate
|
||||
# the files with help from the ui-extract.pl script
|
||||
#--------------------------------------------------
|
||||
elsif ($_=~ /(.*)(\.glade)/o){
|
||||
$filename = "../$1.glade";
|
||||
$xmlfiles="perl \.\/ui-extract.pl --local $filename";
|
||||
system($xmlfiles);
|
||||
}
|
||||
}
|
||||
close FILE;
|
||||
|
||||
# Create .headerlock file, so the script will know
|
||||
# that we already passed this section. This is required
|
||||
# since the individual sections can be reaced at different
|
||||
# times by the Makefile
|
||||
#---------------------------------------------------------
|
||||
system("touch .headerlock");
|
||||
}
|
||||
}
|
||||
|
||||
sub GeneratePot{
|
||||
|
||||
# Generate the potfiles from the POTFILES.in file
|
||||
#------------------------------------------------
|
||||
|
||||
print "Building the $PACKAGE.pot...\n";
|
||||
|
||||
system ("mv POTFILES.in POTFILES.in.old");
|
||||
|
||||
open INFILE, "<POTFILES.in.old";
|
||||
open OUTFILE, ">POTFILES.in";
|
||||
while (<INFILE>) {
|
||||
if ($_ =~ /\.(glade|xml)$/) {
|
||||
s/\.glade$/\.glade\.h/;
|
||||
s/\.xml$/\.xml\.h/;
|
||||
$_ = basename($_);
|
||||
$_ = "po/tmp/$_\n";
|
||||
}
|
||||
print OUTFILE $_;
|
||||
}
|
||||
close OUTFILE;
|
||||
close INFILE;
|
||||
|
||||
$GETTEXT ="xgettext --default-domain\=$PACKAGE --directory\=\.\."
|
||||
." --add-comments --keyword\=\_ --keyword\=N\_"
|
||||
." --files-from\=\.\/POTFILES\.in ";
|
||||
$GTEST ="test \! -f $PACKAGE\.po \|\| \( rm -f \.\/$PACKAGE\.pot "
|
||||
."&& mv $PACKAGE\.po \.\/$PACKAGE\.pot \)";
|
||||
|
||||
system($GETTEXT);
|
||||
system($GTEST);
|
||||
print "Wrote $PACKAGE.pot\n";
|
||||
system("mv POTFILES.in.old POTFILES.in");
|
||||
|
||||
# If .headerlock file is found, it means that the potfiles
|
||||
# already has been generated. If so delete the generated
|
||||
# .h header files. The reason for this approach with a
|
||||
# file as a marker is due to that the Makefile runs the
|
||||
# scripts in turns
|
||||
#---------------------------------------------------------
|
||||
|
||||
if(-e ".headerlock"){
|
||||
unlink(".headerlock");
|
||||
|
||||
print "Removing generated header (.h) files...";
|
||||
system("rm ./tmp/ -rf");
|
||||
}
|
||||
print "done\n";
|
||||
}
|
||||
|
||||
sub Merging{
|
||||
|
||||
if ($ARGV[1]){
|
||||
$LANG = $ARGV[1];
|
||||
} else {
|
||||
$LANG = $ARGV[0];
|
||||
}
|
||||
|
||||
if ($ARGV[0] ne "--dist" && $ARGV[0] ne "-D") {
|
||||
print "Merging $LANG.po with $PACKAGE.pot...";
|
||||
}
|
||||
|
||||
$MERGE="cp $LANG.po $LANG.po.old && msgmerge $LANG.po.old $PACKAGE.pot -o $LANG.po";
|
||||
|
||||
system($MERGE);
|
||||
|
||||
if ($ARGV[0] ne "--dist" && $ARGV[0] ne "-D") {
|
||||
print "\n\n";
|
||||
}
|
||||
|
||||
# Remove the "messages" trash file generated
|
||||
# by gettext, aswell as the backup file
|
||||
#-------------------------------------------
|
||||
unlink "messages";
|
||||
unlink "$LANG.po.old";
|
||||
}
|
||||
|
||||
sub NotExisting{
|
||||
|
||||
# Report error if supplied language
|
||||
# file is non-existant
|
||||
#----------------------------------
|
||||
print "update.pl: sorry, $LANG.po does not exist!\n";
|
||||
print "Try `update.pl --help' for more information.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
sub Status{
|
||||
|
||||
# Print status information about the po file
|
||||
#-------------------------------------------
|
||||
$STATUS="msgfmt --statistics $LANG.po";
|
||||
|
||||
system($STATUS);
|
||||
print "\n";
|
||||
}
|
||||
95
proto.h
95
proto.h
@@ -34,8 +34,9 @@ extern int current_x, current_y, posible_max, totlines;
|
||||
extern int placewewant;
|
||||
extern int mark_beginx, samelinewrap;
|
||||
extern int totsize, temp_opt;
|
||||
extern int fill, flags,tabsize;
|
||||
extern int fill, wrap_at, flags,tabsize;
|
||||
extern int search_last_line;
|
||||
extern int currslen;
|
||||
|
||||
extern WINDOW *edit, *topwin, *bottomwin;
|
||||
extern char *filename;
|
||||
@@ -43,17 +44,30 @@ extern char *answer;
|
||||
extern char *hblank, *help_text;
|
||||
extern char *last_search;
|
||||
extern char *last_replace;
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
extern char *operating_dir;
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
extern char *alt_speller;
|
||||
#endif
|
||||
extern struct stat fileinfo;
|
||||
extern filestruct *current, *fileage, *edittop, *editbot, *filebot;
|
||||
extern filestruct *cutbuffer, *mark_beginbuf;
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
extern filestruct *open_files;
|
||||
#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];
|
||||
extern shortcut writefile_list[WRITEFILE_LIST_LEN], help_list[HELP_LIST_LEN];
|
||||
extern shortcut writefile_list[WRITEFILE_LIST_LEN], insertfile_list[INSERTFILE_LIST_LEN];
|
||||
extern shortcut spell_list[SPELL_LIST_LEN], replace_list_2[REPLACE_LIST_LEN];
|
||||
extern shortcut help_list[HELP_LIST_LEN];
|
||||
#ifndef DISABLE_BROWSER
|
||||
extern shortcut browser_list[BROWSER_LIST_LEN];
|
||||
extern shortcut browser_list[BROWSER_LIST_LEN], gotodir_list[GOTODIR_LIST_LEN];
|
||||
#endif
|
||||
extern shortcut *currshortcut;
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
extern int use_regexp, regexp_compiled;
|
||||
@@ -65,8 +79,10 @@ extern toggle toggles[TOGGLE_LEN];
|
||||
|
||||
/* Programs we want available */
|
||||
|
||||
char *revstrstr(char *haystack, char *needle, char *rev_start);
|
||||
char *strcasestr(char *haystack, char *needle);
|
||||
char *strstrwrapper(char *haystack, char *needle);
|
||||
char *revstrcasestr(char *haystack, char *needle, char *rev_start);
|
||||
char *strstrwrapper(char *haystack, char *needle, char *rev_start);
|
||||
int search_init(int replacing);
|
||||
int renumber(filestruct * fileptr);
|
||||
int free_filestruct(filestruct * src);
|
||||
@@ -75,16 +91,32 @@ int do_yesno(int all, int leavecursor, char *msg, ...);
|
||||
int actual_x(filestruct * fileptr, int xplus);
|
||||
int strlenpt(char *buf);
|
||||
int statusq(int allowtabs, shortcut s[], int slen, char *def, char *msg, ...);
|
||||
int write_file(char *name, int tmpfile);
|
||||
int write_file(char *name, int tmpfile, int append, int nonamechange);
|
||||
int do_cut_text(void);
|
||||
int do_uncut_text(void);
|
||||
int no_help(void);
|
||||
int renumber_all(void);
|
||||
int open_file(char *filename, int insert, int quiet);
|
||||
int do_writeout(char *path, int exiting);
|
||||
int do_gotoline(long defline);
|
||||
int do_insertfile(int loading_file);
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
int add_open_file(int update, int dup_fix);
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
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_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);
|
||||
#endif
|
||||
|
||||
/* Now in move.c */
|
||||
int do_up(void);
|
||||
int do_down(void);
|
||||
@@ -102,7 +134,7 @@ void check_wrap(filestruct * inptr, char ch);
|
||||
void dump_buffer(filestruct * inptr);
|
||||
void align(char **strp);
|
||||
void edit_refresh(void), edit_refresh_clearok(void);
|
||||
void edit_update(filestruct * fileptr, int topmidbot);
|
||||
void edit_update(filestruct * fileptr, int topmidbotnone);
|
||||
void update_cursor(void);
|
||||
void delete_node(filestruct * fileptr);
|
||||
void set_modified(void);
|
||||
@@ -128,11 +160,12 @@ void do_early_abort(void);
|
||||
void *nmalloc(size_t howmuch);
|
||||
void *nrealloc(void *ptr, size_t howmuch);
|
||||
void die(char *msg, ...);
|
||||
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 page_up_center(void);
|
||||
void page_up(void);
|
||||
void blank_edit(void);
|
||||
void search_init_globals(void);
|
||||
void replace_abort(void);
|
||||
@@ -140,12 +173,29 @@ void add_to_cutbuffer(filestruct * inptr);
|
||||
void do_replace_highlight(int highlight_flag, char *word);
|
||||
void nano_disabled_msg(void);
|
||||
void window_init(void);
|
||||
void do_mouse(void);
|
||||
void print_view_warning(void);
|
||||
void unlink_node(filestruct * fileptr);
|
||||
void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
|
||||
int bot_x, int destructive);
|
||||
|
||||
#ifdef ENABLE_NANORC
|
||||
void do_rcfile(void);
|
||||
#endif
|
||||
|
||||
#ifdef NANO_EXTRA
|
||||
void do_credits(void);
|
||||
#endif
|
||||
|
||||
|
||||
int do_writeout_void(void), do_exit(void), do_gotoline_void(void);
|
||||
int do_insertfile(void), do_search(void), page_up(void), page_down(void);
|
||||
int do_insertfile_void(void), do_search(void);
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
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_up(void), do_down (void), do_right(void), do_left (void);
|
||||
int do_home(void), do_end(void), total_refresh(void), do_mark(void);
|
||||
@@ -154,16 +204,39 @@ int do_first_line(void), do_last_line(void);
|
||||
int do_replace(void), do_help(void), do_enter_void(void);
|
||||
int keypad_on(WINDOW * win, int newval);
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
int open_file_dup_fix(int update);
|
||||
int open_prevfile(int closing_file), open_nextfile(int closing_file);
|
||||
#endif
|
||||
|
||||
char *charalloc (size_t howmuch);
|
||||
|
||||
#if defined (ENABLE_MULTIBUFFER) || !defined (ENABLE_OPERATINGDIR)
|
||||
char *get_full_path(char *origpath);
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_BROWSER
|
||||
char *do_browser(char *path);
|
||||
struct stat filestat(const char *path);
|
||||
char *do_browse_from(char *inpath);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
int do_colorinit(void);
|
||||
void color_on(WINDOW *win, int whatever);
|
||||
void color_off(WINDOW *win, int whatever);
|
||||
|
||||
extern colorstruct colors[NUM_NCOLORS];
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
RETSIGTYPE main_loop (int junk);
|
||||
|
||||
filestruct *copy_node(filestruct * src);
|
||||
filestruct *copy_filestruct(filestruct * src);
|
||||
filestruct *make_new_node(filestruct * prevnode);
|
||||
filestruct *findnextstr(int quiet, filestruct * begin,
|
||||
filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin,
|
||||
int beginx, char *needle);
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
filestruct *open_file_dup_search(int update);
|
||||
#endif
|
||||
|
||||
273
rcfile.c
Normal file
273
rcfile.c
Normal file
@@ -0,0 +1,273 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* rcfile.c *
|
||||
* *
|
||||
* 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) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "config.h"
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifdef ENABLE_NANORC
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
#include <libintl.h>
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
#define NUM_RCOPTS 18
|
||||
/* Static stuff for the nanorc file */
|
||||
rcoption rcopts[NUM_RCOPTS] =
|
||||
{
|
||||
{"regexp", USE_REGEXP},
|
||||
{"const", CONSTUPDATE},
|
||||
{"autoindent", AUTOINDENT},
|
||||
{"cut", CUT_TO_END},
|
||||
{"nofollow", FOLLOW_SYMLINKS},
|
||||
{"mouse", USE_MOUSE},
|
||||
{"operatingdir", 0},
|
||||
{"pico", PICO_MODE},
|
||||
{"tabsize", 0},
|
||||
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
{"fill", 0},
|
||||
#endif
|
||||
|
||||
{"speller", 0},
|
||||
{"tempfile", TEMP_OPT},
|
||||
{"view", VIEW_MODE},
|
||||
{"nowrap", NO_WRAP},
|
||||
{"nohelp", NO_HELP},
|
||||
{"suspend", SUSPEND},
|
||||
{"multibuffer", MULTIBUFFER},
|
||||
{"smooth", SMOOTHSCROLL}};
|
||||
|
||||
/* We have an error in some part of the rcfile; put it on stderr and
|
||||
make the user hit return to continue starting up nano */
|
||||
void rcfile_error(char *msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
va_start(ap, msg);
|
||||
vfprintf(stderr, msg, ap);
|
||||
va_end(ap);
|
||||
fprintf(stderr, _("\nPress return to continue starting nano\n"));
|
||||
|
||||
while (getchar() != '\n')
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
/* Just print the error (one of many, perhaps) but don't abort, yet */
|
||||
void rcfile_msg(int *errors, char *msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (!*errors) {
|
||||
*errors = 1;
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
va_start(ap, msg);
|
||||
vfprintf(stderr, msg, ap);
|
||||
va_end(ap);
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
}
|
||||
|
||||
/* 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')
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\0')
|
||||
return NULL;
|
||||
|
||||
/* Null terminate and advance ptr */
|
||||
*ptr++ = 0;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* Parse the RC file, once it has been opened successfully */
|
||||
void parse_rcfile(FILE *rcstream, char *filename)
|
||||
{
|
||||
char *buf, *ptr, *keyword, *option;
|
||||
int set = 0, lineno = 0, i;
|
||||
int errors = 0;
|
||||
|
||||
buf = charalloc(1024);
|
||||
while (fgets(buf, 1023, rcstream) > 0) {
|
||||
lineno++;
|
||||
ptr = buf;
|
||||
while ((*ptr == ' ' || *ptr == '\t') &&
|
||||
(*ptr != '\n' && *ptr != '\0'))
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\n' || *ptr == '\0')
|
||||
continue;
|
||||
|
||||
if (*ptr == '#') {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("parse_rcfile: Read a comment\n"));
|
||||
#endif
|
||||
continue; /* Skip past commented lines */
|
||||
}
|
||||
|
||||
/* Else skip to the next space */
|
||||
keyword = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
if (!ptr)
|
||||
continue;
|
||||
|
||||
/* Else try to parse the keyword */
|
||||
if (!strcasecmp(keyword, "set"))
|
||||
set = 1;
|
||||
else if (!strcasecmp(keyword, "unset"))
|
||||
set = -1;
|
||||
else {
|
||||
rcfile_msg(&errors, _("Error in %s on line %d: command %s not understood"),
|
||||
filename, lineno, keyword);
|
||||
continue;
|
||||
}
|
||||
|
||||
option = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
/* We don't care if ptr == NULL, as it should if using proper syntax */
|
||||
|
||||
if (set != 0) {
|
||||
for (i = 0; i <= NUM_RCOPTS - 1; i++) {
|
||||
if (!strcasecmp(option, rcopts[i].name)) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("parse_rcfile: Parsing option %s\n"),
|
||||
rcopts[i].name);
|
||||
#endif
|
||||
if (set == 1 || rcopts[i].flag == FOLLOW_SYMLINKS) {
|
||||
if (
|
||||
!strcasecmp(rcopts[i].name, "operatingdir") ||
|
||||
!strcasecmp(rcopts[i].name, "tabsize") ||
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
!strcasecmp(rcopts[i].name, "fill") ||
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
!strcasecmp(rcopts[i].name, "speller")
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
) {
|
||||
|
||||
if (*ptr == '\n' || *ptr == '\0') {
|
||||
rcfile_msg(&errors, _("Error in %s on line %d: option %s requires an argument"),
|
||||
filename, lineno, rcopts[i].name);
|
||||
continue;
|
||||
}
|
||||
option = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
if (!strcasecmp(rcopts[i].name, "fill")) {
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
|
||||
if ((i = atoi(option)) < MIN_FILL_LENGTH) {
|
||||
rcfile_msg(&errors,
|
||||
_("Error in %s on line %d: requested fill size %d too small"),
|
||||
filename, lineno, i);
|
||||
}
|
||||
else
|
||||
fill = i;
|
||||
#endif
|
||||
} else if (!strcasecmp(rcopts[i].name, "tabsize")) {
|
||||
if ((i = atoi(option)) <= 0) {
|
||||
rcfile_msg(&errors,
|
||||
_("Error in %s on line %d: requested tab size %d too small"),
|
||||
filename, lineno, i);
|
||||
} else {
|
||||
tabsize = i;
|
||||
}
|
||||
} else {
|
||||
#ifndef DISABLE_SPELLER
|
||||
alt_speller = charalloc(strlen(option) + 1);
|
||||
strcpy(alt_speller, option);
|
||||
#endif
|
||||
}
|
||||
} else
|
||||
SET(rcopts[i].flag);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("set flag %d!\n"), rcopts[i].flag);
|
||||
#endif
|
||||
} else {
|
||||
UNSET(rcopts[i].flag);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("unset flag %d!\n"), rcopts[i].flag);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (errors)
|
||||
rcfile_error(_("Errors found in .nanorc file"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* The main rc file function, tries to open the rc file */
|
||||
void do_rcfile(void)
|
||||
{
|
||||
char *nanorc;
|
||||
char *unable = _("Unable to open ~/.nanorc file, %s");
|
||||
struct stat fileinfo;
|
||||
FILE *rcstream;
|
||||
|
||||
if (getenv("HOME") == NULL)
|
||||
return;
|
||||
|
||||
nanorc = charalloc(strlen(getenv("HOME")) + 10);
|
||||
sprintf(nanorc, "%s/.nanorc", getenv("HOME"));
|
||||
|
||||
if (stat(nanorc, &fileinfo) == -1) {
|
||||
|
||||
/* Abort if the file doesn't exist and there's some other kind
|
||||
of error stat()ing it */
|
||||
if (errno != ENOENT)
|
||||
rcfile_error(unable, errno);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((rcstream = fopen(nanorc, "r")) == NULL) {
|
||||
rcfile_error(unable, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
parse_rcfile(rcstream, nanorc);
|
||||
fclose(rcstream);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif /* ENABLE_NANORC */
|
||||
|
||||
425
search.c
425
search.c
@@ -19,12 +19,13 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include "config.h"
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
@@ -54,18 +55,18 @@ void regexp_cleanup(void)
|
||||
void search_init_globals(void)
|
||||
{
|
||||
if (last_search == NULL) {
|
||||
last_search = nmalloc(1);
|
||||
last_search = charalloc(1);
|
||||
last_search[0] = 0;
|
||||
}
|
||||
if (last_replace == NULL) {
|
||||
last_replace = nmalloc(1);
|
||||
last_replace = charalloc(1);
|
||||
last_replace[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up the system variables for a search or replace. Returns -1 on
|
||||
abort, 0 on success, and 1 on rerun calling program
|
||||
Return -2 to run opposite program (searchg -> replace, replace -> search)
|
||||
Return -2 to run opposite program (search -> replace, replace -> search)
|
||||
|
||||
replacing = 1 if we call from do_replace, 0 if called from do_search func.
|
||||
*/
|
||||
@@ -73,14 +74,25 @@ int search_init(int replacing)
|
||||
{
|
||||
int i = 0;
|
||||
char *buf;
|
||||
char *prompt, *reprompt = "";
|
||||
static char *backupstring = NULL;
|
||||
#ifndef NANO_SMALL
|
||||
int j;
|
||||
#endif
|
||||
|
||||
search_init_globals();
|
||||
|
||||
buf = nmalloc(strlen(last_search) + 5);
|
||||
buf = charalloc(strlen(last_search) + 5);
|
||||
buf[0] = 0;
|
||||
|
||||
|
||||
/* Clear the backupstring if we've changed from Pico mode to regular
|
||||
mode */
|
||||
if (ISSET(CLEAR_BACKUPSTRING)) {
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
UNSET(CLEAR_BACKUPSTRING);
|
||||
}
|
||||
|
||||
/* Okay, fun time. backupstring is our holder for what is being
|
||||
returned from the statusq call. Using answer for this would be tricky.
|
||||
Here, if we're using PICO_MODE, we only want nano to put the
|
||||
@@ -113,22 +125,26 @@ int search_init(int replacing)
|
||||
else
|
||||
strcpy(buf, "");
|
||||
|
||||
if (ISSET(USE_REGEXP) && ISSET(CASE_SENSITIVE))
|
||||
prompt = _("Case Sensitive Regexp Search%s%s");
|
||||
else if (ISSET(USE_REGEXP))
|
||||
prompt = _("Regexp Search%s%s");
|
||||
else if (ISSET(CASE_SENSITIVE))
|
||||
prompt = _("Case Sensitive Search%s%s");
|
||||
else
|
||||
prompt = _("Search%s%s");
|
||||
|
||||
if (replacing)
|
||||
reprompt = _(" (to replace)");
|
||||
|
||||
/* This is now one simple call. It just does a lot */
|
||||
i = statusq(0, replacing ? replace_list : whereis_list,
|
||||
replacing ? REPLACE_LIST_LEN : WHEREIS_LIST_LEN, backupstring,
|
||||
prompt, reprompt, buf);
|
||||
"%s%s%s%s%s%s",
|
||||
_("Search"),
|
||||
|
||||
/* This string is just a modifier for the search prompt,
|
||||
no grammar is implied */
|
||||
ISSET(CASE_SENSITIVE) ? _(" [Case Sensitive]") : "",
|
||||
|
||||
/* This string is just a modifier for the search prompt,
|
||||
no grammar is implied */
|
||||
ISSET(USE_REGEXP) ? _(" [Regexp]") : "",
|
||||
|
||||
/* This string is just a modifier for the search prompt,
|
||||
no grammar is implied */
|
||||
ISSET(REVERSE_SEARCH) ? _(" [Backwards]") : "",
|
||||
|
||||
replacing ? _(" (to replace)") : "",
|
||||
buf);
|
||||
|
||||
/* Cancel any search, or just return with no previous search */
|
||||
if ((i == -1) || (i < 0 && !last_search[0])) {
|
||||
@@ -137,7 +153,10 @@ int search_init(int replacing)
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
return -1;
|
||||
} else if (i == -2) { /* Same string */
|
||||
} else
|
||||
switch (i) {
|
||||
|
||||
case -2: /* Same string */
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP)) {
|
||||
|
||||
@@ -147,10 +166,9 @@ int search_init(int replacing)
|
||||
else
|
||||
regexp_init(answer);
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
} else if (i == 0) { /* They entered something new */
|
||||
break;
|
||||
case 0: /* They entered something new */
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP))
|
||||
regexp_init(answer);
|
||||
@@ -158,26 +176,32 @@ int search_init(int replacing)
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
last_replace[0] = '\0';
|
||||
} else if (i == NANO_CASE_KEY) { /* They want it case sensitive */
|
||||
break;
|
||||
case TOGGLE_CASE_KEY:
|
||||
case TOGGLE_BACKWARDS_KEY:
|
||||
#ifdef HAVE_REGEX_H
|
||||
case TOGGLE_REGEXP_KEY:
|
||||
#endif
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
backupstring = mallocstrcpy(backupstring, answer);
|
||||
|
||||
if (ISSET(CASE_SENSITIVE))
|
||||
UNSET(CASE_SENSITIVE);
|
||||
else
|
||||
SET(CASE_SENSITIVE);
|
||||
#ifndef NANO_SMALL
|
||||
for (j = 0; j <= TOGGLE_LEN - 1; j++)
|
||||
if (i == toggles[j].val)
|
||||
TOGGLE(toggles[j].flag);
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
} else if (i == NANO_OTHERSEARCH_KEY) {
|
||||
case NANO_OTHERSEARCH_KEY:
|
||||
backupstring = mallocstrcpy(backupstring, answer);
|
||||
return -2; /* Call the opposite search function */
|
||||
} else if (i == NANO_FROMSEARCHTOGOTO_KEY) {
|
||||
case NANO_FROMSEARCHTOGOTO_KEY:
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
do_gotoline_void();
|
||||
return -3;
|
||||
} else { /* First line key, etc. */
|
||||
default:
|
||||
do_early_abort();
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
@@ -202,82 +226,156 @@ void not_found_msg(char *str)
|
||||
}
|
||||
}
|
||||
|
||||
filestruct *findnextstr(int quiet, filestruct * begin, int beginx,
|
||||
int past_editbuff; /* search is now looking through lines not displayed */
|
||||
|
||||
filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beginx,
|
||||
char *needle)
|
||||
{
|
||||
filestruct *fileptr;
|
||||
char *searchstr, *found = NULL, *tmp;
|
||||
int past_editbot = 0, current_x_find;
|
||||
char *searchstr, *rev_start = NULL, *found = NULL;
|
||||
int current_x_find = 0;
|
||||
|
||||
fileptr = current;
|
||||
|
||||
current_x_find = current_x + 1;
|
||||
past_editbuff = 0;
|
||||
|
||||
/* Are we searching the last line? (i.e. the line where search started) */
|
||||
if ((fileptr == begin) && (current_x_find < beginx))
|
||||
search_last_line = 1;
|
||||
if (!ISSET(REVERSE_SEARCH)) { /* forward search */
|
||||
|
||||
/* Make sure we haven't passed the end of the string */
|
||||
if (strlen(fileptr->data) < current_x_find)
|
||||
current_x_find--;
|
||||
current_x_find = current_x + 1;
|
||||
#if 0
|
||||
/* Are we now back to the place where the search started) */
|
||||
if ((fileptr == begin) && (beginx > current_x_find))
|
||||
search_last_line = 1;
|
||||
#endif
|
||||
/* Make sure we haven't passed the end of the string */
|
||||
if (strlen(fileptr->data) < current_x_find)
|
||||
current_x_find--;
|
||||
|
||||
searchstr = &fileptr->data[current_x_find];
|
||||
searchstr = &fileptr->data[current_x_find];
|
||||
|
||||
/* Look for needle in searchstr */
|
||||
while ((found = strstrwrapper(searchstr, needle)) == NULL) {
|
||||
/* Look for needle in searchstr */
|
||||
while ((found = strstrwrapper(searchstr, needle, rev_start)) == NULL) {
|
||||
|
||||
/* finished processing file, get out */
|
||||
if (search_last_line) {
|
||||
/* finished processing file, get out */
|
||||
if (search_last_line) {
|
||||
if (!quiet)
|
||||
not_found_msg(needle);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fileptr = fileptr->next;
|
||||
|
||||
if (fileptr == editbot)
|
||||
past_editbuff = 1;
|
||||
|
||||
/* EOF reached ?, wrap around once */
|
||||
if (fileptr == NULL) {
|
||||
if (bracket_mode) /* don't wrap if looking for bracket match */
|
||||
return NULL;
|
||||
fileptr = fileage;
|
||||
past_editbuff = 1;
|
||||
if (!quiet) {
|
||||
statusbar(_("Search Wrapped"));
|
||||
SET(DISABLE_CURPOS);
|
||||
}
|
||||
}
|
||||
|
||||
/* Original start line reached */
|
||||
if (fileptr == begin)
|
||||
search_last_line = 1;
|
||||
|
||||
searchstr = fileptr->data;
|
||||
}
|
||||
|
||||
/* We found an instance */
|
||||
current_x_find = found - fileptr->data;
|
||||
#if 0
|
||||
/* Ensure we haven't wrapped around again! */
|
||||
if ((search_last_line) && (current_x_find >= beginx)) {
|
||||
if (!quiet)
|
||||
not_found_msg(needle);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#ifndef NANO_SMALL
|
||||
else { /* reverse search */
|
||||
|
||||
fileptr = fileptr->next;
|
||||
current_x_find = current_x - 1;
|
||||
|
||||
if (!past_editbot && (fileptr == editbot))
|
||||
past_editbot = 1;
|
||||
|
||||
/* EOF reached, wrap around once */
|
||||
if (fileptr == NULL) {
|
||||
fileptr = fileage;
|
||||
|
||||
past_editbot = 1;
|
||||
|
||||
if (!quiet)
|
||||
statusbar(_("Search Wrapped"));
|
||||
}
|
||||
|
||||
/* Original start line reached */
|
||||
if (fileptr == begin)
|
||||
/* Are we now back to the place where the search started) */
|
||||
if ((fileptr == begin) && (current_x_find > beginx))
|
||||
search_last_line = 1;
|
||||
|
||||
/* Make sure we haven't passed the begining of the string */
|
||||
#if 0 /* Is this required here ? */
|
||||
if (!(&fileptr->data[current_x_find] - fileptr->data))
|
||||
current_x_find++;
|
||||
#endif
|
||||
rev_start = &fileptr->data[current_x_find];
|
||||
searchstr = fileptr->data;
|
||||
}
|
||||
|
||||
/* We found an instance */
|
||||
current_x_find = 0;
|
||||
for (tmp = fileptr->data; tmp != found; tmp++)
|
||||
current_x_find++;
|
||||
/* Look for needle in searchstr */
|
||||
while ((found = strstrwrapper(searchstr, needle, rev_start)) == NULL) {
|
||||
|
||||
/* Ensure we haven't wrap around again! */
|
||||
if ((search_last_line) && (current_x_find >= beginx)) {
|
||||
if (!quiet)
|
||||
not_found_msg(needle);
|
||||
return NULL;
|
||||
/* finished processing file, get out */
|
||||
if (search_last_line) {
|
||||
if (!quiet)
|
||||
not_found_msg(needle);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fileptr = fileptr->prev;
|
||||
|
||||
if (fileptr == edittop->prev)
|
||||
past_editbuff = 1;
|
||||
|
||||
/* SOF reached ?, wrap around once */
|
||||
/* ? */ if (fileptr == NULL) {
|
||||
if (bracket_mode)
|
||||
return NULL;
|
||||
fileptr = filebot;
|
||||
past_editbuff = 1;
|
||||
if (!quiet) {
|
||||
statusbar(_("Search Wrapped"));
|
||||
SET(DISABLE_CURPOS);
|
||||
}
|
||||
}
|
||||
|
||||
/* Original start line reached */
|
||||
if (fileptr == begin)
|
||||
search_last_line = 1;
|
||||
|
||||
searchstr = fileptr->data;
|
||||
rev_start = fileptr->data + strlen(fileptr->data);
|
||||
}
|
||||
|
||||
/* We found an instance */
|
||||
current_x_find = found - fileptr->data;
|
||||
#if 0
|
||||
/* Ensure we haven't wrapped around again! */
|
||||
if ((search_last_line) && (current_x_find < beginx)) {
|
||||
if (!quiet)
|
||||
not_found_msg(needle);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif /* NANO_SMALL */
|
||||
|
||||
/* Set globals now that we are sure we found something */
|
||||
current = fileptr;
|
||||
current_x = current_x_find;
|
||||
|
||||
if (past_editbot)
|
||||
edit_update(fileptr, CENTER);
|
||||
else
|
||||
update_line(current, current_x);
|
||||
if (!bracket_mode) {
|
||||
if (past_editbuff)
|
||||
edit_update(fileptr, CENTER);
|
||||
else
|
||||
update_line(current, current_x);
|
||||
|
||||
placewewant = xplustabs();
|
||||
reset_cursor();
|
||||
placewewant = xplustabs();
|
||||
reset_cursor();
|
||||
}
|
||||
|
||||
return fileptr;
|
||||
}
|
||||
@@ -337,7 +435,7 @@ int do_search(void)
|
||||
last_search = mallocstrcpy(last_search, answer);
|
||||
|
||||
search_last_line = 0;
|
||||
findnextstr(0, current, current_x, answer);
|
||||
findnextstr(FALSE, FALSE, current, current_x, answer);
|
||||
search_abort();
|
||||
return 1;
|
||||
}
|
||||
@@ -352,9 +450,9 @@ void print_replaced(int num)
|
||||
|
||||
void replace_abort(void)
|
||||
{
|
||||
/* Identicle to search_abort, so we'll call it here. If it
|
||||
/* Identical to search_abort, so we'll call it here. If it
|
||||
does something different later, we can change it back. For now
|
||||
it's just a waste to duplicat code */
|
||||
it's just a waste to duplicate code */
|
||||
search_abort();
|
||||
placewewant = xplustabs();
|
||||
}
|
||||
@@ -433,7 +531,7 @@ char *replace_line(void)
|
||||
search_match_count = regmatches[0].rm_eo - regmatches[0].rm_so;
|
||||
new_line_size = replace_regexp(NULL, 0);
|
||||
/* If they specified an invalid subexpression in the replace
|
||||
* text, return NULL indicating an error */
|
||||
* text, return NULL, indicating an error */
|
||||
if (new_line_size < 0)
|
||||
return NULL;
|
||||
} else {
|
||||
@@ -446,7 +544,7 @@ char *replace_line(void)
|
||||
}
|
||||
|
||||
/* Create buffer */
|
||||
copy = nmalloc(new_line_size);
|
||||
copy = charalloc(new_line_size);
|
||||
|
||||
/* Head of Original Line */
|
||||
strncpy(copy, current->data, current_x);
|
||||
@@ -462,7 +560,7 @@ char *replace_line(void)
|
||||
|
||||
/* The tail of the original line */
|
||||
/* This may expose other bugs, because it no longer
|
||||
goes through each character on the string
|
||||
goes through each character in the string
|
||||
and tests for string goodness. But because
|
||||
we can assume the invariant that current->data
|
||||
is less than current_x + strlen(last_search) long,
|
||||
@@ -506,13 +604,13 @@ int do_replace_loop(char *prevanswer, filestruct *begin, int *beginx,
|
||||
while (1) {
|
||||
|
||||
/* Sweet optimization by Rocco here */
|
||||
fileptr = findnextstr(replaceall, begin, *beginx, prevanswer);
|
||||
fileptr = findnextstr(replaceall, FALSE, begin, *beginx, prevanswer);
|
||||
|
||||
/* No more matches. Done! */
|
||||
if (!fileptr)
|
||||
break;
|
||||
|
||||
/* Make sure only wholewords are found */
|
||||
/* Make sure only whole words are found */
|
||||
if (wholewords)
|
||||
{
|
||||
/* start of line or previous character not a letter */
|
||||
@@ -586,6 +684,12 @@ int do_replace(void)
|
||||
filestruct *begin;
|
||||
char *prevanswer = NULL, *buf = NULL;
|
||||
|
||||
if (ISSET(VIEW_MODE)) {
|
||||
print_view_warning();
|
||||
replace_abort();
|
||||
return 0;
|
||||
}
|
||||
|
||||
i = search_init(1);
|
||||
switch (i) {
|
||||
case -1:
|
||||
@@ -603,7 +707,7 @@ int do_replace(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Again, there was a previous string but they deleted it and hit enter */
|
||||
/* Again, there was a previous string, but they deleted it and hit enter */
|
||||
if (!ISSET(PICO_MODE) && !strcmp(answer, "")) {
|
||||
statusbar(_("Replace Cancelled"));
|
||||
replace_abort();
|
||||
@@ -621,7 +725,7 @@ int do_replace(void)
|
||||
}
|
||||
|
||||
if (ISSET(PICO_MODE)) {
|
||||
buf = nmalloc(strlen(last_replace) + 5);
|
||||
buf = charalloc(strlen(last_replace) + 5);
|
||||
if (strcmp(last_replace, "")) {
|
||||
if (strlen(last_replace) > (COLS / 3)) {
|
||||
strncpy(buf, last_replace, COLS / 3);
|
||||
@@ -664,55 +768,42 @@ void goto_abort(void)
|
||||
display_main_list();
|
||||
}
|
||||
|
||||
int do_gotoline(long defline)
|
||||
int do_gotoline(long line, int save_pos)
|
||||
{
|
||||
long line, i = 1, j = 0;
|
||||
filestruct *fileptr;
|
||||
long i = 1;
|
||||
|
||||
if (defline > 0) /* We already know what line we want to go to */
|
||||
line = defline;
|
||||
else { /* Ask for it */
|
||||
if (line <= 0) { /* Ask for it */
|
||||
|
||||
long j = 0;
|
||||
|
||||
j = statusq(0, goto_list, GOTO_LIST_LEN, "", _("Enter line number"));
|
||||
if (j == -1) {
|
||||
if (j != 0) {
|
||||
statusbar(_("Aborted"));
|
||||
goto_abort();
|
||||
return 0;
|
||||
} else if (j != 0) {
|
||||
do_early_abort();
|
||||
}
|
||||
|
||||
line = atoi(answer);
|
||||
|
||||
/* Bounds check */
|
||||
if (line <= 0) {
|
||||
statusbar(_("Come on, be reasonable"));
|
||||
goto_abort();
|
||||
return 0;
|
||||
}
|
||||
if (!strcmp(answer, "$")) {
|
||||
current = filebot;
|
||||
current_x = 0;
|
||||
edit_update(current, CENTER);
|
||||
goto_abort();
|
||||
return 1;
|
||||
}
|
||||
line = atoi(answer);
|
||||
}
|
||||
|
||||
/* Bounds check */
|
||||
if (line <= 0) {
|
||||
statusbar(_("Come on, be reasonable"));
|
||||
goto_abort();
|
||||
return 0;
|
||||
}
|
||||
if (line > totlines) {
|
||||
statusbar(_("Only %d lines available, skipping to last line"),
|
||||
filebot->lineno);
|
||||
current = filebot;
|
||||
current_x = 0;
|
||||
edit_update(current, CENTER);
|
||||
} else {
|
||||
for (fileptr = fileage; fileptr != NULL && i < line; i++)
|
||||
fileptr = fileptr->next;
|
||||
for (current = fileage; ((current->next != NULL) && (i < line)); i++)
|
||||
current = current->next;
|
||||
|
||||
current = fileptr;
|
||||
current_x = 0;
|
||||
current_x = 0;
|
||||
|
||||
/* if save_pos is non-zero, don't change the cursor position when
|
||||
updating the edit window */
|
||||
if (save_pos)
|
||||
edit_update(current, NONE);
|
||||
else
|
||||
edit_update(current, CENTER);
|
||||
}
|
||||
|
||||
goto_abort();
|
||||
return 1;
|
||||
@@ -720,5 +811,91 @@ int do_gotoline(long defline)
|
||||
|
||||
int do_gotoline_void(void)
|
||||
{
|
||||
return do_gotoline(0);
|
||||
return do_gotoline(0, 0);
|
||||
}
|
||||
|
||||
#if (defined ENABLE_MULTIBUFFER || !defined DISABLE_SPELLER)
|
||||
void do_gotopos(long 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);
|
||||
current_x = pos_x;
|
||||
placewewant = pos_placewewant;
|
||||
update_line(current, pos_x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(NANO_SMALL) && defined(HAVE_REGEX_H)
|
||||
|
||||
int do_find_bracket(void)
|
||||
{
|
||||
char ch_under_cursor, wanted_ch;
|
||||
char *pos, *brackets = "([{<>}])";
|
||||
char regexp_pat[] = "[ ]";
|
||||
int offset, have_past_editbuff = 0, flagsave, current_x_save, count = 1;
|
||||
filestruct *current_save;
|
||||
|
||||
ch_under_cursor = current->data[current_x];
|
||||
|
||||
if ((!(pos = strchr(brackets, ch_under_cursor))) || (!((offset = pos - brackets) < 8))) {
|
||||
statusbar(_("Not a bracket"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
blank_statusbar_refresh();
|
||||
|
||||
wanted_ch = *(brackets + ((strlen(brackets) - (offset + 1))));
|
||||
|
||||
current_x_save = current_x;
|
||||
current_save = current;
|
||||
flagsave = flags;
|
||||
SET(USE_REGEXP);
|
||||
|
||||
/* apparent near redundancy with regexp_pat[] here is needed, [][] works, [[]] doesn't */
|
||||
|
||||
if (offset < (strlen(brackets) / 2)) { /* on a left bracket */
|
||||
regexp_pat[1] = wanted_ch;
|
||||
regexp_pat[2] = ch_under_cursor;
|
||||
UNSET(REVERSE_SEARCH);
|
||||
} else { /* on a right bracket */
|
||||
regexp_pat[1] = ch_under_cursor;
|
||||
regexp_pat[2] = wanted_ch;
|
||||
SET(REVERSE_SEARCH);
|
||||
}
|
||||
|
||||
regexp_init(regexp_pat);
|
||||
|
||||
while (1) {
|
||||
search_last_line = 0;
|
||||
if (findnextstr(1, 1, current, current_x, regexp_pat)) {
|
||||
have_past_editbuff |= past_editbuff;
|
||||
if (current->data[current_x] == ch_under_cursor) /* found identical bracket */
|
||||
count++;
|
||||
else { /* found complementary bracket */
|
||||
if (!(--count)) {
|
||||
if (have_past_editbuff)
|
||||
edit_update(current, CENTER);
|
||||
else
|
||||
update_line(current, current_x);
|
||||
placewewant = xplustabs();
|
||||
reset_cursor();
|
||||
break ;
|
||||
}
|
||||
}
|
||||
} else { /* didn't find either left or right bracket */
|
||||
statusbar(_("No matching bracket"));
|
||||
current_x = current_x_save;
|
||||
current = current_save;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ISSET(REGEXP_COMPILED))
|
||||
regexp_cleanup();
|
||||
flags = flagsave;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
148
utils.c
148
utils.c
@@ -19,12 +19,13 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "nano.h"
|
||||
#include "proto.h"
|
||||
|
||||
@@ -46,54 +47,105 @@ void lowercase(char *src)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* I can't believe I have to write this function */
|
||||
char *strcasestr(char *haystack, char *needle)
|
||||
/* None of this is needed if we're using NANO_SMALL! */
|
||||
#ifndef NANO_SMALL
|
||||
char *revstrstr(char *haystack, char *needle, char *rev_start)
|
||||
{
|
||||
char *localneedle, *localhaystack, *found, *tmp, *tmp2;
|
||||
char *p, *q, *r;
|
||||
|
||||
/* Make a copy of the search string and searcgh space */
|
||||
localneedle = nmalloc(strlen(needle) + 2);
|
||||
localhaystack = nmalloc(strlen(haystack) + 2);
|
||||
|
||||
strcpy(localneedle, needle);
|
||||
strcpy(localhaystack, haystack);
|
||||
|
||||
/* Make them lowercase */
|
||||
lowercase(localneedle);
|
||||
lowercase(localhaystack);
|
||||
|
||||
/* Look for the lowercased substring in the lowercased search space -
|
||||
return NULL if we didn't find anything */
|
||||
if ((found = strstr(localhaystack, localneedle)) == NULL) {
|
||||
free(localneedle);
|
||||
free(localhaystack);
|
||||
return NULL;
|
||||
for(p = rev_start ; p >= haystack ; --p) {
|
||||
for (r = p, q = needle ; (*q == *r) && (*q != '\0') ; r++, q++)
|
||||
;
|
||||
if (*q == '\0')
|
||||
return p;
|
||||
}
|
||||
/* Else return the pointer to the same place in the real search space */
|
||||
tmp2 = haystack;
|
||||
for (tmp = localhaystack; tmp != found; tmp++)
|
||||
tmp2++;
|
||||
|
||||
free(localneedle);
|
||||
free(localhaystack);
|
||||
return tmp2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *strstrwrapper(char *haystack, char *needle)
|
||||
char *revstrcasestr(char *haystack, char *needle, char *rev_start)
|
||||
{
|
||||
char *p, *q, *r;
|
||||
|
||||
for(p = rev_start ; p >= haystack ; --p) {
|
||||
for (r = p, q = needle ; (tolower(*q) == tolower(*r)) && (*q != '\0') ; r++, q++)
|
||||
;
|
||||
if (*q == '\0')
|
||||
return p;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This is now mutt's version (called mutt_stristr) because it doesn't
|
||||
use memory allocation to do a simple search (yuck). */
|
||||
char *strcasestr(char *haystack, char *needle)
|
||||
{
|
||||
const char *p, *q;
|
||||
|
||||
if (!haystack)
|
||||
return NULL;
|
||||
if (!needle)
|
||||
return (haystack);
|
||||
|
||||
while (*(p = haystack)) {
|
||||
for (q = needle; *p && *q && tolower (*p) == tolower (*q); p++, q++)
|
||||
;
|
||||
if (!*q)
|
||||
return (haystack);
|
||||
haystack++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif /* NANO_SMALL */
|
||||
|
||||
char *strstrwrapper(char *haystack, char *needle, char *rev_start)
|
||||
{
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
|
||||
int result;
|
||||
char *i, *j;
|
||||
|
||||
if (ISSET(USE_REGEXP)) {
|
||||
int result = regexec(&search_regexp, haystack, 10, regmatches, 0);
|
||||
if (!result)
|
||||
return haystack + regmatches[0].rm_so;
|
||||
#ifndef NANO_SMALL
|
||||
if (!ISSET(REVERSE_SEARCH)) {
|
||||
result = regexec(&search_regexp, haystack, 10, regmatches, 0);
|
||||
if (!result)
|
||||
return haystack + regmatches[0].rm_so;
|
||||
} else {
|
||||
#endif
|
||||
/* do quick check first */
|
||||
if (!(regexec(&search_regexp, haystack, 10, regmatches, 0))) {
|
||||
/* there is a match */
|
||||
for(i = rev_start ; i >= haystack ; --i)
|
||||
if (!(result = regexec(&search_regexp, i, 10, regmatches, 0))) {
|
||||
j = i + regmatches[0].rm_so;
|
||||
if (j <= rev_start)
|
||||
return j;
|
||||
}
|
||||
|
||||
}
|
||||
#ifndef NANO_SMALL
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
if (ISSET(CASE_SENSITIVE))
|
||||
return strstr(haystack, needle);
|
||||
else
|
||||
return strcasestr(haystack, needle);
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(CASE_SENSITIVE)) {
|
||||
if (ISSET(REVERSE_SEARCH))
|
||||
return revstrstr(haystack, needle, rev_start);
|
||||
else
|
||||
return strstr(haystack,needle);
|
||||
|
||||
} else {
|
||||
if (ISSET(REVERSE_SEARCH))
|
||||
return revstrcasestr(haystack, needle, rev_start);
|
||||
else
|
||||
#endif
|
||||
return strcasestr(haystack, needle);
|
||||
#ifndef NANO_SMALL
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Thanks BG, many ppl have been asking for this... */
|
||||
@@ -109,6 +161,20 @@ void *nmalloc(size_t howmuch)
|
||||
return r;
|
||||
}
|
||||
|
||||
/* We're going to need this too - Hopefully this will minimize
|
||||
the transition cost of moving to the apropriate function. */
|
||||
char *charalloc(size_t howmuch)
|
||||
{
|
||||
void *r;
|
||||
|
||||
/* Panic save? */
|
||||
|
||||
if (!(r = calloc(howmuch, sizeof (char))))
|
||||
die(_("nano: calloc: out of memory!"));
|
||||
|
||||
return (char *) r;
|
||||
}
|
||||
|
||||
void *nrealloc(void *ptr, size_t howmuch)
|
||||
{
|
||||
void *r;
|
||||
@@ -119,7 +185,7 @@ void *nrealloc(void *ptr, size_t howmuch)
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Copy one malloced string to another pointer.
|
||||
/* Copy one malloc()ed string to another pointer.
|
||||
|
||||
Should be used as dest = mallocstrcpy(dest, src);
|
||||
*/
|
||||
@@ -138,7 +204,7 @@ void *mallocstrcpy(char *dest, char *src)
|
||||
return(dest);
|
||||
}
|
||||
|
||||
dest = nmalloc(strlen(src) + 1);
|
||||
dest = charalloc(strlen(src) + 1);
|
||||
strcpy(dest, src);
|
||||
|
||||
return dest;
|
||||
@@ -149,7 +215,7 @@ void *mallocstrcpy(char *dest, char *src)
|
||||
void new_magicline(void)
|
||||
{
|
||||
filebot->next = nmalloc(sizeof(filestruct));
|
||||
filebot->next->data = nmalloc(1);
|
||||
filebot->next->data = charalloc(1);
|
||||
filebot->next->data[0] = '\0';
|
||||
filebot->next->prev = filebot;
|
||||
filebot->next->next = NULL;
|
||||
|
||||
423
winio.c
423
winio.c
@@ -19,11 +19,12 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "config.h"
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
@@ -37,7 +38,7 @@
|
||||
|
||||
/* winio.c statics */
|
||||
static int statblank = 0; /* Number of keystrokes left after
|
||||
we call statubar() before we
|
||||
we call statusbar(), before we
|
||||
actually blank the statusbar */
|
||||
|
||||
/* Local Function Prototypes for only winio.c */
|
||||
@@ -65,7 +66,7 @@ int do_last_line(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Like xplustabs, but for a specifc index of a speficific filestruct */
|
||||
/* Like xplustabs, but for a specific index of a specific filestruct */
|
||||
int xpt(filestruct * fileptr, int index)
|
||||
{
|
||||
int i, tabs = 0;
|
||||
@@ -81,7 +82,7 @@ int xpt(filestruct * fileptr, int index)
|
||||
else
|
||||
tabs += tabsize - (tabs % tabsize);
|
||||
} else if (fileptr->data[i] & 0x80)
|
||||
/* Make 8 bit chars only 1 collumn! */
|
||||
/* Make 8 bit chars only 1 column! */
|
||||
;
|
||||
else if (fileptr->data[i] < 32)
|
||||
tabs++;
|
||||
@@ -127,7 +128,7 @@ int actual_x_from_start(filestruct * fileptr, int xplus, int start)
|
||||
}
|
||||
|
||||
/* Opposite of xplustabs */
|
||||
inline int actual_x(filestruct * fileptr, int xplus)
|
||||
int actual_x(filestruct * fileptr, int xplus)
|
||||
{
|
||||
return actual_x_from_start(fileptr, xplus, 0);
|
||||
}
|
||||
@@ -148,7 +149,7 @@ int strlenpt(char *buf)
|
||||
else
|
||||
tabs += tabsize - (tabs % tabsize);
|
||||
} else if (buf[i] & 0x80)
|
||||
/* Make 8 bit chars only 1 collumn! */
|
||||
/* Make 8 bit chars only 1 column! */
|
||||
;
|
||||
else if (buf[i] < 32)
|
||||
tabs++;
|
||||
@@ -158,7 +159,7 @@ int strlenpt(char *buf)
|
||||
}
|
||||
|
||||
|
||||
/* resets current_y based on the position of current and puts the cursor at
|
||||
/* resets current_y, based on the position of current, and puts the cursor at
|
||||
(current_y, current_x) */
|
||||
void reset_cursor(void)
|
||||
{
|
||||
@@ -226,7 +227,11 @@ void nanoget_repaint(char *buf, char *inputbuf, int x)
|
||||
int len = strlen(buf);
|
||||
int wid = COLS - len;
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(bottomwin, COLOR_STATUSBAR);
|
||||
#endif
|
||||
blank_statusbar();
|
||||
|
||||
if (x <= COLS - 1) {
|
||||
/* Black magic */
|
||||
buf[len - 1] = ' ';
|
||||
@@ -243,9 +248,13 @@ void nanoget_repaint(char *buf, char *inputbuf, int x)
|
||||
waddnstr(bottomwin, &inputbuf[wid * ((x - len) / (wid))], wid);
|
||||
wmove(bottomwin, 0, ((x - len) % wid) + len);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(bottomwin, COLOR_STATUSBAR);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Get the input from the kb, this should only be called from statusq */
|
||||
/* 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)
|
||||
{
|
||||
@@ -256,12 +265,17 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
int shift = 0;
|
||||
#endif
|
||||
|
||||
inputbuf = nmalloc(strlen(def) + 1);
|
||||
inputbuf = charalloc(strlen(def) + 1);
|
||||
inputbuf[0] = 0;
|
||||
|
||||
x_left = strlen(buf);
|
||||
x = strlen(def) + x_left;
|
||||
|
||||
#ifndef DISABLE_MOUSE
|
||||
currshortcut = s;
|
||||
currslen = slen;
|
||||
#endif
|
||||
|
||||
/* Get the input! */
|
||||
if (strlen(def) > 0)
|
||||
strcpy(inputbuf, def);
|
||||
@@ -273,7 +287,11 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
|
||||
while ((kbinput = wgetch(bottomwin)) != 13) {
|
||||
for (j = 0; j <= slen - 1; j++) {
|
||||
if (kbinput == s[j].val) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("Aha! \'%c\' (%d)\n"), kbinput, kbinput);
|
||||
#endif
|
||||
|
||||
if (kbinput == s[j].val && kbinput < 32) {
|
||||
|
||||
/* We shouldn't discard the answer it gave, just because
|
||||
we hit a keystroke, GEEZ! */
|
||||
@@ -288,7 +306,8 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
tabbed = 0;
|
||||
|
||||
switch (kbinput) {
|
||||
/* Stuff we want to equate with <enter>, ASCII 13 */
|
||||
|
||||
/* Stuff we want to equate with <enter>, ASCII 13 */
|
||||
case 343:
|
||||
ungetch(13); /* Enter on iris-ansi $TERM, sometimes */
|
||||
break;
|
||||
@@ -299,15 +318,22 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
case 543: /* Right ctrl again */
|
||||
case 544:
|
||||
case 545: /* Right alt again */
|
||||
break;
|
||||
#endif
|
||||
break;
|
||||
#ifndef DISABLE_MOUSE
|
||||
#ifdef NCURSES_MOUSE_VERSION
|
||||
case KEY_MOUSE:
|
||||
do_mouse();
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case NANO_HOME_KEY:
|
||||
case KEY_HOME:
|
||||
x = x_left;
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
break;
|
||||
case NANO_END_KEY:
|
||||
case KEY_END:
|
||||
x = x_left + strlen(inputbuf);
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
case NANO_FORWARD_KEY:
|
||||
@@ -323,16 +349,13 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
strlen(inputbuf) - (x - x_left) - 1);
|
||||
inputbuf[strlen(inputbuf) - 1] = 0;
|
||||
}
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
break;
|
||||
case NANO_CONTROL_K:
|
||||
case NANO_CONTROL_U:
|
||||
*inputbuf = 0;
|
||||
x = x_left;
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
break;
|
||||
case KEY_BACKSPACE:
|
||||
case KEY_DC:
|
||||
case 127:
|
||||
case NANO_CONTROL_H:
|
||||
if (strlen(inputbuf) > 0) {
|
||||
@@ -347,7 +370,6 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
}
|
||||
if (x > strlen(buf))
|
||||
x--;
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
break;
|
||||
#ifndef DISABLE_TABCOMP
|
||||
case NANO_CONTROL_I:
|
||||
@@ -358,7 +380,6 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
x += shift;
|
||||
if (x - x_left > strlen(inputbuf))
|
||||
x = strlen(inputbuf) + x_left;
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@@ -372,21 +393,22 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
case KEY_DOWN:
|
||||
break;
|
||||
|
||||
case KEY_DC:
|
||||
goto do_deletekey;
|
||||
|
||||
case 27:
|
||||
switch (kbinput = wgetch(edit)) {
|
||||
case 79:
|
||||
case 'O':
|
||||
switch (kbinput = wgetch(edit)) {
|
||||
case 70:
|
||||
case 'F':
|
||||
x = x_left + strlen(inputbuf);
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
break;
|
||||
case 72:
|
||||
case 'H':
|
||||
x = x_left;
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 91:
|
||||
case '[':
|
||||
switch (kbinput = wgetch(edit)) {
|
||||
case 'C':
|
||||
if (x < xend)
|
||||
@@ -398,11 +420,12 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
x--;
|
||||
wmove(bottomwin, 0, x);
|
||||
break;
|
||||
case 49:
|
||||
case '1':
|
||||
case '7':
|
||||
x = x_left;
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
goto skip_126;
|
||||
case 51:
|
||||
goto skip_tilde;
|
||||
case '3':
|
||||
do_deletekey:
|
||||
if (strlen(inputbuf) > 0
|
||||
&& (x - x_left) != strlen(inputbuf)) {
|
||||
memmove(inputbuf + (x - x_left),
|
||||
@@ -410,25 +433,41 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
strlen(inputbuf) - (x - x_left) - 1);
|
||||
inputbuf[strlen(inputbuf) - 1] = 0;
|
||||
}
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
goto skip_126;
|
||||
case 52:
|
||||
goto skip_tilde;
|
||||
case '4':
|
||||
case '8':
|
||||
x = x_left + strlen(inputbuf);
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
goto skip_126;
|
||||
skip_126:
|
||||
goto skip_tilde;
|
||||
skip_tilde:
|
||||
nodelay(edit, TRUE);
|
||||
kbinput = wgetch(edit);
|
||||
if (kbinput == 126 || kbinput == ERR)
|
||||
if (kbinput == '~' || kbinput == ERR)
|
||||
kbinput = -1;
|
||||
nodelay(edit, FALSE);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
for (j = 0; j <= slen - 1; j++) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("Aha! \'%c\' (%d)\n"), kbinput, kbinput);
|
||||
#endif
|
||||
if (kbinput == s[j].val || kbinput == s[j].val - 32) {
|
||||
|
||||
/* We hit an Alt key. Do like above. We don't
|
||||
just ungetch the letter and let it get caught
|
||||
above cause that screws the keypad... */
|
||||
answer = mallocstrcpy(answer, inputbuf);
|
||||
free(inputbuf);
|
||||
return s[j].val;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
if (kbinput < 32)
|
||||
break;
|
||||
|
||||
@@ -442,21 +481,19 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
||||
|
||||
x++;
|
||||
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("input \'%c\' (%d)\n"), kbinput, kbinput);
|
||||
#endif
|
||||
}
|
||||
nanoget_repaint(buf, inputbuf, x);
|
||||
wrefresh(bottomwin);
|
||||
}
|
||||
|
||||
answer = mallocstrcpy(answer, inputbuf);
|
||||
free(inputbuf);
|
||||
|
||||
/* Now that the text is editable instead of bracketed, we have to
|
||||
check for answer == def, instead of answer == "" */
|
||||
if (((ISSET(PICO_MODE)) && !strcmp(answer, "")) ||
|
||||
((!ISSET(PICO_MODE)) && !strcmp(answer, def)))
|
||||
/* In pico mode, just check for a blank answer here */
|
||||
if (((ISSET(PICO_MODE)) && !strcmp(answer, "")))
|
||||
return -2;
|
||||
else
|
||||
return 0;
|
||||
@@ -477,8 +514,15 @@ void titlebar(char *path)
|
||||
if (path == NULL)
|
||||
what = filename;
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(topwin, COLOR_TITLEBAR);
|
||||
mvwaddstr(topwin, 0, 0, hblank);
|
||||
#else
|
||||
horizbar(topwin, 0);
|
||||
wattron(topwin, A_REVERSE);
|
||||
#endif
|
||||
|
||||
|
||||
mvwaddstr(topwin, 0, 3, VERMSG);
|
||||
|
||||
space = COLS - strlen(VERMSG) - strlen(VERSION) - 21;
|
||||
@@ -504,7 +548,14 @@ void titlebar(char *path)
|
||||
}
|
||||
if (ISSET(MODIFIED))
|
||||
mvwaddstr(topwin, 0, COLS - 10, _("Modified"));
|
||||
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(topwin, COLOR_TITLEBAR);
|
||||
#else
|
||||
wattroff(topwin, A_REVERSE);
|
||||
#endif
|
||||
|
||||
wrefresh(topwin);
|
||||
reset_cursor();
|
||||
}
|
||||
@@ -513,7 +564,7 @@ void onekey(char *keystroke, char *desc)
|
||||
{
|
||||
char description[80];
|
||||
|
||||
snprintf(description, 12, " %-10s", desc);
|
||||
snprintf(description, 12 - (strlen(keystroke) - 2), " %-10s", desc);
|
||||
wattron(bottomwin, A_REVERSE);
|
||||
waddstr(bottomwin, keystroke);
|
||||
wattroff(bottomwin, A_REVERSE);
|
||||
@@ -537,13 +588,27 @@ void bottombars(shortcut s[], int slen)
|
||||
if (ISSET(NO_HELP))
|
||||
return;
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(bottomwin, COLOR_BOTTOMBARS);
|
||||
#endif
|
||||
|
||||
/* Determine how many extra spaces are needed to fill the bottom of the screen */
|
||||
k = COLS / 6 - 13;
|
||||
if (slen < 2)
|
||||
k = COLS / 6 - 13;
|
||||
else
|
||||
k = COLS / ((slen + (slen %2)) / 2) - 13;
|
||||
|
||||
|
||||
clear_bottomwin();
|
||||
wmove(bottomwin, 1, 0);
|
||||
|
||||
for (i = 0; i <= slen - 1; i += 2) {
|
||||
snprintf(keystr, 10, "^%c", s[i].val + 64);
|
||||
|
||||
if (s[i].val < 97)
|
||||
snprintf(keystr, 10, "^%c", s[i].val + 64);
|
||||
else
|
||||
snprintf(keystr, 10, "M-%c", s[i].val - 32);
|
||||
|
||||
onekey(keystr, s[i].desc);
|
||||
|
||||
for (j = 0; j < k; j++)
|
||||
@@ -552,13 +617,22 @@ void bottombars(shortcut s[], int slen)
|
||||
|
||||
wmove(bottomwin, 2, 0);
|
||||
for (i = 1; i <= slen - 1; i += 2) {
|
||||
snprintf(keystr, 10, "^%c", s[i].val + 64);
|
||||
|
||||
if (s[i].val < 97)
|
||||
snprintf(keystr, 10, "^%c", s[i].val + 64);
|
||||
else
|
||||
snprintf(keystr, 10, "M-%c", s[i].val - 32);
|
||||
|
||||
onekey(keystr, s[i].desc);
|
||||
|
||||
for (j = 0; j < k; j++)
|
||||
waddch(bottomwin, ' ');
|
||||
}
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(bottomwin, COLOR_BOTTOMBARS);
|
||||
#endif
|
||||
|
||||
wrefresh(bottomwin);
|
||||
|
||||
}
|
||||
@@ -576,7 +650,7 @@ void set_modified(void)
|
||||
/* And so start the display update routines */
|
||||
/* Given a column, this returns the "page" it is on */
|
||||
/* "page" in the case of the display columns, means which set of 80 */
|
||||
/* characters is viewable (ie: page 1 shows from 1 to COLS) */
|
||||
/* characters is viewable (e.g.: page 1 shows from 1 to COLS) */
|
||||
inline int get_page_from_virtual(int virtual)
|
||||
{
|
||||
int page = 2;
|
||||
@@ -612,7 +686,7 @@ inline int get_page_end_virtual(int page)
|
||||
/* This takes care of the case where there is a mark that covers only */
|
||||
/* the current line. */
|
||||
|
||||
/* It expects a line with no tab characers (ie: the type that edit_add */
|
||||
/* It expects a line with no tab characters (i.e.: the type that edit_add */
|
||||
/* deals with */
|
||||
void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
|
||||
int virt_cur_x, int this_page)
|
||||
@@ -620,7 +694,7 @@ void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
|
||||
/*
|
||||
* The general idea is to break the line up into 3 sections: before
|
||||
* the mark, the mark, and after the mark. We then paint each in
|
||||
* turn (for those that are currently visible, of course
|
||||
* turn (for those that are currently visible, of course)
|
||||
*
|
||||
* 3 start points: 0 -> begin, begin->end, end->strlen(data)
|
||||
* in data : pre sel post
|
||||
@@ -632,7 +706,7 @@ void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
|
||||
int pre_data_len = begin, sel_data_len = end - begin, post_data_len = 0; /* Determined from the other two */
|
||||
|
||||
/* now fix the start locations & lengths according to the cursor's
|
||||
* position (ie: our page) */
|
||||
* position (i.e.: our page) */
|
||||
if (pre_data_len < this_page_start)
|
||||
pre_data_len = 0;
|
||||
else
|
||||
@@ -656,10 +730,22 @@ void add_marked_sameline(int begin, int end, filestruct * fileptr, int y,
|
||||
|
||||
/* Paint this line! */
|
||||
mvwaddnstr(edit, y, 0, &fileptr->data[this_page_start], pre_data_len);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattron(edit, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
mvwaddnstr(edit, y, begin - this_page_start,
|
||||
&fileptr->data[begin], sel_data_len);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattroff(edit, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
mvwaddnstr(edit, y, end - this_page_start,
|
||||
&fileptr->data[end], post_data_len);
|
||||
}
|
||||
@@ -674,22 +760,33 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||
int virt_mark_beginx, int this_page)
|
||||
{
|
||||
#ifndef NANO_SMALL
|
||||
/* There are quite a few cases that could take place, we'll deal
|
||||
/* 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
|
||||
&& fileptr->lineno > current->lineno)
|
||||
|| (fileptr->lineno < mark_beginbuf->lineno
|
||||
&& fileptr->lineno < current->lineno))) {
|
||||
/* If we get here we are on a line that is atleast
|
||||
/* If we get here we are on a line that is at least
|
||||
* partially selected. The lineno checks above determined
|
||||
* that */
|
||||
if (fileptr != mark_beginbuf && fileptr != current) {
|
||||
/* We are on a completely marked line, paint it all
|
||||
* inverse */
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattron(edit, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
mvwaddnstr(edit, yval, 0, fileptr->data, COLS);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattroff(edit, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
} else if (fileptr == mark_beginbuf && fileptr == current) {
|
||||
/* Special case, we're still on the same line we started
|
||||
* marking -- so we call our helper function */
|
||||
@@ -704,19 +801,24 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||
}
|
||||
} else if (fileptr == mark_beginbuf) {
|
||||
/*
|
||||
* we're updating the line that was first marked
|
||||
* We're updating the line that was first marked,
|
||||
* but we're not currently on it. So we want to
|
||||
* figur out which half to invert based on our
|
||||
* figure out which half to invert based on our
|
||||
* relative line numbers.
|
||||
*
|
||||
* i.e. If we're above the "beginbuf" line, we want to
|
||||
* mark the left side. Otherwise we're below, so we
|
||||
* mark the right
|
||||
* I.e. if we're above the "beginbuf" line, we want to
|
||||
* mark the left side. Otherwise, we're below, so we
|
||||
* mark the right.
|
||||
*/
|
||||
int target;
|
||||
|
||||
if (mark_beginbuf->lineno > current->lineno)
|
||||
if (mark_beginbuf->lineno > current->lineno) {
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattron(edit, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
}
|
||||
|
||||
target =
|
||||
(virt_mark_beginx <
|
||||
@@ -724,10 +826,23 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||
|
||||
mvwaddnstr(edit, yval, 0, fileptr->data, target);
|
||||
|
||||
if (mark_beginbuf->lineno < current->lineno)
|
||||
if (mark_beginbuf->lineno < current->lineno) {
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattron(edit, A_REVERSE);
|
||||
else
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
} else {
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattroff(edit, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
}
|
||||
|
||||
target = (COLS - 1) - virt_mark_beginx;
|
||||
if (target < 0)
|
||||
@@ -736,17 +851,31 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||
mvwaddnstr(edit, yval, virt_mark_beginx,
|
||||
&fileptr->data[virt_mark_beginx], target);
|
||||
|
||||
if (mark_beginbuf->lineno < current->lineno)
|
||||
if (mark_beginbuf->lineno < current->lineno) {
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattroff(edit, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
}
|
||||
|
||||
} else if (fileptr == current) {
|
||||
/* we're on the cursors line, but it's not the first
|
||||
/* We're on the cursor's line, but it's not the first
|
||||
* one we marked. Similar to the previous logic. */
|
||||
int this_page_start = get_page_start_virtual(this_page),
|
||||
this_page_end = get_page_end_virtual(this_page);
|
||||
|
||||
if (mark_beginbuf->lineno < current->lineno)
|
||||
if (mark_beginbuf->lineno < current->lineno) {
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattron(edit, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
}
|
||||
|
||||
if (virt_cur_x > COLS - 2) {
|
||||
mvwaddnstr(edit, yval, 0,
|
||||
@@ -756,10 +885,23 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||
mvwaddnstr(edit, yval, 0, fileptr->data, virt_cur_x);
|
||||
}
|
||||
|
||||
if (mark_beginbuf->lineno > current->lineno)
|
||||
if (mark_beginbuf->lineno > current->lineno) {
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattron(edit, A_REVERSE);
|
||||
else
|
||||
#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,
|
||||
@@ -769,8 +911,15 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||
mvwaddnstr(edit, yval, virt_cur_x,
|
||||
&fileptr->data[virt_cur_x], COLS - virt_cur_x);
|
||||
|
||||
if (mark_beginbuf->lineno > current->lineno)
|
||||
if (mark_beginbuf->lineno > current->lineno) {
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(edit, COLOR_MARKER);
|
||||
#else
|
||||
wattroff(edit, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else
|
||||
@@ -784,7 +933,7 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||
* Just update one line in the edit buffer. Basically a wrapper for
|
||||
* edit_add
|
||||
*
|
||||
* index gives is a place in the string to update starting from.
|
||||
* index gives us a place in the string to update starting from.
|
||||
* Likely args are current_x or 0.
|
||||
*/
|
||||
void update_line(filestruct * fileptr, int index)
|
||||
@@ -805,12 +954,12 @@ void update_line(filestruct * fileptr, int index)
|
||||
|
||||
mvwaddstr(edit, line, 0, hblank);
|
||||
|
||||
/* Next, convert all the tabs to spaces so everything else is easy */
|
||||
/* Next, convert all the tabs to spaces, so everything else is easy */
|
||||
index = xpt(fileptr, index);
|
||||
|
||||
realdata = fileptr->data;
|
||||
len = strlen(realdata);
|
||||
fileptr->data = nmalloc(xpt(fileptr, len) + 1);
|
||||
fileptr->data = charalloc(xpt(fileptr, len) + 1);
|
||||
|
||||
pos = 0;
|
||||
for (i = 0; i < len; i++) {
|
||||
@@ -841,7 +990,7 @@ void update_line(filestruct * fileptr, int index)
|
||||
/* Now, Paint the line */
|
||||
if (current == fileptr && index > COLS - 2) {
|
||||
/* This handles when the current line is beyond COLS */
|
||||
/* It requires figureing out what page we're at */
|
||||
/* It requires figuring out what page we're on */
|
||||
page = get_page_from_virtual(index);
|
||||
col = get_page_start_virtual(page);
|
||||
|
||||
@@ -912,7 +1061,7 @@ void edit_refresh(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Same as above, but touch the window first so everything is redrawn.
|
||||
* Same as above, but touch the window first, so everything is redrawn.
|
||||
*/
|
||||
void edit_refresh_clearok(void)
|
||||
{
|
||||
@@ -922,10 +1071,10 @@ void edit_refresh_clearok(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Nice generic routine to update the edit buffer given a pointer to the
|
||||
* Nice generic routine to update the edit buffer, given a pointer to the
|
||||
* file struct =)
|
||||
*/
|
||||
void edit_update(filestruct * fileptr, int topmidbot)
|
||||
void edit_update(filestruct * fileptr, int topmidbotnone)
|
||||
{
|
||||
int i = 0;
|
||||
filestruct *temp;
|
||||
@@ -934,8 +1083,11 @@ void edit_update(filestruct * fileptr, int topmidbot)
|
||||
return;
|
||||
|
||||
temp = fileptr;
|
||||
if (topmidbot == 2);
|
||||
else if (topmidbot == 0)
|
||||
if (topmidbotnone == TOP);
|
||||
else if (topmidbotnone == NONE)
|
||||
for (i = 0; i <= current_y - 1 && temp->prev != NULL; i++)
|
||||
temp = temp->prev;
|
||||
else if (topmidbotnone == BOTTOM)
|
||||
for (i = 0; i <= editwinrows - 1 && temp->prev != NULL; i++)
|
||||
temp = temp->prev;
|
||||
else
|
||||
@@ -948,7 +1100,7 @@ void edit_update(filestruct * fileptr, int topmidbot)
|
||||
edit_refresh();
|
||||
}
|
||||
|
||||
/* This function updates current based on where current_y is, reset_cursor
|
||||
/* This function updates current, based on where current_y is; reset_cursor
|
||||
does the opposite */
|
||||
void update_cursor(void)
|
||||
{
|
||||
@@ -974,7 +1126,7 @@ void update_cursor(void)
|
||||
/*
|
||||
* Ask a question on the statusbar. Answer will be stored in answer
|
||||
* global. Returns -1 on aborted enter, -2 on a blank string, and 0
|
||||
* otherwise, the valid shortcut key caught, Def is any editable text we
|
||||
* otherwise, the valid shortcut key caught. Def is any editable text we
|
||||
* want to put up by default.
|
||||
*
|
||||
* New arg tabs tells whether or not to allow tab completion.
|
||||
@@ -992,9 +1144,21 @@ int statusq(int tabs, shortcut s[], int slen, char *def, char *msg, ...)
|
||||
va_end(ap);
|
||||
strncat(foo, ": ", 132);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(bottomwin, COLOR_STATUSBAR);
|
||||
#else
|
||||
wattron(bottomwin, A_REVERSE);
|
||||
#endif
|
||||
|
||||
|
||||
ret = nanogetstr(tabs, foo, def, s, slen, (strlen(foo) + 3));
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(bottomwin, COLOR_STATUSBAR);
|
||||
#else
|
||||
wattroff(bottomwin, A_REVERSE);
|
||||
#endif
|
||||
|
||||
|
||||
switch (ret) {
|
||||
|
||||
@@ -1030,6 +1194,12 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
|
||||
char *nostr; /* Same for no */
|
||||
char *allstr; /* And all, surprise! */
|
||||
char shortstr[5]; /* Temp string for above */
|
||||
#ifndef DISABLE_MOUSE
|
||||
#ifdef NCURSES_MOUSE_VERSION
|
||||
MEVENT mevent;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Yes, no and all are strings of any length. Each string consists of
|
||||
all characters accepted as a valid character for that value.
|
||||
@@ -1040,9 +1210,10 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
|
||||
|
||||
/* Write the bottom of the screen */
|
||||
clear_bottomwin();
|
||||
wattron(bottomwin, A_REVERSE);
|
||||
blank_statusbar_refresh();
|
||||
wattroff(bottomwin, A_REVERSE);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(bottomwin, COLOR_BOTTOMBARS);
|
||||
#endif
|
||||
|
||||
/* Remove gettext call for keybindings until we clear the thing up */
|
||||
if (!ISSET(NO_HELP)) {
|
||||
@@ -1065,9 +1236,23 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
|
||||
va_start(ap, msg);
|
||||
vsnprintf(foo, 132, msg, ap);
|
||||
va_end(ap);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(bottomwin, COLOR_BOTTOMBARS);
|
||||
color_on(bottomwin, COLOR_STATUSBAR);
|
||||
#else
|
||||
wattron(bottomwin, A_REVERSE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
blank_statusbar();
|
||||
mvwaddstr(bottomwin, 0, 0, foo);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(bottomwin, COLOR_STATUSBAR);
|
||||
#else
|
||||
wattroff(bottomwin, A_REVERSE);
|
||||
#endif
|
||||
|
||||
wrefresh(bottomwin);
|
||||
|
||||
if (leavecursor == 1)
|
||||
@@ -1077,12 +1262,45 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
|
||||
kbinput = wgetch(edit);
|
||||
|
||||
switch (kbinput) {
|
||||
#ifndef DISABLE_MOUSE
|
||||
#ifdef NCURSES_MOUSE_VERSION
|
||||
case KEY_MOUSE:
|
||||
|
||||
/* Look ma! We get to duplicate lots of code from do_mouse!! */
|
||||
if (getmouse(&mevent) == ERR)
|
||||
break;
|
||||
if (!wenclose(bottomwin, mevent.y, mevent.x) || ISSET(NO_HELP))
|
||||
break;
|
||||
mevent.y -= editwinrows + 3;
|
||||
if (mevent.y < 0)
|
||||
break;
|
||||
else {
|
||||
|
||||
/* Rather than a bunch of if statements, set up a matrix
|
||||
of possible return keystrokes based on the x and y values */
|
||||
if (all) {
|
||||
char yesnosquare[2][2] = {
|
||||
{yesstr[0], allstr[0]},
|
||||
{nostr[0], NANO_CONTROL_C }};
|
||||
|
||||
ungetch(yesnosquare[mevent.y][mevent.x/(COLS/6)]);
|
||||
} else {
|
||||
char yesnosquare[2][2] = {
|
||||
{yesstr[0], '\0'},
|
||||
{nostr[0], NANO_CONTROL_C }};
|
||||
|
||||
ungetch(yesnosquare[mevent.y][mevent.x/(COLS/6)]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case NANO_CONTROL_C:
|
||||
ok = -2;
|
||||
break;
|
||||
default:
|
||||
|
||||
/* Look for the kbinput in the yes, no and (optinally) all str */
|
||||
/* Look for the kbinput in the yes, no and (optimally) all str */
|
||||
for (i = 0; yesstr[i] != 0 && yesstr[i] != kbinput; i++)
|
||||
;
|
||||
if (yesstr[i] != 0) {
|
||||
@@ -1134,12 +1352,22 @@ void statusbar(char *msg, ...)
|
||||
|
||||
wmove(bottomwin, 0, start_x);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_on(bottomwin, COLOR_STATUSBAR);
|
||||
#else
|
||||
wattron(bottomwin, A_REVERSE);
|
||||
#endif
|
||||
|
||||
waddstr(bottomwin, "[ ");
|
||||
waddstr(bottomwin, foo);
|
||||
waddstr(bottomwin, " ]");
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(bottomwin, COLOR_STATUSBAR);
|
||||
#else
|
||||
wattroff(bottomwin, A_REVERSE);
|
||||
#endif
|
||||
|
||||
wrefresh(bottomwin);
|
||||
|
||||
if (ISSET(CONSTUPDATE))
|
||||
@@ -1212,23 +1440,29 @@ int do_cursorpos(void)
|
||||
}
|
||||
|
||||
/* Our broken, non-shortcut list compliant help function.
|
||||
But hey, it's better than nothing, and it's dynamic! */
|
||||
But, hey, it's better than nothing, and it's dynamic! */
|
||||
int do_help(void)
|
||||
{
|
||||
#ifndef DISABLE_HELP
|
||||
char *ptr = help_text, *end;
|
||||
int i, j, row = 0, page = 1, kbinput = 0, no_more = 0, kp;
|
||||
int i, j, row = 0, page = 1, kbinput = 0, no_more = 0, kp, kp2;
|
||||
int no_help_flag = 0;
|
||||
|
||||
blank_edit();
|
||||
curs_set(0);
|
||||
blank_statusbar();
|
||||
|
||||
#ifndef DISABLE_MOUSE
|
||||
currshortcut = help_list;
|
||||
currslen = HELP_LIST_LEN;
|
||||
#endif
|
||||
|
||||
kp = keypad_on(edit, 1);
|
||||
kp2 = keypad_on(bottomwin, 1);
|
||||
|
||||
if (ISSET(NO_HELP)) {
|
||||
|
||||
/* Well if we're going to do this, we should at least
|
||||
/* Well, if we're going to do this, we should at least
|
||||
do it the right way */
|
||||
no_help_flag = 1;
|
||||
UNSET(NO_HELP);
|
||||
@@ -1241,6 +1475,13 @@ int do_help(void)
|
||||
do {
|
||||
ptr = help_text;
|
||||
switch (kbinput) {
|
||||
#ifndef DISABLE_MOUSE
|
||||
#ifdef NCURSES_MOUSE_VERSION
|
||||
case KEY_MOUSE:
|
||||
do_mouse();
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case NANO_NEXTPAGE_KEY:
|
||||
case NANO_NEXTPAGE_FKEY:
|
||||
case KEY_NPAGE:
|
||||
@@ -1260,7 +1501,7 @@ int do_help(void)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Calculate where in the text we should be based on the page */
|
||||
/* Calculate where in the text we should be, based on the page */
|
||||
for (i = 1; i < page; i++) {
|
||||
row = 0;
|
||||
j = 0;
|
||||
@@ -1289,7 +1530,7 @@ int do_help(void)
|
||||
}
|
||||
if (j == COLS - 5) {
|
||||
|
||||
/* Don't print half a word if we've run of of space */
|
||||
/* Don't print half a word if we've run out of space */
|
||||
while (*end != ' ' && *end != '\0') {
|
||||
end--;
|
||||
j--;
|
||||
@@ -1320,6 +1561,7 @@ int do_help(void)
|
||||
curs_set(1);
|
||||
edit_refresh();
|
||||
kp = keypad_on(edit, kp);
|
||||
kp2 = keypad_on(bottomwin, kp2);
|
||||
|
||||
#elif defined(DISABLE_HELP)
|
||||
nano_disabled_msg();
|
||||
@@ -1364,7 +1606,7 @@ void dump_buffer_reverse(filestruct * inptr)
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
|
||||
/* Fix editbot based on the assumption that edittop is correct */
|
||||
/* Fix editbot, based on the assumption that edittop is correct */
|
||||
void fix_editbot(void)
|
||||
{
|
||||
int i;
|
||||
@@ -1382,7 +1624,7 @@ void do_replace_highlight(int highlight_flag, char *word)
|
||||
highlight_word = mallocstrcpy(highlight_word, ¤t->data[current_x]);
|
||||
highlight_word[strlen(word)] = '\0';
|
||||
|
||||
/* adjust output when word extends beyond screen*/
|
||||
/* adjust output when word extends beyond screen */
|
||||
|
||||
x = xplustabs();
|
||||
y = get_page_end_virtual(get_page_from_virtual(x)) + 1;
|
||||
@@ -1408,7 +1650,7 @@ void do_replace_highlight(int highlight_flag, char *word)
|
||||
}
|
||||
|
||||
#ifdef NANO_EXTRA
|
||||
#define CREDIT_LEN 47
|
||||
#define CREDIT_LEN 48
|
||||
void do_credits(void)
|
||||
{
|
||||
int i, j = 0, k, place = 0, start_x;
|
||||
@@ -1447,6 +1689,7 @@ void do_credits(void)
|
||||
"Joshua Jensen",
|
||||
"Ryan Krebs",
|
||||
"Albert Chin",
|
||||
"David Lawrence Ramsey",
|
||||
"",
|
||||
specialthx,
|
||||
"Plattsburgh State University",
|
||||
@@ -1511,7 +1754,7 @@ void do_credits(void)
|
||||
int keypad_on(WINDOW * win, int newval)
|
||||
{
|
||||
|
||||
/* This is taken right from aumix. Don't sue me */
|
||||
/* This is taken right from aumix. Don't sue me. */
|
||||
#ifdef HAVE_USEKEYPAD
|
||||
int old;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user