help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cc-mode in emacs 23.2 goes into infinte loop


From: jdiamond
Subject: cc-mode in emacs 23.2 goes into infinte loop
Date: Sat, 22 Jan 2011 18:41:37 -0400
User-agent: slrn/0.9.9p1 (Linux)

I have the following file (which is actually my real mode file with
almost everything removed):

----------------- zsd-c-mode.el -------------------
(require 'cc-mode)

(eval-and-compile
   (c-add-language 'zsd-c-mode 'c-mode))

(defvar zsd-c-mode-syntax-table nil
    "Syntax table in use in zsd-c-mode buffers."
)

(defun
    zsd-c-mode ()
    "Major mode for editing C source code.
    Based loosely upon the Unipress Emacs electric-c mode."
    (interactive)
    (c-init-language-vars zsd-c-mode)
    (c-common-init 'zsd-c-mode)
    (setq zsd-c-font-lock-keywords-3 nil)
)
---------------------------------------------------

If I start up emacs 23.2 with
        emacs -Q qqq.q
and them
        M-x load-file RET ~/emacs/zsd-c-mode.el
and then
        M-x zsd-c-mode RET
and then in the buffer I type
        #define as(
when I hit the '(' emacs goes into an (apparently) infinite loop.
(The '(' does not actually appear in the buffer until I hit ^G.)

Tracking it down (a bit), I see that in cc-mode c-neutralize-CPP-line
is not doing The Right Thing any more.  Specifically,
        (c-put-char-property (nth 1 s) 'syntax-table '(1))
is not changing anything in the result of the following call to
        (parse-partial-sexp beg end -1)
and so c-neutralize-CPP-line loops.

Before I file this as a bug, are there any cc-mode experts here who
can comment on whether I am committing some grievous sin with the code
above?  (This worked in earlier versions of emacs, but perhaps the
above has suffered from bit rot by changes to emacs.)

Thanks.
                                Jim


reply via email to

[Prev in Thread] Current Thread [Next in Thread]