From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [ANN] outorg.el -- reverse Org-Babel
Date: Wed, 13 Feb 2013 11:54:36 +0100 [thread overview]
Message-ID: <87mwv8xz4j.fsf@gmail.com> (raw)
In-Reply-To: 87ehgl5ibs.fsf@bzg.ath.cx
Bastien <bzg@altern.org> writes:
Hi Bastien,
> Note that both your libraries (supporting some Org syntax in
> comments) are a perfect match for Christopher recent chance
> in master, which allows a more powerful orgstruct-mode in
> those files -- with folding etc. If you didn't, have a look:
>
> C-h v orgstruct-heading-prefix-regexp RET
for equivalence with outline-minor-mode, one would need
,--------------------------------
| orgstruct-heading-prefix-regexp
| orgstruct-heading-prefix-level
`--------------------------------
just like:
,-------------------------------------------------------------------------------
| outline-regexp is a variable defined in `outline.el'.
|
| Regular expression to match the beginning of a heading.
| Any line whose beginning matches this regexp is considered to start a heading.
| Note that Outline mode only checks this regexp at the start of a line,
| so the regexp need not (and usually does not) start with `^'.
| The recommended way to set this is with a Local Variables: list
| in the file it applies to. See also `outline-heading-end-regexp'.
`-------------------------------------------------------------------------------
,----------------------------------------------------------------------------
| outline-level is a variable defined in `outline.el'.
|
| *Function of no args to compute a header's nesting level in an outline.
| It can assume point is at the beginning of a header line and that the match
| data reflects the `outline-regexp'.
`----------------------------------------------------------------------------
on the other hand:
,---------------------------------------------------------
| (define-derived-mode org-mode outline-mode "Org"
| [...]
| (org-set-local 'outline-regexp org-outline-regexp)
| (org-set-local 'outline-level 'org-outline-level) ...)
`---------------------------------------------------------
I'm not sure if I really understand orgstruct-mode, but it seems to me
that when orgstruct-mode is active in a (e.g. elisp) buffer, all outline
functions and vars are available, and so are org-outline-regexp and
org-outline-level.
Then a library like outorg could use outline functionality in its
functions and it would work no matter if the buffer is in
outline-minor-mode or in orgstruct-mode. The only change necesary would
be to set outline-regexp and outline-level conditionally on the
minor-mode active.
Or why not use outline-regexp and outline-level directly, like org.el
does in some places:
,---------------------------------------------------------------------------
| 6624: (if (re-search-forward (concat "^" outline-regexp) nil t)
`---------------------------------------------------------------------------
,-----------------------------------------------------
| 36 matches for "[^-]outline-level" in buffer: org.el
`-----------------------------------------------------
I'm not really sure how much of Org-mode and Outline is available when
orgstruct is loaded, and if and why there is a need for
'orgstruct-heading-prefix-regexp' - couldn't orgstruct just set a
buffer-local 'outline-regexp' instead? Some enlightment is welcome.
--
cheers,
Thorsten
next prev parent reply other threads:[~2013-02-13 10:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-11 23:38 [ANN] outorg.el -- reverse Org-Babel Thorsten Jolitz
2013-02-12 2:06 ` François Pinard
2013-02-12 3:13 ` Thorsten Jolitz
2013-02-12 4:53 ` François Pinard
2013-02-12 14:05 ` Thorsten Jolitz
2013-02-12 18:10 ` François Pinard
2013-02-12 21:32 ` Bastien
2013-02-12 23:53 ` Thorsten Jolitz
2013-02-13 10:54 ` Thorsten Jolitz [this message]
2013-02-14 7:41 ` Bastien
2013-02-12 23:45 ` Thorsten Jolitz
2013-02-12 18:12 ` Samuel Wales
2013-02-13 0:11 ` Thorsten Jolitz
2013-02-13 11:38 ` Bastien
2013-02-15 23:38 ` Samuel Wales
2013-02-12 19:54 ` Alan Schmitt
2013-02-13 0:17 ` Thorsten Jolitz
2013-02-13 11:33 ` Bastien
2013-02-13 11:05 ` Thorsten Jolitz
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=87mwv8xz4j.fsf@gmail.com \
--to=tjolitz@gmail.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).