# HG changeset patch # User Richard M. Stallman # Date 935864594 0 # Node ID 862886e87cf522abc15bee3fa3000c887d1a1ec7 # Parent 7c4808c6804b040ed406a315427c23c5fe7c7f61 (dired-string-replace-match): Return `nil' when no match found with global search. diff -r 7c4808c6804b -r 862886e87cf5 lisp/dired.el --- a/lisp/dired.el Sat Aug 28 18:22:20 1999 +0000 +++ b/lisp/dired.el Sat Aug 28 18:23:14 1999 +0000 @@ -1315,12 +1315,12 @@ Optional arg LITERAL means to take NEWTEXT literally. Optional arg GLOBAL means to replace all matches." (if global - (let ((start 0)) + (let ((start 0) ret) (while (string-match regexp string start) (let ((from-end (- (length string) (match-end 0)))) - (setq string (replace-match newtext t literal string)) + (setq ret (setq string (replace-match newtext t literal string))) (setq start (- (length string) from-end)))) - string) + ret) (if (not (string-match regexp string 0)) nil (replace-match newtext t literal string))))