all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: jdiamond@snipthis.AcadiaU.ca
To: help-gnu-emacs@gnu.org
Subject: cc-mode in emacs 23.2 goes into infinte loop
Date: Sat, 22 Jan 2011 18:41:37 -0400	[thread overview]
Message-ID: <slrnijmn91.9tr.Jim.Diamond@jdiamond-nb2.acadiau.ca> (raw)

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	other threads:[~2011-01-22 22:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-22 22:41 jdiamond [this message]
2011-01-23  9:54 ` cc-mode in emacs 23.2 goes into infinte loop rusi
2011-01-23 14:05   ` foo-font-lock-keywords (was Re: cc-mode in emacs 23.2 goes into infinte loop) Jorgen Grahn
2011-01-23 16:49     ` rusi
2011-01-23 19:22       ` Jim Diamond
2011-01-23 16:47   ` cc-mode in emacs 23.2 goes into infinte loop Jim Diamond
2011-01-23 17:57     ` rusi

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=slrnijmn91.9tr.Jim.Diamond@jdiamond-nb2.acadiau.ca \
    --to=jdiamond@snipthis.acadiau.ca \
    --cc=help-gnu-emacs@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.