changeset 74042:b9f8abc451de

(x-cut-buffer-or-selection-value): Decode text from cut-buffers with next-selection-coding-system if not nil.
author Jan Djärv <jan.h.d@swipnet.se>
date Sat, 18 Nov 2006 13:16:58 +0000
parents af4e0c118339
children 2bd7a6d6a83f
files lisp/ChangeLog lisp/term/x-win.el
diffstat 2 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Nov 18 12:25:35 2006 +0000
+++ b/lisp/ChangeLog	Sat Nov 18 13:16:58 2006 +0000
@@ -1,3 +1,8 @@
+2006-11-18  Jan Dj,Ad(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.
--- a/lisp/term/x-win.el	Sat Nov 18 12:25:35 2006 +0000
+++ b/lisp/term/x-win.el	Sat Nov 18 13:16:58 2006 +0000
@@ -2334,20 +2334,17 @@
 	  (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)