emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116779: Restore compatibility with legacy comment-s


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r116779: Restore compatibility with legacy comment-start-skip values
Date: Mon, 17 Mar 2014 06:48:28 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116779
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16971
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Mon 2014-03-17 08:48:09 +0200
message:
  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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/newcomment.el             
newcomment.el-20091113204419-o5vbwnq5f7feedwu-1719
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-03-17 06:22:58 +0000
+++ b/lisp/ChangeLog    2014-03-17 06:48:09 +0000
@@ -1,5 +1,8 @@
 2014-03-17  Dmitry Gutov  <address@hidden>
 
+       * 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

=== modified file 'lisp/newcomment.el'
--- a/lisp/newcomment.el        2014-01-01 07:43:34 +0000
+++ b/lisp/newcomment.el        2014-03-17 06:48:09 +0000
@@ -523,7 +523,12 @@
         (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]