From: Michael T. <mt...@bb...> - 2005-03-22 16:37:34
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> There has been an annoying bug in recent xemacs builds which (I suspect) can be traced to the following changelog entry:<br> <br> <blockquote>2004-08-11 Martin Stjernholm <a class="moz-txt-link-rfc2396E" href="mailto:bug...@gn..."><bug...@gn...></a><br> * cc-engine.el (c-syntactic-re-search-forward): Fixed bug so that<br> it doesn't go past the closing paren when PAREN-LEVEL is used.<br> Reordered the syntax checks to get more efficient skipping in some<br> situations.<br> </blockquote> <br> The symptom I see is that during edit sessions of java files (in xemacs -vanilla), typing a line like:<br> <blockquote>Someclass foo = <br> </blockquote> will result in a warning buffer being exposed with the following message:<br> <blockquote>(warning/warning) Error caught in `font-lock-pre-idle-hook': (errorInvalid search limit (wrong side of point))<br> </blockquote> The top of the associated backtrace looks like:<br> <blockquote> # bind (standard-output stack-trace-on-signal debug-on-signal stack-trace-on-error debug-on-error)<br> signal(error ("Invalid search limit (wrong side of point)"))<br> byte-code("..." [start err signal] 3)<br> # bind (err start tmp search-pos state state-pos check-pos check-state last-token-end-pos found lookbehind-submatch not-inside-token paren-level noerror bound regexp)<br> c-syntactic-re-search-forward("[;,{]" 1036 move t)<br> # bind (c-record-type-identifiers c-record-ref-identifiers pos next-pos id-start id-end paren-depth id-face got-init c-last-identifier-range separator-prop types list limit)<br> c-font-lock-declarators(1036 t nil)<br> # (unwind-protect ...)<br> # bind (match-data -match-end-pos- parse-sexp-lookup-properties limit)<br> #<compiled-function (limit) "...(93)" [parse-sexp-lookup-properties face start end limit -match-end-pos- nil boundp re-search-forward t 0 c-skip-comments-and-strings match-data (...) 1 font-lock-type-face put-nonduplicable-text-property font-lock (...) c-forward-sws (...) c-font-lock-declarators c-known-type-key match-data match-data match-data] 5>(1036)<br> # bind (highlights matcher keyword nkeywords iter old-progress progress bufname keywords case-fold-search loudly loudvar end start)<br> font-lock-fontify-keywords-region(1016 1036 nil)<br> # (unwind-protect ...)<br> # bind (modified buffer-undo-list inhibit-read-only old-syntax-table buffer-file-name buffer-file-truename loudly end beg)<br> font-lock-default-fontify-region(1016 1036 nil)<br> # bind (loudly end beg)<br> font-lock-fontify-region(1016 1036)<br> </blockquote> <br> The proximal cause is marked in the code below (from the 20040814 release):<br> <blockquote>(defun c-font-lock-declarators (limit list types)<br> ...<br> (cond ((eq id-face 'font-lock-function-name-face)<br> ;; Skip a parenthesized initializer (C++) or a function<br> ;; prototype.<br> (if (c-safe (c-forward-sexp 1) t)<br> (c-forward-syntactic-ws limit)<br> (goto-char limit)))<br> <br> (got-init<br> ;; Skip an initializer expression. If we're at a '='<br> ;; then accept a brace list directly after it to cope<br> ;; with array initializers. Otherwise stop at braces<br> ;; to avoid going past full function and class blocks.<br> (and (if (and (eq got-init ?=)<br> (= (c-forward-token-2) 0)<br> (looking-at "{"))<br> (c-safe (c-forward-sexp) t)<br> t)<br> ;; BUG? The following line blows out because (not (< (point) limit)) !!<br> (c-syntactic-re-search-forward "[;,{]" limit 'move t)<br> (backward-char)))<br> <br> (t (c-forward-syntactic-ws limit)))<br> ...<br> nil)<br> </blockquote> <br> I've been using a workaround that merely replaces my "BUG" comment line above with a (< (point) limit) expression. I'll not claim that this is the corrent fix, but it works for me (so far) without introducing other obvious problems.<br> <br> Thanks,<br> Michael Thome<br> <a class="moz-txt-link-abbreviated" href="mailto:mt...@bb...">mt...@bb...</a><br> <br> PS bug-cc-mode doesn't appear on the gnu mailman list - not sure if there are archives somewhere, so I understand this may be a redundant report.<br> </body> </html> |