summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Teirlinck <teirllm@auburn.edu>2004-05-03 01:24:47 +0000
committerLuc Teirlinck <teirllm@auburn.edu>2004-05-03 01:24:47 +0000
commitdeae888e00d26ee67beae8ec9ad2b30d31dbcd71 (patch)
treeebde7de555647de53b8e81478caf1bba79e32338
parent294240c35d87784a87d85a97642ae518262ee37d (diff)
downloademacs-deae888e00d26ee67beae8ec9ad2b30d31dbcd71.tar.gz
(xselect-convert-to-string): Bind `inhibit-read-only' to t.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/select.el81
2 files changed, 46 insertions, 40 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 015898b1d6d..4cb5ac61070 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-02 Luc Teirlinck <teirllm@auburn.edu>
+
+ * select.el (xselect-convert-to-string): Bind `inhibit-read-only'
+ to t.
+
2004-05-03 Nick Roberts <nickrob@gnu.org>
* progmodes/gdb-ui.el (gud-watch, gdb-display-buffer)
diff --git a/lisp/select.el b/lisp/select.el
index 01b227d8712..d6a18fee706 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -177,46 +177,47 @@ Cut buffers are considered obsolete; you should use selections instead."
(setq coding (coding-system-base coding))
(setq coding 'raw-text))
;; Suppress producing escape sequences for compositions.
- (remove-text-properties 0 (length str) '(composition nil) str)
- (cond
- ((eq type 'TEXT)
- (if (not (multibyte-string-p str))
- ;; Don't have to encode unibyte string.
- (setq type 'STRING)
- ;; If STR contains only ASCII, Latin-1, and raw bytes,
- ;; encode STR by iso-latin-1, and return it as type
- ;; `STRING'. Otherwise, encode STR by CODING. In that
- ;; case, the returing type depends on CODING.
- (let ((charsets (find-charset-string str)))
- (setq charsets
- (delq 'ascii
- (delq 'latin-iso8859-1
- (delq 'eight-bit-control
- (delq 'eight-bit-graphic charsets)))))
- (if charsets
- (setq str (encode-coding-string str coding)
- type (if (memq coding '(compound-text
- compound-text-with-extensions))
- 'COMPOUND_TEXT
- 'STRING))
- (setq type 'STRING
- str (encode-coding-string str 'iso-latin-1))))))
-
- ((eq type 'COMPOUND_TEXT)
- (setq str (encode-coding-string str coding)))
-
- ((eq type 'STRING)
- (if (memq coding '(compound-text
- compound-text-with-extensions))
- (setq str (string-make-unibyte str))
- (setq str (encode-coding-string str coding))))
-
- ((eq type 'UTF8_STRING)
- (setq str (encode-coding-string str 'utf-8)))
-
- (t
- (error "Unknow selection type: %S" type))
- ))
+ (let ((inhibit-read-only t))
+ (remove-text-properties 0 (length str) '(composition nil) str)
+ (cond
+ ((eq type 'TEXT)
+ (if (not (multibyte-string-p str))
+ ;; Don't have to encode unibyte string.
+ (setq type 'STRING)
+ ;; If STR contains only ASCII, Latin-1, and raw bytes,
+ ;; encode STR by iso-latin-1, and return it as type
+ ;; `STRING'. Otherwise, encode STR by CODING. In that
+ ;; case, the returing type depends on CODING.
+ (let ((charsets (find-charset-string str)))
+ (setq charsets
+ (delq 'ascii
+ (delq 'latin-iso8859-1
+ (delq 'eight-bit-control
+ (delq 'eight-bit-graphic charsets)))))
+ (if charsets
+ (setq str (encode-coding-string str coding)
+ type (if (memq coding '(compound-text
+ compound-text-with-extensions))
+ 'COMPOUND_TEXT
+ 'STRING))
+ (setq type 'STRING
+ str (encode-coding-string str 'iso-latin-1))))))
+
+ ((eq type 'COMPOUND_TEXT)
+ (setq str (encode-coding-string str coding)))
+
+ ((eq type 'STRING)
+ (if (memq coding '(compound-text
+ compound-text-with-extensions))
+ (setq str (string-make-unibyte str))
+ (setq str (encode-coding-string str coding))))
+
+ ((eq type 'UTF8_STRING)
+ (setq str (encode-coding-string str 'utf-8)))
+
+ (t
+ (error "Unknow selection type: %S" type))
+ )))
(setq next-selection-coding-system nil)
(cons type str))))