all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: emacs18@gmail.com
To: 8998@debbugs.gnu.org
Subject: bug#8998: further analysis of the problem
Date: Mon, 04 Jul 2011 20:50:32 -0700	[thread overview]
Message-ID: <qtmliwdcrnb.fsf@gmail.com> (raw)
In-Reply-To: <qtmy60dd047.fsf@gmail.com>

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.





  parent reply	other threads:[~2011-07-05  3:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05  0:47 bug#8998: 24.0.50; expand-abbrev goes into infinite loop Richard Kim
2011-07-05  2:14 ` bug#8998: culprit found emacs18
2011-07-05  3:50 ` emacs18 [this message]
2011-07-05 18:28   ` bug#8998: further analysis of the problem Stefan Monnier
     [not found]     ` <qtm39ikiij3.fsf@gmail.com>
2011-07-06  1:09       ` Stefan Monnier
2011-07-05 15:32 ` bug#8998: #8999 seems to be duplicate of #8998 Richard Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=qtmliwdcrnb.fsf@gmail.com \
    --to=emacs18@gmail.com \
    --cc=8998@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.