]> code.delx.au - gnu-emacs/blobdiff - lisp/subr.el
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
[gnu-emacs] / lisp / subr.el
index ab0b052dae27c27e0f64ecc032b0437df123c63d..61340283c96b7900c0487e139192ccfa06dbf94b 100644 (file)
@@ -1172,7 +1172,8 @@ any other non-digit terminates the character code and is then used as input."))
       ;; or C-q C-x might not return immediately since ESC or C-x might be
       ;; bound to some prefix in function-key-map or key-translation-map.
       (setq translated char)
-      (let ((translation (lookup-key function-key-map (vector char))))
+      (let ((translation (lookup-key (terminal-local-value 'local-function-key-map nil)
+                                    (vector char))))
        (if (arrayp translation)
            (setq translated (aref translation 0))))
       (cond ((null translated))
@@ -1752,6 +1753,18 @@ See also `with-temp-buffer'."
         (if (window-live-p save-selected-window-window)
             (select-window save-selected-window-window 'norecord))))))
 
+(defmacro with-selected-frame (frame &rest body)
+  "Execute the forms in BODY with FRAME as the selected frame.
+The value returned is the value of the last form in BODY.
+See also `with-temp-buffer'."
+  (declare (indent 1) (debug t))
+  `(let ((save-selected-frame (selected-frame)))
+     (unwind-protect
+        (progn (select-frame ,frame)
+               ,@body)
+       (if (frame-live-p save-selected-frame)
+          (select-frame save-selected-frame)))))
+
 (defmacro with-temp-file (file &rest body)
   "Create a new buffer, evaluate BODY there, and write the buffer to FILE.
 The value returned is the value of the last form in BODY.