]> code.delx.au - gnu-emacs/blobdiff - lisp/subr.el
Merged from miles@gnu.org--gnu-2005 (patch 610-614)
[gnu-emacs] / lisp / subr.el
index 32ee6f987b7df830c4ef775d9c39c5b88b18091e..48ac3c7e672e5259579e7fbf063172efa876d000 100644 (file)
@@ -1170,7 +1170,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))
@@ -1750,6 +1751,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.