summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-08-15 00:34:04 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-08-15 00:34:04 +0000
commit4a4accf705681d4d8e05b72b4a33374bfe0447c7 (patch)
treec838d5495eb303b324781bb88c342fce84b247fb /lisp/window.el
parent5988bd2708b4db612dbfcc74920e3c1c1029a34a (diff)
downloademacs-4a4accf705681d4d8e05b72b4a33374bfe0447c7.tar.gz
(split-window-save-restore-data): Use push and with-current-buffer.
(handle-select-window): Don't do anything if the window has disappeared since the event was generated.
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el15
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/window.el b/lisp/window.el
index cb4de12a9cf..98d5f9963f1 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -239,7 +239,7 @@ If WINDOW is nil or omitted, it defaults to the currently selected window."
(setq done nil))))))
'nomini))))))
-;;; I think this should be the default; I think people will prefer it--rms.
+;; I think this should be the default; I think people will prefer it--rms.
(defcustom split-window-keep-point t
"*If non-nil, split windows keeps the original point in both children.
This is often more convenient for editing.
@@ -300,13 +300,11 @@ new mode line."
(defvar view-return-to-alist)
(defun split-window-save-restore-data (new-w old-w)
- (save-excursion
- (set-buffer (window-buffer))
+ (with-current-buffer (window-buffer)
(if view-mode
(let ((old-info (assq old-w view-return-to-alist)))
- (setq view-return-to-alist
- (cons (cons new-w (cons (and old-info (car (cdr old-info))) t))
- view-return-to-alist))))
+ (push (cons new-w (cons (and old-info (car (cdr old-info))) t))
+ view-return-to-alist)))
new-w))
(defun split-window-horizontally (&optional arg)
@@ -582,8 +580,9 @@ and the buffer that is killed or buried is the one in that window."
"Handle select-window events."
(interactive "e")
(let ((window (posn-window (event-start event))))
- (if (or (not (window-minibuffer-p window))
- (minibuffer-window-active-p window))
+ (if (and (window-live-p window)
+ (or (not (window-minibuffer-p window))
+ (minibuffer-window-active-p window)))
(select-window window))))
(define-key ctl-x-map "2" 'split-window-vertically)