From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#700: hideshow.el micro improvements Date: Thu, 6 Aug 2009 22:49:29 -0700 (PDT) Message-ID: <200908070549.n775nTqo017503@godzilla.ics.uci.edu> References: <87vdm5vqs9.fsf@stupidchicken.com> <4A7AB5EF.70501@bridge-quest.com> Reply-To: Dan Nicolaescu , 700@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249625249 30270 80.91.229.12 (7 Aug 2009 06:07:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Aug 2009 06:07:29 +0000 (UTC) Cc: 700@emacsbugs.donarmstrong.com, Chong Yidong To: Dmitry Bolshakov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 07 08:07:22 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MZIbn-0004yV-Cg for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Aug 2009 08:07:19 +0200 Original-Received: from localhost ([127.0.0.1]:34329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZIbm-0006Zj-Nv for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Aug 2009 02:07:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZIbQ-0006SQ-OA for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 02:06:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZIbK-0006NH-TI for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 02:06:55 -0400 Original-Received: from [199.232.76.173] (port=34061 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZIbK-0006Mt-Lr for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 02:06:50 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:38020) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MZIbK-0005Ld-0Q for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2009 02:06:50 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7766m7t013942; Thu, 6 Aug 2009 23:06:48 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n775t5cW012122; Thu, 6 Aug 2009 22:55:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 07 Aug 2009 05:55:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 700 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Original-Received: via spool by 700-submit@emacsbugs.donarmstrong.com id=B700.124962418511639 (code B ref 700); Fri, 07 Aug 2009 05:55:05 +0000 Original-Received: (at 700) by emacsbugs.donarmstrong.com; 7 Aug 2009 05:49:45 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from sallyv2.ics.uci.edu (sallyv2.ics.uci.edu [128.195.1.120]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n775niKd011636 for <700@emacsbugs.donarmstrong.com>; Thu, 6 Aug 2009 22:49:45 -0700 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by sallyv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n775nU2q024957; Thu, 6 Aug 2009 22:49:30 -0700 (PDT) Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n775nTqo017503; Thu, 6 Aug 2009 22:49:29 -0700 (PDT) In-Reply-To: <4A7AB5EF.70501@bridge-quest.com> (Dmitry Bolshakov's message of "Thu, 06 Aug 2009 14:52:31 +0400") Original-Lines: 93 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n775nU2q024957 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 07 Aug 2009 02:06:55 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29950 Archived-At: Dmitry Bolshakov writes: > -------- Original Message -------- > Subject: Re: hideshow.el micro improvements > From: Chong Yidong > To: Dmitry Bolshakov > Cc: 700@emacsbugs.donarmstrong.com > Date: 06.07.2009 18:18 > > >> 1. show > >> > >> xxx {...} yyy {...} > >> > >> instead of > >> > >> xxx {... > >> } Can you please debug your change, as it has caused problems for lisp files, see: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3896 and http://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00874.html Thanks! > > 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 #) 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); > } > }