diff options
author | Adrian Robert <Adrian.B.Robert@gmail.com> | 2009-01-25 19:43:31 +0000 |
---|---|---|
committer | Adrian Robert <Adrian.B.Robert@gmail.com> | 2009-01-25 19:43:31 +0000 |
commit | 8612b71a44b34519fe1b047a9f1d6f6b1431d411 (patch) | |
tree | cc7567046437fef05a5f60a93518c8c8a2b49bcc /src/keyboard.c | |
parent | 0cb6149297b30250a6dc460ecb700a96bf576ea9 (diff) | |
download | emacs-8612b71a44b34519fe1b047a9f1d6f6b1431d411.tar.gz emacs-8612b71a44b34519fe1b047a9f1d6f6b1431d411.tar.bz2 emacs-8612b71a44b34519fe1b047a9f1d6f6b1431d411.zip |
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.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r-- | src/keyboard.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index a6be5b152db..cae40ffd85e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4113,6 +4113,17 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) #endif } +#if defined (HAVE_NS) + else if (event->kind == NS_TEXT_EVENT) + { + if (event->code == KEY_NS_PUT_WORKING_TEXT) + obj = Fcons (intern ("ns-put-working-text"), Qnil); + else + obj = Fcons (intern ("ns-unput-working-text"), Qnil); + kbd_fetch_ptr = event + 1; + } +#endif + #if defined (HAVE_X11) || defined (HAVE_NTGUI) \ || defined (HAVE_NS) else if (event->kind == DELETE_WINDOW_EVENT) @@ -12382,6 +12393,10 @@ keys_of_keyboard () initial_define_lispy_key (Vspecial_event_map, "delete-frame", "handle-delete-frame"); + initial_define_lispy_key (Vspecial_event_map, "ns-put-working-text", + "ns-put-working-text"); + initial_define_lispy_key (Vspecial_event_map, "ns-unput-working-text", + "ns-unput-working-text"); /* Here we used to use `ignore-event' which would simple set prefix-arg to current-prefix-arg, as is done in `handle-switch-frame'. But `handle-switch-frame is not run from the special-map. |