Commit 7162e3d6 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

DB's latest patch

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1170 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 293 additions and 391 deletions
+293 -391
......@@ -71,7 +71,7 @@
[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)
- Unable to cut the entire file using the marker (discovered by Ken 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
......
CVS code -
- General:
- Typos n misspellings all over the place (David Benbennick).
- Allow --tiny and --multibuffer to cooperate (who the heck
would want this is beyond me but ;-). Changes to
configure.ac, global.c, , (David Benbennick).
- configure.ac:
- Define NDEBUG to silence asserts (David Benbennick).
- files.c:
get_next_filename()
- Optimizations (David Benbennick).
- global.c:
shortcut_init()
- Add missing free_shortcutage()s (David Benbennick).
- nano.c:
die_save_file()
- Add missing free (David Benbennick).
do_justify()
- Optimizations (David Benbennick).
do_wrap()
- Complete rewrite (David Benbennick).
- nano.h:
- NANO_ALT_COMMAND and NANO_ALT_PERIOD were reversed (lol)
(David Benbennick).
......
......@@ -57,7 +57,7 @@
/* 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 */
/* Define this to enable multiple file buffers */
#undef ENABLE_MULTIBUFFER
/* Define this to use the .nanorc file */
......@@ -71,3 +71,6 @@
/* Define this to enable undoing....something */
#undef ENABLE_UNDO
/* Shut up the assert warnings :-) */
#undef NDEBUG
......@@ -17,6 +17,9 @@ dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h)
dnl Turn off assert statements.
AC_DEFINE(NDEBUG)
dnl options
AC_ARG_ENABLE(tiny,
[ --enable-tiny Disable features for the sake of size
......@@ -47,8 +50,8 @@ AC_ARG_ENABLE(undo,
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
[ --enable-multibuffer Enable multiple file buffers],
[if test x$enableval = xyes; then
AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes
fi])
......
......@@ -184,7 +184,7 @@ 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 (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 also reached it's first
official GNU program by Richard Stallman. Nano also reached its first
production release on March 22, 2001.</font></blockquote>
<h2>
......
......@@ -336,8 +336,8 @@ int open_file(char *filename, int insert, int quiet)
/* This function will return the name of the first available extension
of a filename (starting with the filename, then filename.1, etc).
Memory is allocated for the return value. If no writable extension
exists we return "" */
char *get_next_filename(char *name)
exists, we return "". */
char *get_next_filename(const char *name)
{
int i = 0;
char *buf = NULL;
......@@ -346,10 +346,10 @@ char *get_next_filename(char *name)
buf = charalloc(strlen(name) + num_of_digits(INT_MAX) + 2);
strcpy(buf, name);
while(1) {
while (1) {
if (stat(buf, &fs) == -1)
break;
return buf;
if (i == INT_MAX)
break;
......@@ -358,8 +358,8 @@ char *get_next_filename(char *name)
sprintf(&buf[strlen(name)], ".%d", i);
}
if (i == INT_MAX)
buf[0] = '\0';
/* We get here only if there is no possible save file. */
buf[0] = '\0';
return buf;
}
......@@ -376,7 +376,7 @@ int do_insertfile(int loading_file)
#endif
#ifndef DISABLE_OPERATINGDIR
if ((operating_dir) && (strcmp(operating_dir,"."))){
if (operating_dir && (strcmp(operating_dir, "."))) {
i = statusq(1, insertfile_list, "", _("File to insert [from %s] "),
operating_dir);
} else {
......@@ -643,8 +643,8 @@ int load_open_file(void)
totlines = open_files->file_totlines;
totsize = open_files->file_totsize;
/* Unset the marker because nano can't (yet) handle marked text flipping between
open files */
/* Unset the marker because nano can't (yet) handle marked text
flipping between open files */
UNSET(MARK_ISSET);
/* restore full file position: line number, x-coordinate, y-
......@@ -815,6 +815,8 @@ int close_open_file(void)
if (!open_files)
return 1;
open_files->file = fileage;
tmp = open_files;
if (open_nextfile(1)) {
if (open_prevfile(1))
......
......@@ -99,7 +99,9 @@ shortcut *writefile_list = NULL;
shortcut *insertfile_list = NULL;
shortcut *help_list = NULL;
shortcut *spell_list = NULL;
#ifndef NANO_SMALL
shortcut *extcmd_list = NULL;
#endif
#ifndef DISABLE_BROWSER
shortcut *browser_list = NULL;
#endif
......@@ -272,6 +274,10 @@ void shortcut_init(int unjustify)
"", *nano_unjustify_msg = "", *nano_append_msg =
"";
#ifdef ENABLE_MULTIBUFFER
char *nano_openprev_msg = "", *nano_opennext_msg = "";
#endif
#ifndef NANO_SMALL
char *nano_tofiles_msg = "", *nano_gotodir_msg = "", *nano_case_msg =
"", *nano_reverse_msg = "", *nano_execute_msg = "";
......@@ -280,9 +286,6 @@ void shortcut_init(int unjustify)
#ifdef HAVE_REGEX_H
char *nano_regexp_msg = "", *nano_bracket_msg = "";
#endif
#ifdef ENABLE_MULTIBUFFER
char *nano_openprev_msg = "", *nano_opennext_msg = "";
#endif
nano_help_msg = _("Invoke the help menu");
nano_writeout_msg = _("Write the current file to disk");
......@@ -650,6 +653,9 @@ void shortcut_init(int unjustify)
nano_execute_msg, 0, 0, 0, NOVIEW, 0);
#endif
if (spell_list != NULL)
free_shortcutage(&spell_list);
sc_init_one(&spell_list, NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
......@@ -657,6 +663,9 @@ void shortcut_init(int unjustify)
nano_cancel_msg, 0, 0, 0, VIEW, 0);
#ifndef NANO_SMALL
if (extcmd_list != NULL)
free_shortcutage(&extcmd_list);
sc_init_one(&extcmd_list, NANO_HELP_KEY,
_("Get Help"), nano_help_msg, 0, 0, 0, VIEW, do_help);
......
......@@ -79,7 +79,7 @@ source code.
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
If the file being edited is a symbolic link, replace the link with
a new file, do not follow it. Good for editing files in /tmp, perhaps?
.TP
.B \-m (\-\-mouse)
......
......@@ -108,7 +108,7 @@ 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
If the file being edited is a symbolic link, replace the link with
a new file, do not follow it. Good for editing files in /tmp, perhaps?
<DT><B>-m (--mouse)</B>
......
This diff is collapsed.
......@@ -30,7 +30,7 @@
#include "nano.h"
extern int editwinrows;
extern int current_x, current_y, posible_max, totlines;
extern int current_x, current_y, totlines;
extern int placewewant;
extern int mark_beginx, samelinewrap;
extern long totsize;
......@@ -72,7 +72,10 @@ extern shortcut *shortcut_list;
extern shortcut *main_list, *whereis_list;
extern shortcut *replace_list, *goto_list;
extern shortcut *writefile_list, *insertfile_list;
extern shortcut *spell_list, *replace_list_2, *extcmd_list;
extern shortcut *spell_list, *replace_list_2;
#ifndef NANO_SMALL
extern shortcut *extcmd_list;
#endif
extern shortcut *help_list;
#ifndef DISABLE_BROWSER
extern shortcut *browser_list, *gotodir_list;
......@@ -87,7 +90,7 @@ extern regmatch_t regmatches[10];
#ifdef ENABLE_COLOR
extern regex_t color_regexp;
extern regmatch_t colormatches[1];
#endif /* HJAVE_COLOR */
#endif /* ENABLE_COLOR */
#endif
extern toggle *toggles;
......@@ -152,7 +155,7 @@ void shortcut_init(int unjustify);
void signal_init(void);
void lowercase(char *src);
void blank_bottombars(void);
void check_wrap(filestruct * inptr, char ch);
void check_wrap(filestruct * inptr);
void dump_buffer(filestruct * inptr);
void align(char **strp);
void edit_refresh(void), edit_refresh_clearok(void);
......@@ -172,7 +175,6 @@ void previous_line(void);
void center_cursor(void);
void bottombars(shortcut *s);
void blank_statusbar_refresh(void);
void *nmalloc (size_t howmuch);
void nperror(const char *s);
void *mallocstrcpy(char *dest, char *src);
void wrap_reset(void);
......@@ -221,7 +223,6 @@ int load_open_file(void), close_open_file(void);
int do_page_up(void), do_page_down(void);
int do_cursorpos(int constant), do_cursorpos_void(void), do_spell(void);
int do_up(void), do_down (void), do_right(void), do_left (void);
int do_home(void), do_end(void), total_refresh(void), do_mark(void);
int do_delete(void), do_backspace(void), do_tab(void), do_justify(void);
int do_first_line(void), do_last_line(void);
......@@ -234,7 +235,7 @@ int open_prevfile_void(void), open_nextfile_void(void);
#endif
char *charalloc (size_t howmuch);
char *get_next_filename(char *name);
char *get_next_filename(const char *name);
#if !defined (DISABLE_SPELLER) || !defined (DISABLE_OPERATINGDIR)
char *get_full_path(const char *origpath);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment