Commit 218feefc authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

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
parent 4f8aeb84
2014-03-17 Dmitry Gutov <dgutov@yandex.ru>
* newcomment.el (comment-beginning): If `comment-start-skip'
doesn't match, move back one char and try again. (Bug#16971)
* emacs-lisp/lisp-mode.el (lisp-mode-variables): Set
`comment-use-syntax' to t to avoid the unnecessary runtime check.
Set `comment-start-skip' to a simpler value that doesn't try to
......
......@@ -523,7 +523,12 @@ the same as `comment-search-backward'."
(when (nth 4 state)
(goto-char (nth 8 state))
(prog1 (point)
(when (looking-at comment-start-skip)
(when (or (looking-at comment-start-skip)
;; Some older modes use regexps that check the
;; char before the comment for quoting. (Bug#16971)
(save-excursion
(forward-char -1)
(looking-at comment-start-skip)))
(goto-char (match-end 0))))))
;; Can't rely on the syntax table, let's guess based on font-lock.
(unless (eq (get-text-property (point) 'face) 'font-lock-string-face)
......
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