From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: [Bug] Issues with format.el: coding system, byte/char confusion Date: Tue, 08 Apr 2003 02:46:23 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <67B8CED503F3D511BB9F0008C75DAD6605485568@dewdfx17> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1049784723 29482 80.91.224.249 (8 Apr 2003 06:52:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2003 06:52:03 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Apr 08 08:52:02 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 192mxd-0007fO-00 for ; Tue, 08 Apr 2003 08:52:01 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 192n1W-0001zV-00 for ; Tue, 08 Apr 2003 08:56:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192my3-0001Ym-02 for emacs-devel@quimby.gnus.org; Tue, 08 Apr 2003 02:52:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 192muc-0008Q1-00 for emacs-devel@gnu.org; Tue, 08 Apr 2003 02:48:54 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 192mt4-00077T-00 for emacs-devel@gnu.org; Tue, 08 Apr 2003 02:47:19 -0400 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192msE-0006Lg-00 for emacs-devel@gnu.org; Tue, 08 Apr 2003 02:46:26 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.10) id 192msB-0005xz-00; Tue, 08 Apr 2003 02:46:23 -0400 Original-To: "Wedler, Christoph" In-reply-to: <67B8CED503F3D511BB9F0008C75DAD6605485568@dewdfx17> (christoph.wedler@sap.com) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13016 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13016 1. Shouldn't `format-annotate-function' also save the buffer-local variable `buffer-file-coding-system' (as it does with `selective-display' and `enable-multibyte-characters' since v1.38)? That seems plausible, but one ought to test it. 2. To compute the coding system of the current buffer, Emacs adds function `after-insert-file-set-buffer-file-coding-system' to `after-insert-file-functions'. Is this correct? Yes. - decode functions using format.el, - decode functions in `after-insert-file-functions' before `after-insert-file-set-buffer-file-coding-system', - Emacs determines the coding system with `after-insert-file-set-buffer-file-coding-system', - decode functions in `after-insert-file-functions' after `after-insert-file-set-buffer-file-coding-system' That would be true, if there is anything in after-insert-file-functions other than after-insert-file-set-buffer-file-coding-system. Normally I believe there isn't anything else. I would assume that the coding system must be determined before any of the decode functions have been executed... Not necessarily. That would depend on what those other functions are. Normally there aren't any others. I suppose if you add other functions to this hook that you should put them in the proper order. Is there any real example where this question arises, or is it purely hypothetical. 3. The docstring of `after-insert-file-functions' includes "It should return the new byte count", whereas `format-decode' returns the new char count. It looks like they are really both measured in characters. I will fix some doc strings. Thanks.