emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xfns.c


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/src/xfns.c
Date: Mon, 12 Sep 2005 06:27:21 -0400

Index: emacs/src/xfns.c
diff -c emacs/src/xfns.c:1.642 emacs/src/xfns.c:1.643
*** emacs/src/xfns.c:1.642      Sun Aug  7 12:33:18 2005
--- emacs/src/xfns.c    Mon Sep 12 10:27:20 2005
***************
*** 1515,1525 ****
     Otherwise store 0 in *STRINGP, which means that the `encoding' of
     the result should be `COMPOUND_TEXT'.  */
  
! unsigned char *
! x_encode_text (string, coding_system, selectionp, text_bytes, stringp)
       Lisp_Object string, coding_system;
       int *text_bytes, *stringp;
       int selectionp;
  {
    unsigned char *str = SDATA (string);
    int chars = SCHARS (string);
--- 1515,1526 ----
     Otherwise store 0 in *STRINGP, which means that the `encoding' of
     the result should be `COMPOUND_TEXT'.  */
  
! static unsigned char *
! x_encode_text (string, coding_system, selectionp, text_bytes, stringp, freep)
       Lisp_Object string, coding_system;
       int *text_bytes, *stringp;
       int selectionp;
+      int *freep;
  {
    unsigned char *str = SDATA (string);
    int chars = SCHARS (string);
***************
*** 1536,1541 ****
--- 1537,1543 ----
        /* No multibyte character in OBJ.  We need not encode it.  */
        *text_bytes = bytes;
        *stringp = 1;
+       *freep = 0;
        return str;
      }
  
***************
*** 1563,1568 ****
--- 1565,1571 ----
    *stringp = (charset_info == 1
              || (!EQ (coding_system, Qcompound_text)
                  && !EQ (coding_system, Qcompound_text_with_extensions)));
+   *freep = 1;
    return buf;
  }
  
***************
*** 1601,1616 ****
           in the future which can encode all Unicode characters.
           But, for the moment, there's no way to know that the
           current window manager supports it or not.  */
!       text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp);
        text.encoding = (stringp ? XA_STRING
                         : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
        text.format = 8;
        text.nitems = bytes;
  
-         /* Check early, because ENCODE_UTF_8 below may GC and name may be
-            relocated.  */
-         do_free_text_value = text.value != SDATA (name);
- 
        if (NILP (f->icon_name))
          {
            icon = text;
--- 1604,1616 ----
           in the future which can encode all Unicode characters.
           But, for the moment, there's no way to know that the
           current window manager supports it or not.  */
!       text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp,
!                                   &do_free_text_value);
        text.encoding = (stringp ? XA_STRING
                         : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
        text.format = 8;
        text.nitems = bytes;
  
        if (NILP (f->icon_name))
          {
            icon = text;
***************
*** 1619,1630 ****
          {
            /* See the above comment "Note: Encoding strategy".  */
            icon.value = x_encode_text (f->icon_name, coding_system, 0,
!                                       &bytes, &stringp);
            icon.encoding = (stringp ? XA_STRING
                             : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
            icon.format = 8;
            icon.nitems = bytes;
-             do_free_icon_value = icon.value != SDATA (f->icon_name);
          }
  
  #ifdef USE_GTK
--- 1619,1629 ----
          {
            /* See the above comment "Note: Encoding strategy".  */
            icon.value = x_encode_text (f->icon_name, coding_system, 0,
!                                       &bytes, &stringp, &do_free_icon_value);
            icon.encoding = (stringp ? XA_STRING
                             : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
            icon.format = 8;
            icon.nitems = bytes;
          }
  
  #ifdef USE_GTK
***************
*** 1987,1993 ****
         - the same but with the family also replaced with -*-*-.  */
        char *p = base_fontname;
        int i;
!       
        for (i = 0; *p; p++)
        if (*p == '-') i++;
        if (i != 14)
--- 1986,1992 ----
         - the same but with the family also replaced with -*-*-.  */
        char *p = base_fontname;
        int i;
! 
        for (i = 0; *p; p++)
        if (*p == '-') i++;
        if (i != 14)
***************
*** 2011,2017 ****
          char *allcs = "*-*-*-*-*-*-*";
          char *allfamilies = "-*-*-";
          char *all = "*-*-*-*-";
!         
          for (i = 0, p = base_fontname; i < 8; p++)
            {
              if (*p == '-')
--- 2010,2016 ----
          char *allcs = "*-*-*-*-*-*-*";
          char *allfamilies = "-*-*-";
          char *all = "*-*-*-*-";
! 
          for (i = 0, p = base_fontname; i < 8; p++)
            {
              if (*p == '-')




reply via email to

[Prev in Thread] Current Thread [Next in Thread]