emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Rogoff <david@therogoffs.com>
To: emacs-orgmode@gnu.org
Subject: Re: Minor org mode for achieve code folding effects
Date: Thu, 12 Jan 2012 14:58:07 -0800	[thread overview]
Message-ID: <4F0F657F.8050406@therogoffs.com> (raw)
In-Reply-To: <4F0CD92F.9030004@therogoffs.com>

[-- Attachment #1: Type: text/plain, Size: 1982 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 2585 bytes --]

  parent reply	other threads:[~2012-01-12 22:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11  0:34 Minor org mode for achieve code folding effects David Rogoff
2012-01-11  1:21 ` David Rogoff
2012-01-11  6:23   ` Leo Alekseyev
2012-01-11  7:43     ` Tassilo Horn
2012-01-12 22:58 ` David Rogoff [this message]
2012-01-16 18:19   ` David Rogoff
  -- strict thread matches above, loose matches on Subject: below --
2012-01-09 15:14 Giovanni Giorgi
2012-01-09 15:23 ` Carsten Dominik
2012-01-10 21:08 ` Eric S Fraga
2012-01-10 22:47   ` Leo Alekseyev
2012-01-11 14:56 ` Eric S Fraga
2012-01-12  2:12   ` Leo Alekseyev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F0F657F.8050406@therogoffs.com \
    --to=david@therogoffs.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).