From: Dmitry Bolshakov <dmitry.bolshakov@bridge-quest.com>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 700@emacsbugs.donarmstrong.com
Subject: bug#700: hideshow.el micro improvements
Date: Thu, 06 Aug 2009 14:52:31 +0400 [thread overview]
Message-ID: <4A7AB5EF.70501@bridge-quest.com> (raw)
In-Reply-To: <87vdm5vqs9.fsf@stupidchicken.com>
[-- Attachment #1: Type: text/plain, Size: 3410 bytes --]
-------- Original Message --------
Subject: Re: hideshow.el micro improvements
From: Chong Yidong <cyd@stupidchicken.com>
To: Dmitry Bolshakov <dmitry.bolshakov@bridge-quest.com>
Cc: 700@emacsbugs.donarmstrong.com
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
[-- Attachment #2: unbalanced-braces-test.pl --]
[-- Type: text/plain, Size: 155 bytes --]
#!/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);
}
}
next prev parent reply other threads:[~2009-08-06 10:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-06 14:18 bug#700: hideshow.el micro improvements Chong Yidong
2009-08-06 10:52 ` Dmitry Bolshakov [this message]
2009-08-07 5:49 ` Dan Nicolaescu
2009-08-07 14:24 ` Chong Yidong
2009-08-07 16:13 ` Dmitry Bolshakov
-- strict thread matches above, loose matches on Subject: below --
2008-08-12 11:52 Dmitry Bolshakov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A7AB5EF.70501@bridge-quest.com \
--to=dmitry.bolshakov@bridge-quest.com \
--cc=700@emacsbugs.donarmstrong.com \
--cc=cyd@stupidchicken.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).