From a06e69d37061ae9bde69c6d1aa6c8f932bd12236 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Sun, 18 Apr 2004 10:34:40 +0000 Subject: Add save-selected-frame for GNU Emacs --- generic/proof-compat.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'generic') diff --git a/generic/proof-compat.el b/generic/proof-compat.el index ca765d80..b5dfa466 100644 --- a/generic/proof-compat.el +++ b/generic/proof-compat.el @@ -213,6 +213,16 @@ lines than are actually needed in the case where some error may be present." ;;; GNU Emacs compatibility with XEmacs ;;; +(unless (fboundp 'save-selected-frame) +(defmacro save-selected-frame (&rest body) + "Execute forms in BODY, then restore the selected frame. +The value returned is the value of the last form in BODY." + (let ((old-frame (gensym "ssf"))) + `(let ((,old-frame (selected-frame))) + (unwind-protect + (progn ,@body) + (select-frame ,old-frame)))))) + ;; Chars (borrowed from x-symbol-emacs.el compatability file) (unless (fboundp 'characterp) (defalias 'characterp 'integerp)) -- cgit v1.2.3