]> git.eshelyaron.com Git - emacs.git/commitdiff
(x-cut-buffer-or-selection-value): Decode text from
authorJan Djärv <jan.h.d@swipnet.se>
Sat, 18 Nov 2006 13:16:58 +0000 (13:16 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Sat, 18 Nov 2006 13:16:58 +0000 (13:16 +0000)
cut-buffers with next-selection-coding-system if not nil.

lisp/ChangeLog
lisp/term/x-win.el

index 6d5538d63e42a3022ac93486ff2c0183bed866b0..4e616ac7a2a0c0391d4b5c79689b8dd5ef4632f8 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-18  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * term/x-win.el (x-cut-buffer-or-selection-value): Decode text from
+       cut-buffers with next-selection-coding-system if not nil.
+
 2006-11-17  Carsten Dominik  <dominik@science.uva.nl>
 
        * textmodes/org.el (org-fix-decoded-time): New function.
index 0e68fa575eb9155616ccd347241910c33494666c..b0e2dc85a048ca3193d09e6222bff666d847dd65 100644 (file)
@@ -2334,20 +2334,17 @@ order until succeed.")
          (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
+           ;; We can not compare  x-last-selected-text-cut-encoded with
+           ;; cut-text because the next-selection-coding-system may have changed
+           ;; so we need to re-decode anyway.
            (setq x-last-selected-text-cut-encoded cut-text
                  x-last-selected-text-cut
-                 ;; ICCCM says cut buffer always contain ISO-Latin-1
-                 (decode-coding-string cut-text 'iso-latin-1)))))
+                 ;; ICCCM says cut buffer always contain ISO-Latin-1, but
+                 ;; use next-selection-coding-system if not nil.
+                 (decode-coding-string 
+                  cut-text 
+                  (or next-selection-coding-system 'iso-latin-1))))))
 
     ;; As we have done one selection, clear this now.
     (setq next-selection-coding-system nil)