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

Diff of /emacs/src/xfns.c

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

revision 1.538 by pj, Wed Feb 20 10:26:42 2002 UTC revision 1.539 by eliz, Fri Feb 22 13:14:27 2002 UTC
# Line 2345  x_set_scroll_bar_background (f, value, o Line 2345  x_set_scroll_bar_background (f, value, o
2345     CODING_SYSTEM, and return a newly allocated memory area which     CODING_SYSTEM, and return a newly allocated memory area which
2346     should be freed by `xfree' by a caller.     should be freed by `xfree' by a caller.
2347    
2348       SELECTIONP non-zero means the string is being encoded for an X
2349       selection, so it is safe to run pre-write conversions (which
2350       may run Lisp code).
2351    
2352     Store the byte length of resulting text in *TEXT_BYTES.     Store the byte length of resulting text in *TEXT_BYTES.
2353    
2354     If the text contains only ASCII and Latin-1, store 1 in *STRING_P,     If the text contains only ASCII and Latin-1, store 1 in *STRING_P,
# Line 2353  x_set_scroll_bar_background (f, value, o Line 2357  x_set_scroll_bar_background (f, value, o
2357     the result should be `COMPOUND_TEXT'.  */     the result should be `COMPOUND_TEXT'.  */
2358    
2359  unsigned char *  unsigned char *
2360  x_encode_text (string, coding_system, text_bytes, stringp)  x_encode_text (string, coding_system, selectionp, text_bytes, stringp)
2361       Lisp_Object string, coding_system;       Lisp_Object string, coding_system;
2362       int *text_bytes, *stringp;       int *text_bytes, *stringp;
2363         int selectionp;
2364  {  {
2365    unsigned char *str = XSTRING (string)->data;    unsigned char *str = XSTRING (string)->data;
2366    int chars = XSTRING (string)->size;    int chars = XSTRING (string)->size;
# Line 2375  x_encode_text (string, coding_system, te Line 2380  x_encode_text (string, coding_system, te
2380      }      }
2381    
2382    setup_coding_system (coding_system, &coding);    setup_coding_system (coding_system, &coding);
2383      if (selectionp
2384          && SYMBOLP (coding.pre_write_conversion)
2385          && !NILP (Ffboundp (coding.pre_write_conversion)))
2386        {
2387          string = run_pre_post_conversion_on_str (string, &coding, 1);
2388          str = XSTRING (string)->data;
2389          chars = XSTRING (string)->size;
2390          bytes = STRING_BYTES (XSTRING (string));
2391        }
2392    coding.src_multibyte = 1;    coding.src_multibyte = 1;
2393    coding.dst_multibyte = 0;    coding.dst_multibyte = 0;
2394    coding.mode |= CODING_MODE_LAST_BLOCK;    coding.mode |= CODING_MODE_LAST_BLOCK;
# Line 2458  x_set_name (f, name, explicit) Line 2472  x_set_name (f, name, explicit)
2472          coding_system = Vlocale_coding_system;          coding_system = Vlocale_coding_system;
2473          if (NILP (coding_system))          if (NILP (coding_system))
2474            coding_system = Qcompound_text;            coding_system = Qcompound_text;
2475          text.value = x_encode_text (name, coding_system, &bytes, &stringp);          text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp);
2476          text.encoding = (stringp ? XA_STRING          text.encoding = (stringp ? XA_STRING
2477                           : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);                           : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
2478          text.format = 8;          text.format = 8;
# Line 2470  x_set_name (f, name, explicit) Line 2484  x_set_name (f, name, explicit)
2484            }            }
2485          else          else
2486            {            {
2487              icon.value = x_encode_text (f->icon_name, coding_system,              icon.value = x_encode_text (f->icon_name, coding_system, 0,
2488                                          &bytes, &stringp);                                          &bytes, &stringp);
2489              icon.encoding = (stringp ? XA_STRING              icon.encoding = (stringp ? XA_STRING
2490                               : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);                               : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
# Line 2565  x_set_title (f, name, old_name) Line 2579  x_set_title (f, name, old_name)
2579          coding_system = Vlocale_coding_system;          coding_system = Vlocale_coding_system;
2580          if (NILP (coding_system))          if (NILP (coding_system))
2581            coding_system = Qcompound_text;            coding_system = Qcompound_text;
2582          text.value = x_encode_text (name, coding_system, &bytes, &stringp);          text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp);
2583          text.encoding = (stringp ? XA_STRING          text.encoding = (stringp ? XA_STRING
2584                           : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);                           : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
2585          text.format = 8;          text.format = 8;
# Line 2577  x_set_title (f, name, old_name) Line 2591  x_set_title (f, name, old_name)
2591            }            }
2592          else          else
2593            {            {
2594              icon.value = x_encode_text (f->icon_name, coding_system,              icon.value = x_encode_text (f->icon_name, coding_system, 0,
2595                                          &bytes, &stringp);                                          &bytes, &stringp);
2596              icon.encoding = (stringp ? XA_STRING              icon.encoding = (stringp ? XA_STRING
2597                               : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);                               : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);

Legend:
Removed from v.1.538  
changed lines
  Added in v.1.539

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