comparison src/xterm.c @ 2279:012b04efa234

* emacs.c (Finvocation_name): New function. (Vinvocation_name): New variable. (init_cmdargs): Set it. (syms_of_emacs): defsubr Finvocation_name, staticpro and initialize Vinvocation_name. * lisp.h (Vinvocation_name): New extern declaration. * xterm.c (invocation_name): Variable deleted; use Vinvocation_name now. (x_text_icon, x_term_init): Use Vinvocation_name now instead of invocation_name. (x_term_init): Don't initialize invocation_name. (syms_of_xterm): Don't initialize or staticpro invocation_name. * xfns.c (invocation_name): Remove extern declaration for this. [HAVE_X11] (Fx_get_resource): Use Vinvocation_name now instead of invocation_name. [not HAVE_X11] (Fx_get_default): Same.
author Jim Blandy <jimb@redhat.com>
date Sat, 20 Mar 1993 19:30:58 +0000
parents 80e0d36bbb77
children f0a979beceab
comparison
equal deleted inserted replaced
2278:990694465b0f 2279:012b04efa234
156 156
157 /* Stuff for dealing with the main icon title. */ 157 /* Stuff for dealing with the main icon title. */
158 158
159 extern Lisp_Object Vcommand_line_args; 159 extern Lisp_Object Vcommand_line_args;
160 char *hostname, *x_id_name; 160 char *hostname, *x_id_name;
161 Lisp_Object invocation_name;
162 161
163 /* This is the X connection that we are using. */ 162 /* This is the X connection that we are using. */
164 163
165 Display *x_current_display; 164 Display *x_current_display;
166 165
3611 x_wm_set_icon_pixmap (f, 0); 3610 x_wm_set_icon_pixmap (f, 0);
3612 #else /* ! defined (HAVE_X11) */ 3611 #else /* ! defined (HAVE_X11) */
3613 if (icon_font_info == 0) 3612 if (icon_font_info == 0)
3614 icon_font_info 3613 icon_font_info
3615 = XGetFont (XGetDefault (XDISPLAY 3614 = XGetFont (XGetDefault (XDISPLAY
3616 (char *) XSTRING (invocation_name)->data, 3615 (char *) XSTRING (Vinvocation_name)->data,
3617 "BodyFont")); 3616 "BodyFont"));
3618 3617
3619 if (f->display.x->icon_desc) 3618 if (f->display.x->icon_desc)
3620 { 3619 {
3621 XClearIconWindow (XDISPLAY FRAME_X_WINDOW (f)); 3620 XClearIconWindow (XDISPLAY FRAME_X_WINDOW (f));
4521 4520
4522 #if 0 4521 #if 0
4523 XSetAfterFunction (x_current_display, x_trace_wire); 4522 XSetAfterFunction (x_current_display, x_trace_wire);
4524 #endif /* ! 0 */ 4523 #endif /* ! 0 */
4525 4524
4526 invocation_name = Ffile_name_nondirectory (Fcar (Vcommand_line_args));
4527
4528 /* Try to get the host name; if the buffer is too short, try 4525 /* Try to get the host name; if the buffer is too short, try
4529 again. Apparently, the only indication gethostname gives of 4526 again. Apparently, the only indication gethostname gives of
4530 whether the buffer was large enough is the presence or absence 4527 whether the buffer was large enough is the presence or absence
4531 of a '\0' in the string. Eech. */ 4528 of a '\0' in the string. Eech. */
4532 for (;;) 4529 for (;;)
4539 break; 4536 break;
4540 4537
4541 hostname_size <<= 1; 4538 hostname_size <<= 1;
4542 hostname = (char *) xrealloc (hostname, hostname_size); 4539 hostname = (char *) xrealloc (hostname, hostname_size);
4543 } 4540 }
4544 x_id_name = (char *) xmalloc (XSTRING (invocation_name)->size 4541 x_id_name = (char *) xmalloc (XSTRING (Vinvocation_name)->size
4545 + strlen (hostname) 4542 + strlen (hostname)
4546 + 2); 4543 + 2);
4547 sprintf (x_id_name, "%s@%s", XSTRING (invocation_name)->data, hostname); 4544 sprintf (x_id_name, "%s@%s", XSTRING (Vinvocation_name)->data, hostname);
4548 } 4545 }
4549 4546
4550 /* Figure out which modifier bits mean what. */ 4547 /* Figure out which modifier bits mean what. */
4551 x_find_modifier_meanings (); 4548 x_find_modifier_meanings ();
4552 4549
4640 } 4637 }
4641 4638
4642 void 4639 void
4643 syms_of_xterm () 4640 syms_of_xterm ()
4644 { 4641 {
4645 staticpro (&invocation_name);
4646 invocation_name = Qnil;
4647
4648 staticpro (&last_mouse_scroll_bar); 4642 staticpro (&last_mouse_scroll_bar);
4649 } 4643 }
4650 #endif /* ! defined (HAVE_X11) */ 4644 #endif /* ! defined (HAVE_X11) */
4651 #endif /* ! defined (HAVE_X_WINDOWS) */ 4645 #endif /* ! defined (HAVE_X_WINDOWS) */