Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (18 sloc) 0.979 kb
;; http://www.emacswiki.org/emacs/RecursiveEditPreservingWindowConfig
;; inspired by Erik Naggum's `recursive-edit-with-single-window'
(defmacro recursive-edit-preserving-window-config (body)
"*Return a command that enters a recursive edit after executing BODY.
Upon exiting the recursive edit (with\\[exit-recursive-edit] (exit)
or \\[abort-recursive-edit] (abort)), restore window configuration
in current frame."
`(lambda ()
"See the documentation for `recursive-edit-preserving-window-config'."
(interactive)
(save-window-excursion
,body
(recursive-edit))))
(global-set-key (kbd "C-c 0") (recursive-edit-preserving-window-config (delete-window)))
(global-set-key (kbd "C-c 1") (recursive-edit-preserving-window-config
(if (one-window-p 'ignore-minibuffer)
(error "Current window is the only window in its frame")
(delete-other-windows))))
Jump to Line
Something went wrong with that request. Please try again.