unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* safe_call1 considered harmful
@ 2006-07-21  9:36 Eli Zaretskii
  2006-07-21 11:34 ` Kenichi Handa
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2006-07-21  9:36 UTC (permalink / raw)
  Cc: handa

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  <handa@m17n.org>

	* 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)))

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-08-01  0:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-21  9:36 safe_call1 considered harmful Eli Zaretskii
2006-07-21 11:34 ` Kenichi Handa
2006-07-21 15:49   ` Eli Zaretskii
2006-07-24  1:36     ` Kenichi Handa
2006-07-29 11:00       ` Eli Zaretskii
2006-07-31  3:04         ` Kenichi Handa
2006-07-21 19:37   ` Richard Stallman
2006-07-24  1:44     ` Kenichi Handa
2006-07-24 18:22       ` Richard Stallman
2006-07-30  9:18         ` Kenichi Handa
2006-07-31  4:38           ` Richard Stallman
2006-07-31  5:14             ` Kenichi Handa
2006-07-31 22:16               ` Richard Stallman
2006-08-01  0:50                 ` Kenichi Handa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).