emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

safe_call1 considered harmful


From: Eli Zaretskii
Subject: safe_call1 considered harmful
Date: Fri, 21 Jul 2006 12:36:48 +0300

The change below was presumably made to avoid errors in functions that
are put on the various *-coding-system-alist variables.  Those errors
might have been caused by the recent changes in several modes that now
use a cons cell `(FILENAME . BUFFER)' instead of just the file name as
the argument to find-operation-coding-system (when the operation is
insert-file-contents), because some packages put functions on the
file-coding-system-alist that are not ready for the cons cell.

I think the change in coding.c is for the worse: it masks such
problems from us, so instead of seeing bug reports, we sweep the
problems under the carpet, where they run risk to be left undetected
until after the release.

A case in point is the function find-buffer-file-type-coding-system
that dos-w32.el adds to file-coding-system-alist: it was not modified
to support the change in the find-operation-coding-system's interface,
and caused files with DOS EOLs uncompressed from archives to be shown
with the ^M characters.  This happened because
find-buffer-file-type-coding-system throws an error, but safe_call1
silently ignores it.

So how about if we undo the change below?


2006-05-29  Kenichi Handa  <address@hidden>

        * coding.c (Ffind_operation_coding_system): Call a function by
        safe_call1 instead of call1.

Index: src/coding.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/coding.c,v
retrieving revision 1.338
retrieving revision 1.339
diff -u -r1.338 -r1.339
--- src/coding.c        26 May 2006 04:48:21 -0000      1.338
+++ src/coding.c        29 May 2006 00:54:27 -0000      1.339
@@ -7539,7 +7539,7 @@
            return Fcons (val, val);
          if (! NILP (Ffboundp (val)))
            {
-             val = call1 (val, Flist (nargs, args));
+             val = safe_call1 (val, Flist (nargs, args));
              if (CONSP (val))
                return val;
              if (SYMBOLP (val) && ! NILP (Fcoding_system_p (val)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]