summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Bolshakov <dmitry.bolshakov@bridge-quest.com>2011-02-19 17:20:35 -0500
committerChong Yidong <cyd@stupidchicken.com>2011-02-19 17:20:35 -0500
commita87af185c9dd68d60d5ba9076b25586a3afd0f18 (patch)
treedff05f1c7ab0c711e3764b73a1422a7f90e44aff /lisp
parent3ab713fdac16ef6ae249b3da69d69e78361f6792 (diff)
downloademacs-a87af185c9dd68d60d5ba9076b25586a3afd0f18.tar.gz
Prevent hideshow from parsing braces inside comments (Bug#8036).
* progmodes/hideshow.el (hs-find-block-beginning) (hs-hide-level-recursive): Ignore comments when parsing braces.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/progmodes/hideshow.el12
2 files changed, 20 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e0255ceb90c..2f932c3421c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
+2011-02-19 Dmitry Bolshakov <dmitry.bolshakov@bridge-quest.com>
+ Dima Kogan <dkogan@cds.caltech.edu> (tiny change)
+
+ * progmodes/hideshow.el (hs-find-block-beginning)
+ (hs-hide-level-recursive): Ignore comments when parsing braces
+ (Bug#8036).
+
+2011-02-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * vc/vc-bzr.el (vc-bzr-bound-branch-p): New function.
+ (vc-bzr-pull): Use it.
+
2011-02-19 Chong Yidong <cyd@stupidchicken.com>
* vc/vc-bzr.el (vc-bzr--branch-conf): Function deleted.
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 15a94d68735..9468d7b463e 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -689,6 +689,8 @@ Return point, or nil if original point was not in a block."
(point)
;; look backward for the start of a block that contains the cursor
(while (and (re-search-backward hs-block-start-regexp nil t)
+ (save-match-data
+ (not (nth 4 (syntax-ppss)))) ; not inside comments
(not (setq done
(< here (save-excursion
(hs-forward-sexp (match-data t) 1)
@@ -711,10 +713,12 @@ Return point, or nil if original point was not in a block."
(forward-comment (buffer-size))
(and (< (point) maxp)
(re-search-forward hs-block-start-regexp maxp t)))
- (if (> arg 1)
- (hs-hide-level-recursive (1- arg) minp maxp)
- (goto-char (match-beginning hs-block-start-mdata-select))
- (hs-hide-block-at-point t)))
+ (when (save-match-data
+ (not (nth 4 (syntax-ppss)))) ; not inside comments
+ (if (> arg 1)
+ (hs-hide-level-recursive (1- arg) minp maxp)
+ (goto-char (match-beginning hs-block-start-mdata-select))
+ (hs-hide-block-at-point t))))
(goto-char maxp))
(defmacro hs-life-goes-on (&rest body)