diff options
| author | Karoly Lorentey | 2004-07-04 21:51:32 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-07-04 21:51:32 +0000 |
| commit | d0cf63f7695c5d5886a3631ea3c03e82d52ca7c2 (patch) | |
| tree | 4d50eceb105a3868b8a040ba0666195a7fe71869 /lisp/replace.el | |
| parent | d7e4838fdf4ad2d3ec267bbcd84846abad6bb570 (diff) | |
| parent | 2a1a35c60c3acad58ed135fa52efcaceb0ff9091 (diff) | |
| download | emacs-d0cf63f7695c5d5886a3631ea3c03e82d52ca7c2.tar.gz emacs-d0cf63f7695c5d5886a3631ea3c03e82d52ca7c2.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-437
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-438
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-209
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index cac4470c9cd..4c381c658e5 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -118,14 +118,19 @@ strings or patterns." | |||
| 118 | ((eq char ?\,) | 118 | ((eq char ?\,) |
| 119 | (setq pos (read-from-string to)) | 119 | (setq pos (read-from-string to)) |
| 120 | (push `(replace-quote ,(car pos)) list) | 120 | (push `(replace-quote ,(car pos)) list) |
| 121 | (setq to (substring | 121 | (let ((end |
| 122 | to (+ (cdr pos) | 122 | ;; Swallow a space after a symbol |
| 123 | ;; Swallow a space after a symbol | 123 | ;; if there is a space. |
| 124 | ;; if there is a space. | 124 | (if (and (or (symbolp (car pos)) |
| 125 | (if (string-match | 125 | ;; Swallow a space after 'foo |
| 126 | "^[^])\"] " | 126 | ;; but not after (quote foo). |
| 127 | (substring to (1- (cdr pos)))) | 127 | (and (eq (car-safe (car pos)) 'quote) |
| 128 | 1 0)))))) | 128 | (not (= ?\( (aref to 0))))) |
| 129 | (eq (string-match " " to (cdr pos)) | ||
| 130 | (cdr pos))) | ||
| 131 | (1+ (cdr pos)) | ||
| 132 | (cdr pos)))) | ||
| 133 | (setq to (substring to end))))) | ||
| 129 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))) | 134 | (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))) |
| 130 | (setq to (nreverse (delete "" (cons to list))))) | 135 | (setq to (nreverse (delete "" (cons to list))))) |
| 131 | (replace-match-string-symbols to) | 136 | (replace-match-string-symbols to) |
| @@ -208,7 +213,7 @@ In interactive calls, the replacement text can contain `\\,' | |||
| 208 | followed by a Lisp expression. Each | 213 | followed by a Lisp expression. Each |
| 209 | replacement evaluates that expression to compute the replacement | 214 | replacement evaluates that expression to compute the replacement |
| 210 | string. Inside of that expression, `\\&' is a string denoting the | 215 | string. Inside of that expression, `\\&' is a string denoting the |
| 211 | whole match as a sting, `\\N' for a partial match, `\\#&' and `\\#N' | 216 | whole match as a string, `\\N' for a partial match, `\\#&' and `\\#N' |
| 212 | for the whole or a partial match converted to a number with | 217 | for the whole or a partial match converted to a number with |
| 213 | `string-to-number', and `\\#' itself for the number of replacements | 218 | `string-to-number', and `\\#' itself for the number of replacements |
| 214 | done so far (starting with zero). | 219 | done so far (starting with zero). |