From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Rogoff Subject: Re: Minor org mode for achieve code folding effects Date: Thu, 12 Jan 2012 14:58:07 -0800 Message-ID: <4F0F657F.8050406@therogoffs.com> References: CADzxs1nkW_KO_n7RsTtO_W2nAvyUvoKGy+FgztaRFiFyuh44ug@mail.gmail.com <4F0CD92F.9030004@therogoffs.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------060905030503010101010308" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:45034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlTb3-000533-Ch for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 17:58:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlTb1-0003MV-GZ for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 17:58:12 -0500 Received: from oproxy9.bluehost.com ([69.89.24.6]:39652) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RlTb1-0003MH-7p for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 17:58:11 -0500 Received: from ip68-228-84-160.oc.oc.cox.net ([68.228.84.160] helo=therogoffs.local) by box775.bluehost.com with esmtpa (Exim 4.76) (envelope-from ) id 1RlTay-0004YN-Ke for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 15:58:08 -0700 In-Reply-To: <4F0CD92F.9030004@therogoffs.com> 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 This is a multi-part message in MIME format. --------------060905030503010101010308 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 like this: (when (eq major-mode 'emacs-lisp-mode) (setq outline-regexp ";; [*]+ ")) (when (eq major-mode 'verilog-mode) (setq outline-regexp "\\s-*// [*]+ ")) Help Please! Thanks! David --------------060905030503010101010308 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Carlos Russo <mestre.adamastor <at> 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:

<tab> runs the command orgstruct-hijacker-command-102, which is an interactive Lisp function.
It is bound to <tab>.
(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 like this:
(when (eq major-mode 'emacs-lisp-mode)
  (setq outline-regexp ";; [*]+ "))
(when (eq major-mode 'verilog-mode)
  (setq outline-regexp "\\s-*// [*]+ "))

Help Please!

Thanks!

 David

--------------060905030503010101010308--