emacs-devel
[Top][All Lists]
Advanced

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

Re: ctext-pre-write-conversion barfs


From: Tak Ota
Subject: Re: ctext-pre-write-conversion barfs
Date: Sat, 23 Feb 2002 08:11:49 -0800 (PST)

Sat, 23 Feb 2002 10:48:42 +0200: "Eli Zaretskii" <address@hidden> wrote:

> Do you have any real-life example of using compound-text in a way that
> causes it to be called from write-region?  Note that compound-text is
> generally inappropriate for use in file I/O, as its string says (it
> can't DTRT with multibyte text).

I don't know the exact mechanism why ctext-pre-write-conversion was
summoned.  But it was where the debug-on-error brought me to, while
using a mail package 'Mew' (3.0.54).  Following is the last function
issued in Mew (mew-mark.el) where write-region was called with a
string for the argument START.

(defun mew-summary-clean-folder-cache (folder)
  "Erase Summary mode then remove and touch the cache file."
  (if (get-buffer folder)
      (save-excursion
        (set-buffer folder)
        (mew-erase-buffer)
        (set-buffer-modified-p nil)))
  (let ((cfile (mew-expand-folder folder mew-summary-cache-file)))
    (if (file-exists-p cfile)
        (write-region "" nil cfile nil 'no-msg))))

BTW, I just now tried to save this buffer and noticed that
ctext-pre-write-conversion was invoked.  It is called 3 times for
each save-buffer.  Here is the output from describe-coding-system.

-Tak


Coding system for saving this buffer:
  x -- ctext-unix

Default coding system (for new files):
  S -- sjis (alias of japanese-shift-jis)

Coding system for keyboard input:
  S -- sjis (alias of japanese-shift-jis)

Coding system for terminal output:
  S -- sjis (alias of japanese-shift-jis)

Defaults for subprocess I/O:
  decoding: S -- sjis (alias of japanese-shift-jis)

  encoding: S -- sjis (alias of japanese-shift-jis)


Priority order for recognizing coding systems when reading files:
  1. iso-2022-jp (alias: junet)
  2. japanese-iso-8bit (alias: euc-japan-1990 euc-japan euc-jp)
  3. japanese-shift-jis (alias: shift_jis sjis)
  4. iso-2022-jp-2 
  5. iso-latin-1 (alias: iso-8859-1 latin-1)
  6. iso-2022-7bit 
  7. iso-2022-8bit-ss2 
  8. emacs-mule 
  9. raw-text (alias: mew-cs-text mew-cs-text-lf mew-cs-text-crlf 
mew-cs-text-cr mew-cs-text-net)
  10. chinese-big5 (alias: big5 cn-big5)
  11. no-conversion (alias: binary)
  12. mule-utf-8 (alias: utf-8)

  Other coding systems cannot be distinguished automatically
  from these, and therefore cannot be recognized automatically
  with the present coding system priorities.

  The following are decoded correctly but recognized as iso-2022-jp-2:
    iso-2022-7bit-ss2 iso-2022-7bit-lock iso-2022-7bit-lock-ss2 iso-2022-cn 
iso-2022-cn-ext iso-2022-kr

Particular coding systems specified for certain file names:

  OPERATION     TARGET PATTERN          CODING SYSTEM(s)
  ---------     --------------          ----------------
  File I/O      "\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'"
                                        (no-conversion . no-conversion)
                "\\.tgz\\'"             (no-conversion . no-conversion)
                "\\.bz2\\'"             (no-conversion . no-conversion)
                "\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'"
                                        (no-conversion . no-conversion)
                "\\.elc\\'"             (emacs-mule . emacs-mule)
                "\\.utf\\(-8\\)?\\'"    utf-8
                "\\(\\`\\|/\\)loaddefs.el\\'"
                                        (raw-text . raw-text-unix)
                "\\.tar\\'"             (no-conversion . no-conversion)
                ""                      find-buffer-file-type-coding-system
  Process I/O   nothing specified
  Network I/O   "nntp"                  (junet-unix . junet-unix)
                110                     (no-conversion . no-conversion)
                25                      (no-conversion . no-conversion)



reply via email to

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