diff options
| author | Dmitry Gutov | 2014-03-17 08:48:09 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2014-03-17 08:48:09 +0200 |
| commit | 218feefcc075f3da15c87f06fa418048ffe5ae3a (patch) | |
| tree | 6b2bfcf66218596a34a01fa0092700f1a455eaff /lisp/newcomment.el | |
| parent | 4f8aeb84b61f3be4eb0b5a7e3be0f7f8e9d5200e (diff) | |
| download | emacs-218feefcc075f3da15c87f06fa418048ffe5ae3a.tar.gz emacs-218feefcc075f3da15c87f06fa418048ffe5ae3a.zip | |
Restore compatibility with legacy comment-start-skip values
* lisp/newcomment.el (comment-beginning): If `comment-start-skip'
doesn't match, move back one char and try again.
Fixes: debbugs:16971
Diffstat (limited to 'lisp/newcomment.el')
| -rw-r--r-- | lisp/newcomment.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 710dc74077d..44e270a66ea 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -523,7 +523,12 @@ the same as `comment-search-backward'." | |||
| 523 | (when (nth 4 state) | 523 | (when (nth 4 state) |
| 524 | (goto-char (nth 8 state)) | 524 | (goto-char (nth 8 state)) |
| 525 | (prog1 (point) | 525 | (prog1 (point) |
| 526 | (when (looking-at comment-start-skip) | 526 | (when (or (looking-at comment-start-skip) |
| 527 | ;; Some older modes use regexps that check the | ||
| 528 | ;; char before the comment for quoting. (Bug#16971) | ||
| 529 | (save-excursion | ||
| 530 | (forward-char -1) | ||
| 531 | (looking-at comment-start-skip))) | ||
| 527 | (goto-char (match-end 0)))))) | 532 | (goto-char (match-end 0)))))) |
| 528 | ;; Can't rely on the syntax table, let's guess based on font-lock. | 533 | ;; Can't rely on the syntax table, let's guess based on font-lock. |
| 529 | (unless (eq (get-text-property (point) 'face) 'font-lock-string-face) | 534 | (unless (eq (get-text-property (point) 'face) 'font-lock-string-face) |