diff options
| author | Kim F. Storm | 2005-11-29 23:58:20 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-11-29 23:58:20 +0000 |
| commit | c0e4cc19874341e454dcbbe6ecad74984babe832 (patch) | |
| tree | 757a316a0762a680784ecda3eec624c86a5be467 /lisp | |
| parent | 15575807da8ad6088e2ae420e0dc1799b4608dd9 (diff) | |
| download | emacs-c0e4cc19874341e454dcbbe6ecad74984babe832.tar.gz emacs-c0e4cc19874341e454dcbbe6ecad74984babe832.zip | |
(cua--rectangle-overlays): Make permanent-local.
(cua--rectangle-post-command): Cleanup overlays and deactivate mark
after revert-buffer (or anything else which kills all local variables).
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/emulation/cua-rect.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 35132e60e8d..0590af50249 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el | |||
| @@ -65,6 +65,7 @@ | |||
| 65 | ;; List of overlays used to display current rectangle. | 65 | ;; List of overlays used to display current rectangle. |
| 66 | (defvar cua--rectangle-overlays nil) | 66 | (defvar cua--rectangle-overlays nil) |
| 67 | (make-variable-buffer-local 'cua--rectangle-overlays) | 67 | (make-variable-buffer-local 'cua--rectangle-overlays) |
| 68 | (put 'cua--rectangle-overlays 'permanent-local t) | ||
| 68 | 69 | ||
| 69 | (defvar cua--overlay-keymap | 70 | (defvar cua--overlay-keymap |
| 70 | (let ((map (make-sparse-keymap))) | 71 | (let ((map (make-sparse-keymap))) |
| @@ -1393,7 +1394,12 @@ With prefix arg, indent to that column." | |||
| 1393 | (if (and mark-active | 1394 | (if (and mark-active |
| 1394 | (not deactivate-mark)) | 1395 | (not deactivate-mark)) |
| 1395 | (cua--highlight-rectangle) | 1396 | (cua--highlight-rectangle) |
| 1396 | (cua--deactivate-rectangle))) | 1397 | (cua--deactivate-rectangle)) |
| 1398 | (when cua--rectangle-overlays | ||
| 1399 | ;; clean-up after revert-buffer | ||
| 1400 | (mapcar (function delete-overlay) cua--rectangle-overlays) | ||
| 1401 | (setq cua--rectangle-overlays nil) | ||
| 1402 | (setq deactivate-mark t))) | ||
| 1397 | (when cua--rect-undo-set-point | 1403 | (when cua--rect-undo-set-point |
| 1398 | (goto-char cua--rect-undo-set-point) | 1404 | (goto-char cua--rect-undo-set-point) |
| 1399 | (setq cua--rect-undo-set-point nil))) | 1405 | (setq cua--rect-undo-set-point nil))) |