From: Michael Brand <michael.brand@alumni.ethz.ch>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: `C-u 2 S-Tab' with `#+STARTUP: odd'
Date: Wed, 14 Oct 2009 21:20:10 +0200 [thread overview]
Message-ID: <4AD6246A.1050506@alumni.ethz.ch> (raw)
In-Reply-To: <E2F2B73A-800E-40BE-BC9C-A5C123411659@gmail.com>
> I have troube understanding what you mean.
>
> An outline heading looks like this
>
> *** heading
>
> If the cursor is at the first character of that line, org-outline-level
> will return 3.
I want `3' _independently_ of on which column the cursor is on that line and therefore use (save-excursion (beginning-of-line) (org-outline-level)).
> If the line looks different, the return value will be badly
> determined (governed by the most recent match of a regular expression
> anywhere in Emacs, might be anything).
To cover this I use (outline-on-heading-p), without the optional parameter in my case.
> If you need to find out, in a lisp program, if you are at the beginning
> of a headline, use
>
> (and (org-at-heading-p t) (bolp))
The matter is that within any one line I rather want to _ignore_ the column than to _know_ on which column the cursor is.
With all discussed here in this thread combined together I use
(if (outline-on-heading-p)
(org-reduced-level
(save-excursion (beginning-of-line) (org-outline-level)))
'0)))
for my suggestion of heading visibility depth stepping described here
http://thread.gmane.org/gmane.emacs.orgmode/17581/focus=18392
next prev parent reply other threads:[~2009-10-14 19:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 7:24 `C-u 2 S-Tab' with `#+STARTUP: odd' Michael Brand
2009-10-12 13:15 ` Carsten Dominik
2009-10-12 20:00 ` Michael Brand
2009-10-13 18:47 ` Carsten Dominik
2009-10-14 6:19 ` Michael Brand
2009-10-14 11:15 ` Bernt Hansen
2009-10-14 11:56 ` Michael Brand
2009-10-14 13:58 ` Carsten Dominik
2009-10-14 19:20 ` Michael Brand [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-09-10 11:48 Michael Brand
2009-09-10 16:32 ` Carsten Dominik
2009-10-14 10:15 ` Carsten Dominik
2009-10-14 13:58 ` Carsten Dominik
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AD6246A.1050506@alumni.ethz.ch \
--to=michael.brand@alumni.ethz.ch \
--cc=carsten.dominik@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.