Mercurial > hg > xemacs-beta
comparison lisp/cl.el @ 2136:9d6ec778e1e8
[xemacs-hg @ 2004-06-17 03:08:28 by james]
Fix setf of a substring when start is negative.
author | james |
---|---|
date | Thu, 17 Jun 2004 03:08:28 +0000 |
parents | f557693c61de |
children | 393039450288 |
comparison
equal
deleted
inserted
replaced
2135:e6d43c299b9c | 2136:9d6ec778e1e8 |
---|---|
213 val)) | 213 val)) |
214 | 214 |
215 (defun cl-set-substring (str start end val) | 215 (defun cl-set-substring (str start end val) |
216 (if end (if (< end 0) (incf end (length str))) | 216 (if end (if (< end 0) (incf end (length str))) |
217 (setq end (length str))) | 217 (setq end (length str))) |
218 (if (< start 0) (incf start str)) | 218 (if (< start 0) (incf start (length str))) |
219 (concat (and (> start 0) (substring str 0 start)) | 219 (concat (and (> start 0) (substring str 0 start)) |
220 val | 220 val |
221 (and (< end (length str)) (substring str end)))) | 221 (and (< end (length str)) (substring str end)))) |
222 | 222 |
223 | 223 |