comparison lisp/prim/simple.el @ 165:5a88923fcbfe r20-3b9

Import from CVS: tag r20-3b9
author cvs
date Mon, 13 Aug 2007 09:44:42 +0200
parents 0132846995bd
children 85ec50267440
comparison
equal deleted inserted replaced
164:4e0740e5aab2 165:5a88923fcbfe
1166 ;; this code, but only for text-properties and not full extents. -sb 1166 ;; this code, but only for text-properties and not full extents. -sb
1167 ;; If the buffer is read-only, we should beep, in case the person 1167 ;; If the buffer is read-only, we should beep, in case the person
1168 ;; just isn't aware of this. However, there's no harm in putting 1168 ;; just isn't aware of this. However, there's no harm in putting
1169 ;; the region's text in the kill ring, anyway. 1169 ;; the region's text in the kill ring, anyway.
1170 ((or (and buffer-read-only (not inhibit-read-only)) 1170 ((or (and buffer-read-only (not inhibit-read-only))
1171 (text-property-not-all beg end 'read-only nil)) 1171 (text-property-not-all (min beg end) (max beg end) 'read-only nil))
1172 ;; This is redundant. 1172 ;; This is redundant.
1173 ;; (if verbose (message "Copying %d characters" 1173 ;; (if verbose (message "Copying %d characters"
1174 ;; (- (max beg end) (min beg end)))) 1174 ;; (- (max beg end) (min beg end))))
1175 (copy-region-as-kill beg end) 1175 (copy-region-as-kill beg end)
1176 ;; ;; This should always barf, and give us the correct error. 1176 ;; ;; This should always barf, and give us the correct error.
1193 tail) 1193 tail)
1194 (delete-region beg end) 1194 (delete-region beg end)
1195 ;; Search back in buffer-undo-list for this string, 1195 ;; Search back in buffer-undo-list for this string,
1196 ;; in case a change hook made property changes. 1196 ;; in case a change hook made property changes.
1197 (setq tail buffer-undo-list) 1197 (setq tail buffer-undo-list)
1198 (while (not (stringp (car-safe (car-safe tail)))) ; XEmacs 1198 (while (and tail
1199 (setq tail (cdr tail))) 1199 (not (stringp (car-safe (car-safe tail))))) ; XEmacs
1200 (pop tail))
1200 ;; Take the same string recorded for undo 1201 ;; Take the same string recorded for undo
1201 ;; and put it in the kill-ring. 1202 ;; and put it in the kill-ring.
1202 (kill-new (car (car tail))))) 1203 (and tail
1204 (kill-new (car (car tail))))))
1203 1205
1204 (t 1206 (t
1205 ;; if undo is not kept, grab the string then delete it (which won't 1207 ;; if undo is not kept, grab the string then delete it (which won't
1206 ;; add another string to the undo list). 1208 ;; add another string to the undo list).
1207 (copy-region-as-kill beg end) 1209 (copy-region-as-kill beg end)