Commit 14b8c3d9 authored by Alan Mackenzie's avatar Alan Mackenzie
Browse files

Make CC Mode not hang when _some_ lines end in CRLF. Bug #11841.

cc-engine.el (c-backward-comments): Add code to work around
`forward-comment' not recognizing ^M as whitespace.
parent da187191
2012-12-11 Alan Mackenzie <acm@muc.de>
Make CC Mode not hang when _some_ lines end in CRLF. Bug #11841.
* progmodes/cc-engine.el (c-backward-comments): Add code to work
around `forward-comment' not recognizing ^M as whitespace.
2012-12-11 Fabián Ezequiel Gallina <fgallina@cuca>
* progmodes/python.el (python-skeleton-class)
......
......@@ -1452,8 +1452,21 @@ comment at the start of cc-engine.el for more info."
;; return t when moving backwards at bob.
(not (bobp))
(if (let (open-paren-in-column-0-is-defun-start)
(forward-comment -1))
(if (let (open-paren-in-column-0-is-defun-start moved-comment)
(while
(and (not (setq moved-comment (forward-comment -1)))
;; Cope specifically with ^M^J here -
;; forward-comment sometimes gets stuck after ^Ms,
;; sometimes after ^M^J.
(or
(when (eq (char-before) ?\r)
(backward-char)
t)
(when (and (eq (char-before) ?\n)
(eq (char-before (1- (point))) ?\r))
(backward-char 2)
t))))
moved-comment)
(if (looking-at "\\*/")
;; Emacs <= 20 and XEmacs move back over the
;; closer of a block comment that lacks an opener.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment