diff options
| author | Kenichi Handa | 2003-05-28 11:35:50 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-05-28 11:35:50 +0000 |
| commit | 59c94f0325d8c41da287e1fb9a88f6720bbef94d (patch) | |
| tree | a0ca1b3a686040948b74e591f00c49cdcf2997a6 /src | |
| parent | 941caafe73a576dfe329d8321810b4bb8e94c08d (diff) | |
| download | emacs-59c94f0325d8c41da287e1fb9a88f6720bbef94d.tar.gz emacs-59c94f0325d8c41da287e1fb9a88f6720bbef94d.zip | |
(kill_workbuf_unwind): New function.
(Finsert_file_contents): On replacing, call
make_conversion_work_buffer with correct args, and call
record_unwind_protect with the first arg kill_workbuf_unwind.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c index 674b954e401..24a3377f8e8 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -289,6 +289,18 @@ restore_point_unwind (location) | |||
| 289 | Fset_marker (location, Qnil, Qnil); | 289 | Fset_marker (location, Qnil, Qnil); |
| 290 | return Qnil; | 290 | return Qnil; |
| 291 | } | 291 | } |
| 292 | |||
| 293 | /* Kill the working buffer for code conversion. */ | ||
| 294 | |||
| 295 | static Lisp_Object | ||
| 296 | kill_workbuf_unwind (workbuf) | ||
| 297 | Lisp_Object workbuf; | ||
| 298 | { | ||
| 299 | if (! NILP (workbuf) && ! NILP (Fbuffer_live_p (workbuf))) | ||
| 300 | Fkill_buffer (workbuf); | ||
| 301 | return Qnil; | ||
| 302 | } | ||
| 303 | |||
| 292 | 304 | ||
| 293 | Lisp_Object Qexpand_file_name; | 305 | Lisp_Object Qexpand_file_name; |
| 294 | Lisp_Object Qsubstitute_in_file_name; | 306 | Lisp_Object Qsubstitute_in_file_name; |
| @@ -4032,12 +4044,12 @@ actually used. */) | |||
| 4032 | unsigned char *decoded; | 4044 | unsigned char *decoded; |
| 4033 | int temp; | 4045 | int temp; |
| 4034 | int this_count = BINDING_STACK_SIZE (); | 4046 | int this_count = BINDING_STACK_SIZE (); |
| 4047 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | ||
| 4035 | Lisp_Object conversion_buffer | 4048 | Lisp_Object conversion_buffer |
| 4036 | = make_conversion_work_buffer (! NILP (current_buffer | 4049 | = make_conversion_work_buffer (-1, multibyte); |
| 4037 | ->enable_multibyte_characters)); | ||
| 4038 | struct gcpro1; | 4050 | struct gcpro1; |
| 4039 | 4051 | ||
| 4040 | record_unwind_protect (code_conversion_restore, save_excursion_save ()); | 4052 | record_unwind_protect (kill_workbuf_unwind, conversion_buffer); |
| 4041 | 4053 | ||
| 4042 | /* First read the whole file, performing code conversion into | 4054 | /* First read the whole file, performing code conversion into |
| 4043 | CONVERSION_BUFFER. */ | 4055 | CONVERSION_BUFFER. */ |