Mercurial > hg > xemacs-beta
comparison src/device-x.c @ 267:966663fcf606 r20-5b32
Import from CVS: tag r20-5b32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:26:29 +0200 |
parents | 727739f917cb |
children | c5d627a313b1 |
comparison
equal
deleted
inserted
replaced
266:18d185df8c54 | 267:966663fcf606 |
---|---|
327 /* Read in locale-specific resources from | 327 /* Read in locale-specific resources from |
328 data-directory/app-defaults/$LANG/Emacs. | 328 data-directory/app-defaults/$LANG/Emacs. |
329 This is in addition to the standard app-defaults files, and | 329 This is in addition to the standard app-defaults files, and |
330 does not override resources defined elsewhere */ | 330 does not override resources defined elsewhere */ |
331 CONST char *data_dir; | 331 CONST char *data_dir; |
332 char path[MAXPATHLEN]; | 332 char *path; |
333 XrmDatabase db = XtDatabase (dpy); /* ### XtScreenDatabase(dpy) ? */ | 333 XrmDatabase db = XtDatabase (dpy); /* ### XtScreenDatabase(dpy) ? */ |
334 CONST char *locale = XrmLocaleOfDatabase (db); | 334 CONST char *locale = XrmLocaleOfDatabase (db); |
335 | 335 |
336 if (STRINGP (Vx_app_defaults_directory) && | 336 if (STRINGP (Vx_app_defaults_directory) && |
337 XSTRING_LENGTH (Vx_app_defaults_directory) > 0) | 337 XSTRING_LENGTH (Vx_app_defaults_directory) > 0) |
338 { | 338 { |
339 GET_C_STRING_FILENAME_DATA_ALLOCA(Vx_app_defaults_directory, data_dir); | 339 GET_C_STRING_FILENAME_DATA_ALLOCA(Vx_app_defaults_directory, data_dir); |
340 path = (char *)alloca (strlen (data_dir) + strlen (locale) + 7); | |
340 sprintf (path, "%s%s/Emacs", data_dir, locale); | 341 sprintf (path, "%s%s/Emacs", data_dir, locale); |
341 if (!access (path, R_OK)) | 342 if (!access (path, R_OK)) |
342 XrmCombineFileDatabase (path, &db, False); | 343 XrmCombineFileDatabase (path, &db, False); |
343 } | 344 } |
344 else if (STRINGP (Vdata_directory) && XSTRING_LENGTH (Vdata_directory) > 0) | 345 else if (STRINGP (Vdata_directory) && XSTRING_LENGTH (Vdata_directory) > 0) |
345 { | 346 { |
346 GET_C_STRING_FILENAME_DATA_ALLOCA (Vdata_directory, data_dir); | 347 GET_C_STRING_FILENAME_DATA_ALLOCA (Vdata_directory, data_dir); |
348 path = (char *)alloca (strlen (data_dir) + 13 + strlen (locale) + 7); | |
347 sprintf (path, "%sapp-defaults/%s/Emacs", data_dir, locale); | 349 sprintf (path, "%sapp-defaults/%s/Emacs", data_dir, locale); |
348 if (!access (path, R_OK)) | 350 if (!access (path, R_OK)) |
349 XrmCombineFileDatabase (path, &db, False); | 351 XrmCombineFileDatabase (path, &db, False); |
350 } | 352 } |
351 } | 353 } |
362 | 364 |
363 XtGetApplicationNameAndClass (dpy, &app_name, &app_class); | 365 XtGetApplicationNameAndClass (dpy, &app_name, &app_class); |
364 /* search for a matching visual if requested by the user, or setup the display default */ | 366 /* search for a matching visual if requested by the user, or setup the display default */ |
365 numargs = 0; | 367 numargs = 0; |
366 { | 368 { |
367 char buf1[100],buf2[100]; | 369 char *buf1 = (char *)alloca (strlen (app_name) + 17); |
370 char *buf2 = (char *)alloca (strlen (app_class) + 17); | |
368 char *type; | 371 char *type; |
369 XrmValue value; | 372 XrmValue value; |
370 | 373 |
371 sprintf (buf1, "%s.emacsVisual", app_name); | 374 sprintf (buf1, "%s.emacsVisual", app_name); |
372 sprintf (buf2, "%s.EmacsVisual", app_class); | 375 sprintf (buf2, "%s.EmacsVisual", app_class); |