From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Temporary code folding for navigation Date: Thu, 25 Apr 2013 16:14:41 +0200 Message-ID: <87fvyeu27i.fsf@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1366899330 6723 80.91.229.3 (25 Apr 2013 14:15:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Apr 2013 14:15:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 25 16:15:34 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UVMxO-0008R2-RA for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Apr 2013 16:15:30 +0200 Original-Received: from localhost ([::1]:51537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVMxL-00011g-C4 for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Apr 2013 10:15:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVMws-0000qd-Vb for help-gnu-emacs@gnu.org; Thu, 25 Apr 2013 10:15:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVMwn-00089E-SH for help-gnu-emacs@gnu.org; Thu, 25 Apr 2013 10:14:58 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:44260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVMwn-000893-J1 for help-gnu-emacs@gnu.org; Thu, 25 Apr 2013 10:14:53 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UVMwi-0007LD-Av for help-gnu-emacs@gnu.org; Thu, 25 Apr 2013 16:14:48 +0200 Original-Received: from g231234041.adsl.alicedsl.de ([92.231.234.41]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Apr 2013 16:14:48 +0200 Original-Received: from tjolitz by g231234041.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Apr 2013 16:14:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 77 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231234041.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:OuWMvbyekEUv7jG7wXSbSh9z+Xk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90343 Archived-At: Illya Bomash writes: Hi Illya, > From what I can tell, outshine won’t just use the function definitions > themselves to define structure — it specifically uses commented > org-mode header lines for structure? outshine.el is enhanced outline-minor-mode and responsable for the file structuring and outline-navigation and structure editing. I think what you want is navi-mode.el,build on top of outshine and occur-mode. You can think of an *Navi* buffer as an permanent *Occur* buffer associated with an original buffer, with predefined headline and (mode-specific) keyword searches. For Emacs Lisp, I defined the following set of keyword searches: ,------------------------------------------- | [KEY] : [SEARCH] | ================ | a : ALL | f : FUN | v : VAR | x : OBJ | b : DB | F : defun | V : defvar | C : defconst | G : defgroup | U : defcustom | A : defadvice | M : defmarcro | D : defface | S : defstruct | L : defclass | K : global-set-key | T : add-to-list | Q : setq | H : add-hook | O : hook | X : lambda | R : require `------------------------------------------- thus if you type 'a' in a *Navi* buffer associated to an Emacs Lisp buffer, all definitions will be used to define structure (and only the definitions). 'f' is a bit more specific, it shows 'function' definitions in a broader sense (functions, macros...). And 'F' only shows '(defun ...) matches. If you want to use (outshine) headlines to define structure, just type '1', '2', ...,'8' in the *Navi* buffer, and the headlines up to that level will be shown. You combine headline with keyword searches by using 'C-1 F' or 'C-3 v' for example. Note that keyword-searches are customizable ('navi-key-mappings' and 'navi-keywords'), and that by default all ASCII printing characters are bound to 'navi-generic-command', thus there are a lot of free one-key bindings left you can use to define your own keyword searches (mode-specific). > What I had in mind originally would just use the function definitions > themselves as navigation headers (sort of like making a temporary > buffer from the current imenu or ECB data), but doing it by header > levels instead could be a useful way to go about it…. I’ll give it a > shot! As mentioned above, when the original (Emacs Lisp) buffer has outline-minor-mode with outshine extensions activated, you only have to type 'F' in the associated *Navi* buffer and you get the function definitions as navigation headers and nothing else. -- cheers, Thorsten