GNU bug report logs - #8998
24.0.50; expand-abbrev goes into infinite loop

Previous Next

Package: emacs;

Reported by: Richard Kim <emacs18 <at> gmail.com>

Date: Tue, 5 Jul 2011 00:48:01 UTC

Severity: normal

Merged with 8999

Found in version 24.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: emacs18 <at> gmail.com
To: 8998 <at> debbugs.gnu.org
Subject: bug#8998: further analysis of the problem
Date: Mon, 04 Jul 2011 20:50:32 -0700
I did some further investigation and have more information to share.

The recent change made in `define-derived-mode' adds :parents abbrev
property to the derived mode's abbrev table, e.g.,
`lisp-interaction-mode-abbrev-table'.  Unfortunately this results in
cyclic data where :parent abbrev property of
lisp-interaction-mode-abbrev-table is itself, i.e., the following is
true:

  (eq 
   lisp-interaction-mode-abbrev-table
   (car (abbrev-table-get lisp-interaction-mode-abbrev-table :parents)))

This cyclic relationship (i.e., being its own parent) causes infinite
loop within `abbrev-symbol' which has code similar to this:

  (while tables
    (setq table (pop tables))
    (setq tables (append (abbrev-table-get table :parents) tables))
    ...)

This loop within `abbrev-symbol' in conjunction with
lisp-interaction-mode-abbrev-table being its own parent causes the
infinite loop.

Why is `lisp-interaction-mode-abbrev-table' its own parent?
I think the answer is that the following items have something to do with
it.

A. lisp-interaction-mode and emacs-lisp-mode are both defined via 
   define-derived-mode macro.

B. Both modes call `lisp-mode-variables' utility function which sets
   local-abbrev-table.

C. define-derived-mode macro uses local-abbrev-table as the value of
   parent *before* setting it, i.e., it uses the value of
   local-abbrev-table (whatever it is) as the parent!

I hope this helps.




This bug report was last modified 14 years and 19 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.