APPROVE COMMIT
NOTE: This patch has been committed
src/ChangeLog.carbon2 addition:
2007-09-30 Aidan Kehoe <kehoea(a)parhasard.net>
* intl-carbon.c:
* intl-carbon.c (complex_vars_of_intl_carbon):
Use the Qunicode_type symbol, not the Qtype symbol, to tell the
Unicode coding system creation code what sort of coding system to
create.
* console-carbon.c:
* console-carbon.c (carbon_perhaps_init_unseen_key_defaults):
* console-carbon.c (console_type_create_carbon):
* console-carbon.c (vars_of_console_carbon):
Add the perhaps_init_unseen_key_defaults method to Carbon
consoles.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: src/console-carbon.c
===================================================================
RCS src/intl-carbon.c
===================================================================
RCS
Index: src/intl-carbon.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Attic/intl-carbon.c,v
retrieving revision 1.1.2.2
diff -u -u -r1.1.2.2 intl-carbon.c
--- src/intl-carbon.c 2005/02/25 17:17:42 1.1.2.2
+++ src/intl-carbon.c 2007/09/30 21:39:19
@@ -32,5 +32,9 @@
void
complex_vars_of_intl_carbon (void)
{
- Fmake_coding_system (Qcarbon_unicode, Qunicode, build_msg_string ("Carbon
Unicode"), nconc2 (list4 (Qdocumentation, build_msg_string ( "Converts to the
Unicode encoding for Carbon/Quartz 2D calls.\nThe encoding used is standard UTF-16
big-endian."), Qmnemonic, build_string ("CARBON-U")), list4 (Qtype,
Qutf_16, Qlittle_endian, Qnil)));
+#ifdef WORDS_BIGENDIAN
+ Fmake_coding_system (Qcarbon_unicode, Qunicode, build_msg_string ("Carbon
Unicode"), nconc2 (list4 (Qdocumentation, build_msg_string ( "Converts to the
Unicode encoding for Carbon/Quartz 2D calls.\nThe encoding used is standard UTF-16
big-endian."), Qmnemonic, build_string ("CARBON-U")), list4 (Qunicode_type,
Qutf_16, Qlittle_endian, Qnil)));
+#else
+ Fmake_coding_system (Qcarbon_unicode, Qunicode, build_msg_string ("Carbon
Unicode"), nconc2 (list4 (Qdocumentation, build_msg_string ( "Converts to the
Unicode encoding for Carbon/Quartz 2D calls.\nThe encoding used is standard UTF-16
big-endian."), Qmnemonic, build_string ("CARBON-U")), list4 (Qunicode_type,
Qutf_16, Qlittle_endian, Qt)));
+#endif
}
Index: src/console-carbon.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Attic/console-carbon.c,v
retrieving revision 1.1.2.2
diff -u -u -r1.1.2.2 console-carbon.c
--- src/console-carbon.c 2005/02/25 17:17:41 1.1.2.2
+++ src/console-carbon.c 2007/09/30 21:39:19
@@ -22,11 +22,14 @@
#include "lisp.h"
#include "console-impl.h"
+#include "elhash.h"
/* All functions in this file are taken from console-qt.cpp*/
DEFINE_CONSOLE_TYPE (carbon);
+Lisp_Object Vcarbon_seen_characters;
+
static int
carbon_initially_selected_for_input (struct console * UNUSED (con))
{
@@ -80,6 +83,57 @@
RETURN_UNGCPRO (connection);
}
+static Lisp_Object
+carbon_perhaps_init_unseen_key_defaults (struct console *con, Lisp_Object key)
+{
+ Ichar val;
+ extern Lisp_Object Vcurrent_global_map;
+
+ if (SYMBOLP(key))
+ {
+ /* We've no idea what to default a symbol to on MS Windows, and most
+ of the keys I'm aware of that have
+ symbols--cf. event-msw.c--_shouldn't_ have associated chars. */
+ return Qnil;
+ }
+
+ CHECK_CHAR(key);
+
+ if (!(HASH_TABLEP(Vcarbon_seen_characters)))
+ {
+ /* All the keysym we deal with are character objects; therefore, we
+ can use eq as the test without worrying. */
+ Vcarbon_seen_characters = make_lisp_hash_table (128,
+ HASH_TABLE_NON_WEAK,
+ HASH_TABLE_EQ);
+ }
+ /* Might give the user an opaque error if make_lisp_hash_table fails,
+ but it shouldn't crash. */
+ CHECK_HASH_TABLE(Vcarbon_seen_characters);
+
+ val = XCHAR(key);
+
+ /* Same logic as in x_has_keysym; I'm not convinced it's sane. */
+ if (val < 0x80)
+ {
+ return Qnil;
+ }
+
+ if (!NILP(Fgethash(key, Vcarbon_seen_characters, Qnil)))
+ {
+ return Qnil;
+ }
+
+ if (NILP (Flookup_key (Vcurrent_global_map, key, Qnil)))
+ {
+ Fputhash(key, Qt, Vcarbon_seen_characters);
+ Fdefine_key (Vcurrent_global_map, key, Qself_insert_command);
+ return Qt;
+ }
+
+ return Qnil;
+}
+
void
syms_of_console_carbon (void)
{
@@ -96,6 +150,7 @@
CONSOLE_HAS_METHOD (carbon, canonicalize_device_connection);
CONSOLE_HAS_METHOD (carbon, device_to_console_connection);
CONSOLE_HAS_METHOD (carbon, initially_selected_for_input);
+ CONSOLE_HAS_METHOD (carbon, perhaps_init_unseen_key_defaults);
}
void
@@ -107,5 +162,11 @@
void
vars_of_console_carbon (void)
{
+
+ DEFVAR_LISP ("carbon-seen-characters", &Vcarbon_seen_characters /*
+Hash table of non-ASCII characters the Carbon subsystem has seen.
+*/ );
+ Vcarbon_seen_characters = Qnil;
+
Fprovide (Qcarbon);
}
cvs server: I know nothing about ChangeLog.carbon2
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches