diff options
| author | Alan Mackenzie | 2008-02-25 21:15:50 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2008-02-25 21:15:50 +0000 |
| commit | d70e24224531b98a13bc1d7fcdca0265c44950bb (patch) | |
| tree | 835d4d3c28cc67e7b61175808c5418dc768733c0 | |
| parent | af9b45f99c6d953f1fd9d820889d59d551c0f8b0 (diff) | |
| download | emacs-d70e24224531b98a13bc1d7fcdca0265c44950bb.tar.gz emacs-d70e24224531b98a13bc1d7fcdca0265c44950bb.zip | |
(c-neutralize-syntax-in-CPP): Fix a bug on typing "#" at EOB.
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 9a1a66010b1..db71bf33408 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -845,13 +845,11 @@ Note that the style variables are always made local to the buffer." | |||
| 845 | (if (setq limits (c-literal-limits)) | 845 | (if (setq limits (c-literal-limits)) |
| 846 | (goto-char (cdr limits))) | 846 | (goto-char (cdr limits))) |
| 847 | 847 | ||
| 848 | (while (and (< (point) end) | 848 | (while (search-forward-regexp c-anchored-cpp-prefix end t) |
| 849 | (search-forward-regexp c-anchored-cpp-prefix end t)) | ||
| 850 | (when (c-beginning-of-macro) ; Guard against being in a string/comment. | 849 | (when (c-beginning-of-macro) ; Guard against being in a string/comment. |
| 851 | (setq mbeg (point)) | 850 | (setq mbeg (point)) |
| 852 | (c-end-of-macro) ; Do we need to go forward 1 char here? No! | 851 | (c-end-of-macro) ; Do we need to go forward 1 char here? No! |
| 853 | (c-neutralize-CPP-line mbeg (point))) | 852 | (c-neutralize-CPP-line mbeg (point)))))) ; We might still be in a comment - this is OK. |
| 854 | (forward-char)))) ; We might still be in a comment - this is OK. | ||
| 855 | 853 | ||
| 856 | (defun c-before-change (beg end) | 854 | (defun c-before-change (beg end) |
| 857 | ;; Function to be put on `before-change-function'. Primarily, this calls | 855 | ;; Function to be put on `before-change-function'. Primarily, this calls |