Function: majutsu-restore-window-configuration

majutsu-restore-window-configuration is a natively compiled function defined in majutsu-mode.el.

Signature

(majutsu-restore-window-configuration &optional KILL-BUFFER)

Documentation

Bury or kill the current buffer and restore previous window configuration.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-mode.el
(defun majutsu-restore-window-configuration (&optional kill-buffer)
  "Bury or kill the current buffer and restore previous window configuration."
  (let ((winconf majutsu-previous-window-configuration)
        (buffer (current-buffer))
        (frame (selected-frame)))
    (quit-window kill-buffer (selected-window))
    (when (and winconf (equal frame (window-configuration-frame winconf)))
      (set-window-configuration winconf)
      (when (buffer-live-p buffer)
        (with-current-buffer buffer
          (setq majutsu-previous-window-configuration nil)))
      (set-buffer (with-selected-window (selected-window)
                    (current-buffer))))))