From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: safe_call1 considered harmful Date: Fri, 21 Jul 2006 12:36:48 +0300 Message-ID: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1153474640 7748 80.91.229.2 (21 Jul 2006 09:37:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Jul 2006 09:37:20 +0000 (UTC) Cc: handa@m17n.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 21 11:37:16 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G3rRX-0006wh-Hr for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2006 11:37:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G3rRW-0007nr-ES for ged-emacs-devel@m.gmane.org; Fri, 21 Jul 2006 05:37:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G3rRJ-0007mC-1w for emacs-devel@gnu.org; Fri, 21 Jul 2006 05:36:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G3rRH-0007jU-7O for emacs-devel@gnu.org; Fri, 21 Jul 2006 05:36:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G3rRH-0007jL-3q for emacs-devel@gnu.org; Fri, 21 Jul 2006 05:36:55 -0400 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G3rRe-00029r-M9 for emacs-devel@gnu.org; Fri, 21 Jul 2006 05:37:18 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-83-130-197-168.inter.net.il [83.130.197.168]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id FIC60293 (AUTH halo1); Fri, 21 Jul 2006 12:36:48 +0300 (IDT) Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:57423 Archived-At: 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 * 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)))