From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: Re: program outlining Date: Mon, 11 Jul 2016 14:59:00 +0000 Message-ID: References: <69592de8-5bae-48ac-9435-76e219d6ee38@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1468249186 16679 80.91.229.3 (11 Jul 2016 14:59:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jul 2016 14:59:46 +0000 (UTC) To: Rusi , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 11 16:59:45 2016 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 1bMcgS-0006Ng-Bo for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jul 2016 16:59:44 +0200 Original-Received: from localhost ([::1]:34143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMcgO-0008LP-1m for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jul 2016 10:59:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMcfy-0008LK-77 for help-gnu-emacs@gnu.org; Mon, 11 Jul 2016 10:59:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMcfv-0004Dk-Mg for help-gnu-emacs@gnu.org; Mon, 11 Jul 2016 10:59:13 -0400 Original-Received: from mail-oi0-x22d.google.com ([2607:f8b0:4003:c06::22d]:34574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMcfv-0004Df-GE for help-gnu-emacs@gnu.org; Mon, 11 Jul 2016 10:59:11 -0400 Original-Received: by mail-oi0-x22d.google.com with SMTP id s66so151185688oif.1 for ; Mon, 11 Jul 2016 07:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4fVNgTPoFKsoY1piVpQDVwm60/GVFXQRnFd8IxDv+A4=; b=PyL4LqyYYHTQ454VMI2jpQeUV7Z6GhlmAKdqdhG6iMubzetFV7Mb1t4oMto+D6sVXy 7JECk71BxngJzYs8liwzHpA3Eujw/u0Pb+Vv/nUtq8faBhYrd4m0/WXqNpHl2laO34RI OryoFVpXyTPFNyTlRAyTGqXYusQu4lG8CtbQaqHY1iaej5GwaDWUUnbdBiUCfC8z9ZGM pS44C2hc1IFoGti+/ZFWApRVQUfXAtingaCGYDbuSf3nwFDjUq2IKfl3pPhpH1nDCLog CtJ976z+tY4sMvzfNlqA+XOXK/vsusJtDVh0u8SHqFOgi1h4AfnUAJZK5/RWal5FN9a3 PDmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=4fVNgTPoFKsoY1piVpQDVwm60/GVFXQRnFd8IxDv+A4=; b=aqKuSivPyWbTZiliB1POCNDesmT+WpfkN1Z/1YKusKSN8nMo+/3y0tbHz3TW6Bdtfo Y0Hr3gBDYhdzQ94DwzHAIiZEtZhSOQxeHUh6JVu5XwkWqziptZvdXME31T0+5yK/EyBj Y9wg2JA0NZEo5F2N5rjvo6HK+pHD39UEc6PeIGSFWyFzxvxVwxxs/mQ3lARDEv0QORl6 rS9/hdtHKUYcn++phdPGzYYD7vpXFwSYWvVbW/UgxHv0l8/d06CFZt0cQLvpBzu0CtLB o3/OghVwtBWVr34WzMdnFZTNvTtTuU4w3tfcIw4S2WnJZ2cYTBUz+m/EWILTr5Cn6nNr oe9g== X-Gm-Message-State: ALyK8tJj/k0O6nsmcWdSJ/ePr1KIj0nizbvoZIS1Lp+9fskLszxq01Fe4nma+cW5p5OrmLECHKjjRYaxjGzuYQ== X-Received: by 10.157.54.66 with SMTP id w60mr10935424otb.133.1468249150631; Mon, 11 Jul 2016 07:59:10 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::22d X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:110777 Archived-At: On Mon, Jul 11, 2016 at 10:19 AM Rusi wrote: > How does it work? > That's a very broad question. Here's an attempt to quickly explain this. outshine mode works by piggybacking on outline-minor-mode. So you enable outline-minor-mode where you want outshine to work. > Which modes? > I already have that in my posted outshine config: (defvar modi/outline-minor-mode-hooks '(verilog-mode-hook emacs-lisp-mode-hook conf-space-mode-hook) ; for .tmux.conf "List of hooks of major modes in which `outline-minor-mode' should be enabled.") > I can load this file alright > Loading just this file will *not* work. There are dependencies in it on my minor mode, and probably other things too. It's part of my whole config. So I wouldn't expect it to work independently. > But thereafter outshine is so undocumented that I dont know what next > I found the documentation here to be adequate: https://github.com/tj64/outshine#installation You need to pose specific questions.. Check for yourself if the outshine mode is getting enabled when it should (when you enable outline-minor-mode in any major mode) On a different note does outshine understand programming language syntax? > It uses a major-mode's comment syntax to detect headlines. For emacs-lisp-mode, ;;; heading level 1 ;;;; heading level 2 ;;;;; heading level 3 For all other modes, it detects org-like heading syntax with that major-mode's comment chars as prefix. For verilog-mode, // * heading level 1 // ** heading level 2 // *** heading level 3 For shell-script-mode, # * heading level 1 # ** heading level 2 # *** heading level 3 > Or does it need addition of org-style 'cookies'? > (as explained above) > Because if latter its not much use for arbitrary codebases > Yes, outshine does need adding special syntax headings as shown above. If you are able to add those, and others in your team do not mind it, do it. Because for everyone not using emacs/outshine, they are as good as regular comments and it will not affect the code's functionality. > (which hideshow seems to handle at least somewhat) > This boils down to personal preference. I like outshine syntax because it brings in many more org-like commands (not just visibility cycling). I can even promote/demote sections, move them up/down, mark/comment whole sections, etc. Also I can automatically parse a file and auto-generate a contents section (like this: https://github.com/kaushalmodi/.emacs.d/blob/3bfb3faa76653c4d36317359f477707bf31c6082/setup-files/setup-editing.el#L4-L42 ) If all you need is code folding, then outshine is most likely an overkill. I have experimented with a lot of code folding methods. For pure code folding, I end up using a hybrid of fold-this (3rd party package), set-selective-display (inbuilt) and yafolding (3rd party package) wrapped in my modi/fold-dwim command (config: https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-fold.el ). Ignoring all that, the simply thing to try would be to try just the fold-this package. -- -- Kaushal Modi