Subject: bug#8108: 24.0.50; debugging pre-write-conversion in define-coding-system

From: Werner LEMBERG <[email-masked]>
Date: Thu, 24 Feb 2011 08:40:58 +0100 (CET)

----------------------------------------------------------------------

I'm updating my cjk-enc.el package (part of the CJK bundle for LaTeX)
to replace make-coding-system with define-coding-system.  However, I
can't debug it.

In previous Emacs versions, I've instrumented the function used for
the pre-write-conversion hook, and the debugger correctly stops there.
However, with a recent Emacs (bzr version 103411 from today) this no
longer works.  Is this a bug?  Am I missing something?

Here's an example, defining an encoding called `foo-coding'.  Trying
to instrument `foo-encode', then saving an arbitrary test file with
`foo-coding', the debugger doesn't get invoked.

(define-coding-system
  'foo-coding
  "Coding-system foo"
  :mnemonic ?c
  :coding-type 'emacs-mule
  :charset-list '(ascii)
  :pre-write-conversion 'foo-encode)

(defun foo-encode (from to)
  (insert "foo"))

----------------------------------------------------------------------

In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.22.1)
 of 2011-02-24 on linux-nvf0.site
Windowing system distributor `The X.Org Foundation', version 11.0.10903000
configured using `configure  'MAKEINFO=/usr/bin/makeinfo''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Summary

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  transient-mark-mode: t

Recent input:
M-x m e w <return> <return> d d SPC d d x i <return> 
d x M-x e m a c s - v e <tab> <tab> <return> g B a 
<tab> <return> C-r e m a c s C-r C-a <return> M-x e 
m a c s - b <tab> C-g b u f <backspace> <backspace> 
b u g <tab> <tab> C-g M-x e m a c s - <tab> C-g M-x 
b u g <tab> <tab> C-g M-x r e p o <tab> r t <tab> 
<return>

Recent messages:
Refiling and deleting...done
GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.22.1) of 2011-02-24 on linux-nvf0.site
Scanning +Backup...done
Mark saved where search started
Quit [2 times]
Making completion list...
Quit
Making completion list...
Quit
Making completion list...

Load-path shadows:
None found.

Features:
(shadow emacsbug url-util url-parse auth-source eieio byte-opt
bytecomp byte-compile assoc gnus-util time-date password-cache
url-vars mm-util mail-prsvr multi-isearch pp mew-varsx mew-unix
cal-menu calendar cal-loaddefs mew-auth mew-config mew-imap2 mew-imap
mew-nntp2 mew-nntp mew-pop mew-smtp mew-ssl mew-ssh mew-net
mew-highlight mew-sort mew-fib mew-ext mew-refile mew-demo mew-attach
mew-draft mew-message mew-thread mew-virtual mew-summary4 mew-summary3
mew-summary2 mew-summary mew-search mew-pick mew-passwd mew-scan
mew-syntax mew-bq mew-smime mew-pgp mew-header mew-exec mew-mark
mew-mime mew-edit mew-decode mew-encode mew-cache mew-minibuf
mew-complete mew-addrbook mew-local mew-vars3 mew-vars2 mew-vars
mew-env mew-mule3 mew-mule mew-gemacs mew-key mew-func mew-blvs
mew-const mew tex regexp-opt advice help-fns advice-preload tex-site
auto-loads quail help-mode easymenu view cjktilde disp-table tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image fringe lisp-mode register page menu-bar rfn-eshadow
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces
cus-face files text-properties overlay md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)