emacs-devel
[Top][All Lists]
Advanced

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

[Bug] Issues with format.el: coding system, byte/char confusion


From: Wedler, Christoph
Subject: [Bug] Issues with format.el: coding system, byte/char confusion
Date: Mon, 7 Apr 2003 19:30:31 +0200

[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




reply via email to

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