aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2015-08-09 18:30:00 +0200
committerJonas Bernoulli <jonas@bernoul.li>2015-08-09 18:30:00 +0200
commitf1dd112a10ad3aead12ff05786be4b5e289225d0 (patch)
tree353e52061c28d41890599bcfdf4bd9fc8b9d1c59 /lisp
parent553820da413d10bf33f935945167a5317766b01d (diff)
magit-mode-display-buffer: don't store winconf unconditionally
Only store the previous window configuration when it will actually be used when burying the buffer, i.e when `magit-restore-window-configuration' is non-nil.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/magit-mode.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index c076211..e96d0eb 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -82,7 +82,12 @@ frame. If this isn't the case setting then the default value
might lead to undesirable behaviour. Also quitting a Magit
buffer while another Magit buffer that was created earlier is
still displayed will cause that buffer to be hidden, which might
-or might not be what you want."
+or might not be what you want.
+
+Note that if this was previously disabled, then setting it to t
+does not effect Magit buffers that already exist, because the
+previous window configurations are only stored if and only if
+this option is non-nil."
:package-version '(magit . "2.1.0")
:group 'magit
:type 'boolean)
@@ -455,7 +460,8 @@ the function `magit-toplevel'."
(let ((section (magit-current-section)))
(with-current-buffer buffer
(setq magit-previous-section section)
- (magit-save-window-configuration)))
+ (when magit-restore-window-configuration
+ (magit-save-window-configuration))))
(funcall (or switch-function
(if (derived-mode-p 'magit-mode)
'switch-to-buffer