From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Benjamin Rutt Newsgroups: gmane.emacs.help Subject: Re: Hide text Date: Sat, 21 Feb 2004 13:14:58 -0500 Organization: The Ohio State University Dept. of Computer and Info. Science Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <55f725fe.0402210757.1f503c4e@posting.google.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1077387505 32615 80.91.224.253 (21 Feb 2004 18:18:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 21 Feb 2004 18:18:25 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 21 19:18:10 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 1Aubha-0007Kn-00 for ; Sat, 21 Feb 2004 19:18:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AubfL-00043e-61 for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Feb 2004 13:15:51 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!129.250.16.78.MISMATCH!peer1.stngva01.us.to.verio.net!news.verio.net!news.harvard.edu!news.dfci.harvard.edu!news.cis.ohio-state.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: mu.cis.ohio-state.edu Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (usg-unix-v) Cancel-Lock: sha1:hmRFBX9N0WZlSsRgFh8BX710wOs= Original-Xref: shelby.stanford.edu gnu.emacs.help:121101 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:17051 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:17051 nybban@telia.com (Fredrik Andersson) writes: > I wonder if it is possible to hide part of text in Emacs? > I would like to compress/expand the text inside a subroutine. > > Before compression: > -------------------- > Function name(a,var z:boolean):Boolean; > Var > x:Real; > z:Bollean; > BEGIN > x:=4; > z:=True; > END; > > After compression: > ------------------ > Function name(a,var z:boolean):Boolean; If all you have in the file are functions, try enabling outline-minor-mode, and customizing the buffer-local variable outline-regexp to match your function name. The idea is that you'd match the function signature as a top-level outline header. Maybe something like: (setq outline-regexp "Function [a-z]+(.*):.*;$") Then, try M-x hide-subtree on the function name line, and it will hide the text between that line and the next function. -- Benjamin