diff options
| author | Eli Zaretskii | 2002-06-05 17:38:19 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2002-06-05 17:38:19 +0000 |
| commit | 8f9b87b5561d282c9e410da2d920b2cd8875e13f (patch) | |
| tree | b4897c4685e6b9b045614fa23e09c59e24d58f4d /src | |
| parent | d176a839b02506ddd4b3a0f0611c6a2339690b20 (diff) | |
| download | emacs-8f9b87b5561d282c9e410da2d920b2cd8875e13f.tar.gz emacs-8f9b87b5561d282c9e410da2d920b2cd8875e13f.zip | |
(lisp_data_to_selection_data): If the requested type
is STRING, call string_make_unibyte to encode the selected text
as a string.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/xselect.c | 24 |
2 files changed, 25 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 941ded6b959..6bef61ab14e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2002-06-05 Eli Zaretskii <eliz@is.elta.co.il> | 1 | 2002-06-05 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 2 | ||
| 3 | * xselect.c (lisp_data_to_selection_data): If the requested type | ||
| 4 | is STRING, call string_make_unibyte to encode the selected text | ||
| 5 | as a string. | ||
| 6 | |||
| 3 | * window.c (Fset_window_hscroll): Doc fix. | 7 | * window.c (Fset_window_hscroll): Doc fix. |
| 4 | 8 | ||
| 5 | 2002-06-05 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 9 | 2002-06-05 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
diff --git a/src/xselect.c b/src/xselect.c index 28b3338757e..3e1c9d0edf9 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1757,14 +1757,32 @@ lisp_data_to_selection_data (display, obj, | |||
| 1757 | /* Since we are now handling multilingual text, we must consider | 1757 | /* Since we are now handling multilingual text, we must consider |
| 1758 | sending back compound text. */ | 1758 | sending back compound text. */ |
| 1759 | int stringp; | 1759 | int stringp; |
| 1760 | extern Lisp_Object Qcompound_text; | ||
| 1760 | 1761 | ||
| 1761 | if (NILP (Vnext_selection_coding_system)) | 1762 | if (NILP (Vnext_selection_coding_system)) |
| 1762 | Vnext_selection_coding_system = Vselection_coding_system; | 1763 | Vnext_selection_coding_system = Vselection_coding_system; |
| 1763 | 1764 | ||
| 1764 | *format_ret = 8; | 1765 | *format_ret = 8; |
| 1765 | *data_ret = x_encode_text (obj, Vnext_selection_coding_system, 1, | 1766 | /* If the requested type is STRING, we must encode the selected |
| 1766 | (int *) size_ret, &stringp); | 1767 | text as a string, even if the coding system set by the user |
| 1767 | *nofree_ret = (*data_ret == XSTRING (obj)->data); | 1768 | is ctext or its derivatives. */ |
| 1769 | if (EQ (type, QSTRING) | ||
| 1770 | && (EQ (Vnext_selection_coding_system, Qcompound_text) | ||
| 1771 | || EQ (Vnext_selection_coding_system, | ||
| 1772 | Qcompound_text_with_extensions))) | ||
| 1773 | { | ||
| 1774 | Lisp_Object unibyte_string; | ||
| 1775 | |||
| 1776 | unibyte_string = string_make_unibyte (obj); | ||
| 1777 | *data_ret = XSTRING (unibyte_string)->data; | ||
| 1778 | *nofree_ret = 1; | ||
| 1779 | } | ||
| 1780 | else | ||
| 1781 | { | ||
| 1782 | *data_ret = x_encode_text (obj, Vnext_selection_coding_system, 1, | ||
| 1783 | (int *) size_ret, &stringp); | ||
| 1784 | *nofree_ret = (*data_ret == XSTRING (obj)->data); | ||
| 1785 | } | ||
| 1768 | if (NILP (type)) | 1786 | if (NILP (type)) |
| 1769 | type = (stringp ? QSTRING : QCOMPOUND_TEXT); | 1787 | type = (stringp ? QSTRING : QCOMPOUND_TEXT); |
| 1770 | Vlast_coding_system_used = (*nofree_ret | 1788 | Vlast_coding_system_used = (*nofree_ret |