comparison src/device-x.c @ 3707:f6f6fc9eb269

[xemacs-hg @ 2006-11-28 21:20:22 by aidan] Better language behaviour on startup.
author aidan
date Tue, 28 Nov 2006 21:20:37 +0000
parents cb9e9a46686b
children 229bd619740a
comparison
equal deleted inserted replaced
3706:4ca1ef2bdb6a 3707:f6f6fc9eb269
33 #include "buffer.h" 33 #include "buffer.h"
34 #include "device-impl.h" 34 #include "device-impl.h"
35 #include "elhash.h" 35 #include "elhash.h"
36 #include "events.h" 36 #include "events.h"
37 #include "faces.h" 37 #include "faces.h"
38 #include "file-coding.h"
38 #include "frame-impl.h" 39 #include "frame-impl.h"
39 #include "process.h" /* for egetenv */ 40 #include "process.h" /* for egetenv */
40 #include "redisplay.h" 41 #include "redisplay.h"
41 #include "sysdep.h" 42 #include "sysdep.h"
42 #include "window.h" 43 #include "window.h"
190 191
191 static Lisp_Object 192 static Lisp_Object
192 coding_system_of_xrm_database (XrmDatabase USED_IF_MULE (db)) 193 coding_system_of_xrm_database (XrmDatabase USED_IF_MULE (db))
193 { 194 {
194 #ifdef MULE 195 #ifdef MULE
195 const Extbyte *locale = XrmLocaleOfDatabase (db); 196 const Extbyte *locale;
196 Lisp_Object localestr = build_ext_string (locale, Qbinary); 197 Lisp_Object localestr;
197 return call1 (Qget_coding_system_from_locale, localestr); 198 static XrmDatabase last_xrm_db;
199
200 /* This will always be zero, nil or an actual coding system object, so no
201 need to worry about GCPROing it--it'll be protected from garbage
202 collection by means of Vcoding_system_hash_table in file-coding.c. */
203 static Lisp_Object last_coding_system;
204
205 if (db == last_xrm_db)
206 {
207 return last_coding_system;
208 }
209
210 last_xrm_db = db;
211
212 locale = XrmLocaleOfDatabase (db);
213 localestr = build_ext_string (locale, Qbinary);
214 last_coding_system = call1 (Qget_coding_system_from_locale, localestr);
215
216 return last_coding_system;
198 #else 217 #else
199 return Qbinary; 218 return Qbinary;
200 #endif 219 #endif
201 } 220 }
202 221