]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-mask-paragraph): Avoid invalid search
authorMartin Rudalics <rudalics@gmx.at>
Sat, 8 Dec 2007 09:55:50 +0000 (09:55 +0000)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 8 Dec 2007 09:55:50 +0000 (09:55 +0000)
bound error in block comment branch.

lisp/ChangeLog
lisp/progmodes/cc-cmds.el

index 30be1ca08869cf691cccfb0c641e82a70a695a36..7608273c9bfa139cd2d48919e5c168368f365e3e 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-08  Martin Rudalics  <rudalics@gmx.at>
+
+       * progmodes/cc-cmds.el (c-mask-paragraph): Avoid invalid search
+       bound error in block comment branch.
+
 2007-12-08  David Kastrup  <dak@gnu.org>
 
        * textmodes/reftex.el (reftex-select-with-char):
index db052c4b8f52d8611b57aea903efa4d10cf211b8..06c0946290bdb34124304639ec577bc5f0f57ecd 100644 (file)
@@ -3864,7 +3864,12 @@ command to conveniently insert and align the necessary backslashes."
                  (save-excursion
                    (goto-char (cdr c-lit-limits))
                    (beginning-of-line)
-                   (and (search-forward-regexp
+                   ;; The following conjunct was added to avoid an
+                   ;; "Invalid search bound (wrong side of point)"
+                   ;; error in the subsequent re-search.  Maybe
+                   ;; another fix would be needed (2007-12-08).
+                   (and (> (- (cdr c-lit-limits) 2) (point))
+                        (search-forward-regexp
                          (concat "\\=[ \t]*\\(" c-current-comment-prefix "\\)")
                          (- (cdr c-lit-limits) 2) t)
                         (not (search-forward-regexp