all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Sanjoy Mahajan <sanjoy@olin.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: outline-demote incorrectly demotes leaf nodes
Date: Wed, 19 Oct 2011 09:14:16 +0200	[thread overview]
Message-ID: <DC7696B2-5B7A-49FB-B9BB-F89B2C6E8224@gmail.com> (raw)
In-Reply-To: <loom.20111018T195720-418@post.gmane.org>


On 18.10.2011, at 20:03, Sanjoy Mahajan wrote:

> Christian Moe <mail <at> christianmoe.com> writes:
> 
>> The Org manual (2.5 Structure editing) says to use M-S-≤right> 
>> (org-demote-subtree) for what the submitter wants to do.
> 
> (I am the original reporter of the issue on the Debian BTS.)  That is useful
> information for me, and I will use those keys.
> 
> 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

  parent reply	other threads:[~2011-10-19  7:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18  8:55 outline-demote incorrectly demotes leaf nodes Sébastien Delafond
2011-10-18  9:59 ` Christian Moe
2011-10-18 10:22   ` Bernt Hansen
2011-10-18 11:21     ` Sébastien Delafond
2011-10-18 11:27       ` Bernt Hansen
2011-10-18 18:03   ` Sanjoy Mahajan
2011-10-18 18:57     ` Nick Dokos
2011-10-19  7:14     ` Carsten Dominik [this message]
2011-10-19 13:57       ` Sanjoy Mahajan
2011-10-19 15:39       ` Michael Brand
2011-10-21 14:22         ` Bastien
2011-10-21 14:40         ` Carsten Dominik
2011-10-21 16:08           ` Bastien
2011-10-22  8:15           ` Michael Brand
2011-11-09 18:16             ` Michael Brand
2011-12-11 18:44               ` Bastien

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=DC7696B2-5B7A-49FB-B9BB-F89B2C6E8224@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sanjoy@olin.edu \
    /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.