From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Teemu.Parkkinen@patria.fi Newsgroups: gmane.emacs.devel Subject: New feature proposal for Emacs Date: Thu, 5 Feb 2004 10:38:02 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1075970501 3201 80.91.224.253 (5 Feb 2004 08:41:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2004 08:41:41 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Feb 05 09:41:26 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aof4g-00056D-00 for ; Thu, 05 Feb 2004 09:41:26 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Aof4f-0001nf-00 for ; Thu, 05 Feb 2004 09:41:26 +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 1Aof3v-0007Qg-M7 for emacs-devel@quimby.gnus.org; Thu, 05 Feb 2004 03:40:39 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aof3J-0007OX-DH for emacs-devel@gnu.org; Thu, 05 Feb 2004 03:40:01 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aof2l-0006Wu-Ed for emacs-devel@gnu.org; Thu, 05 Feb 2004 03:39:58 -0500 Original-Received: from [192.89.123.25] (helo=smtp.tele.fi) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aof2k-0005bl-V2 for emacs-devel@gnu.org; Thu, 05 Feb 2004 03:39:27 -0500 Original-Received: from hubns01.patria.fi (unknown [193.209.168.1]) by smtp.tele.fi (Postfix) with ESMTP id 4158D37DD4 for ; Thu, 5 Feb 2004 10:38:24 +0200 (EET) Original-To: emacs-devel@gnu.org X-Mailer: Lotus Notes Release 5.0.8 June 18, 2001 X-MIMETrack: Serialize by Router on HUBNS01/HUB/PATRIA(Release 5.0.11 |July 24, 2002) at 05.02.2004 10:39:12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19732 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19732 Hi everyone! I have an idea what would be quite helpful when editing long source-code files. I'm not sure if this is already implemented, but anyway: Consider a long source-file. It is difficult to edit, because you have to flip pages often to see other parts of the file. Below, we have a c-file that has some code in it. ---------------- Begin example code ---------------------- /* includes */ #include #include "someOther.h" ... /* system initialization function */ int initSystem(int* params) { /* check parameter values */ if ( param[0] == 1 ) return ILLEGAL_VALUE; if ( param[1] == 1 ) return ILLEGAL_VALUE; if ( param[2] == 1 ) return ILLEGAL_VALUE; if ( param[3] == 1 ) return ILLEGAL_VALUE; if ( param[4] == 1 ) return ILLEGAL_VALUE; /* process input parameters */ if (params[0] == 1) do_things(); if (params[1] == 2) do_Something_else(); /* copy parameter tables */ for (int i=0; i MAX) return HW_ERROR; if (value < MIN) return HW_ERROR; } } ----------- end example code ------------- When editing real source files, you often want to see only a small part of the code when other parts are meaningless at that time. It would be enough to see only a comment line of those meaningless blocks that says what that block does. (And very often one comments the blocks already this way). So here is the idea: Would it be possible to hide certain blocks of code (or hide all and show only those you wish to see) by some way? When a block is hidden, only the first comment of it is shown. Let me illustrate this with the example code: We wish to edit only the part that processes the input parameters. We select "show-this-block" and Emacs expands that block. At this time the source code would look like this: ---------------- Begin example code2 ---------------------- /* includes */ /* system initialization function */ int initSystem(int* params) { /* check parameter values */ /* process input parameters */ if (params[0] == 1) do_things(); if (params[1] == 2) do_Something_else(); /* copy parameter tables */ /* check hardware status */ } ----------- end example code2 ------------- This example code is small and very simple, but if one could hide certain blocks from bigger (and more complicated) file, the programmer could more easily see what the code really does. Very often I get confused if there are several lines of code which does only some very simple thing. It would be enought to see only a brief explanation that says what is done at this point. One could also hide entire functions, if those are not needed at that time. I hope you get the point what I'm trying to say. I would like to hear if this is already implemented (it very well may be). If it isn't, do you think this feature would be helpful? -Teemu