changeset 57523:a2d6c6e6486a

(looking-back): Return only t or nil.
author Richard M. Stallman <rms@gnu.org>
date Sat, 16 Oct 2004 15:29:46 +0000
parents 3f7aa44cf697
children 7eb69809590b
files lisp/subr.el
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Sat Oct 16 15:26:23 2004 +0000
+++ b/lisp/subr.el	Sat Oct 16 15:29:46 2004 +0000
@@ -2023,11 +2023,12 @@
 
 (defun looking-back (regexp &optional limit)
   "Return non-nil if text before point matches regular expression REGEXP.
-Like `looking-at' except backwards and slower.
+Like `looking-at' except matches before point, and is slower.
 LIMIT if non-nil speeds up the search by specifying how far back the
 match can start."
-  (save-excursion
-    (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))
+  (not (null
+	(save-excursion
+	  (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))))
 
 (defconst split-string-default-separators "[ \f\t\n\r\v]+"
   "The default value of separators for `split-string'.