/* Decide the coding-system of the file. */
{
- Lisp_Object val = Qnil;
+ Lisp_Object val;
+ val = Qnil;
if (!NILP (Vcoding_system_for_read))
val = Vcoding_system_for_read;
/* In REPLACE mode, we can use the same coding system
that was used to visit the file. */
val = current_buffer->buffer_file_coding_system;
- else
+ else if (! not_regular)
{
+ /* Don't try looking inside a file for a coding system specification
+ if it is not seekable. */
if (! NILP (Vset_auto_coding_function))
{
/* Find a coding system specified in the heading two lines
{
Lisp_Object args[6], coding_systems;
- args[0] = Qinsert_file_contents, args[1] = orig_filename,
- args[2] = visit, args[3] = beg, args[4] = end, args[5] = replace;
+ args[0] = Qinsert_file_contents, args[1] = orig_filename;
+ args[2] = visit, args[3] = beg, args[4] = end, args[5] = replace;
coding_systems = Ffind_operation_coding_system (6, args);
- if (CONSP (coding_systems)) val = XCONS (coding_systems)->car;
+ if (CONSP (coding_systems))
+ val = XCONS (coding_systems)->car;
}
}