changeset 86251:ec2f30e07030

* term/mac-win.el (x-setup-function-keys): Only setup local-function-key-map if it has not been setup already for the current frame. Move the suspend-emacs processing here. * s/darwin.h (MULTI_KBOARD): Remove. * macfns.c (x_create_tip_frame, Fx_create_frame) (x_create_tip_frame): Don't deal with MULTI_KBOARD.
author Dan Nicolaescu <dann@ics.uci.edu>
date Tue, 20 Nov 2007 17:58:52 +0000
parents 9a2cbd44a899
children 2da228125cce
files lisp/ChangeLog lisp/term/mac-win.el src/ChangeLog src/macfns.c src/macterm.c src/s/darwin.h
diffstat 6 files changed, 36 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Nov 20 16:40:16 2007 +0000
+++ b/lisp/ChangeLog	Tue Nov 20 17:58:52 2007 +0000
@@ -1,3 +1,9 @@
+2007-11-20  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term/mac-win.el (x-setup-function-keys): Only setup
+	local-function-key-map if it has not been setup already for the
+	current frame. Move the suspend-emacs processing here.
+
 2007-11-20  Juanma Barranquero  <lekktu@gmail.com>
 
 	* progmodes/grep.el (xargs-program): New variable.
--- a/lisp/term/mac-win.el	Tue Nov 20 16:40:16 2007 +0000
+++ b/lisp/term/mac-win.el	Tue Nov 20 17:58:52 2007 +0000
@@ -1058,28 +1058,31 @@
 
 ;;;; Function keys
 
-(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
-			   global-map)
-
 (defun x-setup-function-keys (frame)
   "Setup Function Keys for mac."
-;; Map certain keypad keys into ASCII characters
-;; that people usually expect.
-(define-key local-function-key-map [backspace] [?\d])
-(define-key local-function-key-map [delete] [?\d])
-(define-key local-function-key-map [tab] [?\t])
-(define-key local-function-key-map [linefeed] [?\n])
-(define-key local-function-key-map [clear] [?\C-l])
-(define-key local-function-key-map [return] [?\C-m])
-(define-key local-function-key-map [escape] [?\e])
-(define-key local-function-key-map [M-backspace] [?\M-\d])
-(define-key local-function-key-map [M-delete] [?\M-\d])
-(define-key local-function-key-map [M-tab] [?\M-\t])
-(define-key local-function-key-map [M-linefeed] [?\M-\n])
-(define-key local-function-key-map [M-clear] [?\M-\C-l])
-(define-key local-function-key-map [M-return] [?\M-\C-m])
-(define-key local-function-key-map [M-escape] [?\M-\e])
-)
+  ;; Don't do this twice on the same display, or it would break
+  ;; normal-erase-is-backspace-mode.
+  (unless (terminal-parameter frame 'x-setup-function-keys)
+    (with-selected-frame frame
+      ;; Map certain keypad keys into ASCII characters
+      ;; that people usually expect.
+      (define-key local-function-key-map [backspace] [?\d])
+      (define-key local-function-key-map [delete] [?\d])
+      (define-key local-function-key-map [tab] [?\t])
+      (define-key local-function-key-map [linefeed] [?\n])
+      (define-key local-function-key-map [clear] [?\C-l])
+      (define-key local-function-key-map [return] [?\C-m])
+      (define-key local-function-key-map [escape] [?\e])
+      (define-key local-function-key-map [M-backspace] [?\M-\d])
+      (define-key local-function-key-map [M-delete] [?\M-\d])
+      (define-key local-function-key-map [M-tab] [?\M-\t])
+      (define-key local-function-key-map [M-linefeed] [?\M-\n])
+      (define-key local-function-key-map [M-clear] [?\M-\C-l])
+      (define-key local-function-key-map [M-return] [?\M-\C-m])
+      (define-key local-function-key-map [M-escape] [?\M-\e])
+      (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
+				 local-function-key-map global-map))
+    (set-terminal-parameter frame 'x-setup-function-keys t))))
 
 ;; These tell read-char how to convert
 ;; these special chars to ASCII.
--- a/src/ChangeLog	Tue Nov 20 16:40:16 2007 +0000
+++ b/src/ChangeLog	Tue Nov 20 17:58:52 2007 +0000
@@ -1,3 +1,10 @@
+2007-11-20  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* s/darwin.h (MULTI_KBOARD): Remove.
+
+	* macfns.c (x_create_tip_frame, Fx_create_frame)
+	(x_create_tip_frame): Don't deal with MULTI_KBOARD.
+
 2007-11-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* buffer.c (Fbuffer_local_value): Remove redundant test.
--- a/src/macfns.c	Tue Nov 20 16:40:16 2007 +0000
+++ b/src/macfns.c	Tue Nov 20 17:58:52 2007 +0000
@@ -2547,11 +2547,7 @@
   if (EQ (display, Qunbound))
     display = Qnil;
   dpyinfo = check_x_display_info (display);
-#ifdef MULTI_KBOARD
   kb = dpyinfo->terminal->kboard;
-#else
-  kb = &the_only_kboard;
-#endif
 
   name = mac_get_arg (parameters, Qname, "name", "Name", RES_TYPE_STRING);
   if (!STRINGP (name)
@@ -2615,9 +2611,7 @@
   image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
   dpyinfo_refcount = dpyinfo->reference_count;
 #endif /* GLYPH_DEBUG */
-#ifdef MULTI_KBOARD
   FRAME_KBOARD (f) = kb;
-#endif
 
   /* Specify the parent under which to make this window.  */
 
@@ -3809,11 +3803,7 @@
 
   parms = Fcopy_alist (parms);
 
-#ifdef MULTI_KBOARD
   kb = dpyinfo->terminal->kboard;
-#else
-  kb = &the_only_kboard;
-#endif
 
   /* Get the name of the frame to use for resource lookup.  */
   name = mac_get_arg (parms, Qname, "name", "Name", RES_TYPE_STRING);
@@ -3859,9 +3849,7 @@
   image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
   dpyinfo_refcount = dpyinfo->reference_count;
 #endif /* GLYPH_DEBUG */
-#ifdef MULTI_KBOARD
   FRAME_KBOARD (f) = kb;
-#endif
   f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window;
   f->output_data.mac->explicit_parent = 0;
 
--- a/src/macterm.c	Tue Nov 20 16:40:16 2007 +0000
+++ b/src/macterm.c	Tue Nov 20 17:58:52 2007 +0000
@@ -12823,7 +12823,6 @@
   /* FIXME: This keyboard setup is 100% untested, just copied from
      w32_create_terminal in order to set window-system now that it's
      a keyboard object.  */
-#ifdef MULTI_KBOARD
   /* We don't yet support separate terminals on Mac, so don't try to share
      keyboards between virtual terminals that are on the same physical
      terminal like X does.  */
@@ -12838,7 +12837,6 @@
   if (current_kboard == initial_kboard)
     current_kboard = terminal->kboard;
   terminal->kboard->reference_count++;
-#endif
 
   return terminal;
 }
--- a/src/s/darwin.h	Tue Nov 20 16:40:16 2007 +0000
+++ b/src/s/darwin.h	Tue Nov 20 17:58:52 2007 +0000
@@ -53,9 +53,6 @@
 /* We need a little extra space, see ../../lisp/loadup.el. */
 #define SYSTEM_PURESIZE_EXTRA 30000
 
-/* XXX The MULTI_KBOARD support does not work yet on this platform. */
-#undef MULTI_KBOARD
-
 #endif
 #endif