Added -b, -e and -f compatibility flags, updated man pages, added Alt-Alt-x functionality
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@411 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
3a7c0bee6b
Коммит
51b3eec536
12
ChangeLog
12
ChangeLog
@ -6,9 +6,11 @@ General
|
|||||||
HURD. Changes in files.c:write_file(), new function
|
HURD. Changes in files.c:write_file(), new function
|
||||||
nano.c:clear_filename(), many changed in main(), a few other
|
nano.c:clear_filename(), many changed in main(), a few other
|
||||||
places. Please test this!
|
places. Please test this!
|
||||||
|
- Added -b, -e, and -f flags, which we ignore as nano provides
|
||||||
|
their functionality already.
|
||||||
- cut.c:
|
- cut.c:
|
||||||
do_uncut_text()
|
do_uncut_text()
|
||||||
- Fix renumbering bug when uncutting marked test at filebot.
|
- Fix renumbering bug when uncutting marked text at filebot.
|
||||||
- Fix screen not being displayed when we are uncutting marked
|
- Fix screen not being displayed when we are uncutting marked
|
||||||
text at editbot (Bug discovered by Ken Tyler).
|
text at editbot (Bug discovered by Ken Tyler).
|
||||||
- Fix magic line not getting created when (you guessed it)
|
- Fix magic line not getting created when (you guessed it)
|
||||||
@ -26,6 +28,14 @@ General
|
|||||||
- nano.c:
|
- nano.c:
|
||||||
renumber()
|
renumber()
|
||||||
- Dont stupidly assign the value of prev->lineno if prev == NULL!
|
- Dont 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
|
||||||
|
modify_control_key. Removed #ifdef _POSIX_VDISABLE check
|
||||||
|
around Control-S,Q,Z handlers because we need it now for
|
||||||
|
the Alt-Alt-x code.
|
||||||
|
- nano.1, nano.1.html:
|
||||||
|
- Updated man page for -b, -e, -f and expanded explanation for -p.
|
||||||
- utils.c:
|
- utils.c:
|
||||||
new_magicline()
|
new_magicline()
|
||||||
- Increment totsize!! We decrement it when we've read a file,
|
- Increment totsize!! We decrement it when we've read a file,
|
||||||
|
2
faq.html
2
faq.html
@ -21,7 +21,7 @@
|
|||||||
nano?</a></font>
|
nano?</a></font>
|
||||||
<br><font color="#330000"><a href="#1.5">1.5. Why the name change from
|
<br><font color="#330000"><a href="#1.5">1.5. Why the name change from
|
||||||
TIP?</a></font>
|
TIP?</a></font>
|
||||||
<br><font color="#330000"><a href="#1.6">1.6 What is the current version
|
<br><font color="#330000"><a href="#1.6">1.6. What is the current version
|
||||||
of nano?</a></font>
|
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 man page
|
||||||
without having to download the program!</a></font></blockquote>
|
without having to download the program!</a></font></blockquote>
|
||||||
|
7
nano.1
7
nano.1
@ -64,7 +64,9 @@ a new file, do not follow it. Good for editing files in /tmp perhaps?
|
|||||||
Enable mouse support (if available for your system).
|
Enable mouse support (if available for your system).
|
||||||
.TP
|
.TP
|
||||||
.B \-p (\-\-pico)
|
.B \-p (\-\-pico)
|
||||||
Emulate Pico as closely as possible.
|
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
|
.TP
|
||||||
.B \-s (\-\-speller)
|
.B \-s (\-\-speller)
|
||||||
Enable alternative spell checker command.
|
Enable alternative spell checker command.
|
||||||
@ -84,6 +86,9 @@ Disable help screen at bottom of editor.
|
|||||||
.B \-z (\-\-suspend)
|
.B \-z (\-\-suspend)
|
||||||
Enable suspend ability.
|
Enable suspend ability.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-b, \-e, \-f
|
||||||
|
Ignored, for compatibility with Pico.
|
||||||
|
.TP
|
||||||
.B \+LINE
|
.B \+LINE
|
||||||
Places cursor at LINE on startup.
|
Places cursor at LINE on startup.
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
|
10
nano.1.html
10
nano.1.html
@ -86,7 +86,9 @@ Enable mouse support (if available for your system).
|
|||||||
<DT><B>-p (--pico)</B>
|
<DT><B>-p (--pico)</B>
|
||||||
|
|
||||||
<DD>
|
<DD>
|
||||||
Emulate Pico as closely as possible.
|
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>-s (--speller)</B>
|
||||||
|
|
||||||
<DD>
|
<DD>
|
||||||
@ -111,6 +113,10 @@ Disable help screen at bottom of editor.
|
|||||||
|
|
||||||
<DD>
|
<DD>
|
||||||
Enable suspend ability.
|
Enable suspend ability.
|
||||||
|
<DT><B>-b, -e, -f</B>
|
||||||
|
|
||||||
|
<DD>
|
||||||
|
Ignored, for compatibility with Pico.
|
||||||
<DT><B>+LINE</B>
|
<DT><B>+LINE</B>
|
||||||
|
|
||||||
<DD>
|
<DD>
|
||||||
@ -171,6 +177,6 @@ used by others).
|
|||||||
This document was created by
|
This document was created by
|
||||||
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
|
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
|
||||||
using the manual pages.<BR>
|
using the manual pages.<BR>
|
||||||
Time: 04:21:24 GMT, December 03, 2000
|
Time: 02:16:52 GMT, December 18, 2000
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
36
nano.c
36
nano.c
@ -2034,7 +2034,7 @@ int main(int argc, char *argv[])
|
|||||||
int kbinput; /* Input from keyboard */
|
int kbinput; /* Input from keyboard */
|
||||||
long startline = 0; /* Line to try and start at */
|
long startline = 0; /* Line to try and start at */
|
||||||
int keyhandled = 0; /* Have we handled the keystroke yet? */
|
int keyhandled = 0; /* Have we handled the keystroke yet? */
|
||||||
int i;
|
int i, modify_control_seq = 0;
|
||||||
char *argv0;
|
char *argv0;
|
||||||
#ifdef _POSIX_VDISABLE
|
#ifdef _POSIX_VDISABLE
|
||||||
struct termios term;
|
struct termios term;
|
||||||
@ -2077,10 +2077,10 @@ int main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GETOPT_LONG
|
#ifdef HAVE_GETOPT_LONG
|
||||||
while ((optchr = getopt_long(argc, argv, "?T:RVchiklmpr:s:tvwxz",
|
while ((optchr = getopt_long(argc, argv, "?T:RVbcefhiklmpr:s:tvwxz",
|
||||||
long_options, &option_index)) != EOF) {
|
long_options, &option_index)) != EOF) {
|
||||||
#else
|
#else
|
||||||
while ((optchr = getopt(argc, argv, "h?T:RVciklmpr:s:tvwxz")) != EOF) {
|
while ((optchr = getopt(argc, argv, "h?T:RVbcefiklmpr:s:tvwxz")) != EOF) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (optchr) {
|
switch (optchr) {
|
||||||
@ -2099,6 +2099,11 @@ int main(int argc, char *argv[])
|
|||||||
case 'V':
|
case 'V':
|
||||||
version();
|
version();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
case 'b':
|
||||||
|
case 'e':
|
||||||
|
case 'f':
|
||||||
|
/* Pico compatibility flags */
|
||||||
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
SET(CONSTUPDATE);
|
SET(CONSTUPDATE);
|
||||||
break;
|
break;
|
||||||
@ -2275,6 +2280,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
case 27:
|
||||||
|
/* If we get Alt-Alt, the next keystroke should be the same as a
|
||||||
|
control sequence */
|
||||||
|
modify_control_seq = 1;
|
||||||
|
keyhandled = 1;
|
||||||
|
break;
|
||||||
case 91:
|
case 91:
|
||||||
|
|
||||||
switch (kbinput = wgetch(edit)) {
|
switch (kbinput = wgetch(edit)) {
|
||||||
@ -2404,6 +2415,18 @@ int main(int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* If the modify_control_seq is set, we received an Alt-Alt
|
||||||
|
sequence before this, so we make this key a control sequence
|
||||||
|
by subtracting 64 or 96, depending on its value. */
|
||||||
|
if (!keyhandled && modify_control_seq) {
|
||||||
|
if (kbinput >= 'A' && kbinput < 'a')
|
||||||
|
kbinput -= 64;
|
||||||
|
else if (kbinput >= 'a' && kbinput <= 'z')
|
||||||
|
kbinput -= 96;
|
||||||
|
|
||||||
|
modify_control_seq = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Look through the main shortcut list to see if we've hit a
|
/* Look through the main shortcut list to see if we've hit a
|
||||||
shortcut key */
|
shortcut key */
|
||||||
for (i = 0; i < MAIN_LIST_LEN && !keyhandled; i++) {
|
for (i = 0; i < MAIN_LIST_LEN && !keyhandled; i++) {
|
||||||
@ -2417,18 +2440,17 @@ int main(int argc, char *argv[])
|
|||||||
keyhandled = 1;
|
keyhandled = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef _POSIX_VDISABLE
|
/* If we're in raw mode or using Alt-Alt-x, we have to catch
|
||||||
/* Since we're in raw mode, we have to catch ^Q and ^S */
|
Control-S and Control-Q */
|
||||||
if (kbinput == 17 || kbinput == 19)
|
if (kbinput == 17 || kbinput == 19)
|
||||||
keyhandled = 1;
|
keyhandled = 1;
|
||||||
|
|
||||||
/* And catch ^Z by hand when triggered */
|
/* Catch ^Z by hand when triggered also */
|
||||||
if (kbinput == 26) {
|
if (kbinput == 26) {
|
||||||
if (ISSET(SUSPEND))
|
if (ISSET(SUSPEND))
|
||||||
do_suspend(0);
|
do_suspend(0);
|
||||||
keyhandled = 1;
|
keyhandled = 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Last gasp, stuff that's not in the main lists */
|
/* Last gasp, stuff that's not in the main lists */
|
||||||
if (!keyhandled)
|
if (!keyhandled)
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user