]> git.eshelyaron.com Git - emacs.git/commitdiff
Restore compatibility with legacy comment-start-skip values
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 17 Mar 2014 06:48:09 +0000 (08:48 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 17 Mar 2014 06:48:09 +0000 (08:48 +0200)
* lisp/newcomment.el (comment-beginning): If `comment-start-skip'
doesn't match, move back one char and try again.

Fixes: debbugs:16971
lisp/ChangeLog
lisp/newcomment.el

index 5f348fbc49955a5bb07183401108e371f5bcfe13..b3f9a9073f64c99b0dd9c256cc6bfcabecca02dc 100644 (file)
@@ -1,5 +1,8 @@
 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
index 710dc74077d499bc12d9af52dc47793e7591098a..44e270a66eabab5ce53f323346cb461d9713cf4b 100644 (file)
@@ -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)