Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
6ad0beeb
Commit
6ad0beeb
authored
Nov 08, 1997
by
Kenichi Handa
Browse files
(Finsert_file_contents): Use new macros defined in
coding.h. (Fwrite_region): Likewise.
parent
ca1e6a13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
src/fileio.c
src/fileio.c
+11
-9
No files found.
src/fileio.c
View file @
6ad0beeb
...
...
@@ -3284,7 +3284,7 @@ This does code conversion according to the value of\n\
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 @@ This does code conversion according to the value of\n\
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 @@ This does code conversion according to the value of\n\
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 @@ This does code conversion according to the value of\n\
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 @@ This does code conversion according to the value of\n\
{
/* 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 @@ This does code conversion according to the value of\n\
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 @@ to the file, instead of any buffer contents, and END is ignored.")
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment