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


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to