New arg --enable-extra, checks for ./configure options, oher stuff :-)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@316 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2000-11-24 20:45:14 +00:00
parent 650e8a406b
commit 8a0de3bb3f
11 changed files with 500 additions and 296 deletions

View File

@ -6,6 +6,8 @@ CVS code -
- Username tab completion code, and cleaned up existing tabcomp
code. New functions real_dir_from_tide(), append_slash_if_dir(),
username_tab_completion is more than a stub now =-).
- New options --enable-extra. New code in nano.c:version() to
print out various options from ./configure, function do_credits().
- files.c:
write_file()
- Unsetting modified on temp files bug fixed (Rocco Corsi).

View File

@ -24,5 +24,8 @@
/* Define to use the slang wrappers for curses instead of native curses */
#undef USE_SLANG
/* Define this to enable the extra stuff */
#undef NANO_EXTRA
/* Define to disable the tab completion code Chris worked so hard on! */
#undef DISABLE_TABCOMP

View File

@ -76,6 +76,9 @@
/* Define to use the slang wrappers for curses instead of native curses */
#undef USE_SLANG
/* Define this to enable the extra stuff */
#undef NANO_EXTRA
/* Define to disable the tab completion code Chris worked so hard on! */
#undef DISABLE_TABCOMP

370
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,12 @@ AC_ARG_ENABLE(tiny,
AC_DEFINE(NANO_SMALL) tiny_support=yes
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
fi])
AC_ARG_ENABLE(tabcomp,
[ --disable-tabcomp Disables tab completion code for a smaller binary],
[if test x$enableval != xyes; then

11
files.c
View File

@ -455,6 +455,9 @@ int write_file(char *name, int tmp)
int do_writeout(int exiting)
{
int i = 0;
#ifdef NANO_EXTRA
static int did_cred = 0;
#endif
answer = mallocstrcpy(answer, filename);
@ -481,6 +484,14 @@ int do_writeout(int exiting)
#ifdef DEBUG
fprintf(stderr, _("filename is %s"), answer);
#endif
#ifdef NANO_EXTRA
if (exiting && !ISSET(TEMP_OPT) && !strcasecmp(answer, "zzy") && !did_cred) {
do_credits();
did_cred = 1;
return - 1;
}
#endif
if (strcmp(answer, filename)) {
struct stat st;
if (!stat(answer, &st)) {

20
nano.c
View File

@ -417,7 +417,25 @@ void version(void)
printf(_(" nano version %s by Chris Allegretta (compiled %s, %s)\n"),
VERSION, __TIME__, __DATE__);
printf(_
(" Email: nano@nano-editor.org Web: http://www.nano-editor.org\n"));
(" Email: nano@nano-editor.org Web: http://www.nano-editor.org"));
#if defined(NANO_SMALL) || defined(NANO_EXTRA) || defined(DISABLE_TABCOMP) || defined(USE_SLANG)
printf(_("\n Compiled options:"));
#endif
#ifdef NANO_SMALL
printf(" --enable-tiny");
#endif
#ifdef NANO_EXTRA
printf(" --enable-extra");
#endif
#ifdef DISABLE_TABCOMP
printf(" --disable-tabcomp");
#endif
#ifdef USE_SLANG
printf(" --with-slang");
#endif
printf("\n");
}
filestruct *make_new_node(filestruct * prevnode)

View File

@ -169,70 +169,81 @@ Usage: nano [option] +LINE <file>\n\
{" -z \t\tEnable suspend\n", 136},
{" +LINE\t\tStart at line number LINE\n", 137},
{" nano version %s by Chris Allegretta (compiled %s, %s)\n", 138},
{" Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org\n", 139},
{"Mark Set", 140},
{"Mark UNset", 141},
{"check_wrap called with inptr->data=\"%s\"\n", 142},
{"current->data now = \"%s\"\n", 143},
{"After, data = \"%s\"\n", 144},
{"Edit a replacement", 145},
{"Could not create a temporary filename: %s", 146},
{"Finished checking spelling", 147},
{"Spell checking failed", 148},
{"Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? ", 149},
{"Cannot resize top win", 150},
{"Cannot move top win", 151},
{"Cannot resize edit win", 152},
{"Cannot move edit win", 153},
{"Cannot resize bottom win", 154},
{"Cannot move bottom win", 155},
{"Justify Complete", 156},
{"%s enable/disable", 157},
{"enabled", 158},
{"disabled", 159},
{"Main: set up windows\n", 160},
{"Main: bottom win\n", 161},
{"Main: open file\n", 162},
{"I got Alt-O-%c! (%d)\n", 163},
{"I got Alt-[-1-%c! (%d)\n", 164},
{"I got Alt-[-2-%c! (%d)\n", 165},
{"I got Alt-[-%c! (%d)\n", 166},
{"I got Alt-%c! (%d)\n", 167},
{"Case Sensitive Regexp Search%s%s", 168},
{"Regexp Search%s%s", 169},
{"Case Sensitive Search%s%s", 170},
{"Search%s%s", 171},
{" (to replace)", 172},
{"Search Cancelled", 173},
{"\"%s...\" not found", 174},
{"Search Wrapped", 175},
{"Replaced %d occurences", 176},
{"Replaced 1 occurence", 177},
{"Replace Cancelled", 178},
{"Replace this instance?", 179},
{"Replace failed: unknown subexpression!", 180},
{"Replace with [%s]", 181},
{"Replace with", 182},
{"Enter line number", 183},
{"Aborted", 184},
{"Come on, be reasonable", 185},
{"Only %d lines available, skipping to last line", 186},
{"actual_x_from_start for xplus=%d returned %d\n", 187},
{"input '%c' (%d)\n", 188},
{"New Buffer", 189},
{" File: ...", 190},
{"Modified", 191},
{"Moved to (%d, %d) in edit buffer\n", 192},
{"current->data = \"%s\"\n", 193},
{"I got \"%s\"\n", 194},
{"Yes", 195},
{"All", 196},
{"No", 197},
{"do_cursorpos: linepct = %f, bytepct = %f\n", 198},
{"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 199},
{"Dumping file buffer to stderr...\n", 200},
{"Dumping cutbuffer to stderr...\n", 201},
{"Dumping a buffer to stderr...\n", 202},
{" Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org", 139},
{"\
\n\
Compiled options:", 140},
{"Mark Set", 141},
{"Mark UNset", 142},
{"check_wrap called with inptr->data=\"%s\"\n", 143},
{"current->data now = \"%s\"\n", 144},
{"After, data = \"%s\"\n", 145},
{"Edit a replacement", 146},
{"Could not create a temporary filename: %s", 147},
{"Finished checking spelling", 148},
{"Spell checking failed", 149},
{"Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? ", 150},
{"Cannot resize top win", 151},
{"Cannot move top win", 152},
{"Cannot resize edit win", 153},
{"Cannot move edit win", 154},
{"Cannot resize bottom win", 155},
{"Cannot move bottom win", 156},
{"Justify Complete", 157},
{"%s enable/disable", 158},
{"enabled", 159},
{"disabled", 160},
{"Main: set up windows\n", 161},
{"Main: bottom win\n", 162},
{"Main: open file\n", 163},
{"I got Alt-O-%c! (%d)\n", 164},
{"I got Alt-[-1-%c! (%d)\n", 165},
{"I got Alt-[-2-%c! (%d)\n", 166},
{"I got Alt-[-%c! (%d)\n", 167},
{"I got Alt-%c! (%d)\n", 168},
{"Case Sensitive Regexp Search%s%s", 169},
{"Regexp Search%s%s", 170},
{"Case Sensitive Search%s%s", 171},
{"Search%s%s", 172},
{" (to replace)", 173},
{"Search Cancelled", 174},
{"\"%s...\" not found", 175},
{"Search Wrapped", 176},
{"Replaced %d occurences", 177},
{"Replaced 1 occurence", 178},
{"Replace Cancelled", 179},
{"Replace this instance?", 180},
{"Replace failed: unknown subexpression!", 181},
{"Replace with [%s]", 182},
{"Replace with", 183},
{"Enter line number", 184},
{"Aborted", 185},
{"Come on, be reasonable", 186},
{"Only %d lines available, skipping to last line", 187},
{"actual_x_from_start for xplus=%d returned %d\n", 188},
{"input '%c' (%d)\n", 189},
{"New Buffer", 190},
{" File: ...", 191},
{"Modified", 192},
{"Moved to (%d, %d) in edit buffer\n", 193},
{"current->data = \"%s\"\n", 194},
{"I got \"%s\"\n", 195},
{"Yes", 196},
{"All", 197},
{"No", 198},
{"do_cursorpos: linepct = %f, bytepct = %f\n", 199},
{"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 200},
{"Dumping file buffer to stderr...\n", 201},
{"Dumping cutbuffer to stderr...\n", 202},
{"Dumping a buffer to stderr...\n", 203},
{"The nano text editor", 204},
{"version ", 205},
{"Brought to you by:", 206},
{"Special thanks to:", 207},
{"The Free Software Foundation", 208},
{"Pavel Curtis, Zeyd Ben-Halim and Eric S. Raymond for ncurses", 209},
{"and anyone else we forgot...", 210},
{"Thank you for using nano!\n", 211},
};
int _msg_tbl_length = 202;
int _msg_tbl_length = 211;

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-11-24 09:04-0500\n"
"POT-Creation-Date: 2000-11-24 15:45-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -55,7 +55,7 @@ msgstr ""
msgid "File to insert [from ./] "
msgstr ""
#: files.c:276 files.c:301 files.c:498 nano.c:1355
#: files.c:276 files.c:301 files.c:509 nano.c:1373
msgid "Cancelled"
msgstr ""
@ -94,20 +94,20 @@ msgstr ""
msgid "Wrote %d lines"
msgstr ""
#: files.c:477
#: files.c:480
msgid "File Name to write"
msgstr ""
#: files.c:482
#: files.c:485
#, c-format
msgid "filename is %s"
msgstr ""
#: files.c:487
#: files.c:498
msgid "File exists, OVERWRITE ?"
msgstr ""
#: files.c:921
#: files.c:932
msgid "(more)"
msgstr ""
@ -384,7 +384,7 @@ msgid "Case Sens"
msgstr ""
#: global.c:344 global.c:364 global.c:375 global.c:385 global.c:401
#: global.c:405 global.c:411 winio.c:1025
#: global.c:405 global.c:411 winio.c:1026
msgid "Cancel"
msgstr ""
@ -602,127 +602,133 @@ msgid " nano version %s by Chris Allegretta (compiled %s, %s)\n"
msgstr ""
#: nano.c:420
msgid " Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org\n"
msgid " Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org"
msgstr ""
#: nano.c:455
#: nano.c:423
msgid ""
"\n"
" Compiled options:"
msgstr ""
#: nano.c:473
msgid "Mark Set"
msgstr ""
#: nano.c:460
#: nano.c:478
msgid "Mark UNset"
msgstr ""
#: nano.c:887
#: nano.c:905
#, c-format
msgid "check_wrap called with inptr->data=\"%s\"\n"
msgstr ""
#: nano.c:938
#: nano.c:956
#, c-format
msgid "current->data now = \"%s\"\n"
msgstr ""
#: nano.c:991
#: nano.c:1009
#, c-format
msgid "After, data = \"%s\"\n"
msgstr ""
#: nano.c:1093
#: nano.c:1111
msgid "Edit a replacement"
msgstr ""
#: nano.c:1304
#: nano.c:1322
#, c-format
msgid "Could not create a temporary filename: %s"
msgstr ""
#: nano.c:1320
#: nano.c:1338
msgid "Finished checking spelling"
msgstr ""
#: nano.c:1322
#: nano.c:1340
msgid "Spell checking failed"
msgstr ""
#: nano.c:1342
#: nano.c:1360
msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? "
msgstr ""
#: nano.c:1505
#: nano.c:1523
msgid "Cannot resize top win"
msgstr ""
#: nano.c:1507
#: nano.c:1525
msgid "Cannot move top win"
msgstr ""
#: nano.c:1509
#: nano.c:1527
msgid "Cannot resize edit win"
msgstr ""
#: nano.c:1511
#: nano.c:1529
msgid "Cannot move edit win"
msgstr ""
#: nano.c:1513
#: nano.c:1531
msgid "Cannot resize bottom win"
msgstr ""
#: nano.c:1515
#: nano.c:1533
msgid "Cannot move bottom win"
msgstr ""
#: nano.c:1786
#: nano.c:1804
msgid "Justify Complete"
msgstr ""
#: nano.c:1854
#: nano.c:1872
#, c-format
msgid "%s enable/disable"
msgstr ""
#: nano.c:1866
#: nano.c:1884
msgid "enabled"
msgstr ""
#: nano.c:1867
#: nano.c:1885
msgid "disabled"
msgstr ""
#: nano.c:2097
#: nano.c:2115
msgid "Main: set up windows\n"
msgstr ""
#: nano.c:2110
#: nano.c:2128
msgid "Main: bottom win\n"
msgstr ""
#: nano.c:2116
#: nano.c:2134
msgid "Main: open file\n"
msgstr ""
#: nano.c:2153
#: nano.c:2171
#, c-format
msgid "I got Alt-O-%c! (%d)\n"
msgstr ""
#: nano.c:2175
#: nano.c:2193
#, c-format
msgid "I got Alt-[-1-%c! (%d)\n"
msgstr ""
#: nano.c:2208
#: nano.c:2226
#, c-format
msgid "I got Alt-[-2-%c! (%d)\n"
msgstr ""
#: nano.c:2256
#: nano.c:2274
#, c-format
msgid "I got Alt-[-%c! (%d)\n"
msgstr ""
#: nano.c:2282
#: nano.c:2300
#, c-format
msgid "I got Alt-%c! (%d)\n"
msgstr ""
@ -812,72 +818,104 @@ msgstr ""
msgid "Only %d lines available, skipping to last line"
msgstr ""
#: winio.c:120
#: winio.c:121
#, c-format
msgid "actual_x_from_start for xplus=%d returned %d\n"
msgstr ""
#: winio.c:438
#: winio.c:439
#, c-format
msgid "input '%c' (%d)\n"
msgstr ""
#: winio.c:476
#: winio.c:477
msgid "New Buffer"
msgstr ""
#: winio.c:479
#: winio.c:480
msgid " File: ..."
msgstr ""
#: winio.c:487
#: winio.c:488
msgid "Modified"
msgstr ""
#: winio.c:939
#: winio.c:940
#, c-format
msgid "Moved to (%d, %d) in edit buffer\n"
msgstr ""
#: winio.c:950
#: winio.c:951
#, c-format
msgid "current->data = \"%s\"\n"
msgstr ""
#: winio.c:995
#: winio.c:996
#, c-format
msgid "I got \"%s\"\n"
msgstr ""
#: winio.c:1020
#: winio.c:1021
msgid "Yes"
msgstr ""
#: winio.c:1022
#: winio.c:1023
msgid "All"
msgstr ""
#: winio.c:1024
#: winio.c:1025
msgid "No"
msgstr ""
#: winio.c:1161
#: winio.c:1162
#, c-format
msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
msgstr ""
#: winio.c:1165
#: winio.c:1166
msgid "line %d of %d (%.0f%%), character %d of %d (%.0f%%)"
msgstr ""
#: winio.c:1293
#: winio.c:1294
msgid "Dumping file buffer to stderr...\n"
msgstr ""
#: winio.c:1295
#: winio.c:1296
msgid "Dumping cutbuffer to stderr...\n"
msgstr ""
#: winio.c:1297
#: winio.c:1298
msgid "Dumping a buffer to stderr...\n"
msgstr ""
#: winio.c:1339
msgid "The nano text editor"
msgstr ""
#: winio.c:1340
msgid "version "
msgstr ""
#: winio.c:1341
msgid "Brought to you by:"
msgstr ""
#: winio.c:1342
msgid "Special thanks to:"
msgstr ""
#: winio.c:1343
msgid "The Free Software Foundation"
msgstr ""
#: winio.c:1344
msgid "Pavel Curtis, Zeyd Ben-Halim and Eric S. Raymond for ncurses"
msgstr ""
#: winio.c:1345
msgid "and anyone else we forgot..."
msgstr ""
#: winio.c:1346
msgid "Thank you for using nano!\n"
msgstr ""

View File

@ -131,6 +131,9 @@ void page_up_center(void);
void blank_edit(void);
void search_init_globals(void);
void replace_abort(void);
#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);

95
winio.c
View File

@ -22,6 +22,7 @@
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "config.h"
#include "proto.h"
#include "nano.h"
@ -1327,3 +1328,97 @@ void fix_editbot(void)
for (i = 0; (i <= editwinrows - 1) && (editbot->next != NULL)
&& (editbot != filebot); i++, editbot = editbot->next);
}
#ifdef NANO_EXTRA
#define CREDIT_LEN 43
void do_credits(void)
{
int i, j = 0, place = 0, start_x;
char *what;
char *nanotext = _("The nano text editor");
char *version = _("version ");
char *brought = _("Brought to you by:");
char *specialthx = _("Special thanks to:");
char *fsf = _("The Free Software Foundation");
char *ncurses = _("Pavel Curtis, Zeyd Ben-Halim and Eric S. Raymond for ncurses");
char *anyonelse = _("and anyone else we forgot...");
char *thankyou = _("Thank you for using nano!\n");
char *credits[CREDIT_LEN] = {nanotext,
version,
VERSION,
"",
brought,
"Chris Allegretta",
"Jordi Mallach",
"Adam Rogoyski",
"Rob Siemborski",
"Rocco Corsi",
"Ken Tyler",
"Sven Guckes",
"Florian König",
"Pauli Virtanen",
"Daniele Medri",
"Clement Laforet",
"Tedi Heriyanto",
"Erik Anderson",
"Big Gaute",
"Joshua Jensen",
"",
specialthx,
"Plattsburgh State University",
"Benet Laboratories",
"Amy Allegretta",
"Linda Young",
"Jeremy Robichaud",
"Richard Kolb II",
fsf,
"Linus Torvalds",
ncurses,
anyonelse,
thankyou,
"", "", "", "",
"(c) 2000 Chris Allegretta",
"", "", "", "",
"www.nano-editor.org"
};
curs_set(0);
nodelay(edit, TRUE);
blank_bottombars();
mvwaddstr(topwin, 0, 0, hblank);
wrefresh(bottomwin);
wrefresh(topwin);
while (wgetch(edit) == ERR) {
blank_edit();
for (i = editwinrows / 2 - 1; i >= (editwinrows / 2 - 1 - j); i--) {
mvwaddstr(edit, i * 2, 0, hblank);
if (place - (editwinrows / 2 - 1 - i) < CREDIT_LEN)
what = credits[place - (editwinrows / 2 - 1 - i)];
else
what = "";
start_x = center_x - strlen(what) / 2 - 1;
mvwaddstr(edit, i * 2, start_x, what);
}
if (j < editwinrows / 2 - 1)
j++;
place++;
wrefresh(edit);
sleep(1);
if (place >= CREDIT_LEN + editwinrows / 2)
break;
}
nodelay(edit, FALSE);
curs_set(1);
display_main_list();
total_refresh();
}
#endif