From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai =?iso-8859-15?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: Re: Run coding system auto-detection manually? Date: Wed, 07 Aug 2002 17:18:36 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: References: <200208070824.RAA17705@etlken.m17n.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1028733522 1760 127.0.0.1 (7 Aug 2002 15:18:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 7 Aug 2002 15:18:42 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17cSa9-0000SH-00 for ; Wed, 07 Aug 2002 17:18:41 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17cSvn-0001LE-00 for ; Wed, 07 Aug 2002 17:41:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17cSaf-0006Te-00; Wed, 07 Aug 2002 11:19:13 -0400 Original-Received: from waldorf.cs.uni-dortmund.de ([129.217.4.42]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17cSaD-0006OA-00 for ; Wed, 07 Aug 2002 11:18:45 -0400 Original-Received: from lothlorien.cs.uni-dortmund.de (lothlorien [129.217.19.67]) by waldorf.cs.uni-dortmund.de with ESMTP id g77FIhb17173; Wed, 7 Aug 2002 17:18:43 +0200 (MES) Original-Received: from lucy.cs.uni-dortmund.de (lucy [129.217.19.80]) by lothlorien.cs.uni-dortmund.de id RAA14961; Wed, 7 Aug 2002 17:18:38 +0200 (MET DST) Original-Received: by lucy.cs.uni-dortmund.de (Postfix, from userid 6104) id 2D0E63AC1C; Wed, 7 Aug 2002 17:18:36 +0200 (CEST) Original-To: Kenichi Handa In-Reply-To: <200208070824.RAA17705@etlken.m17n.org> (Kenichi Handa's message of "Wed, 7 Aug 2002 17:24:55 +0900 (JST)") Original-Lines: 48 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6339 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6339 Kenichi Handa writes: > So, for the case of a precious file, I think we must check > VISIT (if that is string) instead of FILENAME in > find-operation-coding-system. What do you think about the > this patch? > > --- > Ken'ichi HANDA > handa@etl.go.jp > > > *** coding.c.~1.252.~ Mon Jul 29 13:28:42 2002 > --- coding.c Wed Aug 7 17:20:00 2002 > *************** > *** 6878,6883 **** > --- 6878,6890 ---- > if (nargs < 1 + XINT (target_idx)) > error ("Too few arguments for operation: %s", > SDATA (SYMBOL_NAME (operation))); > + /* For write-region, if the 6th argument (i.e. VISIT, the 5th > + argument to write-region) is string, it must be treated as a > + target file name. */ > + if (EQ (operation, Qwrite_region) > + && nargs > 5 > + && STRINGP (args[5])) > + target_idx = 4; > target = args[XINT (target_idx) + 1]; > if (!(STRINGP (target) > || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) How about, instead of hard-coding the write-region operation, find-operation-coding-system is extended so that the target-idx property can express the rule? If Fget (operation, Qtarget_idx) returns a cons, one could eval it and assume that the result would be an integer to use. Then the target-idx property for write-region could be (if (stringp visit) 5 3) or something like that. What do you think? (I don't mean the concrete suggestion, it might well turn out to be rubbish. I mean the idea to make the decision in find-operation-coding-system configurable from Lisp.) kai -- A large number of young women don't trust men with beards. (BFBS Radio)