changeset 4380:461fdb92f3b6

Correct the perhaps_init_unseen_key_defaults GTK code; don't override X11 fonts. 2008-01-02 Aidan Kehoe <kehoea@parhasard.net> * emacs.c (main_1): Call the new vars_of_console_gtk function. * console-gtk.c (vars_of_console_gtk): New. * console-gtk.c (gtk_perhaps_init_unseen_key_defaults): Correct the initialisation of the hash table, on the model of the MSW and TTY builds. 2008-01-02 Aidan Kehoe <kehoea@parhasard.net> * gtk-init.el (init-post-gtk-win): Trust the X11 code to give us decent default fonts.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 02 Jan 2008 22:11:03 +0100
parents 92188a8f47a3
children 3906442b491b
files lisp/ChangeLog lisp/gtk-init.el src/ChangeLog src/console-gtk.c src/emacs.c
diffstat 5 files changed, 32 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Jan 02 21:33:54 2008 +0100
+++ b/lisp/ChangeLog	Wed Jan 02 22:11:03 2008 +0100
@@ -1,3 +1,8 @@
+2008-01-02  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* gtk-init.el (init-post-gtk-win): 
+	Trust the X11 code to give us decent default fonts.
+
 2008-01-02  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* x-iso8859-1.el: Removed.
