[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Restore window configuration after Ediff

From: PJ Weisberg
Subject: Restore window configuration after Ediff
Date: Fri, 15 Apr 2011 15:33:10 -0700

I'm not 100% sure if this is a bug or if I'm trying to do something I
should try to do.  I'm trying to call ediff-buffers and then use a
hook to restore the frame to its original state after Ediff is done.
Here's some sample code:

(defvar saved-configuration nil)

(defun do-ediff()
  (add-hook 'ediff-quit-hook 'do-ediff-cleanup)
  (setq saved-configuration (current-window-configuration))
  (ediff-buffers "*scratch*" "*scratch*"))

(defun do-ediff-cleanup()
  (set-window-configuration saved-configuration)
  (remove-hook 'ediff-quit-hook 'do-ediff-cleanup))

The problem is that after I quit ediff, the ediff control frame
doesn't always disappear.

I get the behavior I want if I use ediff-after-quit-hook-internal
instead of ediff-quit-hook, but the "internal" part of that name tells
me that's a bad idea.

Is there a better way to accomplish what I'm trying to do?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]