all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Restore window configuration after Ediff
@ 2011-04-15 22:33 PJ Weisberg
       [not found] ` <yu9y639d2yl.fsf@nyu.edu>
  2011-04-18 17:31 ` Guilherme Gondim
  0 siblings, 2 replies; 8+ messages in thread
From: PJ Weisberg @ 2011-04-15 22:33 UTC (permalink / raw)
  To: help-gnu-emacs

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()
  (interactive)
  (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?

-PJ



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Restore window configuration after Ediff
@ 2011-04-16  7:36 martin rudalics
  2011-04-16  8:33 ` PJ Weisberg
  0 siblings, 1 reply; 8+ messages in thread
From: martin rudalics @ 2011-04-16  7:36 UTC (permalink / raw)
  To: pj; +Cc: help-gnu-emacs

 > ======================================================================
 > (defvar saved-configuration nil)
 >
 > (defun do-ediff()
 >   (interactive)
 >   (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.

Replace `current-window-configuration' by `current-frame-configuration'
and `set-window-configuration' by `set-frame-configuration'.

martin



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-18 17:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-15 22:33 Restore window configuration after Ediff PJ Weisberg
     [not found] ` <yu9y639d2yl.fsf@nyu.edu>
2011-04-17 18:09   ` PJ Weisberg
2011-04-18 17:31 ` Guilherme Gondim
  -- strict thread matches above, loose matches on Subject: below --
2011-04-16  7:36 martin rudalics
2011-04-16  8:33 ` PJ Weisberg
2011-04-16 10:08   ` martin rudalics
2011-04-16 18:26     ` PJ Weisberg
2011-04-17 10:24       ` martin rudalics

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.