unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: safe_call1 considered harmful
Date: Mon, 24 Jul 2006 10:36:12 +0900	[thread overview]
Message-ID: <E1G4pMi-0005wp-00@etlken> (raw)
In-Reply-To: <uac73gdpy.fsf@gnu.org> (message from Eli Zaretskii on Fri, 21 Jul 2006 18:49:29 +0300)

In article <uac73gdpy.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:

>> But, by considering this problem again, I found another
>> solution than calling find-operation-coding-system with
>> (FILENAME . BUFFER).  That is to provide an extra argument
>> BUFFER.  Then, we can keep backward compatibility and
>> find-buffer-file-type-coding-system works as before, and, by
>> modifying po-find-file-coding-system to check that extra
>> argument instead of checking if FILENAME is cons or not, we
>> can make it work well too.

> This will work if no function on file-coding-system-alist currently
> looks at arguments beyond the 1st one, the file name.  If there are
> functions which look beyond that, such a change will break them.

No, what I meant is to give the extra argument BUFFER at the
END of the normal arguments to insert-file-contents.  So,
for instance, tar-extract will call
find-operation-coding-system as this:

			     (car (find-operation-coding-system
				   'insert-file-contents
				   name t nil nil nil (current-buffer)))

The new docstring (only the last paragraph) for
find-operation-coding-system will be:

----------------------------------------------------------------------
[...]
If OPERATION is `insert-file-contents', there may be an extra argument
BUFFER at the end.  In that case, FILENAME is a file name to look up,
and BUFFER is a buffer that contains the file's contents (not yet
decoded).  If `file-coding-system-alist' specifies a function to call
for FILENAME, that function should examine the contents of BUFFER
instead of reading the file.
----------------------------------------------------------------------

This change breaks only such a function that checks that the
number of given arguments is not greater than 5 (the maximum
arguments to insert-file-contents).  I believe such a
function is very very rare.

> In any case, I think we should revert the change you made to use
> safe_call1.

Yes.

---
Kenichi Handa
handa@m17n.org

  reply	other threads:[~2006-07-24  1:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=E1G4pMi-0005wp-00@etlken \
    --to=handa@m17n.org \
    --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).