From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Britton Kerin Newsgroups: gmane.emacs.bugs Subject: hs-hide-level doesn't hide multiline comments in C mode Date: Thu, 22 Jan 2004 12:48:54 -0900 (AKST) Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-443943081-1818813180-1074808134=:2999" X-Trace: sea.gmane.org 1074808345 4226 80.91.224.253 (22 Jan 2004 21:52:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2004 21:52:25 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 22 22:52:14 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AjmkI-0007zV-00 for ; Thu, 22 Jan 2004 22:52:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ajmj4-0008OO-RB for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Jan 2004 16:50:58 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ajmiz-0008H3-H2 for bug-gnu-emacs@gnu.org; Thu, 22 Jan 2004 16:50:53 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AjmiL-0007fL-9j for bug-gnu-emacs@gnu.org; Thu, 22 Jan 2004 16:50:46 -0500 Original-Received: from [137.229.87.247] (helo=mail1.asf.alaska.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AjmhN-0006uV-VE for bug-gnu-emacs@gnu.org; Thu, 22 Jan 2004 16:49:14 -0500 Original-Received: from localhost (bkerin@localhost) by mail1.asf.alaska.edu (8.11.6/8.11.6) with ESMTP id i0MLmsX04401 for ; Thu, 22 Jan 2004 12:48:55 -0900 Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6691 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6691 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---443943081-1818813180-1074808134=:2999 Content-Type: TEXT/PLAIN; charset=US-ASCII The info node for hs-minor-mode (Hideshow minor mode) has second paragraph: Just what constitutes a block depends on the major mode. In C mode or C++ mode, they are delimited by braces, while in Lisp mode and similar modes they are delimited by parentheses. Multi-line comments also count as blocks. But hs-hide-level doesn't seem to treat multi-line comments as blocks, even when hs-hide-comments-when-hiding-all is non-nill. This is irritating when dealing with many types of file destinied for a preprocessor (bison, SWIG, gob, etc.) which use the %{ %} pair to delimit source to be included literally in the generated code, which you want to use c-mode to edit. The attached file illustrates this, using the following commands: alitak$ 'emacs' -q test_source.gob M-x c-mode M-x hs-minor-mode C-u 2 M-x hs-hide-level That big fat comment is still sitting there... I would suggest that either: 1. Multiline comments should be treated as blocks in this case, as advertised. This is probably not so good since some people will doubtless want to see the whole comments by default. 2. The hs-hide-comments-when-hiding-all variable should be made to apply to hs-hide-level as well. 3. A new configuration variable should be introduced to control the behavior of hs-hide-level wrt comments. Probably the best way to go. In any case, paragraph two should be rewritten a bit since comments and blocks clearly aren't being treated quite the same way. A slightly surprising (though probably desirable) related behavior is exibited by the following command sequence: alitak$ 'emacs' -q test_source.gob M-x c-mode M-x hs-minor-mode C-u 3 M-x forward-char C-u 2 M-x hs-hide-level Even though we are in a comment, which is supposed to count as a block, and there arent't any sub-blocks 2 levels deep to hide, we get the same behavior as if we hadn't moved into the comment. Emacs version: GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2004-01-22 on alitak.asf.alaska.edu Configuration command line: ./configure --prefix=/home/bkerin/local Source modifications: None Britton Kerin ---443943081-1818813180-1074808134=:2999 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="test_source.gob" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="test_source.gob" LyogQSBDLWxpa2UgZmlsZSB0aGF0IGdldHMgcHJlcHJvY2Vzc2VkIGFuZCB0 aGVyZWZvcmUgb2ZmZXJzIGEgd2F5IHRvDQogICBpbmNsdWRlIGxpdGVyYWwg QyBjb2RlICh1c2luZyB0aGUgY29tbW9uICV7ICV9IG1lY2hhbmlzbSkuICAq Lw0KDQovKiBCZWdpbiBsaXRlcmFsIGNvZGUuICAqLw0KJXsNCg0KLyogQSBs b25nLXdpbmRlZCBtdWx0aWxpbmUgY29tbWVudCBkZXNjcmliaW5nIHRoZSBm dW5jdGlvbg0KICAgc29tZV9mdW5jdGlvbi4gIFRoaXMgY29tbWVudCBkcm9u ZXMgb24gYW4gb24gYW5kIG9uIHRlbGxpbmcgeW91DQogICBldmVyeSBsaXR0 bGUgdGhpbmcgdGhlIGZ1bmN0aW9uIGRvZXMuICBJdHMgbG9uZyBlbm91Z2gg dGhhdCB5b3UNCiAgIHdhbnQgaHMtaGlkZS1sZXZlbCB0byBoaWRlIGl0IGxp a2UgYSBibG9jaywgYXMgYWR2ZXJ0aXNlZC4gICovIA0Kc3RhdGljIHZvaWQN CnNvbWVfZnVuY3Rpb24gKHZvaWQpDQp7DQogIC8qIFNvbWUgZnVuY3Rpb24g Ym9keS4gICovDQp9DQoNCiV9DQoNCg== ---443943081-1818813180-1074808134=:2999 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bug-gnu-emacs mailing list Bug-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs ---443943081-1818813180-1074808134=:2999--