changeset 26744:f14026cd9767

(kill-region): Use the new `delete-and-extract-region' rather than the undo log (which is incorrect with *-change-functions).
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 07 Dec 1999 06:30:44 +0000
parents 2ddbff6366e9
children 91304e25926b
files lisp/ChangeLog lisp/simple.el
diffstat 2 files changed, 18 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Dec 07 04:58:54 1999 +0000
+++ b/lisp/ChangeLog	Tue Dec 07 06:30:44 1999 +0000
@@ -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):
--- a/lisp/simple.el	Tue Dec 07 04:58:54 1999 +0000
+++ b/lisp/simple.el	Tue Dec 07 06:30:44 1999 +0000
@@ -1633,29 +1633,12 @@
 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