* infinite loop while editing C code: emacs 23.2
@ 2011-01-14 1:00 Jim Diamond
0 siblings, 0 replies; only message in thread
From: Jim Diamond @ 2011-01-14 1:00 UTC (permalink / raw)
To: help-gnu-emacs
For many years I've been using "my own(*)" C mode, in which I have
(require 'cc-mode).
(And yes, some of you are going to say to just customize cc mode, but
I'd prefer not to do that.)
"Recently" ((*cough*) emacs 21 or 22, IIRC), a problem has cropped up.
I can repeatedly reproduce the problem as follows:
- fire up a new emacs,
- start editing a C program,
- and type
#d<space>sd(
it goes into an apparently infinite loop.
I have
(define-abbrev zsd-c-mode-abbrev-table "#d" "#define " nil)
so after typing
#d<space>sd the line looks like
#define sd
and when I type the '(' the '(' does not appear on the screen.
If, before I do this, I (setq debug-on-quit t), the Backtrace buffer shows
debugger entered--Lisp error: (quit)
c-neutralize-CPP-line(2 16)
c-extend-and-neutralize-syntax-in-CPP(15 16 0)
c-after-change(15 16 0)
Looking at the code in cc-mode.el I'm at a bit of a loss at to what
the issue is.
Interestingly, this infinite loop does not happen all the time. If,
after quitting with ^G, I finish that line and then continue to add
more similar #define lines, the other ones don't cause any problems.
(I can't say for certain whether or not in some other situation the
problem re-occurs.)
I also have the possibly-relevant code
(defvar zsd-c-mode-abbrev-table nil
"Abbrev table in use in zsd-c-mode buffers."
)
(define-abbrev-table 'zsd-c-mode-abbrev-table ())
(define-abbrev zsd-c-mode-abbrev-table "#d" "#define " nil)
(setq local-abbrev-table zsd-c-mode-abbrev-table)
(defvar zsd-c-mode-syntax-table nil
"Syntax table in use in zsd-c-mode buffers."
)
(setq zsd-c-mode-syntax-table (make-syntax-table))
(c-populate-syntax-table zsd-c-mode-syntax-table)
(modify-syntax-entry ?# "w" zsd-c-mode-syntax-table)
z(set-syntax-table zsd-c-mode-syntax-table)
I realize that without seeing my whole mode file, others are probably
shooting in the dark. But having said that...
Any ideas? Any suggestions on what I should do next to debug this
problem? My C mode worked benevolently for many years, starting with
emacs 18.<something>; I should have chased this down when I first
noticed it, but I decided to quit procrastinating on this one today.
Thanks.
Jim
(*) In fact, it is a heavily-modified version of something I came
across when I first started using emacs.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-01-14 1:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14 1:00 infinite loop while editing C code: emacs 23.2 Jim Diamond
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).