[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r108700: Improve and document the lan
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r108700: Improve and document the language-change event on MS-Windows. |
Date: |
Sat, 23 Jun 2012 15:39:23 +0300 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 108700
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2012-06-23 15:39:23 +0300
message:
Improve and document the language-change event on MS-Windows.
src/keyboard.c (kbd_buffer_get_event): Include the codepage and the
language ID in the event parameters.
src/w32term.c (w32_read_socket): Put the new keyboard codepage into
event.code, not the obscure "character set ID".
doc/lispref/commands.texi (Misc Events): Document the language-change event.
modified:
doc/lispref/ChangeLog
doc/lispref/commands.texi
src/ChangeLog
src/keyboard.c
src/w32term.c
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog 2012-06-22 21:17:42 +0000
+++ b/doc/lispref/ChangeLog 2012-06-23 12:39:23 +0000
@@ -1,3 +1,7 @@
+2012-06-23 Eli Zaretskii <address@hidden>
+
+ * commands.texi (Misc Events): Document the language-change event.
+
2012-06-22 Paul Eggert <address@hidden>
Support higher-resolution time stamps (Bug#9000).
=== modified file 'doc/lispref/commands.texi'
--- a/doc/lispref/commands.texi 2012-05-27 01:34:14 +0000
+++ b/doc/lispref/commands.texi 2012-06-23 12:39:23 +0000
@@ -1716,6 +1716,38 @@
@smallexample
(signal-process (emacs-pid) 'sigusr1)
@end smallexample
+
address@hidden @code{language-change} event
address@hidden language-change
+This kind of event is generated on MS-Windows when the input language
+has changed. This typically means that the keyboard keys will send to
+Emacs characters from a different language. The generated event has
+this form:
+
address@hidden
+(language-change @var{frame} @var{codepage} @var{language-id})
address@hidden smallexample
+
address@hidden
+Here @var{frame} is the frame which was current when the input
+language changed; @var{codepage} is the new codepage number; and
address@hidden is the numerical ID of the new input language. The
+coding-system (@pxref{Coding Systems}) that corresponds to
address@hidden is @address@hidden or
address@hidden@var{codepage}}. To convert @var{language-id} to a
+string (e.g., to use it for various language-dependent features, such
+as @code{set-language-environment}), use the
address@hidden function, like this:
+
address@hidden
+;; Get the abbreviated language name, such as "ENU" for English
+(w32-get-locale-info language-id)
+;; Get the full English name of the language,
+;; such as "English (United States)"
+(w32-get-locale-info language-id 4097)
+;; Get the full localized name of the language
+(w32-get-locale-info language-id t)
address@hidden smallexample
@end table
If one of these events arrives in the middle of a key sequence---that
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2012-06-23 10:47:00 +0000
+++ b/src/ChangeLog 2012-06-23 12:39:23 +0000
@@ -1,3 +1,11 @@
+2012-06-23 Eli Zaretskii <address@hidden>
+
+ * keyboard.c (kbd_buffer_get_event): Include the codepage and the
+ language ID in the event parameters.
+
+ * w32term.c (w32_read_socket): Put the new keyboard codepage into
+ event.code, not the obscure "character set ID".
+
2012-06-23 Chong Yidong <address@hidden>
* xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
=== modified file 'src/keyboard.c'
--- a/src/keyboard.c 2012-06-22 21:17:42 +0000
+++ b/src/keyboard.c 2012-06-23 12:39:23 +0000
@@ -3982,9 +3982,11 @@
#if defined (WINDOWSNT)
else if (event->kind == LANGUAGE_CHANGE_EVENT)
{
- /* Make an event (language-change (FRAME CHARSET LCID)). */
- obj = Fcons (event->frame_or_window, Qnil);
- obj = Fcons (Qlanguage_change, Fcons (obj, Qnil));
+ /* Make an event (language-change (FRAME CODEPAGE LANGUAGE-ID)). */
+ obj = Fcons (Qlanguage_change,
+ list3 (event->frame_or_window,
+ make_number (event->code),
+ make_number (event->modifiers)));
kbd_fetch_ptr = event + 1;
}
#endif
=== modified file 'src/w32term.c'
--- a/src/w32term.c 2012-06-17 00:32:36 +0000
+++ b/src/w32term.c 2012-06-23 12:39:23 +0000
@@ -4234,8 +4234,8 @@
/* Generate a language change event. */
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
- /* lParam contains the input lang ID. Use it to update our
- record of the keyboard codepage. */
+ /* lParam contains the input language ID in its low 16 bits.
+ Use it to update our record of the keyboard codepage. */
keyboard_codepage = codepage_for_locale ((LCID)(msg.msg.lParam
& 0xffff));
@@ -4243,7 +4243,7 @@
{
inev.kind = LANGUAGE_CHANGE_EVENT;
XSETFRAME (inev.frame_or_window, f);
- inev.code = msg.msg.wParam;
+ inev.code = keyboard_codepage;
inev.modifiers = msg.msg.lParam & 0xffff;
}
break;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r108700: Improve and document the language-change event on MS-Windows.,
Eli Zaretskii <=