Function: winner-set-conf

winner-set-conf is a byte-compiled function defined in winner.el.gz.

Signature

(winner-set-conf WINCONF)

Source Code

;; Defined in /usr/src/emacs/lisp/winner.el.gz
;;;; Restoring configurations

;; Works almost as `set-window-configuration',
;; but does not change the contents or the size of the minibuffer,
;; and tries to preserve the selected window.
(defun winner-set-conf (winconf)
  (let* ((miniwin  (minibuffer-window))
         (chosen   (selected-window))
         (minisize (window-height miniwin)))
    (cl-letf (((window-buffer miniwin))
              ((window-point  miniwin)))
      (set-window-configuration winconf))
    (cond
     ((window-live-p chosen) (select-window chosen))
     ((window-minibuffer-p) (other-window 1)))
    (when (/= minisize (window-height miniwin))
      (with-selected-window miniwin
        (enlarge-window (- minisize (window-height)))))))