From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Rogoff Subject: Re: Minor org mode for achieve code folding effects Date: Mon, 16 Jan 2012 18:19:00 +0000 (UTC) Message-ID: References: CADzxs1nkW_KO_n7RsTtO_W2nAvyUvoKGy+FgztaRFiFyuh44ug@mail.gmail.com <4F0CD92F.9030004@therogoffs.com> <4F0F657F.8050406@therogoffs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rmr9L-0006eb-8V for emacs-orgmode@gnu.org; Mon, 16 Jan 2012 13:19:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rmr9I-0002Jg-UQ for emacs-orgmode@gnu.org; Mon, 16 Jan 2012 13:19:19 -0500 Received: from lo.gmane.org ([80.91.229.12]:36311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rmr9I-0002JQ-Lf for emacs-orgmode@gnu.org; Mon, 16 Jan 2012 13:19:16 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rmr9F-0001GV-3s for emacs-orgmode@gnu.org; Mon, 16 Jan 2012 19:19:13 +0100 Received: from pat.qlogic.com ([198.70.193.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 Jan 2012 19:19:13 +0100 Received: from david by pat.qlogic.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 Jan 2012 19:19:13 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org David Rogoff therogoffs.com> writes: > Carlos Russo gmail.com> writes: >> I have used both Carsten's and Eric's solution, as well as hideshow-org (https://github.com/secelis/hideshow-org), which works rather well and deserves a mention. >> Expanding a bit on Carsten's post: Tassilo Horn wrote some convenience functions to set the outline minor mode regexps to correspond to the current comment syntax. Thus, if I'm (for instance) in shell-script mode, # * and # ** become the outline level 1 and 2 markers. > > I have all this working and it's great. But... This is using outline-minor- mode. Like Giovanni, who started this thread, I'm used to orgmode, which is a little different although it uses outline mode. I tried hacking the code to use orgstruct-mode, which is the minor mode version of orgmode. I got a little figured out, but got lost. > I would think all of Tassilo's code to automatically set up outline-regexp would still be valid, but I'm not doing something right. I saw Carsten's message to look at the visibility cycling and understand that, but the keymaps are not working right and the outline-regexp isn't being set right. I've worked around the latter with a quick function I can call from the file buffer. However, I don't know what's going on with the keymap. It looks right. For example, c-h k TAB gives this: > runs the command orgstruct-hijacker-command-102, which is an interactive Lisp function. It is bound to . > (orgstruct-hijacker-command-102 ARG) > In Structure, run `org-cycle'. > Outside of structure, run the binding of `[(tab)]' or ` '. > > However, it doesn't seem to recognize when it's in a structure. M-x org-cycle works as does M-x org-global-cycle. > > I only need this for emacs-lisp-mode and verilog-mode so I simplified Tassilo's code (for now) like this: > > (when (eq major-mode 'emacs-lisp-mode) > (setq outline-regexp ";; [*]+ ")) > (when (eq major-mode 'verilog-mode) > (setq outline-regexp "\\s-*// [*]+ ")) Anyone?