From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: outline-demote incorrectly demotes leaf nodes Date: Wed, 19 Oct 2011 09:14:16 +0200 Message-ID: References: <20111018105406.921@usenet.piggo.com> <4E9D4E10.6070606@christianmoe.com> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGQM4-0002Cp-10 for emacs-orgmode@gnu.org; Wed, 19 Oct 2011 03:14:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGQM1-0002zg-49 for emacs-orgmode@gnu.org; Wed, 19 Oct 2011 03:14:23 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:47237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGQM0-0002zR-Vw for emacs-orgmode@gnu.org; Wed, 19 Oct 2011 03:14:21 -0400 Received: by eye4 with SMTP id 4so1540488eye.0 for ; Wed, 19 Oct 2011 00:14:19 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sanjoy Mahajan Cc: emacs-orgmode@gnu.org On 18.10.2011, at 20:03, Sanjoy Mahajan wrote: > Christian Moe christianmoe.com> writes: >=20 >> The Org manual (2.5 Structure editing) says to use M-S-=E2=89=A4right>=20= >> (org-demote-subtree) for what the submitter wants to do. >=20 > (I am the original reporter of the issue on the Debian BTS.) That is = useful > information for me, and I will use those keys. >=20 > I do worry about one point, namely that C-c C-> (outline-demote) = should still > work. And it does work in regular outline mode. For example, if I = rename my > test file to c.otl and then use C-c C-> on the main heading, all the = subtrees > are demoted as I expected. Whereas in org mode the leaf subtree gets = a space > instead of a * when it is being demoted. The reason for this is because in outline mode, headings are starting = with a number of stars, while in Org-mode, they start with stars followed by a space. So "***News" is a heading in outline-mode, but not in = Org-mode, where you'd have to use "*** News". When outline-mode tries to invent a new heading during demoting, it = replicates the last character in the headline marker, and that will be a star in = outline-mode and the space in Org-mode. We could fix this by defining outline-headling-alist in org-mode. For = example, you could do it like this: (add-hook 'org-mode-hook (lambda () (setq outline-heading-alist '(("* " . 1) ("** " . 2) ......)))) and make sure to mention all levels you might possibly every use. However, Org-mode is not outline mode, and there is no guarantee that outline functions will work. Another option, if you prefer the C-> and C-< bindings is this: (add-hook 'org-mode-hook (lambda () (define-key org-mode-map [(control ?<)] 'org-promote-subtree) (define-key org-mode-map [(control ?>)] 'org-demote-subtree))) HTH - Carsten