aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-08-15 00:34:04 +0000
committerStefan Monnier2002-08-15 00:34:04 +0000
commit4a4accf705681d4d8e05b72b4a33374bfe0447c7 (patch)
treec838d5495eb303b324781bb88c342fce84b247fb
parent5988bd2708b4db612dbfcc74920e3c1c1029a34a (diff)
downloademacs-4a4accf705681d4d8e05b72b4a33374bfe0447c7.tar.gz
emacs-4a4accf705681d4d8e05b72b4a33374bfe0447c7.zip
(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.
-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."
239 (setq done nil)))))) 239 (setq done nil))))))
240 'nomini)))))) 240 'nomini))))))
241 241
242;;; I think this should be the default; I think people will prefer it--rms. 242;; I think this should be the default; I think people will prefer it--rms.
243(defcustom split-window-keep-point t 243(defcustom split-window-keep-point t
244 "*If non-nil, split windows keeps the original point in both children. 244 "*If non-nil, split windows keeps the original point in both children.
245This is often more convenient for editing. 245This is often more convenient for editing.
@@ -300,13 +300,11 @@ new mode line."
300(defvar view-return-to-alist) 300(defvar view-return-to-alist)
301 301
302(defun split-window-save-restore-data (new-w old-w) 302(defun split-window-save-restore-data (new-w old-w)
303 (save-excursion 303 (with-current-buffer (window-buffer)
304 (set-buffer (window-buffer))
305 (if view-mode 304 (if view-mode
306 (let ((old-info (assq old-w view-return-to-alist))) 305 (let ((old-info (assq old-w view-return-to-alist)))
307 (setq view-return-to-alist 306 (push (cons new-w (cons (and old-info (car (cdr old-info))) t))
308 (cons (cons new-w (cons (and old-info (car (cdr old-info))) t)) 307 view-return-to-alist)))
309 view-return-to-alist))))
310 new-w)) 308 new-w))
311 309
312(defun split-window-horizontally (&optional arg) 310(defun split-window-horizontally (&optional arg)
@@ -582,8 +580,9 @@ and the buffer that is killed or buried is the one in that window."
582 "Handle select-window events." 580 "Handle select-window events."
583 (interactive "e") 581 (interactive "e")
584 (let ((window (posn-window (event-start event)))) 582 (let ((window (posn-window (event-start event))))
585 (if (or (not (window-minibuffer-p window)) 583 (if (and (window-live-p window)
586 (minibuffer-window-active-p window)) 584 (or (not (window-minibuffer-p window))
585 (minibuffer-window-active-p window)))
587 (select-window window)))) 586 (select-window window))))
588 587
589(define-key ctl-x-map "2" 'split-window-vertically) 588(define-key ctl-x-map "2" 'split-window-vertically)