emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/term/x-win.el [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/term/x-win.el [emacs-unicode-2]
Date: Wed, 08 Dec 2004 02:10:51 -0500

Index: emacs/lisp/term/x-win.el
diff -c emacs/lisp/term/x-win.el:1.165.2.5 emacs/lisp/term/x-win.el:1.165.2.6
*** emacs/lisp/term/x-win.el:1.165.2.5  Fri Aug 27 07:00:30 2004
--- emacs/lisp/term/x-win.el    Wed Dec  8 05:02:30 2004
***************
*** 2097,2103 ****
    "The value of the PRIMARY X selection last time we selected or
  pasted text.")
  (defvar x-last-selected-text-cut nil
!   "The value of the X cut buffer last time we selected or pasted text.")
  
  ;;; It is said that overlarge strings are slow to put into the cut buffer.
  ;;; Note this value is overridden below.
--- 2097,2107 ----
    "The value of the PRIMARY X selection last time we selected or
  pasted text.")
  (defvar x-last-selected-text-cut nil
!   "The value of the X cut buffer last time we selected or pasted text.
! The actual text stored in the X cut buffer is what encoded from this value.")
! (defvar x-last-selected-text-cut-encoded nil
!   "The value of the X cut buffer last time we selected or pasted text.
! This is the actual text stored in the X cut buffer.")
  
  ;;; It is said that overlarge strings are slow to put into the cut buffer.
  ;;; Note this value is overridden below.
***************
*** 2120,2138 ****
    ;; It becomes slow, and if really big it causes errors.
    (cond ((>= (length text) x-cut-buffer-max)
         (x-set-cut-buffer "" push)
!        (setq x-last-selected-text-cut ""))
!       ;; Don't store a multibyte string that contains
!       ;; eight-bit-control/graphic chars because they can't be
!       ;; restored correctly by x-get-cut-buffer.
!       ((and (multibyte-string-p text)
!             (let ((charsets (find-charset-string text)))
!               (or (memq 'eight-bit-control charsets)
!                   (memq 'eight-bit-graphic charsets))))
!        (x-set-cut-buffer "" push)
!        (setq x-last-selected-text-cut ""))
        (t
!        (x-set-cut-buffer text push)
!        (setq x-last-selected-text-cut text)))
    (x-set-selection 'PRIMARY text)
    (setq x-last-selected-text-primary text)
    (when x-select-enable-clipboard
--- 2124,2137 ----
    ;; It becomes slow, and if really big it causes errors.
    (cond ((>= (length text) x-cut-buffer-max)
         (x-set-cut-buffer "" push)
!        (setq x-last-selected-text-cut ""
!              x-last-selected-text-cut-encoded ""))
        (t
!        (setq x-last-selected-text-cut text
!              x-last-selected-text-cut-encoded
!              (encode-coding-string text (or locale-coding-system
!                                             'iso-latin-1)))
!        (x-set-cut-buffer x-last-selected-text-cut-encoded push)))
    (x-set-selection 'PRIMARY text)
    (setq x-last-selected-text-primary text)
    (when x-select-enable-clipboard
***************
*** 2292,2308 ****
      ;; from what we remebered them to be last time we did a
      ;; cut/paste operation.
      (setq cut-text
!         (cond;; check primary selection
           ((or (not cut-text) (string= cut-text ""))
            (setq x-last-selected-text-cut nil))
!          ((eq      cut-text x-last-selected-text-cut) nil)
!          ((string= cut-text x-last-selected-text-cut)
            ;; Record the newer string,
            ;; so subsequent calls can use the `eq' test.
!           (setq x-last-selected-text-cut cut-text)
!       nil)
!      (t
!           (setq x-last-selected-text-cut cut-text))))
  
      ;; As we have done one selection, clear this now.
      (setq next-selection-coding-system nil)
--- 2291,2313 ----
      ;; from what we remebered them to be last time we did a
      ;; cut/paste operation.
      (setq cut-text
!         (cond;; check cut buffer
           ((or (not cut-text) (string= cut-text ""))
            (setq x-last-selected-text-cut nil))
!          ;; This short cut doesn't work because x-get-cut-buffer
!          ;; always returns a newly created string.
!          ;; ((eq      cut-text x-last-selected-text-cut) nil)
!          ((string= cut-text x-last-selected-text-cut-encoded)
!           ;; See the comment above.  No need of this recording.
            ;; Record the newer string,
            ;; so subsequent calls can use the `eq' test.
!           ;; (setq x-last-selected-text-cut cut-text)
!           nil)
!          (t
!           (setq x-last-selected-text-cut-encoded cut-text
!                 x-last-selected-text-cut
!                 (decode-coding-string cut-text (or locale-coding-system
!                                                    'iso-latin-1))))))
  
      ;; As we have done one selection, clear this now.
      (setq next-selection-coding-system nil)




reply via email to

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