Mercurial > emacs
comparison src/xfns.c @ 81291:7edf1ae10375
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-790
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 09 Jun 2007 03:19:04 +0000 |
parents | 516508c377db 96c01b44f51d |
children | c567f60cd935 cc587bfd19ca e9f94688a064 |
comparison
equal
deleted
inserted
replaced
81290:de76ddca1e47 | 81291:7edf1ae10375 |
---|---|
1514 | 1514 |
1515 | 1515 |
1516 /* Encode Lisp string STRING as a text in a format appropriate for | 1516 /* Encode Lisp string STRING as a text in a format appropriate for |
1517 XICCC (X Inter Client Communication Conventions). | 1517 XICCC (X Inter Client Communication Conventions). |
1518 | 1518 |
1519 This can call Lisp code, so callers must GCPRO. | |
1520 | |
1519 If STRING contains only ASCII characters, do no conversion and | 1521 If STRING contains only ASCII characters, do no conversion and |
1520 return the string data of STRING. Otherwise, encode the text by | 1522 return the string data of STRING. Otherwise, encode the text by |
1521 CODING_SYSTEM, and return a newly allocated memory area which | 1523 CODING_SYSTEM, and return a newly allocated memory area which |
1522 should be freed by `xfree' by a caller. | 1524 should be freed by `xfree' by a caller. |
1523 | 1525 |
1561 setup_coding_system (coding_system, &coding); | 1563 setup_coding_system (coding_system, &coding); |
1562 if (selectionp | 1564 if (selectionp |
1563 && SYMBOLP (coding.pre_write_conversion) | 1565 && SYMBOLP (coding.pre_write_conversion) |
1564 && !NILP (Ffboundp (coding.pre_write_conversion))) | 1566 && !NILP (Ffboundp (coding.pre_write_conversion))) |
1565 { | 1567 { |
1568 struct gcpro gcpro1; | |
1569 /* We don't need to GCPRO string. */ | |
1570 GCPRO1 (coding_system); | |
1566 string = run_pre_post_conversion_on_str (string, &coding, 1); | 1571 string = run_pre_post_conversion_on_str (string, &coding, 1); |
1572 UNGCPRO; | |
1567 str = SDATA (string); | 1573 str = SDATA (string); |
1568 chars = SCHARS (string); | 1574 chars = SCHARS (string); |
1569 bytes = SBYTES (string); | 1575 bytes = SBYTES (string); |
1570 } | 1576 } |
1571 coding.src_multibyte = 1; | 1577 coding.src_multibyte = 1; |