From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: `C-u 2 S-Tab' with `#+STARTUP: odd' Date: Wed, 14 Oct 2009 21:20:10 +0200 Message-ID: <4AD6246A.1050506@alumni.ethz.ch> References: 6D3A0AC2-C1BF-4541-8E55-0E3A4E488A67@gmail.com <4AD2D9A9.1030504@alumni.ethz.ch> <4AD38AE1.7000409@alumni.ethz.ch> <8850D7A8-1F73-494D-98CF-10AA691B1170@gmail.com> <4AD56D56.5050302@alumni.ethz.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1My9OV-0007m8-Vi for emacs-orgmode@gnu.org; Wed, 14 Oct 2009 15:20:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1My9OR-0007dB-4W for emacs-orgmode@gnu.org; Wed, 14 Oct 2009 15:20:19 -0400 Received: from [199.232.76.173] (port=34586 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1My9OR-0007cw-1f for emacs-orgmode@gnu.org; Wed, 14 Oct 2009 15:20:15 -0400 Received: from mail05.solnet.ch ([212.101.4.139]:63758) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1My9OQ-0002Gz-Nr for emacs-orgmode@gnu.org; Wed, 14 Oct 2009 15:20:14 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org > 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