Mercurial > emacs
comparison src/keyboard.c @ 101490:cfaf6934d659
Changes to remove Feval calls from GUI under NS.
* nsterm.h: Move KEY_NS_... definitions here from nsterm.m. Add
NS_TOGGLE_TOOLBAR, NS_PUT_WORKING_TEXT, NS_UNPUT_WORKING_TEXT.
Remove NS_INSERT_WORKING_TEXT, NS_DELETE_WORKING_TEXT.
* nsterm.m: Move KEY_NS_... definitions to nsterm.h.
(EmacsView-toggleToolbar:): Use KEY_NS_TOGGLE_TOOLBAR.
(EmacsView-setMarkedText:,-deleteWorkingText:): Use NS_TEXT_EVENT
instead of NON_ASCII_KEYSTROKE_EVENT.
(EmacsApp-terminate:): Use KEY_NS_POWER_OFF instead of Feval.
(EmacsApp-applicationShouldTerminate:): Query user.
(EmacsPreferencesController-runHelp:): Use KEY_NS_INFO_PREFS
instead of Feval.
* termhooks.h (NS_TEXT_EVENT): New event type under HAVE_NS.
* keyboard.c (kbd_buffer_get_event): Check for it.
(keys_of_keyboard): Define lispy keys for
ns-put/unput-working-text.
* nsmenu.m (ns_popup_dialog): Resync window setting with X and W32
versions.
(EmacsDialog-runDialogAt:): Use NSModalPanelRunLoopMode.
author | Adrian Robert <Adrian.B.Robert@gmail.com> |
---|---|
date | Sun, 25 Jan 2009 19:43:31 +0000 |
parents | 3ffd03438eeb |
children | 798e92a3bab0 |
comparison
equal
deleted
inserted
replaced
101489:d98a233b0396 | 101490:cfaf6934d659 |
---|---|
4111 a window system. */ | 4111 a window system. */ |
4112 abort (); | 4112 abort (); |
4113 #endif | 4113 #endif |
4114 } | 4114 } |
4115 | 4115 |
4116 #if defined (HAVE_NS) | |
4117 else if (event->kind == NS_TEXT_EVENT) | |
4118 { | |
4119 if (event->code == KEY_NS_PUT_WORKING_TEXT) | |
4120 obj = Fcons (intern ("ns-put-working-text"), Qnil); | |
4121 else | |
4122 obj = Fcons (intern ("ns-unput-working-text"), Qnil); | |
4123 kbd_fetch_ptr = event + 1; | |
4124 } | |
4125 #endif | |
4126 | |
4116 #if defined (HAVE_X11) || defined (HAVE_NTGUI) \ | 4127 #if defined (HAVE_X11) || defined (HAVE_NTGUI) \ |
4117 || defined (HAVE_NS) | 4128 || defined (HAVE_NS) |
4118 else if (event->kind == DELETE_WINDOW_EVENT) | 4129 else if (event->kind == DELETE_WINDOW_EVENT) |
4119 { | 4130 { |
4120 /* Make an event (delete-frame (FRAME)). */ | 4131 /* Make an event (delete-frame (FRAME)). */ |
12380 initial_define_key (global_map, Ctl (']'), "abort-recursive-edit"); | 12391 initial_define_key (global_map, Ctl (']'), "abort-recursive-edit"); |
12381 initial_define_key (meta_map, 'x', "execute-extended-command"); | 12392 initial_define_key (meta_map, 'x', "execute-extended-command"); |
12382 | 12393 |
12383 initial_define_lispy_key (Vspecial_event_map, "delete-frame", | 12394 initial_define_lispy_key (Vspecial_event_map, "delete-frame", |
12384 "handle-delete-frame"); | 12395 "handle-delete-frame"); |
12396 initial_define_lispy_key (Vspecial_event_map, "ns-put-working-text", | |
12397 "ns-put-working-text"); | |
12398 initial_define_lispy_key (Vspecial_event_map, "ns-unput-working-text", | |
12399 "ns-unput-working-text"); | |
12385 /* Here we used to use `ignore-event' which would simple set prefix-arg to | 12400 /* Here we used to use `ignore-event' which would simple set prefix-arg to |
12386 current-prefix-arg, as is done in `handle-switch-frame'. | 12401 current-prefix-arg, as is done in `handle-switch-frame'. |
12387 But `handle-switch-frame is not run from the special-map. | 12402 But `handle-switch-frame is not run from the special-map. |
12388 Commands from that map are run in a special way that automatically | 12403 Commands from that map are run in a special way that automatically |
12389 preserves the prefix-arg. Restoring the prefix arg here is not just | 12404 preserves the prefix-arg. Restoring the prefix arg here is not just |