From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Wedler, Christoph" Newsgroups: gmane.emacs.devel Subject: [Bug] Issues with format.el: coding system, byte/char confusion Date: Mon, 7 Apr 2003 19:30:31 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <67B8CED503F3D511BB9F0008C75DAD6605485568@dewdfx17> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: main.gmane.org 1049737673 28950 80.91.224.249 (7 Apr 2003 17:47:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2003 17:47:53 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Apr 07 19:47:49 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 192aij-0007WX-00 for ; Mon, 07 Apr 2003 19:47:49 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 192amL-0002wN-00 for ; Mon, 07 Apr 2003 19:51:33 +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 192aaL-00060W-02 for emacs-devel@quimby.gnus.org; Mon, 07 Apr 2003 13:39:09 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 192aU7-00030K-00 for emacs-devel@gnu.org; Mon, 07 Apr 2003 13:32:43 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 192aTm-0002l2-00 for emacs-devel@gnu.org; Mon, 07 Apr 2003 13:32:23 -0400 Original-Received: from smtpde02.sap-ag.de ([155.56.68.170]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192aSH-0001ky-00 for emacs-devel@gnu.org; Mon, 07 Apr 2003 13:30:49 -0400 Original-Received: from sap-ag.de (smtpde02) by smtpde02.sap-ag.de (out) with ESMTP id TAA09039 for ; Mon, 7 Apr 2003 19:30:55 +0200 (MESZ) Original-To: "'emacs-devel@gnu.org'" X-Mailer: Internet Mail Service (5.5.2656.59) X-SAP: out 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:12980 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12980 [Test using Emacs-21.2.95.1, with head revision of: format.el,v 1.40, fileio.c,v 1.479] There are some issues with format.el: 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)? 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? In the DEFUN for "insert-file-contents" in fileio.c, Emacs first calls Qformat_decode and then the functions in `after-insert-file-functions'. In other words, we have the following call sequence: - 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' I would assume that the coding system must be determined before any of the decode functions have been executed... Or does it simply not matter when `after-insert-file-set-buffer-file-coding-system' is called? 3. The docstring of `after-insert-file-functions' includes "It should return the new byte count", whereas `format-decode' returns the new char count. In the DEFUN for "insert-file-contents" in fileio.c, the invocations of Qformat_decode and the functions in Vafter_insert_file_functions (and the use of the return value `inserted') look quite similar... Which is correct for both: byte count or char count? (I hope the latter, you might want to check `after-insert-file-set-buffer-file-coding-system' in this case.) - Christoph