From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [jdsmith@as.arizona.edu: HideShow Click to show/hide] Date: Tue, 21 Nov 2006 02:48:18 -0500 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1164095449 11760 80.91.229.2 (21 Nov 2006 07:50:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Nov 2006 07:50:49 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 21 08:50:48 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GmQP2-0002NE-5b for ged-emacs-devel@m.gmane.org; Tue, 21 Nov 2006 08:50:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmQP1-0006aD-NT for ged-emacs-devel@m.gmane.org; Tue, 21 Nov 2006 02:50:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GmQNS-0004lH-VU for emacs-devel@gnu.org; Tue, 21 Nov 2006 02:49:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GmQNR-0004jL-9t for emacs-devel@gnu.org; Tue, 21 Nov 2006 02:49:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmQNQ-0004ik-If for emacs-devel@gnu.org; Tue, 21 Nov 2006 02:49:08 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GmQNQ-0007LL-K6 for emacs-devel@gnu.org; Tue, 21 Nov 2006 02:49:08 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1GmQMc-000645-KR; Tue, 21 Nov 2006 02:48:19 -0500 Original-To: Thien-Thi Nguyen , Dan Nicolaescu X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:62591 Archived-At: Would you please tell us what to do here? ------- Start of forwarded message ------- To: emacs-devel@gnu.org From: JD Smith Date: Mon, 20 Nov 2006 14:30:27 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Subject: HideShow Click to show/hide X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed version=3.0.4 HideShow seems to have an issue when collapsing blocks, in C or elsewhere, with Shift-mouse-2. Consider this: int main(int argc, char argv[]) { int i=0; for (i=0;i<5;i++) { printf("Got %d\n",i); } } Shift-Middle clicking anywhere after the first brace at the end of main properly produces: int main(int argc, char argv[]) {... S-mouse-2 on that line anywhere again unfolds it. But now in the for statement: int main(int argc, char argv[]) { int i=0; for (i=0;i<5;i++) {... } There is nowhere you can Shift-click to recover the for block. It always collapses the main block instead. The only reason it worked in the main case is because it was the outermost block, so it can't find a prior block to collapse. I believe a simple change to first move to the end of the line should fix this: *** hideshow.el 10 Feb 2006 02:00:30 -0700 1.58 - --- hideshow.el 26 Oct 2006 12:49:10 -0700 *************** *** 706,711 **** - --- 706,712 ---- (if (and c-reg (nth 0 c-reg)) ;; point is inside a comment, and that comment is hidable (goto-char (nth 0 c-reg)) + (end-of-line) (when (and (not c-reg) (hs-find-block-beginning) (looking-at hs-block-start-regexp)) This isn't really perfect, because it doesn't work naturally for continued lines before the block, e.g. int main(int argc, char argv[]) { int i=0; for (i=0;i<5;i++) { printf("Got %d\n",i); } } Really you'd want uncollapse the block below point if point is on a continued line (like the for... above) which begins the block. Not sure of an easy way to do this, but this simple fix at least gives you *somewhere* to click (on the line with the ellipsis). JD _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ------- End of forwarded message -------