/[emacs]/emacs/src/xterm.c
ViewVC logotype

Diff of /emacs/src/xterm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.743 by lektu, Thu Jul 11 14:18:02 2002 UTC revision 1.744 by raeburn, Mon Jul 15 00:00:41 2002 UTC
# Line 7269  note_mouse_highlight (f, x, y) Line 7269  note_mouse_highlight (f, x, y)
7269                if (NILP (b))                if (NILP (b))
7270                  b = make_number (0);                  b = make_number (0);
7271                if (NILP (e))                if (NILP (e))
7272                  e = make_number (XSTRING (object)->size - 1);                  e = make_number (SCHARS (object) - 1);
7273                fast_find_string_pos (w, XINT (b), object,                fast_find_string_pos (w, XINT (b), object,
7274                                      &dpyinfo->mouse_face_beg_col,                                      &dpyinfo->mouse_face_beg_col,
7275                                      &dpyinfo->mouse_face_beg_row,                                      &dpyinfo->mouse_face_beg_row,
# Line 7367  note_mouse_highlight (f, x, y) Line 7367  note_mouse_highlight (f, x, y)
7367              /* Try text properties.  */              /* Try text properties.  */
7368              if (STRINGP (object)              if (STRINGP (object)
7369                  && charpos >= 0                  && charpos >= 0
7370                  && charpos < XSTRING (object)->size)                  && charpos < SCHARS (object))
7371                {                {
7372                  help = Fget_text_property (make_number (charpos),                  help = Fget_text_property (make_number (charpos),
7373                                             Qhelp_echo, object);                                             Qhelp_echo, object);
# Line 12099  x_error_catcher (display, error) Line 12099  x_error_catcher (display, error)
12099       XErrorEvent *error;       XErrorEvent *error;
12100  {  {
12101    XGetErrorText (display, error->error_code,    XGetErrorText (display, error->error_code,
12102                   XSTRING (x_error_message_string)->data,                   SDATA (x_error_message_string),
12103                   X_ERROR_MESSAGE_SIZE);                   X_ERROR_MESSAGE_SIZE);
12104  }  }
12105    
# Line 12131  x_catch_errors (dpy) Line 12131  x_catch_errors (dpy)
12131    record_unwind_protect (x_catch_errors_unwind, x_error_message_string);    record_unwind_protect (x_catch_errors_unwind, x_error_message_string);
12132    
12133    x_error_message_string = make_uninit_string (X_ERROR_MESSAGE_SIZE);    x_error_message_string = make_uninit_string (X_ERROR_MESSAGE_SIZE);
12134    XSTRING (x_error_message_string)->data[0] = 0;    SREF (x_error_message_string, 0) = 0;
12135    
12136    return count;    return count;
12137  }  }
# Line 12158  x_check_errors (dpy, format) Line 12158  x_check_errors (dpy, format)
12158    /* Make sure to catch any errors incurred so far.  */    /* Make sure to catch any errors incurred so far.  */
12159    XSync (dpy, False);    XSync (dpy, False);
12160    
12161    if (XSTRING (x_error_message_string)->data[0])    if (SREF (x_error_message_string, 0))
12162      error (format, XSTRING (x_error_message_string)->data);      error (format, SDATA (x_error_message_string));
12163  }  }
12164    
12165  /* Nonzero if we had any X protocol errors  /* Nonzero if we had any X protocol errors
# Line 12172  x_had_errors_p (dpy) Line 12172  x_had_errors_p (dpy)
12172    /* Make sure to catch any errors incurred so far.  */    /* Make sure to catch any errors incurred so far.  */
12173    XSync (dpy, False);    XSync (dpy, False);
12174    
12175    return XSTRING (x_error_message_string)->data[0] != 0;    return SREF (x_error_message_string, 0) != 0;
12176  }  }
12177    
12178  /* Forget about any errors we have had, since we did x_catch_errors on DPY.  */  /* Forget about any errors we have had, since we did x_catch_errors on DPY.  */
# Line 12181  void Line 12181  void
12181  x_clear_errors (dpy)  x_clear_errors (dpy)
12182       Display *dpy;       Display *dpy;
12183  {  {
12184    XSTRING (x_error_message_string)->data[0] = 0;    SREF (x_error_message_string, 0) = 0;
12185  }  }
12186    
12187  /* Stop catching X protocol errors and let them make Emacs die.  /* Stop catching X protocol errors and let them make Emacs die.
# Line 12481  x_new_fontset (f, fontsetname) Line 12481  x_new_fontset (f, fontsetname)
12481         to do.  */         to do.  */
12482      return fontset_name (fontset);      return fontset_name (fontset);
12483    
12484    result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data));    result = x_new_font (f, (SDATA (fontset_ascii (fontset))));
12485    
12486    if (!STRINGP (result))    if (!STRINGP (result))
12487      /* Can't load ASCII font.  */      /* Can't load ASCII font.  */
# Line 12493  x_new_fontset (f, fontsetname) Line 12493  x_new_fontset (f, fontsetname)
12493  #ifdef HAVE_X_I18N  #ifdef HAVE_X_I18N
12494    if (FRAME_XIC (f)    if (FRAME_XIC (f)
12495        && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea)))        && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea)))
12496      xic_set_xfontset (f, XSTRING (fontset_ascii (fontset))->data);      xic_set_xfontset (f, SDATA (fontset_ascii (fontset)));
12497  #endif  #endif
12498        
12499    return build_string (fontsetname);    return build_string (fontsetname);
# Line 14093  x_list_fonts (f, pattern, size, maxnames Line 14093  x_list_fonts (f, pattern, size, maxnames
14093            XFontStruct *font;            XFontStruct *font;
14094            unsigned long value;            unsigned long value;
14095    
14096            font = XLoadQueryFont (dpy, XSTRING (pattern)->data);            font = XLoadQueryFont (dpy, SDATA (pattern));
14097            if (x_had_errors_p (dpy))            if (x_had_errors_p (dpy))
14098              {              {
14099                /* This error is perhaps due to insufficient memory on X                /* This error is perhaps due to insufficient memory on X
# Line 14136  x_list_fonts (f, pattern, size, maxnames Line 14136  x_list_fonts (f, pattern, size, maxnames
14136          {          {
14137            /* We try at least 10 fonts because XListFonts will return            /* We try at least 10 fonts because XListFonts will return
14138               auto-scaled fonts at the head.  */               auto-scaled fonts at the head.  */
14139            names = XListFonts (dpy, XSTRING (pattern)->data, max (maxnames, 10),            names = XListFonts (dpy, SDATA (pattern), max (maxnames, 10),
14140                                &num_fonts);                                &num_fonts);
14141            if (x_had_errors_p (dpy))            if (x_had_errors_p (dpy))
14142              {              {
# Line 14237  x_list_fonts (f, pattern, size, maxnames Line 14237  x_list_fonts (f, pattern, size, maxnames
14237                BLOCK_INPUT;                BLOCK_INPUT;
14238                count = x_catch_errors (dpy);                count = x_catch_errors (dpy);
14239                thisinfo = XLoadQueryFont (dpy,                thisinfo = XLoadQueryFont (dpy,
14240                                           XSTRING (XCAR (tem))->data);                                           SDATA (XCAR (tem)));
14241                if (x_had_errors_p (dpy))                if (x_had_errors_p (dpy))
14242                  {                  {
14243                    /* This error is perhaps due to insufficient memory on X                    /* This error is perhaps due to insufficient memory on X
# Line 14417  x_load_font (f, fontname, size) Line 14417  x_load_font (f, fontname, size)
14417          for (tail = font_names; CONSP (tail); tail = XCDR (tail))          for (tail = font_names; CONSP (tail); tail = XCDR (tail))
14418            if (dpyinfo->font_table[i].name            if (dpyinfo->font_table[i].name
14419                && (!strcmp (dpyinfo->font_table[i].name,                && (!strcmp (dpyinfo->font_table[i].name,
14420                             XSTRING (XCAR (tail))->data)                             SDATA (XCAR (tail)))
14421                    || !strcmp (dpyinfo->font_table[i].full_name,                    || !strcmp (dpyinfo->font_table[i].full_name,
14422                                XSTRING (XCAR (tail))->data)))                                SDATA (XCAR (tail)))))
14423              return (dpyinfo->font_table + i);              return (dpyinfo->font_table + i);
14424      }      }
14425    
# Line 14437  x_load_font (f, fontname, size) Line 14437  x_load_font (f, fontname, size)
14437         a bug of not finding a font even if the font surely exists and         a bug of not finding a font even if the font surely exists and
14438         is loadable by XLoadQueryFont.  */         is loadable by XLoadQueryFont.  */
14439      if (size > 0 && !NILP (font_names))      if (size > 0 && !NILP (font_names))
14440        fontname = (char *) XSTRING (XCAR (font_names))->data;        fontname = (char *) SDATA (XCAR (font_names));
14441    
14442      BLOCK_INPUT;      BLOCK_INPUT;
14443      count = x_catch_errors (FRAME_X_DISPLAY (f));      count = x_catch_errors (FRAME_X_DISPLAY (f));
# Line 14689  same_x_server (name1, name2) Line 14689  same_x_server (name1, name2)
14689       char *name1, *name2;       char *name1, *name2;
14690  {  {
14691    int seen_colon = 0;    int seen_colon = 0;
14692    unsigned char *system_name = XSTRING (Vsystem_name)->data;    unsigned char *system_name = SDATA (Vsystem_name);
14693    int system_name_length = strlen (system_name);    int system_name_length = strlen (system_name);
14694    int length_until_period = 0;    int length_until_period = 0;
14695    
# Line 14771  x_term_init (display_name, xrm_option, r Line 14771  x_term_init (display_name, xrm_option, r
14771          argv[argc++] = xrm_option;          argv[argc++] = xrm_option;
14772        }        }
14773      stop_polling ();      stop_polling ();
14774      dpy = XtOpenDisplay (Xt_app_con, XSTRING (display_name)->data,      dpy = XtOpenDisplay (Xt_app_con, SDATA (display_name),
14775                           resource_name, EMACS_CLASS,                           resource_name, EMACS_CLASS,
14776                           emacs_options, XtNumber (emacs_options),                           emacs_options, XtNumber (emacs_options),
14777                           &argc, argv);                           &argc, argv);
# Line 14787  x_term_init (display_name, xrm_option, r Line 14787  x_term_init (display_name, xrm_option, r
14787  #ifdef HAVE_X11R5  #ifdef HAVE_X11R5
14788    XSetLocaleModifiers ("");    XSetLocaleModifiers ("");
14789  #endif  #endif
14790    dpy = XOpenDisplay (XSTRING (display_name)->data);    dpy = XOpenDisplay (SDATA (display_name));
14791  #endif /* not USE_X_TOOLKIT */  #endif /* not USE_X_TOOLKIT */
14792    
14793    /* Detect failure.  */    /* Detect failure.  */
# Line 14809  x_term_init (display_name, xrm_option, r Line 14809  x_term_init (display_name, xrm_option, r
14809    
14810      for (share = x_display_list, tail = x_display_name_list; share;      for (share = x_display_list, tail = x_display_name_list; share;
14811           share = share->next, tail = XCDR (tail))           share = share->next, tail = XCDR (tail))
14812        if (same_x_server (XSTRING (XCAR (XCAR (tail)))->data,        if (same_x_server (SDATA (XCAR (XCAR (tail))),
14813                           XSTRING (display_name)->data))                           SDATA (display_name)))
14814          break;          break;
14815      if (share)      if (share)
14816        dpyinfo->kboard = share->kboard;        dpyinfo->kboard = share->kboard;
# Line 14856  x_term_init (display_name, xrm_option, r Line 14856  x_term_init (display_name, xrm_option, r
14856  #endif /* ! 0 */  #endif /* ! 0 */
14857    
14858    dpyinfo->x_id_name    dpyinfo->x_id_name
14859      = (char *) xmalloc (STRING_BYTES (XSTRING (Vinvocation_name))      = (char *) xmalloc (SBYTES (Vinvocation_name)
14860                          + STRING_BYTES (XSTRING (Vsystem_name))                          + SBYTES (Vsystem_name)
14861                          + 2);                          + 2);
14862    sprintf (dpyinfo->x_id_name, "%s@%s",    sprintf (dpyinfo->x_id_name, "%s@%s",
14863             XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data);             SDATA (Vinvocation_name), SDATA (Vsystem_name));
14864    
14865    /* Figure out which modifier bits mean what.  */    /* Figure out which modifier bits mean what.  */
14866    x_find_modifier_meanings (dpyinfo);    x_find_modifier_meanings (dpyinfo);
# Line 14923  x_term_init (display_name, xrm_option, r Line 14923  x_term_init (display_name, xrm_option, r
14923                                            build_string ("PrivateColormap"),                                            build_string ("PrivateColormap"),
14924                                            Qnil, Qnil);                                            Qnil, Qnil);
14925            if (STRINGP (value)            if (STRINGP (value)
14926                && (!strcmp (XSTRING (value)->data, "true")                && (!strcmp (SDATA (value), "true")
14927                    || !strcmp (XSTRING (value)->data, "on")))                    || !strcmp (SDATA (value), "on")))
14928              dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap);              dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap);
14929          }          }
14930      }      }
# Line 15084  x_term_init (display_name, xrm_option, r Line 15084  x_term_init (display_name, xrm_option, r
15084                                      build_string ("Synchronous"),                                      build_string ("Synchronous"),
15085                                      Qnil, Qnil);                                      Qnil, Qnil);
15086      if (STRINGP (value)      if (STRINGP (value)
15087          && (!strcmp (XSTRING (value)->data, "true")          && (!strcmp (SDATA (value), "true")
15088              || !strcmp (XSTRING (value)->data, "on")))              || !strcmp (SDATA (value), "on")))
15089        XSynchronize (dpyinfo->display, True);        XSynchronize (dpyinfo->display, True);
15090    }    }
15091        

Legend:
Removed from v.1.743  
changed lines
  Added in v.1.744

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26