emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/subr.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/subr.el
Date: Fri, 30 May 2003 19:11:36 -0400

Index: emacs/lisp/subr.el
diff -c emacs/lisp/subr.el:1.354 emacs/lisp/subr.el:1.355
*** emacs/lisp/subr.el:1.354    Thu May 22 16:59:57 2003
--- emacs/lisp/subr.el  Fri May 30 19:11:35 2003
***************
*** 1820,1825 ****
--- 1820,1838 ----
        (buffer-substring-no-properties (match-beginning num)
                                        (match-end num)))))
  
+ (defun looking-back (regexp)
+   "Return t if text before point matches regular expression REGEXP.
+ This function modifies the match data that `match-beginning',
+ `match-end' and `match-data' access; save and restore the match
+ data if you want to preserve them."
+   (save-excursion
+     (let ((beg (point)))
+       (if (re-search-backward regexp nil t)
+         (if (= (match-end 0) beg)
+             t
+           nil)
+       nil))))
+ 
  (defconst split-string-default-separators "[ \f\t\n\r\v]+"
    "The default value of separators for `split-string'.
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]