emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Michael Brand <michael.ch.brand@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: understanding the function outline-level
Date: Tue, 07 Jun 2011 23:24:01 +0530	[thread overview]
Message-ID: <81r575mssm.fsf@gmail.com> (raw)
In-Reply-To: <BANLkTikSyCCo8SW3kGK95O1s+SajdA8v+Q@mail.gmail.com> (Michael Brand's message of "Tue, 7 Jun 2011 18:23:27 +0200")

Michael Brand <michael.ch.brand@gmail.com> writes:

> Hi all
>
> I am on the way of tracking down an (Org?) buglet and now
> outline-level tries to strike me with my lack of experience with
> "Match Data" of Emacs search and I would like to ask for some help to
> understand.
>
> M-: (outline-level) returns a value that I don't understand yet. The
> number does not correspond to the amount of stars and is independent
> of at the beginning of which line the point was before. And when I
> look at the implementation of outline-level I am missing a function
> that initializes the "Match Data". Where is that last search or match
> operation?

(A quick hint. May not be complete though)

The typical call sequence seems to be:

1. Move the cursor to a headline.
2. Call outline-level.

It is (1) which presumably does a regexp search and ends up in the
headline.

So outline-level cannot be called in and of itself. It always need to be
preceded by some other call which positions the cursor in a headline in
the first place.

Cursory look suggests that there are multiple ways by which (1) could be
achieved - mostly they seem to be outline tree traversal functions.

Summary: Look at outline-level in source code. Jump a few lines above
and watch out for any sort of traversal functions.

,----[ C-h f outline-level RET ]
| outline-level is a compiled Lisp function in `outline.el'.
| 
| (outline-level)
| 
| Return the depth to which a statement is nested in the outline.
| Point must be at the beginning of a header line.
| This is actually either the level specified in `outline-heading-alist'
| or else the number of characters matched by `outline-regexp'.
| 
| [back]
`----



>
> Michael
>
>

-- 

  reply	other threads:[~2011-06-07 17:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 16:23 understanding the function outline-level Michael Brand
2011-06-07 17:54 ` Jambunathan K [this message]
2011-06-07 18:33 ` Niels Giesen
2011-06-09  7:04   ` Michael Brand
2011-06-09  7:51   ` Carsten Dominik
2011-06-07 20:30 ` Aankhen

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=81r575mssm.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=michael.ch.brand@gmail.com \
    /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).