Commit Graph

86 Commits (bf1346f3429ec00c552bb46753b3602d23e9acd7)

Author SHA1 Message Date
David Lawrence Ramsey ca92becf9d apply patch from DB: in write_file(), if we've tried to write to an
unwritable file and we're not prepending, tempname is NULL when it's
passed to unlink(); this can cause problems if unlink() can't handle
NULL, so don't call it in that case


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2012 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-22 03:33:54 +00:00
David Lawrence Ramsey 2c4e34cfce another indentation fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2011 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-22 03:30:39 +00:00
David Lawrence Ramsey 4b7e3c3efa minor cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1992 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-15 16:25:56 +00:00
David Lawrence Ramsey 1929982ec3 in do_insertfile(), when inserting a file in non-multibuffer mode,
preserve placewewant as well as current_x, for compatibility with Pico


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1982 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-09 20:12:04 +00:00
David Lawrence Ramsey 7cfea8bb8c in mark_order(), add check for MARK_ISSET's not being set; also make one
more int -> bool conversion and cosmetic fix


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1974 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-08 15:35:33 +00:00
David Lawrence Ramsey 487149e713 in do_insertfile(), add missing #ifdefs around the wrap_reset() call so
that nano compiles with wrapping disabled again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1970 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-05 20:24:48 +00:00
David Lawrence Ramsey 045883aa34 really fix the resetstatus problems this time, and add a few other
miscellaneous fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1969 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-05 20:11:31 +00:00
David Lawrence Ramsey 056c5ef4a6 another int -> bool conversion
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1968 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-05 16:14:19 +00:00
David Lawrence Ramsey b49daec3f2 in do_insertfile(), if file browsing succeeds, copy the filename we
browsed to into ans, put back Enter, and show the prompt one last time
so that it's exited properly and the cursor position at the statusbar is
reset


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1967 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-05 02:46:24 +00:00
David Lawrence Ramsey 951d7148d1 add minor cosmetic fixes, and do another int -> bool conversion
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1961 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-04 15:23:47 +00:00
David Lawrence Ramsey 3e189a8b9c in open_(prev|next)_file(), translate the "New Buffer" string when
displaying "Switched to" messages on the statusbar; also do a few more
int -> bool conversions


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1959 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-03 19:18:48 +00:00
David Lawrence Ramsey 7c1f17ab6d after reading in a file and detecting the format it's in, set the file
format flags (DOS_FILE and MAC_FILE) to match, and preserve them across
multiple file buffers


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1958 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-03 13:47:26 +00:00
David Lawrence Ramsey 360191c434 consistency fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1957 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-01 21:37:36 +00:00
David Lawrence Ramsey be908f6992 for consistency, make do_insertfile() take a parameter to indicate
whether it's in "Execute Command" mode; also add continue and goto to
the "c-file" regexes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1955 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-01 18:34:30 +00:00
David Lawrence Ramsey e5d8f32834 add a bunch of key-related fixes: put Meta-( (Meta-9), Meta-) (Meta-0),
and Meta-J back in the shortcut list since Meta-G is used in the file
browser and not as a toggle, tweak nanogetstr() and statusq() so that
resetstatuspos can be reduced to a static bool, change the names of some
keys to be more consistent, and add the ^R^X^X and ^W^T^T shortcuts
(note that the latter doesn't preserve the contents of the statusbar yet
when ^T is pressed at the "Go To Line" prompt), and add a few other
miscellaneous tweaks


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1954 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-30 22:07:21 +00:00
David Lawrence Ramsey 47e82b1752 fix #ifdef breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1953 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-28 22:21:46 +00:00
David Lawrence Ramsey 04a8d1c040 add a multibuffer mode toggle to the "Execute Command" prompt, for
consistency with the "Read File" prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1952 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-28 22:14:58 +00:00
David Lawrence Ramsey 03225330dc simplify do_insertfile() by reusing variables where possible
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1951 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-28 20:50:50 +00:00
David Lawrence Ramsey 670a56c241 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1948 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-28 16:03:03 +00:00
David Lawrence Ramsey eb16f43cf9 add a func_key flag to the low-level input functions and the currently
existing high-level input functions, to indicate extended keypad values


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1943 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-27 01:04:50 +00:00
David Lawrence Ramsey 02517e0a0f add DB's overhaul of the file loading code to increase efficiency,
remove ugly workarounds for most cases of edittop's or current's being
NULL (as those cases no longer occur due to the overhaul), and remove
detection of binary files (since it wasn't always accurate and will only
cause problems when UTF-8 support is added); also add a few minor fixes
of mine


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1928 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-05 21:40:31 +00:00
David Lawrence Ramsey 146bb6026a in do_insertfile(), readd the NANO_SMALL #ifdef around the start_again:
label to avoid a warning


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1919 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-27 21:02:38 +00:00
David Lawrence Ramsey dfca1c4ea6 add unget_kbinput(), a wrapper for ungetch()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1911 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-25 16:37:06 +00:00
David Lawrence Ramsey a0b5ba2f7f convert ints to bools in the low-level input routines, and consolidate
the high-level input routines for the edit window


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1910 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-25 15:39:10 +00:00
David Lawrence Ramsey a27bd65057 per DB's patch, overhaul the rcfile and history file reading and writing
routines to fix a few fundamental problems and limitations; also add
getline() and getdelim() equivalents adapted from GNU mailutils 0.5 (and
tweaked to better integrate with nano), since the patch uses getline()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1900 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-17 05:23:38 +00:00
David Lawrence Ramsey 7dfec43f42 per DB's patch, show the "Press Return To Continue" prompt if we can't
read the .nano_history file while starting nano


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1896 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 15:20:14 +00:00
David Lawrence Ramsey 95e39e5f46 add missing error message simplifications from before
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1892 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 02:52:14 +00:00
David Lawrence Ramsey 1e7f1ea1e8 indentation fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1891 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 02:11:35 +00:00
David Lawrence Ramsey 6420d445c2 add a bunch of DB's miscellaneous fixes, plus a few of mine
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1890 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-11 05:13:08 +00:00
David Lawrence Ramsey 049e4a5db3 per DB's patch, simplify the saving of emergency files in die(),
die_save_file(), and get_next_filename()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1889 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-10 23:05:59 +00:00
David Lawrence Ramsey 00d7798756 per DB's patch, convert a few parts of files.c to use bool so that
open_pipe()'s failure is handled properly again, and add various
#ifdefs to fix a few warnings and compilation problems that occur when
everything is enabled manually including NANO_SMALL


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1886 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-07 21:27:37 +00:00
David Lawrence Ramsey 4d44d2de0e make lastwastab and list use TRUE and FALSE instead of 1 and 0, make
them bools in the process, and make a few other minor cosmetic cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1880 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-01 22:35:31 +00:00
David Lawrence Ramsey b8c479a9e9 add DB's fix for a problem where quoted justify wouldn't work if
HAVE_REGEX_H wasn't set, and don't treat the return values of the string
comparison functions as boolean anymore


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1877 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-31 14:10:23 +00:00
David Lawrence Ramsey a6d26d04fd rcfile tweaks: prompt only once for all rcfile errors instead of once
for each separate error, make sure all the messages end in newlines,
etc.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1876 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-30 22:52:44 +00:00
David Lawrence Ramsey 9ef3adbc1d add a consistency fix for do_enter() and a few minor cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1874 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-30 17:30:17 +00:00
David Lawrence Ramsey 1536f8613d fix spacing problem in the "Save Under Different Name" prompt
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1864 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-24 16:50:20 +00:00
David Lawrence Ramsey 36dd87b1fb properly handle invalid tab sizes in nanorc files and make a few more
cosmetic cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1859 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-18 17:43:43 +00:00
David Lawrence Ramsey fd3039a8e7 cut down on redundant inclusions of <sys/types.h>, include it in proto.h
per DB's patch, and make a few more minor cosmetic cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1857 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-17 19:49:12 +00:00
David Lawrence Ramsey 576bf331ef various changes to cut down on binary size: per DB's patch, add new N_()
macro to mark strings that aren't translated immediately and convert
nano to use it where needed, overhaul the shortcut list and toggle list
initialization code for efficiency, and replace rcfile_msg() with
rcfile_error(); also add a few minor miscellaneous cleanups by DB and
myself


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1852 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-12 03:10:30 +00:00
David Lawrence Ramsey d717d4bac6 add another missing part of DB's patch (read_file() should be returning
void instead of int), and rearrange one NANO_SMALL #ifdef for better
readability


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1851 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-10 16:53:17 +00:00
David Lawrence Ramsey 0273829353 add one last spacing fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1850 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-08 17:29:27 +00:00
David Lawrence Ramsey f708037715 add another prototype fix and a few spacing fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1849 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-08 17:15:10 +00:00
David Lawrence Ramsey 0af8604ec9 more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1847 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-07 23:26:08 +00:00
David Lawrence Ramsey 25529074d3 put back erroneously removed initialization of original_umask
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1843 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-06 14:02:44 +00:00
David Lawrence Ramsey f7b5d930a9 if we're in restricted mode and the filename isn't blank, disable tab
completion at the "Write File" prompt, since we can't change the
filename in that case; also remove an unneeded trailing space


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1842 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-05 14:27:29 +00:00
David Lawrence Ramsey c8c69d5449 for consistency with nano 1.2.x and with other editors, make the mode of
newly created files 666 instead of 600 before it's modified by the
umask; also add a few more minor comment fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1838 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-03 03:22:23 +00:00
David Lawrence Ramsey edab0cc0a5 a few cleanups and consistency fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1837 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-03 03:09:12 +00:00
David Lawrence Ramsey 72e51ab037 per DB's patch (with a few updates of mine), convert the shortcut list
functions and most related functions to return void instead of int, as
the return values of all those functions are essentially unused; also
add a few related miscellaneous cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1836 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-02 14:31:03 +00:00
David Lawrence Ramsey ebd0d7c859 more minor cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1834 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-01 18:59:52 +00:00
David Lawrence Ramsey ae064bf255 don't rely on the return value of curs_set(), as it's broken on e.g.
slang; instead, explicitly turn the cursor off where we need to


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1798 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-01 20:38:00 +00:00