Subject: bug#8986: 23.2; python-mode templates corrupt abbrevs

From: Stefan Monnier <[email-masked]>
Date: Sun, 03 Jul 2011 21:00:03 -0400

>  `emacs -Q':

> When editing abbrevs, the fourth slot may take a hook
> which is performed after abbrev is inserted. python.el
> skeletons use it.

> Now, when other abbrevs come in and the slot remains
> empty, some bug take the previous expansion and puts it
> into the empty slot.

> In the example below: in the first and third line
> wrongly "class" and "def" was auto-inserted by bug,
> whilst the entry was deleted previously.

> In the consequence abbrevs inserted by hand get
> corrupted and vanish.

I am sorry to say that I do not understand this bug report.
You show us an abbrev-table but without telling us what you did to get
this and what else you expected to see.

        Stefan

> Thanks,

> Andreas

> ;;;;;;;;

> (python-mode-abbrev-table)

> "cb"           4    "@command('bookmarks',"  "class"
> "class" (sys)       0 ""                     python-insert-class
> "cr"           1    "class Raclette:"        "def"
> "def" (sys)         0 ""                     python-insert-def
> "for" (sys)         0 ""                     python-insert-for
> "if" (sys)          0 ""                     python-insert-if
> "try/except" (sys)  0 ""                     python-insert-try/except
> "try/finally" (sys) 0 ""                     python-insert-try/finally
> "while" (sys)       0 ""                     python-insert-while

> If Emacs crashed, and you have the Emacs process in the gdb debugger,
> please include the output from the following gdb commands:
>     `bt full' and `xbacktrace'.
> For information about debugging Emacs, please read the file
> /usr/share/emacs/23.2/etc/DEBUG.

> In GNU Emacs 23.2.1 (i586-suse-linux-gnu, GTK+ Version 2.22.1)
>  of 2011-02-22
> Windowing system distributor `The X.Org Foundation', version 11.0.10903000
> configured using `configure  '--with-pop' '--without-hesiod'
> --with-kerberos' '--with-kerberos5' '--with-xim' '--enable-autodepend'
> --prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info'
> --datadir=/usr/share' '--localstatedir=/var' '--sharedstatedir=/var/lib'
> --libexecdir=/usr/lib' '--with-x' '--with-sound' '--with-sync-input'
> --with-xpm' '--with-jpeg' '--with-tiff' '--with-gif' '--with-png'
> --with-rsvg' '--with-dbus' '--without-gpm' '--with-x-toolkit=gtk'
> --x-includes=/usr/include' '--x-libraries=/usr/lib:/usr/share/X11'
> --with-xft' '--with-libotf' '--with-m17n-flt' '--build=i586-suse-linux'
> build_alias=i586-suse-linux' 'CC=gcc-4.3'
> CFLAGS=-fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -D_GNU_SOURCE -std=gnu89 -pipe -Wno-pointer-sign -Wno-unused-variable -Wno-unused-label -Wno-unprototyped-calls -fno-optimize-sibling-calls -DSYSTEM_PURESIZE_EXTRA=55000 	 -DSITELOAD_PURESIZE_EXTRA=10000
> LDFLAGS=-Wl,-O2 -Wl,--hash-size=65521''

> 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=local
>   locale-coding-system: utf-8-unix
>   default enable-multibyte-characters: t

> Major mode: Edit-Abbrevs

> Minor modes in effect:
>   tooltip-mode: t
>   mouse-wheel-mode: t
>   tool-bar-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-encryption-mode: t
>   auto-compression-mode: t
>   line-number-mode: t
>   transient-mark-mode: t

> Recent input:
> C-x C-f <up> . a <backspace> <backspace> a b <backspace>
> e r <tab> <backspace> <backspace> e <tab> <backspace>
> r <tab> b <tab> e m <tab> p y t <tab> t <tab> <backspace>
> <tab> i <backspace> e i <tab> t g <tab> <backspace>
> <tab> . <tab> <return> M-x e d i <tab> t <tab> - a
> <backspace> <backspace> a <tab> <return> C-s p y t
> h o n - m o d <right> M-x r e p o r t - r <backspace>
> e m a c s - b u <tab> <return>

> Recent messages:
> For information about GNU Emacs and the GNU system, type C-h C-a.
> goto-history-element: Beginning of history; no preceding item
> Making completion list...
> tqs.py has auto save data; consider M-x recover-this-file
> Making completion list...
> Mark saved where search started

