GNU bug report logs -
#45
23.0.60; Can't paste from files with .arc extensions
Previous Next
Reported by: Brian Adkins <info <at> lojic.com>
Date: Sun, 9 Mar 2008 13:15:03 UTC
Severity: normal
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
Message #52 received at 45 <at> emacsbugs.donarmstrong.com (full text, mbox):
In article <87myo1eauw.fsf <at> stupidchicken.com>, Chong Yidong <cyd <at> stupidchicken.com> writes:
> Apart from Firefox, GTK applications don't accept C_STRING, while xterm
> does.
> IIUC, Handa's argument is that a unibyte buffer typically represents
> binary data, so it's more correct to tag it as C_STRING. If other
> applications choose to refuse C_STRING because they don't think it
> generally maps to Latin-1 output, that's their choice.
I think the attached patch will solve the problem. It does
this:
If TEXT is requested, selecte C_STRING for unibyte
buffer/string. If an application doesn't like C_STRING, it
will request again with STRING or COMPOUND_TEXT. In such a
case, follow what requested.
---
Kenichi Handa
handa <at> ni.aist.go.jp
*** select.el.~1.39.~ 2008-02-09 05:16:35.000000000 +0900
--- select.el 2008-04-11 12:48:19.000000000 +0900
***************
*** 241,253 ****
(let ((inhibit-read-only t))
;; Suppress producing escape sequences for compositions.
(remove-text-properties 0 (length str) '(composition nil) str)
! (if (not (multibyte-string-p str))
! ;; Don't have to encode unibyte string.
! (setq type 'C_STRING)
! (if (eq type 'TEXT)
! ;; TEXT is a polimorphic target. We must select the
! ;; actual type from `UTF8_STRING', `COMPOUND_TEXT',
! ;; `STRING', and `C_STRING'.
(let (non-latin-1 non-unicode eight-bit)
(mapc #'(lambda (x)
(if (>= x #x100)
--- 241,252 ----
(let ((inhibit-read-only t))
;; Suppress producing escape sequences for compositions.
(remove-text-properties 0 (length str) '(composition nil) str)
! (if (eq type 'TEXT)
! ;; TEXT is a polimorphic target. We must select the
! ;; actual type from `UTF8_STRING', `COMPOUND_TEXT',
! ;; `STRING', and `C_STRING'.
! (if (not (multibyte-string-p str))
! (setq type 'C_STRING)
(let (non-latin-1 non-unicode eight-bit)
(mapc #'(lambda (x)
(if (>= x #x100)
***************
*** 259,290 ****
str)
(setq type (if non-unicode 'COMPOUND_TEXT
(if non-latin-1 'UTF8_STRING
! (if eight-bit 'C_STRING 'STRING))))))
! (cond
! ((eq type 'UTF8_STRING)
! (if (or (not coding)
! (not (eq (coding-system-type coding) 'utf-8)))
! (setq coding 'utf-8))
! (setq str (encode-coding-string str coding)))
!
! ((eq type 'STRING)
! (if (or (not coding)
! (not (eq (coding-system-type coding) 'charset)))
! (setq coding 'iso-8859-1))
! (setq str (encode-coding-string str coding)))
!
! ((eq type 'COMPOUND_TEXT)
! (if (or (not coding)
! (not (eq (coding-system-type coding) 'iso-2022)))
! (setq coding 'compound-text-with-extensions))
! (setq str (encode-coding-string str coding)))
!
! ((eq type 'C_STRING)
! (setq str (string-make-unibyte str)))
!
! (t
! (error "Unknow selection type: %S" type))
! ))))
(setq next-selection-coding-system nil)
(cons type str))))
--- 258,289 ----
str)
(setq type (if non-unicode 'COMPOUND_TEXT
(if non-latin-1 'UTF8_STRING
! (if eight-bit 'C_STRING 'STRING)))))))
! (cond
! ((eq type 'UTF8_STRING)
! (if (or (not coding)
! (not (eq (coding-system-type coding) 'utf-8)))
! (setq coding 'utf-8))
! (setq str (encode-coding-string str coding)))
!
! ((eq type 'STRING)
! (if (or (not coding)
! (not (eq (coding-system-type coding) 'charset)))
! (setq coding 'iso-8859-1))
! (setq str (encode-coding-string str coding)))
!
! ((eq type 'COMPOUND_TEXT)
! (if (or (not coding)
! (not (eq (coding-system-type coding) 'iso-2022)))
! (setq coding 'compound-text-with-extensions))
! (setq str (encode-coding-string str coding)))
!
! ((eq type 'C_STRING)
! (setq str (string-make-unibyte str)))
!
! (t
! (error "Unknow selection type: %S" type))
! )))
(setq next-selection-coding-system nil)
(cons type str))))
This bug report was last modified 15 years and 176 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.