emacs-devel
[Top][All Lists]
Advanced

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

Re: Run coding system auto-detection manually?


From: Kai Großjohann
Subject: Re: Run coding system auto-detection manually?
Date: Wed, 07 Aug 2002 17:18:36 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Kenichi Handa <address@hidden> 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
> address@hidden
>
>
> *** 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)



reply via email to

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