> Load-path shadows:
> /usr/share/emacs/site-lisp/suse-start-xslide hides
> /usr/share/emacs/site-lisp/xslide/suse-start-xslide
> /usr/share/emacs/site-lisp/psgml/make-regexp hides
> /usr/share/emacs/site-lisp/ess-5.13/lisp/make-regexp
> /usr/share/emacs/site-lisp/flim/md4 hides /usr/share/emacs/23.2/lisp/md4
> /usr/share/emacs/site-lisp/ruby-mode hides
> /usr/share/emacs/23.2/lisp/progmodes/ruby-mode
> /usr/share/emacs/site-lisp/nxml-mode/nxml-mode hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-mode
> /usr/share/emacs/site-lisp/nxml-mode/rng-cmpct hides
> /usr/share/emacs/23.2/lisp/nxml/rng-cmpct
> /usr/share/emacs/site-lisp/nxml-mode/rng-nxml hides
> /usr/share/emacs/23.2/lisp/nxml/rng-nxml
> /usr/share/emacs/site-lisp/nxml-mode/rng-uri hides
> /usr/share/emacs/23.2/lisp/nxml/rng-uri
> /usr/share/emacs/site-lisp/nxml-mode/nxml-enc hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-enc
> /usr/share/emacs/site-lisp/nxml-mode/nxml-glyph hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-glyph
> /usr/share/emacs/site-lisp/nxml-mode/rng-dt hides
> /usr/share/emacs/23.2/lisp/nxml/rng-dt
> /usr/share/emacs/site-lisp/nxml-mode/nxml-ns hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-ns
> /usr/share/emacs/site-lisp/nxml-mode/nxml-maint hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-maint
> /usr/share/emacs/site-lisp/nxml-mode/nxml-outln hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-outln
> /usr/share/emacs/site-lisp/nxml-mode/nxml-rap hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-rap
> /usr/share/emacs/site-lisp/nxml-mode/rng-parse hides
> /usr/share/emacs/23.2/lisp/nxml/rng-parse
> /usr/share/emacs/site-lisp/nxml-mode/xmltok hides
> /usr/share/emacs/23.2/lisp/nxml/xmltok
> /usr/share/emacs/site-lisp/nxml-mode/xsd-regexp hides
> /usr/share/emacs/23.2/lisp/nxml/xsd-regexp
> /usr/share/emacs/site-lisp/nxml-mode/rng-util hides
> /usr/share/emacs/23.2/lisp/nxml/rng-util
> /usr/share/emacs/site-lisp/nxml-mode/nxml-uchnm hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-uchnm
> /usr/share/emacs/site-lisp/nxml-mode/nxml-util hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-util
> /usr/share/emacs/site-lisp/nxml-mode/rng-xsd hides
> /usr/share/emacs/23.2/lisp/nxml/rng-xsd
> /usr/share/emacs/site-lisp/nxml-mode/rng-valid hides
> /usr/share/emacs/23.2/lisp/nxml/rng-valid
> /usr/share/emacs/site-lisp/nxml-mode/nxml-parse hides
> /usr/share/emacs/23.2/lisp/nxml/nxml-parse
> /usr/share/emacs/site-lisp/nxml-mode/rng-maint hides
> /usr/share/emacs/23.2/lisp/nxml/rng-maint
> /usr/share/emacs/site-lisp/nxml-mode/rng-pttrn hides
> /usr/share/emacs/23.2/lisp/nxml/rng-pttrn
> /usr/share/emacs/site-lisp/nxml-mode/rng-loc hides
> /usr/share/emacs/23.2/lisp/nxml/rng-loc
> /usr/share/emacs/site-lisp/nxml-mode/rng-match hides
> /usr/share/emacs/23.2/lisp/nxml/rng-match
> /usr/share/emacs/site-lisp/flim/hmac-md5 hides
> /usr/share/emacs/23.2/lisp/net/hmac-md5
> /usr/share/emacs/site-lisp/flim/sasl-digest hides
> /usr/share/emacs/23.2/lisp/net/sasl-digest
> /usr/share/emacs/site-lisp/flim/sasl hides
> /usr/share/emacs/23.2/lisp/net/sasl
> /usr/share/emacs/site-lisp/flim/hmac-def hides
> /usr/share/emacs/23.2/lisp/net/hmac-def
> /usr/share/emacs/site-lisp/flim/sasl-ntlm hides
> /usr/share/emacs/23.2/lisp/net/sasl-ntlm
> /usr/share/emacs/site-lisp/flim/sasl-cram hides
> /usr/share/emacs/23.2/lisp/net/sasl-cram
> /usr/share/emacs/site-lisp/flim/ntlm hides
> /usr/share/emacs/23.2/lisp/net/ntlm

> Features:
> (shadow sort mail-extr message idna sendmail regexp-opt ecomplete rfc822
> mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap
> mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader
> gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit
> mailheader canlock sha1 hex-util hashcash mail-utils emacsbug
> multi-isearch python-21 python comint ring help-mode easymenu view lpr
> disp-table tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win
> x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register
> page menu-bar rfn-eshadow timer select scroll-bar mldrag 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 system-font-setting
> font-render-setting gtk x-toolkit x multi-tty emacs)