aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2005-11-29 23:58:20 +0000
committerKim F. Storm <[email protected]>2005-11-29 23:58:20 +0000
commitc0e4cc19874341e454dcbbe6ecad74984babe832 (patch)
tree757a316a0762a680784ecda3eec624c86a5be467
parent15575807da8ad6088e2ae420e0dc1799b4608dd9 (diff)
(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).
-rw-r--r--lisp/emulation/cua-rect.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 35132e60e8..0590af5024 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -65,6 +65,7 @@
;; List of overlays used to display current rectangle.
(defvar cua--rectangle-overlays nil)
(make-variable-buffer-local 'cua--rectangle-overlays)
+(put 'cua--rectangle-overlays 'permanent-local t)
(defvar cua--overlay-keymap
(let ((map (make-sparse-keymap)))
@@ -1393,7 +1394,12 @@ With prefix arg, indent to that column."
(if (and mark-active
(not deactivate-mark))
(cua--highlight-rectangle)
- (cua--deactivate-rectangle)))
+ (cua--deactivate-rectangle))
+ (when cua--rectangle-overlays
+ ;; clean-up after revert-buffer
+ (mapcar (function delete-overlay) cua--rectangle-overlays)
+ (setq cua--rectangle-overlays nil)
+ (setq deactivate-mark t)))
(when cua--rect-undo-set-point
(goto-char cua--rect-undo-set-point)
(setq cua--rect-undo-set-point nil)))