From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Veli-Pekka Tätilä" Newsgroups: gmane.emacs.help Subject: Defining outline-regexp Interactively?, the Pros of outline-minor-mode Date: Sat, 4 Oct 2008 21:54:30 +0300 Organization: FINNET customers Message-ID: <48e7bb0d$0$23610$9b536df3@news.fv.fi> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1223149326 14930 80.91.229.12 (4 Oct 2008 19:42:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Oct 2008 19:42:06 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 04 21:43:02 2008 Return-path: Envelope-to: geh-help-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 1KmD1e-00081b-HW for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Oct 2008 21:42:50 +0200 Original-Received: from localhost ([127.0.0.1]:39564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KmD0b-0006Su-CC for geh-help-gnu-emacs@m.gmane.org; Sat, 04 Oct 2008 15:41:45 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin1!goblin.stu.neva.ru!uio.no!fi.sn.net!newsfeed1.fi.sn.net!news.song.fi!not-for-mail Original-Newsgroups: gnu.emacs.help X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Original-Lines: 50 Original-NNTP-Posting-Host: 82-128-218-109-Karjasilta-TR1.suomi.net Original-X-Trace: 1223146253 news.fv.fi 23610 82.128.218.109:1828 Original-X-Complaints-To: abuse@news.fv.fi Original-Xref: news.stanford.edu gnu.emacs.help:163021 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58363 Archived-At: Hi, One thing I really like in Emacs is outline-minor-mode. A newbie question, though, can I easily interactively set the outline-regexp without having to evaluate Lisp code in a separate buffer, or update my config? My matching needs dynamically depend on the kind of content in the buffer, I use a regexp for matching functions when doing Lua, but would like to use a regexp matching numbered headings like 1.3. when viewing a text dump of the Lua reference manual. In fact, I view outline minor mode as a kind of alternative UI to traversing regexp search results non-linearly. Which reminds me if I have n dot-separated sections e.g. 1.3.5 can I make outline-minor-mode understand the concept of subchapters and subsubchapters in its tree structures? I can regexp match the bits all right, though. As to what's good in it: Outline minor mode let's me easily hide function bodies and get the big picture, without having to use regexp matching to jump from function to function. It also makes rearranging stuff a breeze compared to selecting line by line and cutting and pasting, which is what I used to do. It also works great for languages not supported out of the box, such as Lua, if you just say something like: (setq outline-regexp "function") The Emacs wiki has taught me almost as many handy things as the book Learning Gnu Emacs, it is a great resource! Further more, things are so much easier to manage from the keyboard if you go and redefine the branch management keys to emulate tree-control keyboard conventions. I found the following in the wiki and have it in my .emacs file (for Windows and Linux): (global-set-key [M-left] 'hide-body) (global-set-key [M-right] 'show-all) (global-set-key [M-up] 'outline-previous-heading) (global-set-key [M-down] 'outline-next-heading) (global-set-key [C-M-left] 'hide-sublevels) (global-set-key [C-M-right] 'show-children) (global-set-key [C-M-up] 'outline-previous-visible-heading) (global-set-key [C-M-down] 'outline-next-visible-heading) -- With kind regards Veli-Pekka Tätilä Accessibility, Apps and Coding plus Synths and Music: http://vtatila.kapsi.fi