aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2004-04-18 10:34:40 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2004-04-18 10:34:40 +0000
commita06e69d37061ae9bde69c6d1aa6c8f932bd12236 (patch)
tree2063d8f0ff2d7f63f98dddcd3f6de6086cf880b8 /generic
parent7520e9addbee01ee94d587f2f2c2be969356f0bc (diff)
Add save-selected-frame for GNU Emacs
Diffstat (limited to 'generic')
-rw-r--r--generic/proof-compat.el10
1 files changed, 10 insertions, 0 deletions
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))