emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: outline-demote incorrectly demotes leaf nodes
Date: Wed, 9 Nov 2011 19:16:22 +0100	[thread overview]
Message-ID: <CALn3zoiebmw7v1BHa-JQCV6K=2mQUf8m1m4ejTMW2YKqpNtcHw@mail.gmail.com> (raw)
In-Reply-To: <CALn3zojRg8B=A_SG=f6yRfGwiutpczcQVv_bS53ngnA=P96wOA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1808 bytes --]

Hi Carsten

Attached is the patch with this changelog:

Completion of remapping for Outline functions

* lisp/org.el Key bindings: remap the Outline functions from
`outline-mode-prefix-map' where possible.

Michael

On Sat, Oct 22, 2011 at 10:15, Michael Brand <michael.ch.brand@gmail.com> wrote:
> On Fri, Oct 21, 2011 at 16:40, Carsten Dominik
> <carsten.dominik@gmail.com> wrote:
>> Would you like to carefully think about which other functions you
>> might want to have remapped ...
>
> I started to go through the functions that are bound in
> outline-mode-prefix-map to compare their behavior with that of the Org
> equivalents. Now I stumbled upon
> outline/org-forward/backward-same-level. All four doc strings state
> "Stop at the first and last subheadings of a superior heading", but
> the Org ones don't. As I remember, Org "motion on same level" C-c
> C-f/b once stopped. Git bisect shows that this had been the case
> before the "motion on same level" functionality moved into the new
> functions org-forward/backward-same-level with
> http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=0eaf3cce
> At that time the (error "No following same-level heading")
> disappeared.
>
> I assume that Org mode should still stop as documented and like
> Outline mode. If this is true I'd like to ask you if you could help to
> resolve this. Of course I tried to do it myself but have to admit that
> it would mean too much effort for me to understand what happens before
> and after the commit with the three optimization levels that it
> implements.
>
>> and then prepare a patch?
>
> I'll add the two new pairs from above and probably some more into a
> follow-up to this
> http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=b2632dc4
> when I'll be finished with going through outline-mode-prefix-map.

[-- Attachment #2: 0001-Completion-of-remapping-for-Outline-functions.patch.txt --]
[-- Type: text/plain, Size: 3160 bytes --]

From 8de47296168ae9c83a81899046ce79a16136c6ee Mon Sep 17 00:00:00 2001
From: Michael Brand <michael.ch.brand@gmail.com>
Date: Wed, 9 Nov 2011 19:07:45 +0100
Subject: [PATCH] Completion of remapping for Outline functions

* lisp/org.el Key bindings: remap the Outline functions from
`outline-mode-prefix-map' where possible.
---
 lisp/org.el |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 5c4ea33..e24cdae 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17074,9 +17074,43 @@ (defun org-remove-inline-images ()
 
 ;;;; Key bindings
 
-;; Remap outline keys
+;; Outline functions from `outline-mode-prefix-map'
+;; that can be remapped in Org:
+(define-key org-mode-map [remap outline-mark-subtree] 'org-mark-subtree)
+(define-key org-mode-map [remap show-subtree] 'org-show-subtree)
+(define-key org-mode-map [remap outline-forward-same-level]
+  'org-forward-same-level)
+(define-key org-mode-map [remap outline-backward-same-level]
+  'org-backward-same-level)
+(define-key org-mode-map [remap show-branches]
+  'org-kill-note-or-show-branches)
 (define-key org-mode-map [remap outline-promote] 'org-promote-subtree)
 (define-key org-mode-map [remap outline-demote] 'org-demote-subtree)
+(define-key org-mode-map [remap outline-insert-heading] 'org-ctrl-c-ret)
+
+;; Outline functions from `outline-mode-prefix-map'
+;; that can not be remapped in Org:
+;; - the column "key binding" shows whether the Outline function is still
+;;   available in Org mode on the same key that it has been bound to in
+;;   Outline mode:
+;;   - "overridden": key used for a different functionality in Org mode
+;;   - else: key still bound to the same Outline function in Org mode
+;; | Outline function                   | key binding | Org replacement       |
+;; |------------------------------------+-------------+-----------------------|
+;; | `outline-next-visible-heading'     | `C-c C-n'   | still same function   |
+;; | `outline-previous-visible-heading' | `C-c C-p'   | still same function   |
+;; | `show-children'                    | `C-c C-i'   | visibility cycling    |
+;; | `hide-subtree'                     | overridden  | visibility cycling    |
+;; | `outline-up-heading'               | `C-c C-u'   | still same function   |
+;; | `hide-body'                        | overridden  | no replacement        |
+;; | `show-all'                         | overridden  | no replacement        |
+;; | `hide-entry'                       | overridden  | visibility cycling    |
+;; | `show-entry'                       | overridden  | no replacement        |
+;; | `hide-leaves'                      | overridden  | no replacement        |
+;; | `hide-sublevels'                   | overridden  | no replacement        |
+;; | `hide-other'                       | overridden  | no replacement        |
+;; | `outline-move-subtree-up'          | `C-c C-^'   | better: org-shiftup   |
+;; | `outline-move-subtree-down'        | overridden  | better: org-shiftdown |
 
 ;; Make `C-c C-x' a prefix key
 (org-defkey org-mode-map "\C-c\C-x" (make-sparse-keymap))
-- 
1.6.2.1


  reply	other threads:[~2011-11-09 18:16 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
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 [this message]
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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALn3zoiebmw7v1BHa-JQCV6K=2mQUf8m1m4ejTMW2YKqpNtcHw@mail.gmail.com' \
    --to=michael.ch.brand@gmail.com \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).