--- a/lisp/gtk-init.el	Wed Jan 02 21:33:54 2008 +0100
+++ b/lisp/gtk-init.el	Wed Jan 02 22:11:03 2008 +0100
@@ -133,62 +133,6 @@
 
 (defun init-post-gtk-win ()
   (unless gtk-post-win-initted
-    (when (featurep 'mule)
-      (define-specifier-tag 'mule-fonts
-	(lambda (device) (eq 'gtk (device-type device))))
-      (set-face-font
-       'default
-       '("-*-fixed-medium-r-*--16-*-iso8859-1"
-	 "-*-fixed-medium-r-*--*-iso8859-1"
-	 "-*-fixed-medium-r-*--*-iso8859-2"
-	 "-*-fixed-medium-r-*--*-iso8859-3"
-	 "-*-fixed-medium-r-*--*-iso8859-4"
-	 "-*-fixed-medium-r-*--*-iso8859-7"
-	 "-*-fixed-medium-r-*--*-iso8859-8"
-	 "-*-fixed-medium-r-*--*-iso8859-5"
-	 "-*-fixed-medium-r-*--*-iso8859-9"
-
-	 ;; Following 3 fonts proposed by Teruhiko.Kurosaka@Japan.eng.sun
-	 "-sun-gothic-medium-r-normal--14-120-75-75-c-60-jisx0201.1976-0"
-	 "-sun-gothic-medium-r-normal--14-120-75-75-c-120-jisx0208.1983-0"
-	 "-wadalab-gothic-medium-r-normal--14-120-75-75-c-120-jisx0212.1990-0"
-	 ;; Other Japanese fonts
-	 "-*-fixed-medium-r-*--*-jisx0201.1976-*"
-	 "-*-fixed-medium-r-*--*-jisx0208.1983-*"
-	 "-*-fixed-medium-r-*--*-jisx0212*-*"
-
-	 ;; Chinese fonts
-	 "-*-*-medium-r-*--*-gb2312.1980-*"
-       
-	 ;; Use One font specification for CNS chinese
-	 ;; Too many variations in font naming
-	 "-*-fixed-medium-r-*--*-cns11643*-*"
-	 ;; "-*-fixed-medium-r-*--*-cns11643*2"
-	 ;; "-*-fixed-medium-r-*--*-cns11643*3"
-	 ;; "-*-fixed-medium-r-*--*-cns11643*4"
-	 ;; "-*-fixed-medium-r-*--*-cns11643.5-0"
-	 ;; "-*-fixed-medium-r-*--*-cns11643.6-0"
-	 ;; "-*-fixed-medium-r-*--*-cns11643.7-0"
-       
-	 "-*-fixed-medium-r-*--*-big5*-*"
-	 "-*-fixed-medium-r-*--*-sisheng_cwnn-0"
-
-	 ;; Other fonts
-       
-	 ;; "-*-fixed-medium-r-*--*-viscii1.1-1"
-       
-	 ;; "-*-fixed-medium-r-*--*-mulearabic-0"
-	 ;; "-*-fixed-medium-r-*--*-mulearabic-1"
-	 ;; "-*-fixed-medium-r-*--*-mulearabic-2"
-
-	 ;; "-*-fixed-medium-r-*--*-muleipa-1"
-	 ;; "-*-fixed-medium-r-*--*-ethio-*"
-
-	 "-*-mincho-medium-r-*--*-ksc5601.1987-*" ; Korean
-	 "-*-fixed-medium-r-*--*-tis620.2529-1" ; Thai
-	 )
-       'global '(mule-fonts) 'append))
-    
     (setq gtk-post-win-initted t)))
     
 (push '("-geometry" . gtk-init-handle-geometry) command-switch-alist)
--- a/src/ChangeLog	Wed Jan 02 21:33:54 2008 +0100
+++ b/src/ChangeLog	Wed Jan 02 22:11:03 2008 +0100
@@ -1,3 +1,13 @@
+2008-01-02  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* emacs.c (main_1): 
+	Call the new vars_of_console_gtk function. 
+	* console-gtk.c (vars_of_console_gtk): New.
+	* console-gtk.c (gtk_perhaps_init_unseen_key_defaults):
+	Correct the initialisation of the hash table, on the model of the
+	MSW and TTY builds.
+	
+
 2008-01-02  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* doc.c (Fbuilt_in_symbol_file):
--- a/src/console-gtk.c	Wed Jan 02 21:33:54 2008 +0100
+++ b/src/console-gtk.c	Wed Jan 02 22:11:03 2008 +0100
@@ -39,6 +39,8 @@
 
 DEFINE_CONSOLE_TYPE (gtk);
 
+Lisp_Object Vgtk_seen_characters;
+
 static int
 gtk_initially_selected_for_input (struct console *UNUSED (con))
 {
@@ -122,13 +124,11 @@
 				      Lisp_Object key)
 {
   Lisp_Object char_to_associate = Qnil;
-  extern Lisp_Object Vcurrent_global_map, Qgtk_seen_characters,
-    Qcharacter_of_keysym;
+  extern Lisp_Object Vcurrent_global_map, Qcharacter_of_keysym;
 
   if (SYMBOLP(key))
     {
       gchar *symbol_name;
-      guint keyval;
       DECLARE_EISTRING(ei_symname);
       
       eicpy_rawz(ei_symname, XSTRING_DATA(symbol_name(XSYMBOL(key))));
@@ -154,21 +154,22 @@
   else
     {
       CHECK_CHAR(key);
+      char_to_associate = key;
     }
 
-  if (!(HASH_TABLEP(Qgtk_seen_characters)))
+  if (!(HASH_TABLEP(Vgtk_seen_characters)))
     {
-      Qgtk_seen_characters = make_lisp_hash_table (128, HASH_TABLE_NON_WEAK,
+      Vgtk_seen_characters = make_lisp_hash_table (128, HASH_TABLE_NON_WEAK,
 						   HASH_TABLE_EQUAL);
     }
 
   /* Might give the user an opaque error if make_lisp_hash_table fails,
      but it shouldn't crash. */
-  CHECK_HASH_TABLE(Qgtk_seen_characters);
+  CHECK_HASH_TABLE(Vgtk_seen_characters);
 
   if (EQ(char_to_associate, Qnil) /* If there's no char to bind,  */
       || (XCHAR(char_to_associate) < 0x80) /* or it's ASCII */
-      || !NILP(Fgethash(key, Qgtk_seen_characters, Qnil))) /* Or we've seen
+      || !NILP(Fgethash(key, Vgtk_seen_characters, Qnil))) /* Or we've seen
 							      it already, */
     {
       /* then don't bind the key. */
@@ -177,7 +178,7 @@
 
   if (NILP (Flookup_key (Vcurrent_global_map, key, Qnil))) 
     {
-      Fputhash(key, Qt, Qgtk_seen_characters);
+      Fputhash(key, Qt, Vgtk_seen_characters;)
       Fdefine_key (Vcurrent_global_map, key, Qself_insert_command); 
       if (SYMBOLP(key))
 	{
@@ -209,3 +210,10 @@
 {
   REINITIALIZE_CONSOLE_TYPE (gtk);
 }
+
+void
+vars_of_console_gtk (void)
+{
+  staticpro (&Vgtk_seen_characters);
+  Vgtk_seen_characters = Qnil;
+}
--- a/src/emacs.c	Wed Jan 02 21:33:54 2008 +0100
+++ b/src/emacs.c	Wed Jan 02 22:11:03 2008 +0100
@@ -2162,6 +2162,7 @@
 
 #ifdef HAVE_GTK
       vars_of_device_gtk ();
+      vars_of_console_gtk ();
 #ifdef HAVE_DIALOGS
       vars_of_dialog_gtk ();
 #endif