Mercurial > emacs
changeset 55331:0b7159e6ae8f
(xselect-convert-to-string): Bind `inhibit-read-only' to t.
author | Luc Teirlinck <teirllm@auburn.edu> |
---|---|
date | Mon, 03 May 2004 01:23:08 +0000 |
parents | df2107598877 |
children | f996eb43e406 |
files | lisp/select.el |
diffstat | 1 files changed, 37 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/select.el Mon May 03 00:34:50 2004 +0000 +++ b/lisp/select.el Mon May 03 01:23:08 2004 +0000 @@ -177,46 +177,47 @@ (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)))))) + (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 '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 '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))) + ((eq type 'UTF8_STRING) + (setq str (encode-coding-string str 'utf-8))) - (t - (error "Unknow selection type: %S" type)) - )) + (t + (error "Unknow selection type: %S" type)) + ))) (setq next-selection-coding-system nil) (cons type str))))