[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] [PATCH] main: add "/" to the quoting regex, to allow justif
From: |
Benno Schulenberg |
Subject: |
[Nano-devel] [PATCH] main: add "/" to the quoting regex, to allow justifying //-comments |
Date: |
Mon, 21 May 2018 20:36:27 +0200 |
[It would be nice to be able to also add something like "(/\*| \*)",
to make it possible to justify nano-style /*...*/ comments, but that
doesn't work, because the current code demands that the quoting parts
of a paragraph are all exactly the same.]
---
doc/nano.1 | 2 +-
doc/nano.texi | 4 ++--
doc/nanorc.5 | 2 +-
doc/sample.nanorc.in | 2 +-
src/nano.c | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/doc/nano.1 b/doc/nano.1
index 891cbc85..8bb0f0f2 100644
--- a/doc/nano.1
+++ b/doc/nano.1
@@ -124,7 +124,7 @@ and place it at that position again upon reopening such a
file.
.TP
.BR "\-Q ""\fIcharacters\fB""" ", " "\-\-quotestr=""" \fIcharacters """
Set the quoting string for justifying. The default is
-\fB"^([\ \\t]*[#:>|}])+"\fP. Note that \fB\\t\fP stands for an actual Tab.
+\fB"^([\ \\t]*[#/:>|}])+"\fP. Note that \fB\\t\fP stands for an actual Tab.
.TP
.BR \-R ", " \-\-restricted
Restricted mode: don't read or write to any file not specified on the
diff --git a/doc/nano.texi b/doc/nano.texi
index 9da7fa97..58755597 100644
--- a/doc/nano.texi
+++ b/doc/nano.texi
@@ -221,7 +221,7 @@ and place it at that position again upon reopening such a
file.
@item -Q "@var{characters}"
@itemx --quotestr="@var{characters}"
Set the quoting string for justifying. The default value is
address@hidden"^(address@hidden }\t]*[#:>|@}])+"}.
address@hidden"^(address@hidden }\t]*[#/:>|@}])+"}.
Note that @code{\t} stands for a literal Tab character.
@item -R
@@ -848,7 +848,7 @@ Obsolete option. Recognized but ignored.
@item set quotestr "@var{string}"
The email-quote string, used to justify email-quoted paragraphs. This
is an extended regular expression. The default value is
address@hidden"^(address@hidden }\t]*[#:>|@}])+"}.
address@hidden"^(address@hidden }\t]*[#/:>|@}])+"}.
Note that @code{\t} stands for a literal Tab character.
@item set rebinddelete
diff --git a/doc/nanorc.5 b/doc/nanorc.5
index 2bdbfd62..b63fe6f9 100644
--- a/doc/nanorc.5
+++ b/doc/nanorc.5
@@ -204,7 +204,7 @@ Obsolete option. Recognized but ignored.
.B set quotestr "\fIstring\fP"
The email-quote string, used to justify email-quoted paragraphs. This
is an extended regular expression. The default value is
-"\fB^([\ \\t]*[#:>|}])+\fP". Note that \fB\\t\fR stands for an actual
+"\fB^([\ \\t]*[#/:>|}])+\fP". Note that \fB\\t\fR stands for an actual
Tab character.
.TP
.B set rebinddelete
diff --git a/doc/sample.nanorc.in b/doc/sample.nanorc.in
index 263abd1a..fe2fe5e4 100644
--- a/doc/sample.nanorc.in
+++ b/doc/sample.nanorc.in
@@ -126,7 +126,7 @@
## The email-quote string, used to justify email-quoted paragraphs.
## This is an extended regular expression. The default is:
-# set quotestr "^([ ]*[#:>|}])+"
+# set quotestr "^([ ]*[#/:>|}])+"
## Fix Backspace/Delete confusion problem.
# set rebinddelete
diff --git a/src/nano.c b/src/nano.c
index 065425a7..247fe635 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2454,7 +2454,7 @@ int main(int argc, char **argv)
/* If quotestr wasn't specified, set its default value. */
if (quotestr == NULL)
- quotestr = mallocstrcpy(NULL, "^([ \t]*[#:>|}])+");
+ quotestr = mallocstrcpy(NULL, "^([ \t]*[#/:>|}])+");
quoterc = regcomp("ereg, quotestr, NANO_REG_EXTENDED);
if (quoterc == 0) {
--
2.17.0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Nano-devel] [PATCH] main: add "/" to the quoting regex, to allow justifying //-comments,
Benno Schulenberg <=