emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107855: (hs-hide-all): Don't infloop


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107855: (hs-hide-all): Don't infloop on comments that start in the middle of the line.
Date: Wed, 11 Apr 2012 01:34:25 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107855
fixes bug(s): http://debbugs.gnu.org/10496
author: Sébastien Gross <address@hidden>
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Wed 2012-04-11 01:34:25 +0200
message:
  (hs-hide-all): Don't infloop on comments that start in the middle of the line.
modified:
  lisp/ChangeLog
  lisp/progmodes/hideshow.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-10 23:24:31 +0000
+++ b/lisp/ChangeLog    2012-04-10 23:34:25 +0000
@@ -1,3 +1,8 @@
+2012-04-10  Sébastien Gross  <address@hidden>  (tiny change)
+
+       * progmodes/hideshow.el (hs-hide-all): Don't infloop on comments
+       that start in the middle of the line (bug#10496).
+
 2012-04-10  Dan Nicolaescu  <address@hidden>
 
        * battery.el (battery-linux-proc-acpi): Only one battery is

=== modified file 'lisp/progmodes/hideshow.el'
--- a/lisp/progmodes/hideshow.el        2012-04-09 13:05:48 +0000
+++ b/lisp/progmodes/hideshow.el        2012-04-10 23:34:25 +0000
@@ -802,12 +802,15 @@
                   (forward-comment (point-max)))
                 (re-search-forward re (point-max) t))
          (if (match-beginning 1)
-             ;; we have found a block beginning
+             ;; We have found a block beginning.
              (progn
                (goto-char (match-beginning 1))
-               (if hs-hide-all-non-comment-function
-                   (funcall hs-hide-all-non-comment-function)
-                 (hs-hide-block-at-point t)))
+              (unless (if hs-hide-all-non-comment-function
+                          (funcall hs-hide-all-non-comment-function)
+                        (hs-hide-block-at-point t))
+                ;; Go to end of matched data to prevent from getting stuck
+                ;; with an endless loop.
+                (goto-char (match-end 0))))
            ;; found a comment, probably
            (let ((c-reg (hs-inside-comment-p)))
              (when (and c-reg (car c-reg))


reply via email to

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