Skip to content

Commit

Permalink
Merge pull request kyagi#54 from kyagi/not-use-register
Browse files Browse the repository at this point in the history
Don't use register for saving window configuration
  • Loading branch information
syohex committed Feb 23, 2017
2 parents 788250f + b5264e4 commit 9429e53
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions shell-pop.el
Expand Up @@ -9,7 +9,7 @@
;; Created: 2009-05-31 23:57:08
;; Keywords: shell, terminal, tools
;; Compatibility: GNU 24.x
;; Package-Requires: ((emacs "24"))
;; Package-Requires: ((emacs "24") (cl-lib "0.5"))

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -58,6 +58,7 @@
(declare-function eshell-process-interact "esh-proc")

(require 'term)
(require 'cl-lib)

(defgroup shell-pop ()
"Shell-pop"
Expand All @@ -71,6 +72,7 @@
(defvar shell-pop-last-window nil)
(defvar shell-pop-last-shell-buffer-index 1)
(defvar shell-pop-last-shell-buffer-name "")
(defvar shell-pop-window-configuration nil)
;; internal}

(defcustom shell-pop-window-size 30
Expand Down Expand Up @@ -305,7 +307,8 @@ The input format is the same as that of `kbd'."
(shell-pop-get-internal-mode-buffer-window index)))
(cwd (replace-regexp-in-string "\\\\" "/" default-directory)))
(when (shell-pop--full-p)
(window-configuration-to-register :shell-pop)
(setq shell-pop-window-configuration
(list (current-window-configuration) (point-marker)))
(delete-other-windows))
(if w
(select-window w)
Expand All @@ -327,7 +330,11 @@ The input format is the same as that of `kbd'."
(defun shell-pop-out ()
(run-hooks 'shell-pop-out-hook)
(if (shell-pop--full-p)
(jump-to-register :shell-pop)
(let ((window-conf (cl-first shell-pop-window-configuration))
(marker (cl-second shell-pop-window-configuration)))
(set-window-configuration window-conf)
(when (marker-buffer marker)
(goto-char marker)))
(when (and (not (one-window-p)) (not (= shell-pop-window-height 100)))
(bury-buffer)
(delete-window)
Expand Down

0 comments on commit 9429e53

Please sign in to comment.