# HG changeset patch # User Kenichi Handa # Date 878958344 0 # Node ID fb98ec190b6a3aa1bbf9336bec5eb311da9ad835 # Parent 1e30a8b4ff3f9db9404af6e5e154d719629198ec (Finsert_file_contents): Use new macros defined in coding.h. (Fwrite_region): Likewise. diff -r 1e30a8b4ff3f -r fb98ec190b6a src/fileio.c --- a/src/fileio.c Sat Nov 08 03:05:44 1997 +0000 +++ b/src/fileio.c Sat Nov 08 03:05:44 1997 +0000 @@ -3284,7 +3284,7 @@ But if we discover the need for conversion, we give up on this method and let the following if-statement handle the replace job. */ if (!NILP (replace) - && CODING_MAY_REQUIRE_NO_CONVERSION (&coding)) + && ! CODING_REQUIRE_DECODING (&coding)) { int same_at_start = BEGV; int same_at_end = ZV; @@ -3318,9 +3318,7 @@ if (coding.type == coding_type_undecided) detect_coding (&coding, buffer, nread); - if (coding.type != coding_type_undecided - && coding.type != coding_type_no_conversion - && coding.type != coding_type_emacs_mule) + if (CODING_REQUIRE_DECODING (&coding)) /* We found that the file should be decoded somehow. Let's give up here. */ { @@ -3406,7 +3404,8 @@ if (same_at_end > same_at_start && FETCH_BYTE (same_at_end - 1) >= 0200 && ! NILP (current_buffer->enable_multibyte_characters) - && ! CODING_REQUIRE_NO_CONVERSION (&coding)) + && (CODING_REQUIRE_DECODING (&coding) + || CODING_REQUIRE_DETECTION (&coding))) giveup_match_end = 1; break; } @@ -3500,7 +3499,8 @@ how_much += this; - if (! CODING_REQUIRE_NO_CONVERSION (&coding)) + if (CODING_REQUIRE_DECODING (&coding) + || CODING_REQUIRE_DETECTION (&coding)) { int require, produced, consumed; @@ -3646,7 +3646,8 @@ { /* try is reserved in some compilers (Microsoft C) */ int trytry = min (total - how_much, READ_BUF_SIZE - unprocessed); - char *destination = (CODING_REQUIRE_NO_CONVERSION (&coding) + char *destination = (! (CODING_REQUIRE_DECODING (&coding) + || CODING_REQUIRE_DETECTION (&coding)) ? (char *) (POS_ADDR (PT + inserted - 1) + 1) : read_buf + unprocessed); int this; @@ -3671,7 +3672,8 @@ if (! not_regular) how_much += this; - if (! CODING_REQUIRE_NO_CONVERSION (&coding)) + if (CODING_REQUIRE_DECODING (&coding) + || CODING_REQUIRE_DETECTION (&coding)) { int require, produced, consumed; @@ -4224,7 +4226,7 @@ save_errno = errno; } - if (coding.require_flushing && !coding.last_block) + if (CODING_REQUIRE_FLUSHING (&coding) && !coding.last_block) { /* We have to flush out a data. */ coding.last_block = 1;