Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions popwin.el
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ minibuffer window is selected."

(defvar popwin:dummy-buffer nil)

(defun popwin:window-total-width (&optional win)
"Return a window's text plus margin width.
WIN defaults to the selected window."
(+ (window-width win)
(or (car (window-margins win)) 0)
(or (cdr (window-margins win)) 0)))

(defun popwin:dummy-buffer ()
(if (buffer-live-p popwin:dummy-buffer)
popwin:dummy-buffer
Expand Down Expand Up @@ -271,7 +278,7 @@ which is a node of `window-tree' and OUTLINE which is a node of
(defun popwin:create-popup-window-1 (window size position)
"Create a new window with SIZE at POSITION of WINDOW. The
return value is a list of a master window and the popup window."
(let ((width (window-width window))
(let ((width (popwin:window-total-width window))
(height (window-height window)))
(ecase position
((left :left)
Expand Down Expand Up @@ -304,7 +311,7 @@ window-configuration."
(vfactor 1))
(popwin:save-selected-window
(delete-other-windows root-win))
(let ((root-width (window-width root-win))
(let ((root-width (popwin:window-total-width root-win))
(root-height (window-height root-win)))
(when adjust
(if (floatp size)
Expand Down