From: Mark Wooding Date: Fri, 14 Apr 2023 11:02:34 +0000 (+0100) Subject: el/dot-emacs.el: Save and restore window configuration around `ediff'. X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/6938850a823e3c0df2c62e9ce3eaf55a4fd133c8 el/dot-emacs.el: Save and restore window configuration around `ediff'. --- diff --git a/el/dot-emacs.el b/el/dot-emacs.el index a74b693..26cfb63 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -2248,6 +2248,18 @@ doesn't match any of the regular expressions in (add-hook 'post-command-hook 'mdw-update-terminal-title) ;;;-------------------------------------------------------------------------- +;;; Ediff hacking. + +(defvar mdw-ediff-previous-windows) +(defun mdw-ediff-setup () + (setq mdw-ediff-previous-windows (current-window-configuration))) +(defun mdw-ediff-suspend-or-quit () + (set-window-configuration mdw-ediff-previous-windows)) +(add-hook 'ediff-before-setup-hook 'mdw-ediff-setup) +(add-hook 'ediff-quit-hook 'mdw-ediff-suspend-or-quit t) +(add-hook 'ediff-suspend-hook 'mdw-ediff-suspend-or-quit t) + +;;;-------------------------------------------------------------------------- ;;; C programming configuration. ;; Make C indentation nice.