Skip to content

Commit

Permalink
Fix window-point restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomohiro Matsuyama committed Sep 2, 2012
1 parent 8030444 commit 0531e58
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions popwin.el
Expand Up @@ -102,6 +102,14 @@ the selected window."
"Return t if BUFFER might be thought of as a buried buffer."
(eq (car (last (buffer-list))) buffer))

(defun popwin:window-point (window)
"Return window-point of WINDOW. If WINDOW is currently
selected, then return buffer-point instead."
(if (eq (selected-window) window)
(with-current-buffer (window-buffer window)
(point))
(window-point window)))

(defun popwin:window-deletable-p (window)
"Return t if WINDOW is deletable, meaning that WINDOW is alive
and not a minibuffer's window, plus there is two or more windows."
Expand Down Expand Up @@ -168,7 +176,7 @@ HFACTOR, and vertical factor VFACTOR."
(list 'window
node
(window-buffer node)
(window-point node)
(popwin:window-point node)
(window-edges node)
(eq (selected-window) node))
(destructuring-bind (dir edges . windows) node
Expand Down Expand Up @@ -481,7 +489,7 @@ the popup window will be closed are followings:
* Another window has been selected."
(when popwin:popup-window
(let* ((window (selected-window))
(window-point (window-point window))
(window-point (popwin:window-point window))
(window-buffer (window-buffer window))
(minibuf-window-p (window-minibuffer-p window))
(reading-from-minibuf
Expand Down

0 comments on commit 0531e58

Please sign in to comment.