aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2014-03-17 08:48:09 +0200
committerDmitry Gutov2014-03-17 08:48:09 +0200
commit218feefcc075f3da15c87f06fa418048ffe5ae3a (patch)
tree6b2bfcf66218596a34a01fa0092700f1a455eaff
parent4f8aeb84b61f3be4eb0b5a7e3be0f7f8e9d5200e (diff)
downloademacs-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
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/newcomment.el7
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5f348fbc499..b3f9a9073f6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12014-03-17 Dmitry Gutov <dgutov@yandex.ru> 12014-03-17 Dmitry Gutov <dgutov@yandex.ru>
2 2
3 * newcomment.el (comment-beginning): If `comment-start-skip'
4 doesn't match, move back one char and try again. (Bug#16971)
5
3 * emacs-lisp/lisp-mode.el (lisp-mode-variables): Set 6 * emacs-lisp/lisp-mode.el (lisp-mode-variables): Set
4 `comment-use-syntax' to t to avoid the unnecessary runtime check. 7 `comment-use-syntax' to t to avoid the unnecessary runtime check.
5 Set `comment-start-skip' to a simpler value that doesn't try to 8 Set `comment-start-skip' to a simpler value that doesn't try to
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)