Changes to safe_tempnam() (renamed safe_tempfile()),
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
+ 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)
- cut.c:
cut_line()
- Set placewewant properly after cutting a line, to avoid a
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" $Id$
-.TH NANO 1 "version 1.3.8" "May 29, 2005"
+.TH NANO 1 "version 1.3.8" "June 3, 2005"
.\" Please adjust this date whenever revising the manpage.
.\"
"^([\ \\t]*[|>:}#])+" if regular expression support is available, or
">\ " otherwise.
.TP
-.B \-R (\-\-regexp)
-Enable regular expression matching for search strings, as well as
-\\n subexpression replacement for replace strings, if available.
-.TP
.B \-S (\-\-smooth)
Enable smooth scrolling. Text will scroll line-by-line, instead of the
usual chunk-by-chunk behavior.
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" $Id$
-.TH NANORC 5 "version 1.3.8" "May 29, 2005"
+.TH NANORC 5 "version 1.3.8" "June 3, 2005"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
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
## 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
@smallbook
@set EDITION 0.1
@set VERSION 1.3.8
-@set UPDATED 29 May 2005
+@set UPDATED 03 Jun 2005
@dircategory Editors
@direntry
if regular expression support is available, or ``> '' otherwise. Note
that @code{\t} above stands for a literal Tab character.
-@item -R, --regexp
-Turn on regular expression search and search/replace.
-
@item -S, --smooth
Enable smooth scrolling.
#ifndef NANO_SMALL
const char *case_sens_msg = N_("Case Sens");
const char *direction_msg = N_("Direction");
+#endif
#ifdef HAVE_REGEX_H
const char *regexp_msg = N_("Regexp");
#endif
+#ifndef NANO_SMALL
const char *history_msg = N_("History");
#ifdef ENABLE_MULTIBUFFER
const char *new_buffer_msg = N_("New Buffer");
#endif
-#endif /* !NANO_SMALL */
+#endif
#ifndef DISABLE_BROWSER
const char *to_files_msg = N_("To Files");
#endif
-
#ifndef DISABLE_HELP
const char *nano_help_msg = N_("Invoke the help menu");
const char *nano_exit_msg =
N_("Make the current search/replace case (in)sensitive");
const char *nano_reverse_msg =
N_("Make the current search/replace go backwards");
+#endif
#ifdef HAVE_REGEX_H
const char *nano_regexp_msg = N_("Use regular expressions");
#endif
+#ifndef NANO_SMALL
const char *nano_history_msg =
N_("Edit the previous search/replace strings");
-#endif /* !NANO_SMALL */
-
+#endif
#ifndef DISABLE_BROWSER
const char *nano_tofiles_msg = N_("Go to file browser");
#endif
sc_init_one(&whereis_list, NANO_NO_KEY, direction_msg,
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
+#endif
#ifdef HAVE_REGEX_H
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_NO_KEY, regexp_msg,
- IFHELP(nano_regexp_msg, TOGGLE_REGEXP_KEY), NANO_NO_KEY,
+ IFHELP(nano_regexp_msg, NANO_REGEXP_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
+#ifndef NANO_SMALL
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
sc_init_one(&whereis_list, NANO_CUTTILLEND_KEY, cut_till_end_msg,
IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY),
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
-#endif /* !NANO_SMALL */
+#endif
#ifndef DISABLE_JUSTIFY
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&replace_list, NANO_NO_KEY, direction_msg,
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
+#endif
#ifdef HAVE_REGEX_H
sc_init_one(&replace_list, NANO_NO_KEY, regexp_msg,
- IFHELP(nano_regexp_msg, TOGGLE_REGEXP_KEY), NANO_NO_KEY,
+ IFHELP(nano_regexp_msg, NANO_REGEXP_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
+#ifndef NANO_SMALL
sc_init_one(&replace_list, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
-#endif /* !NANO_SMALL */
+#endif
free_shortcutage(&replace_list_2);
print1opt(_("-Q [str]"), _("--quotestr=[str]"),
N_("Quoting string, default \"> \""));
#endif
-#ifdef HAVE_REGEX_H
- print1opt("-R", "--regexp", N_("Do regular expression searches"));
-#endif
#ifndef NANO_SMALL
print1opt("-S", "--smooth", N_("Smooth scrolling"));
#endif
{"morespace", 0, NULL, 'O'},
#ifndef DISABLE_JUSTIFY
{"quotestr", 1, NULL, 'Q'},
-#endif
-#ifdef HAVE_REGEX_H
- {"regexp", 0, NULL, 'R'},
#endif
{"tabsize", 1, NULL, 'T'},
{"version", 0, NULL, 'V'},
while ((optchr =
#ifdef HAVE_GETOPT_LONG
- getopt_long(argc, argv, "h?ABE:FHINOQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz", long_options, NULL)
+ getopt_long(argc, argv, "h?ABE:FHINOQ:ST:VY:Zabcdefgijklmo:pr:s:tvwxz", long_options, NULL)
#else
- getopt(argc, argv, "h?ABE:FHINOQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz")
+ getopt(argc, argv, "h?ABE:FHINOQ:ST:VY:Zabcdefgijklmo:pr:s:tvwxz")
#endif
) != -1) {
quotestr = mallocstrcpy(quotestr, optarg);
break;
#endif
-#ifdef HAVE_REGEX_H
- case 'R':
- SET(USE_REGEXP);
- break;
-#endif
#ifndef NANO_SMALL
case 'S':
SET(SMOOTHSCROLL);
#define NANO_WHEREIS_NEXT_KEY NANO_ALT_W
#define NANO_WHEREIS_NEXT_FKEY KEY_F(16)
#define NANO_TOOTHERWHEREIS_KEY NANO_CONTROL_T
+#define NANO_REGEXP_KEY NANO_ALT_R
#define NANO_REPLACE_KEY NANO_CONTROL_4
#define NANO_REPLACE_FKEY KEY_F(14)
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
#define TOGGLE_NOHELP_KEY NANO_ALT_X
#define TOGGLE_MOUSE_KEY NANO_ALT_M
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
-#define TOGGLE_REGEXP_KEY NANO_ALT_R
#define TOGGLE_WRAP_KEY NANO_ALT_L
#define TOGGLE_BACKWARDS_KEY NANO_ALT_B
#define TOGGLE_CASE_KEY NANO_ALT_C
{"quotestr", 0},
#endif
{"rebinddelete", REBIND_DELETE},
-#ifdef HAVE_REGEX_H
- {"regexp", USE_REGEXP},
-#endif
#ifndef NANO_SMALL
{"smarthome", SMART_HOME},
{"smooth", SMOOTHSCROLL},
TOGGLE(REVERSE_SEARCH);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
+#endif
#ifdef HAVE_REGEX_H
- case TOGGLE_REGEXP_KEY:
+ case NANO_REGEXP_KEY:
TOGGLE(USE_REGEXP);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
#endif
-#endif /* !NANO_SMALL */
case NANO_TOOTHERSEARCH_KEY:
backupstring = mallocstrcpy(backupstring, answer);
return -2; /* Call the opposite search function. */
search_abort();
else if (i == -2) /* Replace. */
do_replace();
-#ifndef NANO_SMALL
else if (i == 1) /* Case Sensitive, Backwards, or Regexp search
* toggle. */
do_search();
-#endif
if (i != 0)
return;