diff options
| author | Stefan Monnier | 1999-12-07 06:30:44 +0000 |
|---|---|---|
| committer | Stefan Monnier | 1999-12-07 06:30:44 +0000 |
| commit | a1eb02bddb07ce904f803c8b6fa2c1282e98938e (patch) | |
| tree | 570bfecb58c03034e24cf82f145c69275bcc1339 | |
| parent | 1da04da19b299687d4100ba044c5cbcede5a0299 (diff) | |
| download | emacs-a1eb02bddb07ce904f803c8b6fa2c1282e98938e.tar.gz emacs-a1eb02bddb07ce904f803c8b6fa2c1282e98938e.zip | |
(kill-region): Use the new `delete-and-extract-region'
rather than the undo log (which is incorrect with *-change-functions).
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/simple.el | 29 |
2 files changed, 18 insertions, 26 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1885aa18b5f..bb6d4b438d7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 1999-12-07 Stefan Monnier <monnier@cs.yale.edu> | ||
| 2 | |||
| 3 | * files.el (save-some-buffers): Turn EXITING into the more general | ||
| 4 | PRED argument to allow specifying a subset of buffers. | ||
| 5 | |||
| 6 | * simple.el (kill-region): Use the new `delete-and-extract-region' | ||
| 7 | rather than the undo log (which is incorrect with *-change-functions). | ||
| 8 | |||
| 9 | * font-lock.el (font-lock-default-fontify-region): Fix subtle | ||
| 10 | off-by-one problem that could force re-fontifying the whole buffer. | ||
| 11 | |||
| 1 | 1999-12-06 Michael Kifer <kifer@cs.sunysb.edu> | 12 | 1999-12-06 Michael Kifer <kifer@cs.sunysb.edu> |
| 2 | 13 | ||
| 3 | * viper-cmd.el (viper-minibuffer-standard-hook, | 14 | * viper-cmd.el (viper-minibuffer-standard-hook, |
| @@ -167,7 +178,7 @@ | |||
| 167 | (lm-summary, lm-authors, lm-maintainer, lm-creation-date) | 178 | (lm-summary, lm-authors, lm-maintainer, lm-creation-date) |
| 168 | (lm-last-modified-date, lm-version, lm-keywords, lm-adapted-by) | 179 | (lm-last-modified-date, lm-version, lm-keywords, lm-adapted-by) |
| 169 | (lm-commentary, lm-verify, lm-synopsis): Use lm-with-file. | 180 | (lm-commentary, lm-verify, lm-synopsis): Use lm-with-file. |
| 170 | (lm-commentary): fix to handle the case when the change log is | 181 | (lm-commentary): Fix to handle the case when the change log is |
| 171 | at the end of the file. | 182 | at the end of the file. |
| 172 | 183 | ||
| 173 | 1999-12-02 Kenichi Handa <handa@etl.go.jp> | 184 | 1999-12-02 Kenichi Handa <handa@etl.go.jp> |
| @@ -867,7 +878,6 @@ | |||
| 867 | * progmodes/compile.el (compilation-error-regexp-alist): | 878 | * progmodes/compile.el (compilation-error-regexp-alist): |
| 868 | Undo previous change. | 879 | Undo previous change. |
| 869 | 880 | ||
| 870 | >>>>>>> 1.97 | ||
| 871 | 1999-10-28 Dave Love <fx@gnu.org> | 881 | 1999-10-28 Dave Love <fx@gnu.org> |
| 872 | 882 | ||
| 873 | * help.el (help-follow): Make arg optional again and really | 883 | * help.el (help-follow): Make arg optional again and really |
| @@ -1255,7 +1265,6 @@ | |||
| 1255 | * emacs-lisp/cl-indent.el (common-lisp-indent-function): Use `eq' | 1265 | * emacs-lisp/cl-indent.el (common-lisp-indent-function): Use `eq' |
| 1256 | instead of `eql'. | 1266 | instead of `eql'. |
| 1257 | 1267 | ||
| 1258 | >>>>>>> 1.86 | ||
| 1259 | 1999-10-14 Stefan Monnier <monnier@cs.yale.edu> | 1268 | 1999-10-14 Stefan Monnier <monnier@cs.yale.edu> |
| 1260 | 1269 | ||
| 1261 | * ange-ftp.el (ange-ftp-make-tmp-name, ange-ftp-del-tmp-name): | 1270 | * ange-ftp.el (ange-ftp-make-tmp-name, ange-ftp-del-tmp-name): |
diff --git a/lisp/simple.el b/lisp/simple.el index 63617178a67..9a44200059c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1633,29 +1633,12 @@ the text killed this time appends to the text killed last time | |||
| 1633 | to make one entry in the kill ring." | 1633 | to make one entry in the kill ring." |
| 1634 | (interactive "*r") | 1634 | (interactive "*r") |
| 1635 | (condition-case nil | 1635 | (condition-case nil |
| 1636 | ;; Don't let the undo list be truncated before we can even access it. | 1636 | (let ((string (delete-and-extract-region beg end))) |
| 1637 | (let ((undo-strong-limit (+ (- (max beg end) (min beg end)) 100)) | 1637 | (when string ;STRING is nil if BEG = END |
| 1638 | (old-list buffer-undo-list) | 1638 | ;; Add that string to the kill ring, one way or another. |
| 1639 | tail | 1639 | (if (eq last-command 'kill-region) |
| 1640 | ;; If we can't rely on finding the killed text | 1640 | (kill-append string (< end beg)) |
| 1641 | ;; in the undo list, save it now as a string. | 1641 | (kill-new string))) |
| 1642 | (string (if (or (eq buffer-undo-list t) | ||
| 1643 | (= beg end)) | ||
| 1644 | (buffer-substring beg end)))) | ||
| 1645 | (delete-region beg end) | ||
| 1646 | ;; Search back in buffer-undo-list for this string, | ||
| 1647 | ;; in case a change hook made property changes. | ||
| 1648 | (setq tail buffer-undo-list) | ||
| 1649 | (unless string | ||
| 1650 | (while (not (stringp (car (car tail)))) | ||
| 1651 | (setq tail (cdr tail))) | ||
| 1652 | ;; If we did not already make the string to use, | ||
| 1653 | ;; use the same one that undo made for us. | ||
| 1654 | (setq string (car (car tail)))) | ||
| 1655 | ;; Add that string to the kill ring, one way or another. | ||
| 1656 | (if (eq last-command 'kill-region) | ||
| 1657 | (kill-append string (< end beg)) | ||
| 1658 | (kill-new string)) | ||
| 1659 | (setq this-command 'kill-region)) | 1642 | (setq this-command 'kill-region)) |
| 1660 | ((buffer-read-only text-read-only) | 1643 | ((buffer-read-only text-read-only) |
| 1661 | ;; The code above failed because the buffer, or some of the characters | 1644 | ;; The code above failed because the buffer, or some of the characters |