bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#700: hideshow.el micro improvements


From: Dmitry Bolshakov
Subject: bug#700: hideshow.el micro improvements
Date: Thu, 06 Aug 2009 14:52:31 +0400
User-agent: Thunderbird 2.0.0.22 (Windows/20090605)

-------- Original Message  --------
Subject: Re: hideshow.el micro improvements
From: Chong Yidong <address@hidden>
To: Dmitry Bolshakov <address@hidden>
Cc: address@hidden
Date: 06.07.2009 18:18

1. show

xxx {...} yyy {...}

instead of

xxx {...
}

You patch did not work properly for GNU-style braces.  I've checked in a
fix that works a little better for both cases.

2. in the hs-hide-level-recursive skip parenthesis inside comments
because of they can be unbalanced

Could you give a test recipe that shows this bug?


hi, see attachment

open file
M-x hs-minor-mode
M-x eval-expression
(hs-hide-level 1)

and i get:

Debugger entered--Lisp error: (scan-error "Unbalanced parentheses" 60 156)
 scan-sexps(60 1)
 forward-sexp(1)
 funcall(forward-sexp 1)
 (progn (set-match-data match-data) (goto-char (match-beginning 
hs-block-start-mdata-select)) (funcall hs-forward-sexp-func arg))
 (unwind-protect (progn (set-match-data match-data) (goto-char ...) (funcall 
hs-forward-sexp-func arg)) (set-match-data save-match-data-internal (quote 
evaporate)))
 (let ((save-match-data-internal ...)) (unwind-protect (progn ... ... ...) 
(set-match-data save-match-data-internal ...)))
 (save-match-data (set-match-data match-data) (goto-char (match-beginning 
hs-block-start-mdata-select)) (funcall hs-forward-sexp-func arg))
 hs-forward-sexp((60 61 #<buffer unbalanced-braces-test.pl>) 1)
 (progn (hs-forward-sexp mdata 1) (end-of-line) (point))
 (let* ((mdata ...) (pure-p ...) (p ...) (q ...) ov) (when (and ... ...) (cond 
... ...) (hs-make-overlay p q ... ...)) (goto-char (if end q ...)))
 (progn (let* (... ... ... ... ov) (when ... ... ...) (goto-char ...)))
 (if (looking-at hs-block-start-regexp) (progn (let* ... ... ...)))
 (when (looking-at hs-block-start-regexp) (let* (... ... ... ... ov) (when ... 
... ...) (goto-char ...)))
 (if comment-reg (hs-hide-comment-region (car comment-reg) (cadr comment-reg) 
end) (when (looking-at hs-block-start-regexp) (let* ... ... ...)))
 hs-hide-block-at-point(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))
 (while (progn (forward-comment ...) (and ... ...)) (if (> arg 1) 
(hs-hide-level-recursive ... minp maxp) (goto-char ...) (hs-hide-block-at-point 
t)))
 hs-hide-level-recursive(1 1 156)
 (save-excursion (message "Hiding blocks ...") (hs-hide-level-recursive arg (point-min) 
(point-max)) (message "Hiding blocks ... done"))
 (let ((inhibit-point-motion-hooks t) (case-fold-search t)) (save-excursion (message "Hiding 
blocks ...") (hs-hide-level-recursive arg ... ...) (message "Hiding blocks ... 
done")) (run-hooks (quote hs-hide-hook)))
 (progn (let (... ...) (save-excursion ... ... ...) (run-hooks ...)))
 (if hs-minor-mode (progn (let ... ... ...)))
 (when hs-minor-mode (let (... ...) (save-excursion ... ... ...) (run-hooks 
...)))
 (hs-life-goes-on (save-excursion (message "Hiding blocks ...") (hs-hide-level-recursive 
arg ... ...) (message "Hiding blocks ... done")) (run-hooks (quote hs-hide-hook)))
 hs-hide-level(1)
 eval((hs-hide-level 1))
 eval-expression((hs-hide-level 1) nil)
 call-interactively(eval-expression)
 execute-extended-command(nil)
 call-interactively(execute-extended-command)


--
With best regards
Dmitry Bolshakov
#!/usr/bin/perl

use strict;

# left brace inside comments { cause error
sub blabla {
        for (my $i = 0; $i < 10; $i++) {
                printf("\$i is %d\n", $i);
        }
}


reply via email to

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