diff options
| author | Richard M. Stallman | 1998-05-19 05:22:50 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-05-19 05:22:50 +0000 |
| commit | cb3e1b4c4cb11ea4461dd09cd5c756b6c5340a5a (patch) | |
| tree | fb42e3537e10bc5519085162f6104943918d24fc | |
| parent | cdda8f47bea08acb08e953f2c09211c3cfa9b7dd (diff) | |
| download | emacs-cb3e1b4c4cb11ea4461dd09cd5c756b6c5340a5a.tar.gz emacs-cb3e1b4c4cb11ea4461dd09cd5c756b6c5340a5a.zip | |
(kill-region): Set this-command unconditionally in a read-only buffer.
| -rw-r--r-- | lisp/simple.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 9e79a114891..ae4ce391110 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1647,10 +1647,11 @@ to make one entry in the kill ring." | |||
| 1647 | ;; However, there's no harm in putting | 1647 | ;; However, there's no harm in putting |
| 1648 | ;; the region's text in the kill ring, anyway. | 1648 | ;; the region's text in the kill ring, anyway. |
| 1649 | (copy-region-as-kill beg end) | 1649 | (copy-region-as-kill beg end) |
| 1650 | ;; This should always barf, and give us the correct error. | 1650 | ;; Set this-command now, so it will be set even if we get an error. |
| 1651 | (setq this-command 'kill-region) | ||
| 1652 | ;; This should barf, if appropriate, and give us the correct error. | ||
| 1651 | (if kill-read-only-ok | 1653 | (if kill-read-only-ok |
| 1652 | (message "Read only text copied to kill ring") | 1654 | (message "Read only text copied to kill ring") |
| 1653 | (setq this-command 'kill-region) | ||
| 1654 | ;; Signal an error if the buffer is read-only. | 1655 | ;; Signal an error if the buffer is read-only. |
| 1655 | (barf-if-buffer-read-only) | 1656 | (barf-if-buffer-read-only) |
| 1656 | ;; If the buffer isn't read-only, the text is. | 1657 | ;; If the buffer isn't read-only, the text is. |