diff options
| author | Alan Mackenzie | 2016-07-14 12:42:17 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2016-07-14 12:42:17 +0000 |
| commit | d0dc74a3a8bc59df3ca88810710d1234a9a08920 (patch) | |
| tree | 0ef26158e627e3b824de684befada782150db79e | |
| parent | 453f883ef81388c39193b9289ef703954e9bc270 (diff) | |
| download | emacs-d0dc74a3a8bc59df3ca88810710d1234a9a08920.tar.gz emacs-d0dc74a3a8bc59df3ca88810710d1234a9a08920.zip | |
CC Mode: correct incorrect invocation of parse-partial-sexp.
Fixes bug #23944.
* lisp/progmodes/cc-engine.el (c-literal-limits): make the sixth argument of
an invocation of parse-partial-sexp 'syntax-table, not the fourth.
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 8648bece70a..51d278f354d 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -2326,7 +2326,7 @@ comment at the start of cc-engine.el for more info." | |||
| 2326 | ((nth 7 s) 'c++) | 2326 | ((nth 7 s) 'c++) |
| 2327 | (t 'c))) | 2327 | (t 'c))) |
| 2328 | (list s ty (nth 8 s))) | 2328 | (list s ty (nth 8 s))) |
| 2329 | 2329 | ||
| 2330 | ((and (not not-in-delimiter) ; inside a comment starter | 2330 | ((and (not not-in-delimiter) ; inside a comment starter |
| 2331 | (not (bobp)) | 2331 | (not (bobp)) |
| 2332 | (progn (backward-char) | 2332 | (progn (backward-char) |
| @@ -2335,12 +2335,12 @@ comment at the start of cc-engine.el for more info." | |||
| 2335 | (looking-at c-comment-start-regexp)))) | 2335 | (looking-at c-comment-start-regexp)))) |
| 2336 | (setq ty (if (looking-at c-block-comment-start-regexp) 'c 'c++)) | 2336 | (setq ty (if (looking-at c-block-comment-start-regexp) 'c 'c++)) |
| 2337 | (list s ty (point))) | 2337 | (list s ty (point))) |
| 2338 | 2338 | ||
| 2339 | (t (list s))))))) | 2339 | (t (list s))))))) |
| 2340 | 2340 | ||
| 2341 | (defun c-state-full-pp-to-literal (here &optional not-in-delimiter) | 2341 | (defun c-state-full-pp-to-literal (here &optional not-in-delimiter) |
| 2342 | ;; This function will supersede c-state-pp-to-literal. | 2342 | ;; This function will supersede c-state-pp-to-literal. |
| 2343 | ;; | 2343 | ;; |
| 2344 | ;; Do a parse-partial-sexp from a position in the buffer before HERE which | 2344 | ;; Do a parse-partial-sexp from a position in the buffer before HERE which |
| 2345 | ;; isn't in a literal, and return information about HERE, either: | 2345 | ;; isn't in a literal, and return information about HERE, either: |
| 2346 | ;; (STATE TYPE (BEG . END)) if HERE is in a literal; or | 2346 | ;; (STATE TYPE (BEG . END)) if HERE is in a literal; or |
| @@ -4821,8 +4821,9 @@ comment at the start of cc-engine.el for more info." | |||
| 4821 | (when (or (nth 3 s) (nth 4 s)) | 4821 | (when (or (nth 3 s) (nth 4 s)) |
| 4822 | (cons (nth 8 s) | 4822 | (cons (nth 8 s) |
| 4823 | (progn (parse-partial-sexp (point) (point-max) | 4823 | (progn (parse-partial-sexp (point) (point-max) |
| 4824 | nil 'syntax-table | 4824 | nil nil |
| 4825 | s) | 4825 | s |
| 4826 | 'syntax-table) | ||
| 4826 | (point))))) | 4827 | (point))))) |
| 4827 | (let ((pp-to-lit (c-state-full-pp-to-literal pos not-in-delimiter))) | 4828 | (let ((pp-to-lit (c-state-full-pp-to-literal pos not-in-delimiter))) |
| 4828 | (car (cddr pp-to-lit)))))) | 4829 | (car (cddr pp-to-lit)))))) |