1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-05 20:43:08 +00:00

(kill-region): Use the new `delete-and-extract-region'

rather than the undo log (which is incorrect with *-change-functions).
This commit is contained in:
Stefan Monnier 1999-12-07 06:30:44 +00:00
parent 1da04da19b
commit a1eb02bddb
2 changed files with 18 additions and 26 deletions

View File

@ -1,3 +1,14 @@
1999-12-07 Stefan Monnier <monnier@cs.yale.edu>
* files.el (save-some-buffers): Turn EXITING into the more general
PRED argument to allow specifying a subset of buffers.
* simple.el (kill-region): Use the new `delete-and-extract-region'
rather than the undo log (which is incorrect with *-change-functions).
* font-lock.el (font-lock-default-fontify-region): Fix subtle
off-by-one problem that could force re-fontifying the whole buffer.
1999-12-06 Michael Kifer <kifer@cs.sunysb.edu>
* viper-cmd.el (viper-minibuffer-standard-hook,
@ -167,7 +178,7 @@
(lm-summary, lm-authors, lm-maintainer, lm-creation-date)
(lm-last-modified-date, lm-version, lm-keywords, lm-adapted-by)
(lm-commentary, lm-verify, lm-synopsis): Use lm-with-file.
(lm-commentary): fix to handle the case when the change log is
(lm-commentary): Fix to handle the case when the change log is
at the end of the file.
1999-12-02 Kenichi Handa <handa@etl.go.jp>
@ -867,7 +878,6 @@
* progmodes/compile.el (compilation-error-regexp-alist):
Undo previous change.
>>>>>>> 1.97
1999-10-28 Dave Love <fx@gnu.org>
* help.el (help-follow): Make arg optional again and really
@ -1255,7 +1265,6 @@
* emacs-lisp/cl-indent.el (common-lisp-indent-function): Use `eq'
instead of `eql'.
>>>>>>> 1.86
1999-10-14 Stefan Monnier <monnier@cs.yale.edu>
* ange-ftp.el (ange-ftp-make-tmp-name, ange-ftp-del-tmp-name):

View File

@ -1633,29 +1633,12 @@ the text killed this time appends to the text killed last time
to make one entry in the kill ring."
(interactive "*r")
(condition-case nil
;; Don't let the undo list be truncated before we can even access it.
(let ((undo-strong-limit (+ (- (max beg end) (min beg end)) 100))
(old-list buffer-undo-list)
tail
;; If we can't rely on finding the killed text
;; in the undo list, save it now as a string.
(string (if (or (eq buffer-undo-list t)
(= beg end))
(buffer-substring beg end))))
(delete-region beg end)
;; Search back in buffer-undo-list for this string,
;; in case a change hook made property changes.
(setq tail buffer-undo-list)
(unless string
(while (not (stringp (car (car tail))))
(setq tail (cdr tail)))
;; If we did not already make the string to use,
;; use the same one that undo made for us.
(setq string (car (car tail))))
;; Add that string to the kill ring, one way or another.
(if (eq last-command 'kill-region)
(kill-append string (< end beg))
(kill-new string))
(let ((string (delete-and-extract-region beg end)))
(when string ;STRING is nil if BEG = END
;; Add that string to the kill ring, one way or another.
(if (eq last-command 'kill-region)
(kill-append string (< end beg))
(kill-new string)))
(setq this-command 'kill-region))
((buffer-read-only text-read-only)
;; The code above failed because the buffer, or some of the characters