comparison src/fileio.c @ 59207:3912575fcded

(Finsert_file_contents): Don't use current_buffer->buffer_file_coding_system even if REPLACE is non-nil. Call Qafter_insert_file_set_coding with the second arg VISIT.
author Kenichi Handa <handa@m17n.org>
date Thu, 30 Dec 2004 12:28:41 +0000
parents 9bde7721ad0f
children c31adbdf12ec 025da3ba778e 95879cc1ed20
comparison
equal deleted inserted replaced
59206:77ba45776c58 59207:3912575fcded
3859 Lisp_Object val; 3859 Lisp_Object val;
3860 val = Qnil; 3860 val = Qnil;
3861 3861
3862 if (!NILP (Vcoding_system_for_read)) 3862 if (!NILP (Vcoding_system_for_read))
3863 val = Vcoding_system_for_read; 3863 val = Vcoding_system_for_read;
3864 else if (! NILP (replace))
3865 /* In REPLACE mode, we can use the same coding system
3866 that was used to visit the file. */
3867 val = current_buffer->buffer_file_coding_system;
3868 else 3864 else
3869 { 3865 {
3870 /* Don't try looking inside a file for a coding system 3866 /* Don't try looking inside a file for a coding system
3871 specification if it is not seekable. */ 3867 specification if it is not seekable. */
3872 if (! not_regular && ! NILP (Vset_auto_coding_function)) 3868 if (! not_regular && ! NILP (Vset_auto_coding_function))
4641 if (set_coding_system) 4637 if (set_coding_system)
4642 Vlast_coding_system_used = coding.symbol; 4638 Vlast_coding_system_used = coding.symbol;
4643 4639
4644 if (! NILP (Ffboundp (Qafter_insert_file_set_coding))) 4640 if (! NILP (Ffboundp (Qafter_insert_file_set_coding)))
4645 { 4641 {
4646 insval = call1 (Qafter_insert_file_set_coding, make_number (inserted)); 4642 insval = call2 (Qafter_insert_file_set_coding, make_number (inserted),
4643 visit);
4647 if (! NILP (insval)) 4644 if (! NILP (insval))
4648 { 4645 {
4649 CHECK_NUMBER (insval); 4646 CHECK_NUMBER (insval);
4650 inserted = XFASTINT (insval); 4647 inserted = XFASTINT (insval);
4651 } 4648 }