summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2007-11-20 17:58:52 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2007-11-20 17:58:52 +0000
commit202c09a889e637eb4162db551252c80bbf46b02b (patch)
tree91c9a3f493ce067ab3d389783a683348cb1c6b45
parent1571d112d97475f53d99a3aff303139ff6ac748b (diff)
downloademacs-202c09a889e637eb4162db551252c80bbf46b02b.tar.gz
* 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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/term/mac-win.el43
-rw-r--r--src/ChangeLog7
-rw-r--r--src/macfns.c12
-rw-r--r--src/macterm.c2
-rw-r--r--src/s/darwin.h3
6 files changed, 36 insertions, 37 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4d04952b62e..ef4f67bf37c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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.
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 7e4ec6546c8..684de49c4ea 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1058,28 +1058,31 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
;;;; 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.
diff --git a/src/ChangeLog b/src/ChangeLog
index 4113948bc97..dda5b989775 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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.
diff --git a/src/macfns.c b/src/macfns.c
index 1622576f073..7afeaafd85b 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2547,11 +2547,7 @@ This function is an internal primitive--use `make-frame' instead. */)
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 @@ This function is an internal primitive--use `make-frame' instead. */)
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 @@ x_create_tip_frame (dpyinfo, parms, text)
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 @@ x_create_tip_frame (dpyinfo, parms, text)
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;
diff --git a/src/macterm.c b/src/macterm.c
index 5ea8f0ba607..bc33cfe472e 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -12823,7 +12823,6 @@ mac_create_terminal (struct mac_display_info *dpyinfo)
/* 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 @@ mac_create_terminal (struct mac_display_info *dpyinfo)
if (current_kboard == initial_kboard)
current_kboard = terminal->kboard;
terminal->kboard->reference_count++;
-#endif
return terminal;
}
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 6bfa0e95106..c1108e7c295 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -53,9 +53,6 @@ Boston, MA 02110-1301, USA. */
/* 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