From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann)
Cc: emacs-devel@gnu.org
Subject: Re: Run coding system auto-detection manually?
Date: Wed, 07 Aug 2002 17:18:36 +0200 [thread overview]
Message-ID: <vafhei6puib.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de> (raw)
In-Reply-To: <200208070824.RAA17705@etlken.m17n.org> (Kenichi Handa's message of "Wed, 7 Aug 2002 17:24:55 +0900 (JST)")
Kenichi Handa <handa@etl.go.jp> 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)
next prev parent reply other threads:[~2002-08-07 15:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-04 14:22 Run coding system auto-detection manually? Kai Großjohann
2002-08-05 4:48 ` Eli Zaretskii
2002-08-05 10:43 ` Kai Großjohann
2002-08-06 1:50 ` Richard Stallman
2002-08-06 9:48 ` Kai Großjohann
2002-08-07 14:23 ` Richard Stallman
2002-08-06 9:50 ` Kai Großjohann
2002-08-07 8:24 ` Kenichi Handa
2002-08-07 15:18 ` Kai Großjohann [this message]
2002-08-08 1:09 ` Kenichi Handa
2002-08-08 7:01 ` Richard Stallman
2002-08-08 8:48 ` Kai Großjohann
2002-08-08 12:45 ` Kenichi Handa
2002-08-08 13:12 ` Kai Großjohann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vafhei6puib.fsf@INBOX.auto.emacs.devel.tok.lucy.cs.uni-dortmund.de \
--to=kai.grossjohann@cs.uni-dortmund.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).