Mercurial > emacs
comparison src/fileio.c @ 50546:4a06e3332577
(Vafter_insert_file_adjust_coding_function): Delete
this variable.
(Qafter_insert_file_set_coding): New variable.
(syms_of_fileio): Initialize and staticpro it. Delete declaration
for after-insert-file-adjust-coding-function.
(Finsert_file_contents): Call Qafter_insert_file_set_coding
instead of Vafter_insert_file_adjust_coding_function.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 11 Apr 2003 10:59:02 +0000 |
parents | 987ee3ecc0a8 |
children | a4f8713c4753 |
comparison
equal
deleted
inserted
replaced
50545:f1c99baf3a4f | 50546:4a06e3332577 |
---|---|
175 Lisp_Object Vset_auto_coding_function; | 175 Lisp_Object Vset_auto_coding_function; |
176 | 176 |
177 /* Functions to be called to process text properties in inserted file. */ | 177 /* Functions to be called to process text properties in inserted file. */ |
178 Lisp_Object Vafter_insert_file_functions; | 178 Lisp_Object Vafter_insert_file_functions; |
179 | 179 |
180 /* Function to be called to adjust buffer-file-coding-system and the | 180 /* Lisp function for setting buffer-file-coding-system and the |
181 multibyteness of the current buffer after inserting a file. */ | 181 multibyteness of the current buffer after inserting a file. */ |
182 Lisp_Object Vafter_insert_file_adjust_coding_function; | 182 Lisp_Object Qafter_insert_file_set_coding; |
183 | 183 |
184 /* Functions to be called to create text property annotations for file. */ | 184 /* Functions to be called to create text property annotations for file. */ |
185 Lisp_Object Vwrite_region_annotate_functions; | 185 Lisp_Object Vwrite_region_annotate_functions; |
186 | 186 |
187 /* During build_annotations, each time an annotation function is called, | 187 /* During build_annotations, each time an annotation function is called, |
4545 } | 4545 } |
4546 | 4546 |
4547 if (set_coding_system) | 4547 if (set_coding_system) |
4548 Vlast_coding_system_used = coding.symbol; | 4548 Vlast_coding_system_used = coding.symbol; |
4549 | 4549 |
4550 if (FUNCTIONP (Vafter_insert_file_adjust_coding_function)) | 4550 if (! NILP (Ffboundp (Qafter_insert_file_set_coding))) |
4551 { | 4551 { |
4552 insval = call1 (Vafter_insert_file_adjust_coding_function, | 4552 insval = call1 (Qafter_insert_file_set_coding, make_number (inserted)); |
4553 make_number (inserted)); | |
4554 if (! NILP (insval)) | 4553 if (! NILP (insval)) |
4555 { | 4554 { |
4556 CHECK_NUMBER (insval); | 4555 CHECK_NUMBER (insval); |
4557 inserted = XFASTINT (insval); | 4556 inserted = XFASTINT (insval); |
4558 } | 4557 } |
6357 | 6356 |
6358 Qformat_decode = intern ("format-decode"); | 6357 Qformat_decode = intern ("format-decode"); |
6359 staticpro (&Qformat_decode); | 6358 staticpro (&Qformat_decode); |
6360 Qformat_annotate_function = intern ("format-annotate-function"); | 6359 Qformat_annotate_function = intern ("format-annotate-function"); |
6361 staticpro (&Qformat_annotate_function); | 6360 staticpro (&Qformat_annotate_function); |
6361 Qafter_insert_file_set_coding = intern ("after-insert-file-set-coding"); | |
6362 staticpro (&Qafter_insert_file_set_coding); | |
6362 | 6363 |
6363 Qcar_less_than_car = intern ("car-less-than-car"); | 6364 Qcar_less_than_car = intern ("car-less-than-car"); |
6364 staticpro (&Qcar_less_than_car); | 6365 staticpro (&Qcar_less_than_car); |
6365 | 6366 |
6366 Fput (Qfile_error, Qerror_conditions, | 6367 Fput (Qfile_error, Qerror_conditions, |
6426 If no coding system is decided, it should check a coding system | 6427 If no coding system is decided, it should check a coding system |
6427 specified in the heading lines with the format: | 6428 specified in the heading lines with the format: |
6428 -*- ... coding: CODING-SYSTEM; ... -*- | 6429 -*- ... coding: CODING-SYSTEM; ... -*- |
6429 or local variable spec of the tailing lines with `coding:' tag. */); | 6430 or local variable spec of the tailing lines with `coding:' tag. */); |
6430 Vset_auto_coding_function = Qnil; | 6431 Vset_auto_coding_function = Qnil; |
6431 | |
6432 DEFVAR_LISP ("after-insert-file-adjust-coding-function", | |
6433 &Vafter_insert_file_adjust_coding_function, | |
6434 doc: /* Function to call to adjust buffer-file-coding-system after inserting a file. | |
6435 The function is called with one arguemnt, the number of characters inserted. | |
6436 It should adjust `buffer-file-coding-system' and the multibyteness of | |
6437 the current buffer, and return the new character count. */); | |
6438 Vafter_insert_file_adjust_coding_function = Qnil; | |
6439 | 6432 |
6440 DEFVAR_LISP ("after-insert-file-functions", &Vafter_insert_file_functions, | 6433 DEFVAR_LISP ("after-insert-file-functions", &Vafter_insert_file_functions, |
6441 doc: /* A list of functions to be called at the end of `insert-file-contents'. | 6434 doc: /* A list of functions to be called at the end of `insert-file-contents'. |
6442 Each is passed one argument, the number of characters inserted. | 6435 Each is passed one argument, the number of characters inserted. |
6443 It should return the new character count, and leave point the same. | 6436 It should return the new character count, and leave point the same. |