summaryrefslogtreecommitdiff
path: root/lisp/textmodes/paragraphs.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-10-21 18:56:56 +0000
committerRichard M. Stallman <rms@gnu.org>2005-10-21 18:56:56 +0000
commitf4b80eb14c8cd969c80cb68ff9508d9e7011db22 (patch)
treecac270286674b97d2cedc34dde8acdd5ccbb4367 /lisp/textmodes/paragraphs.el
parent5ae158bf21d620f7c0d275e8b9719ad0c6df156a (diff)
downloademacs-f4b80eb14c8cd969c80cb68ff9508d9e7011db22.tar.gz
(sentence-end-base): New variable.
(sentence-end): Use sentence-end-base.
Diffstat (limited to 'lisp/textmodes/paragraphs.el')
-rw-r--r--lisp/textmodes/paragraphs.el25
1 files changed, 17 insertions, 8 deletions
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index f4af34fdabf..1ed43279c3d 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -159,23 +159,32 @@ to obtain the value of this variable."
:group 'paragraphs
:type '(choice regexp (const :tag "Use default value" nil)))
+(defcustom sentence-end-base "[.?!][]\"'\xd0c9\x5397d)}]*"
+ "*Regexp matching the basic end of a sentence, not including following space."
+ :group 'paragraphs
+ :type 'string
+ :version "22.1")
+
(defun sentence-end ()
"Return the regexp describing the end of a sentence.
This function returns either the value of the variable `sentence-end'
if it is non-nil, or the default value constructed from the
-variables `sentence-end-double-space', `sentence-end-without-period'
-and `sentence-end-without-space'. The default value specifies
-that in order to be recognized as the end of a sentence, the
-ending period, question mark, or exclamation point must be
-followed by two spaces, unless it's inside some sort of quotes or
-parenthesis. See Info node `(elisp)Standard Regexps'."
+variables `sentence-end-base', `sentence-end-double-space',
+`sentence-end-without-period' and `sentence-end-without-space'.
+
+The default value specifies that in order to be recognized as the
+end of a sentence, the ending period, question mark, or exclamation point
+must be followed by two spaces, with perhaps some closing delimiters
+in between. See Info node `(elisp)Standard Regexps'."
(or sentence-end
(concat (if sentence-end-without-period "\\w \\|")
- "\\([.?!][]\"'\xd0c9\x5397d)}]*"
+ "\\("
+ sentence-end-base
(if sentence-end-double-space
"\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)")
- "\\|[" sentence-end-without-space "]+\\)"
+ "\\|[" sentence-end-without-space "]+"
+ "\\)"
"[ \t\n]*")))
(defcustom page-delimiter "^\014"