summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-02-15 23:29:33 -0500
committerKyle Meyer <kyle@kyleam.com>2016-02-15 23:29:33 -0500
commitaf287828c90c9251ad6af23dc47531549f3d2fd2 (patch)
tree3dafc25f4cb26062a1fddc89b5a3ddb3e7b6e2b6 /lisp
parent8d15b9f5a7de07f2f956fea3ed4007b68a9fb50c (diff)
downloademacs.d-af287828c90c9251ad6af23dc47531549f3d2fd2.tar.gz
ediff: Restore window configuration
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-diff.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/km-diff.el b/lisp/km-diff.el
index 771cedf..b5d3c4b 100644
--- a/lisp/km-diff.el
+++ b/lisp/km-diff.el
@@ -56,5 +56,17 @@
(interactive)
(km/diff--with-other-window #'ediff))
+(defvar km/ediff-previous-window-config nil)
+
+;;;###autoload
+(defun km/ediff-save-window-config ()
+ (setq km/ediff-previous-window-config (current-window-configuration)))
+
+;;;###autoload
+(defun km/ediff-restore-window-config ()
+ (when km/ediff-previous-window-config
+ (set-window-configuration km/ediff-previous-window-config)
+ (setq km/ediff-previous-window-config nil)))
+
(provide 'km-diff)
;;; km-diff.el ends here