emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Eli Zaretskii
Subject: [Emacs-diffs] Changes to emacs/src/w16select.c
Date: Fri, 22 Feb 2002 09:08:17 -0500

Index: emacs/src/w16select.c
diff -c emacs/src/w16select.c:1.24 emacs/src/w16select.c:1.25
*** emacs/src/w16select.c:1.24  Tue Dec 11 01:22:43 2001
--- emacs/src/w16select.c       Fri Feb 22 09:08:17 2002
***************
*** 492,505 ****
    int no_crlf_conversion;
  
    CHECK_STRING (string);
!   
    if (NILP (frame))
      frame = Fselected_frame ();
  
    CHECK_LIVE_FRAME (frame);
    if ( !FRAME_MSDOS_P (XFRAME (frame)))
      goto done;
!   
    BLOCK_INPUT;
  
    nbytes = STRING_BYTES (XSTRING (string));
--- 492,505 ----
    int no_crlf_conversion;
  
    CHECK_STRING (string);
! 
    if (NILP (frame))
      frame = Fselected_frame ();
  
    CHECK_LIVE_FRAME (frame);
    if ( !FRAME_MSDOS_P (XFRAME (frame)))
      goto done;
! 
    BLOCK_INPUT;
  
    nbytes = STRING_BYTES (XSTRING (string));
***************
*** 528,533 ****
--- 528,540 ----
        Vnext_selection_coding_system = Vselection_coding_system;
        setup_coding_system
        (Fcheck_coding_system (Vnext_selection_coding_system), &coding);
+       if (SYMBOLP (coding.pre_write_conversion)
+         && !NILP (Ffboundp (coding.pre_write_conversion)))
+       {
+         string = run_pre_post_conversion_on_str (string, &coding, 1);
+         src = XSTRING (string)->data;
+         nbytes = STRING_BYTES (XSTRING (string));
+       }
        coding.src_multibyte = 1;
        coding.dst_multibyte = 0;
        Vnext_selection_coding_system = Qnil;
***************
*** 543,549 ****
  
    if (!open_clipboard ())
      goto error;
!   
    ok = empty_clipboard ()
      && ((put_status
         = set_clipboard_data (CF_OEMTEXT, src, nbytes, no_crlf_conversion))
--- 550,556 ----
  
    if (!open_clipboard ())
      goto error;
! 
    ok = empty_clipboard ()
      && ((put_status
         = set_clipboard_data (CF_OEMTEXT, src, nbytes, no_crlf_conversion))
***************
*** 552,562 ****
    if (!no_crlf_conversion)
      Vlast_coding_system_used = Qraw_text;
    close_clipboard ();
!   
    if (ok) goto unblock;
  
   error:
!   
    ok = 0;
  
   unblock:
--- 559,569 ----
    if (!no_crlf_conversion)
      Vlast_coding_system_used = Qraw_text;
    close_clipboard ();
! 
    if (ok) goto unblock;
  
   error:
! 
    ok = 0;
  
   unblock:
***************
*** 585,591 ****
        }
        sit_for (2, 0, 0, 1, 1);
      }
!   
   done:
  
    return (ok && put_status == 0 ? string : Qnil);
--- 592,598 ----
        }
        sit_for (2, 0, 0, 1, 1);
      }
! 
   done:
  
    return (ok && put_status == 0 ? string : Qnil);
***************
*** 608,616 ****
    CHECK_LIVE_FRAME (frame);
    if ( !FRAME_MSDOS_P (XFRAME (frame)))
      goto done;
!   
    BLOCK_INPUT;
!   
    if (!open_clipboard ())
      goto unblock;
  
--- 615,623 ----
    CHECK_LIVE_FRAME (frame);
    if ( !FRAME_MSDOS_P (XFRAME (frame)))
      goto done;
! 
    BLOCK_INPUT;
! 
    if (!open_clipboard ())
      goto unblock;
  
***************
*** 625,651 ****
      goto closeclip;
  
    /* Do we need to decode it?  */
!   if (
! #if 1
!       1
! #else
!       ! NILP (buffer_defaults.enable_multibyte_characters)
! #endif
!       )
!     {
!       /* If the clipboard data contains any 8-bit Latin-1 code, we
!        need to decode it.  */
!       int i;
! 
!       for (i = 0; i < truelen; i++)
!       {
!         if (htext[i] >= 0x80)
!           {
!             require_encoding = 1;
!             break;
!           }
!       }
!     }
    if (require_encoding)
      {
        int bufsize;
--- 632,651 ----
      goto closeclip;
  
    /* Do we need to decode it?  */
!   {
!     /* If the clipboard data contains any 8-bit Latin-1 code, we
!        need to decode it.  */
!     int i;
! 
!     for (i = 0; i < truelen; i++)
!       {
!       if (htext[i] >= 0x80)
!         {
!           require_encoding = 1;
!           break;
!         }
!       }
!   }
    if (require_encoding)
      {
        int bufsize;
***************
*** 667,672 ****
--- 667,675 ----
        ret = make_string_from_bytes ((char *) buf,
                                    coding.produced_char, coding.produced);
        xfree (buf);
+       if (SYMBOLP (coding.post_read_conversion)
+         && !NILP (Ffboundp (coding.post_read_conversion)))
+       ret = run_pre_post_conversion_on_str (ret, coding, 0);
        Vlast_coding_system_used = coding.symbol;
      }
    else



reply via email to

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