diff options
| author | Kenichi Handa | 2000-05-29 11:18:02 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-05-29 11:18:02 +0000 |
| commit | f0b950cf5a0c6a681d0a93cbea7374e7f8728fc0 (patch) | |
| tree | 06cf480a13d92b3dfd95b1ce1e0b372e666f015c /src | |
| parent | f4cda61e61b3af2ee92d76e8e81ac1a744ed0901 (diff) | |
| download | emacs-f0b950cf5a0c6a681d0a93cbea7374e7f8728fc0.tar.gz emacs-f0b950cf5a0c6a681d0a93cbea7374e7f8728fc0.zip | |
Include composite.h.
(Fcall_process): Handle composition correctly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/callproc.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/callproc.c b/src/callproc.c index b23a0bb48e5..046c14a9b40 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -75,6 +75,7 @@ extern int errno; | |||
| 75 | #include "charset.h" | 75 | #include "charset.h" |
| 76 | #include "ccl.h" | 76 | #include "ccl.h" |
| 77 | #include "coding.h" | 77 | #include "coding.h" |
| 78 | #include "composite.h" | ||
| 78 | #include <epaths.h> | 79 | #include <epaths.h> |
| 79 | #include "process.h" | 80 | #include "process.h" |
| 80 | #include "syssignal.h" | 81 | #include "syssignal.h" |
| @@ -727,6 +728,8 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 727 | struct coding_system saved_coding; | 728 | struct coding_system saved_coding; |
| 728 | 729 | ||
| 729 | saved_coding = process_coding; | 730 | saved_coding = process_coding; |
| 731 | if (process_coding.composing != COMPOSITION_DISABLED) | ||
| 732 | coding_allocate_composition_data (&process_coding, PT); | ||
| 730 | 733 | ||
| 731 | while (1) | 734 | while (1) |
| 732 | { | 735 | { |
| @@ -764,9 +767,12 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 764 | insert_1_both (bufptr, nread, nread, 0, 1, 0); | 767 | insert_1_both (bufptr, nread, nread, 0, 1, 0); |
| 765 | else | 768 | else |
| 766 | { /* We have to decode the input. */ | 769 | { /* We have to decode the input. */ |
| 767 | int size = decoding_buffer_size (&process_coding, nread); | 770 | int size; |
| 768 | char *decoding_buf = (char *) xmalloc (size); | 771 | char *decoding_buf; |
| 769 | 772 | ||
| 773 | repeat_decoding: | ||
| 774 | size = decoding_buffer_size (&process_coding, nread); | ||
| 775 | decoding_buf = (char *) xmalloc (size); | ||
| 770 | decode_coding (&process_coding, bufptr, decoding_buf, | 776 | decode_coding (&process_coding, bufptr, decoding_buf, |
| 771 | nread, size); | 777 | nread, size); |
| 772 | if (display_on_the_fly | 778 | if (display_on_the_fly |
| @@ -784,15 +790,30 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 784 | continue; | 790 | continue; |
| 785 | } | 791 | } |
| 786 | if (process_coding.produced > 0) | 792 | if (process_coding.produced > 0) |
| 787 | insert_1_both (decoding_buf, process_coding.produced_char, | 793 | { |
| 788 | process_coding.produced, 0, 1, 0); | 794 | insert_1_both (decoding_buf, process_coding.produced_char, |
| 795 | process_coding.produced, 0, 1, 0); | ||
| 796 | if (process_coding.cmp_data) | ||
| 797 | coding_restore_composition (&process_coding, | ||
| 798 | Fcurrent_buffer ()); | ||
| 799 | } | ||
| 789 | xfree (decoding_buf); | 800 | xfree (decoding_buf); |
| 790 | carryover = nread - process_coding.consumed; | 801 | nread -= process_coding.consumed; |
| 802 | carryover = nread; | ||
| 791 | if (carryover > 0) | 803 | if (carryover > 0) |
| 792 | /* As CARRYOVER should not be that large, we had | 804 | /* As CARRYOVER should not be that large, we had |
| 793 | better avoid overhead of bcopy. */ | 805 | better avoid overhead of bcopy. */ |
| 794 | BCOPY_SHORT (bufptr + process_coding.consumed, bufptr, | 806 | BCOPY_SHORT (bufptr + process_coding.consumed, bufptr, |
| 795 | carryover); | 807 | carryover); |
| 808 | if (process_coding.result == CODING_FINISH_INSUFFICIENT_CMP) | ||
| 809 | { | ||
| 810 | /* The decoding ended because of insufficient data | ||
| 811 | area to record information about composition. | ||
| 812 | We must try decoding with additional data area | ||
| 813 | before reading process output. */ | ||
| 814 | coding_allocate_composition_data (&process_coding, PT); | ||
| 815 | goto repeat_decoding; | ||
| 816 | } | ||
| 796 | } | 817 | } |
| 797 | } | 818 | } |
| 798 | 819 | ||
| @@ -819,6 +840,9 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") | |||
| 819 | } | 840 | } |
| 820 | give_up: ; | 841 | give_up: ; |
| 821 | 842 | ||
| 843 | if (process_coding.cmp_data) | ||
| 844 | coding_free_composition_data (&process_coding); | ||
| 845 | |||
| 822 | Vlast_coding_system_used = process_coding.symbol; | 846 | Vlast_coding_system_used = process_coding.symbol; |
| 823 | 847 | ||
| 824 | /* If the caller required, let the buffer inherit the | 848 | /* If the caller required, let the buffer inherit the |