write_file(), write_marked(), die(), do_spell(), and
do_exit(). (DLR)
- Remove the -R/--regexp command line option and enable the
- toggle at the search promptin tiny mode, as it already
+ toggle at the search prompt in tiny mode, as it already
allows the prepend and append toggles at the search prompt.
For consistency, rename TOGGLE_REGEXP_KEY to NANO_REGEXP_KEY,
and move it out of the toggles block to where NANO_PREPEND_KEY
and NANO_APPEND_KEY are. Changes to shortcut_init(), usage(),
- main(), search_init(), nanorc.sample, nano.1, nanorc.5,
- nano.texi, etc. (DLR)
+ main(), search_init(), nano.1, nano.texi, etc. (DLR)
- Various cleanups and improvements in chars.c. Remove some
unnecessary w?ctype wrappers; change the wctype wrappers to
take wint_t instead of wchar_t to match the functions they
toggle_init(), usage(), do_tab(), main(), nanorc.sample,
nano.1, nanorc.5, and nano.texi. (DLR, suggested by many
people)
+ - Change the REVERSE_SEARCH flag to the BACKWARDS_SEARCH flag.
+ (DLR)
- Change the SMOOTHSCROLL flag to the SMOOTH_SCROLL flag. (DLR)
- Change the NO_UTF8 flag to the USE_UTF8 flag, and reverse its
meaning. (DLR)
+ - Add rcfile options "casesensitive" and "backwards", to do
+ case sensitive and backwards searches by default. Changes to
+ nanorc.sample and nanorc.5. (DLR)
- chars.c:
make_mbstring()
- Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a
- Allow the mark to be used in view mode, as Pico does. (DLR)
- Clarify the description of ^X when --enable-multibuffer is
used. (DLR)
+ - Change the description of the Meta-B toggle at the search
+ prompt from "Direction" to "Backwards", for consistency. (DLR)
thanks_for_all_the_fish()
- Remove free_toggles() and move its code here verbatim, as it's
only called here anyway. (David Benbennick)
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" $Id$
-.TH NANORC 5 "version 1.3.8" "June 15, 2005"
+.TH NANORC 5 "version 1.3.8" "June 16, 2005"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
\fBset backupdir "\fIdirectory\fP"\fP
Set the directory where \fBnano\fP puts unique backup files if file
backups are enabled.
+.TP
+\fBset/unset backwards\fP
+Do backwards searches by default.
+.TP
\fBset brackets "\fIstring\fP"\fP
Set the characters treated as closing brackets. They cannot contain
tabs or spaces. Only closing punctuation, optionally followed by
closing brackets, can end sentences.
.TP
+\fBset/unset casesensitive\fP
+Do case sensitive searches by default.
+.TP
\fBset/unset const\fP
Constantly display the cursor position in the status bar.
.TP
work properly. You should only need to use this option if Backspace
acts like Delete on your system.
.TP
+\fBset/unset regexp\fP
+Do regular expression searches by default.
+.TP
\fBset/unset smarthome\fP
Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
## The directory to put unique backup files in.
# set backupdir ""
+## Do backwards searches by default.
+# set backwards
+
## The characters treated as closing brackets. They cannot contain tabs
## or spaces. Only closing punctuation, optionally followed by closing
## brackets, can end sentences.
##
# set brackets "'")}]>"
+## Do case sensitive searches by default.
+# set casesensitive
+
## Constantly display the cursor position in the status bar.
# set const
## Fix Backspace/Delete confusion problem.
# set rebinddelete
+## Do extended regular expression searches by default.
+# set regexp
+
## Make the Home key smarter. When Home is pressed anywhere but at the
## very beginning of non-whitespace characters on a line, the cursor
## will jump to that beginning (either forwards or backwards). If the
#endif
#ifndef NANO_SMALL
const char *case_sens_msg = N_("Case Sens");
- const char *direction_msg = N_("Direction");
+ const char *backwards_msg = N_("Backwards");
#endif
#ifdef HAVE_REGEX_H
const char *regexp_msg = N_("Regexp");
NANO_NO_KEY, VIEW, NULL);
/* Translators: try to keep this string under 10 characters long */
- sc_init_one(&whereis_list, NANO_NO_KEY, direction_msg,
+ sc_init_one(&whereis_list, NANO_NO_KEY, backwards_msg,
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
IFHELP(nano_case_msg, TOGGLE_CASE_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
- sc_init_one(&replace_list, NANO_NO_KEY, direction_msg,
+ sc_init_one(&replace_list, NANO_NO_KEY, backwards_msg,
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
/* The return value. */
bool case_sens_set = ISSET(CASE_SENSITIVE);
#ifndef NANO_SMALL
- bool reverse_search_set = ISSET(REVERSE_SEARCH);
+ bool backwards_search_set = ISSET(BACKWARDS_SEARCH);
#endif
#ifdef HAVE_REGEX_H
bool regexp_set = ISSET(USE_REGEXP);
#ifndef NANO_SMALL
/* Make sure spell-check goes forward only. */
- UNSET(REVERSE_SEARCH);
+ UNSET(BACKWARDS_SEARCH);
#endif
#ifdef HAVE_REGEX_H
/* Make sure spell-check doesn't use regular expressions. */
#ifndef NANO_SMALL
/* Restore search/replace direction. */
- if (reverse_search_set)
- SET(REVERSE_SEARCH);
+ if (backwards_search_set)
+ SET(BACKWARDS_SEARCH);
#endif
#ifdef HAVE_REGEX_H
/* Restore regular expression usage setting. */
#define USE_REGEXP (1<<11)
#define TEMP_FILE (1<<12)
#define CUT_TO_END (1<<13)
-#define REVERSE_SEARCH (1<<14)
+#define BACKWARDS_SEARCH (1<<14)
#define MULTIBUFFER (1<<15)
#define SMOOTH_SCROLL (1<<16)
#define DISABLE_CURPOS (1<<17) /* Damn, we still need it. */
{"autoindent", AUTOINDENT},
{"backup", BACKUP_FILE},
{"backupdir", 0},
+ {"backwards", BACKWARDS_SEARCH},
#endif
#ifndef DISABLE_JUSTIFY
{"brackets", 0},
+#endif
+#ifndef NANO_SMALL
+ {"casesensitive", CASE_SENSITIVE},
#endif
{"const", CONSTUPDATE},
#ifndef NANO_SMALL
{"quotestr", 0},
#endif
{"rebinddelete", REBIND_DELETE},
+#ifdef HAVE_REGEX_H
+ {"regexp", USE_REGEXP},
+#endif
#ifndef NANO_SMALL
{"smarthome", SMART_HOME},
{"smooth", SMOOTH_SCROLL},
#ifndef NANO_SMALL
/* This string is just a modifier for the search prompt; no
* grammar is implied. */
- ISSET(REVERSE_SEARCH) ? _(" [Backwards]") :
+ ISSET(BACKWARDS_SEARCH) ? _(" [Backwards]") :
#endif
"",
backupstring = mallocstrcpy(backupstring, answer);
return 1;
case TOGGLE_BACKWARDS_KEY:
- TOGGLE(REVERSE_SEARCH);
+ TOGGLE(BACKWARDS_SEARCH);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
#endif
* previous or next line. */
rev_start =
#ifndef NANO_SMALL
- ISSET(REVERSE_SEARCH) ? fileptr->data + (current_x - 1) :
+ ISSET(BACKWARDS_SEARCH) ? fileptr->data + (current_x - 1) :
#endif
fileptr->data + (current_x + 1);
}
#ifndef NANO_SMALL
- if (ISSET(REVERSE_SEARCH)) {
+ if (ISSET(BACKWARDS_SEARCH)) {
fileptr = fileptr->prev;
current_y_find--;
} else {
return FALSE;
#ifndef NANO_SMALL
- if (ISSET(REVERSE_SEARCH)) {
+ if (ISSET(BACKWARDS_SEARCH)) {
fileptr = filebot;
current_y_find = editwinrows - 1;
} else {
rev_start = fileptr->data;
#ifndef NANO_SMALL
- if (ISSET(REVERSE_SEARCH))
+ if (ISSET(BACKWARDS_SEARCH))
rev_start += strlen(fileptr->data);
#endif
}
/* Ensure we haven't wrapped around again! */
if (search_last_line &&
#ifndef NANO_SMALL
- ((!ISSET(REVERSE_SEARCH) && current_x_find > beginx) ||
- (ISSET(REVERSE_SEARCH) && current_x_find < beginx))
+ ((!ISSET(BACKWARDS_SEARCH) && current_x_find > beginx) ||
+ (ISSET(BACKWARDS_SEARCH) && current_x_find < beginx))
#else
current_x_find > beginx
#endif
* text. Note that current_x might be set to (size_t)-1
* here. */
#ifndef NANO_SMALL
- if (!ISSET(REVERSE_SEARCH))
+ if (!ISSET(BACKWARDS_SEARCH))
#endif
current_x += match_len + length_change - 1;
/* On a left bracket. */
regexp_pat[1] = wanted_ch;
regexp_pat[2] = ch_under_cursor;
- UNSET(REVERSE_SEARCH);
+ UNSET(BACKWARDS_SEARCH);
} else {
/* On a right bracket. */
regexp_pat[1] = ch_under_cursor;
regexp_pat[2] = wanted_ch;
- SET(REVERSE_SEARCH);
+ SET(BACKWARDS_SEARCH);
}
regexp_init(regexp_pat);
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP)) {
#ifndef NANO_SMALL
- if (ISSET(REVERSE_SEARCH)) {
+ if (ISSET(BACKWARDS_SEARCH)) {
if (regexec(&search_regexp, haystack, 1, regmatches, 0) == 0
&& haystack + regmatches[0].rm_so <= start) {
const char *retval = haystack + regmatches[0].rm_so;
#if !defined(NANO_SMALL) || !defined(DISABLE_SPELLER)
if (ISSET(CASE_SENSITIVE)) {
#ifndef NANO_SMALL
- if (ISSET(REVERSE_SEARCH))
+ if (ISSET(BACKWARDS_SEARCH))
return revstrstr(haystack, needle, start);
else
#endif
}
#endif /* !DISABLE_SPELLER || !NANO_SMALL */
#ifndef NANO_SMALL
- else if (ISSET(REVERSE_SEARCH))
+ else if (ISSET(BACKWARDS_SEARCH))
return mbrevstrcasestr(haystack, needle, start);
#endif
return mbstrcasestr(start, needle);