emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: Orgstruct-mode with custom outline-regexp (was: can the symbol for leading stars be changed?)
Date: Tue, 17 Mar 2009 09:21:51 +0100	[thread overview]
Message-ID: <87sklctv8g.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: 6B9F5437-DC9D-43F1-B63B-7099F72D8221@uva.nl

Carsten Dominik <dominik@science.uva.nl> writes:

Hi Carsten,

>> I wonder if I cannot make `orgstruct-mode' work the same way.  I've
>> always thought that it uses `outline-regexp' for the cycling and
>> stuff, but maybe I'm wrong.  What's the correct regexp that's used
>> for `org-cycle'?  `org-complex-heading-regexp'?
>
> org-cycle does use outline-regexp, so this will work fine.

Hm, it does work with "M-x org-cycle" (then it toggles between FOLDED
and CHILDREN, but not SUBTREE), but with TAB nothing happens.

,----
| <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 `	'.
`----

Here's the test file:

--8<---------------cut here---------------start------------->8---
;;* Heading 1

(setq foo 1)

;;** SubHeading 1.1

(+ 1 1) ;; test

;;** SubHeading 1.2

(defun foo () nil)

;;* Heading 2

(defun bar () nil)

;;** SubHeading 2.1

(+ 7 7)
--8<---------------cut here---------------end--------------->8---

When I hit C-c C-c which should allow setting tags, it tells me

  org-ctrl-c-ctrl-c: C-c C-c can do nothing useful at this location.

although I'm on a headline and the value of outline regexp is:

,----
| outline-regexp is a variable defined in `outline.el'.
| Its value is ";;[*]+ "
| Local in buffer test.el; global value is "[*\f]+"
`----

The only thing that comes into my mind is that those hijacker commands
use a hardcoded outline-regexp or an earlier value of outline-regexp.
Yeah, that seems to be the case.  When I use only stars, the key
bindings work.

Carsten, could you change that, so that the hijackers use the current
value of outline-regexp?

> However, for much other functionality, including demotion and
> promotion, stars are hard-coded.

Cycling would be more than enough for me.  I just want to have a good
structure in my code files where I can easily toggle the visibility.
Basically, `outline-minor-mode' does what I want, but org cycling is
still better.

Bye,
Tassilo
-- 
Chuck Norris sheds his skin twice a year. 

  reply	other threads:[~2009-03-17  8:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16  3:17 can the symbol for leading stars be changed? Gray Calhoun
2009-03-16 10:04 ` Tassilo Horn
2009-03-16 19:20   ` Gray Calhoun
2009-03-16 21:22   ` Carsten Dominik
2009-03-17  8:21     ` Tassilo Horn [this message]
2009-03-17 10:48       ` Orgstruct-mode with custom outline-regexp (was: can the symbol for leading stars be changed?) Carsten Dominik
2009-03-17 12:00         ` Orgstruct-mode with custom outline-regexp Tassilo Horn

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=87sklctv8g.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --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).