Issue844

classification
Title cc-mode parse errors on buffers that aren't source code
Type defect Module cc-mode
Severity some work obstructed Platform x86_64, unix
Keywords Nosy List
explanation
process
These controls should only be changed by committers and tracker administrators.
Status new   Reason
Superseder  
Priority normal   Assigned To

Created on 2012-10-02.00:56:33 by mike.kupfer, last changed 2012-12-10.03:35:30 by mike.kupfer.

Files
File name Uploaded Type Edit Remove
desc mike.kupfer, 2012-10-02.00:56:32 application/octet-stream
Messages
msg2459 [hidden] ([hidden]) Date: 2012-12-10.03:35:29
Some additional information from Jeff Mincy:

Date: Mon, 12 Nov 2012 09:53:42 -0500

 
The problem is that  c-emacs-features has 'add-hook-local in cc-defs.el

This code returns t in 21.4.22 which causes 'add-hook-local to be
added to c-emacs-features

        (let ((buf1 (generate-new-buffer " test1"))
	      (buf2 (generate-new-buffer " test2"))
	      changed)
	  
	  (save-excursion		; Needed for XEmacs's byte compiler
	    (set-buffer buf1)
	    (add-hook 'after-change-functions
		      (lambda (beg end old-len) (setq changed t))
		      nil
		      t)
	    (set-buffer buf2)
	    (insert ?c)
	    (set-buffer buf1)
	    (remove-hook 'after-change-functions
			 (lambda (beg end old-len) (setq changed t))
			 t)
	    (kill-buffer buf1)
	    (kill-buffer buf2)
	    (not changed)))

In 21.4.22 the add-hook sets the global hook.  There seems to be
something preventing the after-change-functions hook from becoming
active immediately after it is added.
msg2450 [hidden] ([hidden]) Date: 2012-10-02.00:58:50
Oops, here's the key information from the "desc" (description) 
attachment.

With cc-mode 1.55 I frequently got an error when refiling a message
using MH-E 8.0.3 after visiting a C source code file.  The Lisp stack
trace looked like this:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  looking-at(nil)
  c-beginning-of-current-token()
  c-unfind-enclosing-token(38)
  c-before-change(1 38)
  erase-buffer()
  mail-extract-address-components("Janne Jokitalo 
<astraljava@kapsi.fi>")
  mh-folder-from-address()
  mh-prompt-for-refile-folder()
  (intern (mh-prompt-for-refile-folder))
  (list (mh-interactive-range "Refile") (intern (mh-prompt-for-refile-
folder)))
  call-interactively(mh-refile-msg)

This is with XEmacs 21.4.22.  I do not
see the problem with XEmacs 21.5.31+0df3cedee9ac, nor do I see it with
21.4.22 and the stable version of cc-mode (1.45 package).

The debugger tells me that the current buffer for the error is

  #<buffer " *extract address components*">

and its major-mode is fundamental-mode.

So it's odd that a C-mode function is getting invoked here.

If I do 

    M-: before-change-functions

in an MH-E folder buffer, I get different results for 21.4 and 21.5.

21.4 (cc-mode 1.55): (c-before-change)

21.4 (cc-mode 1.45): nil

21.5 (cc-mode 1.55): nil

I don't know where the bug is here, so I'm filing against cc-mode to
start.

With cc-mode 1.57 I got a similar error when trying to insert an <h4>
line in an HTML file using psgml (C-c C-e h4 RET).
History
Date User Action Args
2012-12-10 03:35:30mike.kupfersetmessages: + msg2459
2012-10-02 00:58:51mike.kupfersetmessages: + msg2450
2012-10-02 00:56:33mike.kupfercreate