Update a few keybindings in org.el and fix a problem in org-element.el.

* org.el: Update a few keybindings.

Use [(control down)] and "\M-}" for `org-element-forward'.
Use [(control up)] and "\M-{ `org-element-backward'.
Use "\C-c\C-^" for `org-element-up'.
Use "\C-c\C-_" for `org-element-down'.
Use "\C-c\C-@" for `org-element-mark-element'.

* org-element.el (org-element-down): Throw an error when the
element has no content.
This commit is contained in:
Bastien Guerry 2012-07-31 16:11:45 +02:00
parent e3f30e12d2
commit eb5631359a
2 changed files with 13 additions and 10 deletions

View File

@ -4365,7 +4365,8 @@ Move to the previous element at the same level, when possible."
((memq (org-element-type element) org-element-greater-elements) ((memq (org-element-type element) org-element-greater-elements)
;; If contents are hidden, first disclose them. ;; If contents are hidden, first disclose them.
(when (org-element-property :hiddenp element) (org-cycle)) (when (org-element-property :hiddenp element) (org-cycle))
(goto-char (org-element-property :contents-begin element))) (goto-char (or (org-element-property :contents-begin element)
(error "No content for this element"))))
(t (error "No inner element"))))) (t (error "No inner element")))))
(defun org-element-drag-backward () (defun org-element-drag-backward ()

View File

@ -17730,7 +17730,7 @@ BEG and END default to the buffer boundaries."
;; | `outline-next-visible-heading' | `C-c C-n' | still same function | ;; | `outline-next-visible-heading' | `C-c C-n' | still same function |
;; | `outline-previous-visible-heading' | `C-c C-p' | still same function | ;; | `outline-previous-visible-heading' | `C-c C-p' | still same function |
;; | `outline-up-heading' | `C-c C-u' | still same function | ;; | `outline-up-heading' | `C-c C-u' | still same function |
;; | `outline-move-subtree-up' | `C-c C-^' | better: org-shiftup | ;; | `outline-move-subtree-up' | overridden | better: org-shiftup |
;; | `outline-move-subtree-down' | overridden | better: org-shiftdown | ;; | `outline-move-subtree-down' | overridden | better: org-shiftdown |
;; | `show-entry' | overridden | no replacement | ;; | `show-entry' | overridden | no replacement |
;; | `show-children' | `C-c C-i' | visibility cycling | ;; | `show-children' | `C-c C-i' | visibility cycling |
@ -17839,10 +17839,12 @@ BEG and END default to the buffer boundaries."
(org-defkey narrow-map "e" 'org-narrow-to-element) (org-defkey narrow-map "e" 'org-narrow-to-element)
(org-defkey org-mode-map "\C-xne" 'org-narrow-to-element)) (org-defkey org-mode-map "\C-xne" 'org-narrow-to-element))
(org-defkey org-mode-map "\C-\M-t" 'org-element-transpose) (org-defkey org-mode-map "\C-\M-t" 'org-element-transpose)
(org-defkey org-mode-map "\C-\M-f" 'org-element-forward) (org-defkey org-mode-map [(control down)] 'org-element-forward)
(org-defkey org-mode-map "\C-\M-b" 'org-element-backward) (org-defkey org-mode-map [(control up)] 'org-element-backward)
(org-defkey org-mode-map "\C-\M-u" 'org-element-up) (org-defkey org-mode-map "\M-}" 'org-element-forward)
(org-defkey org-mode-map "\C-\M-d" 'org-element-down) (org-defkey org-mode-map "\M-{" 'org-element-backward)
(org-defkey org-mode-map "\C-c\C-^" 'org-element-up)
(org-defkey org-mode-map "\C-c\C-_" 'org-element-down)
(org-defkey org-mode-map "\C-\M-t" 'org-element-transpose) (org-defkey org-mode-map "\C-\M-t" 'org-element-transpose)
(org-defkey org-mode-map "\C-c\C-f" 'org-forward-same-level) (org-defkey org-mode-map "\C-c\C-f" 'org-forward-same-level)
(org-defkey org-mode-map "\C-c\C-b" 'org-backward-same-level) (org-defkey org-mode-map "\C-c\C-b" 'org-backward-same-level)
@ -17915,7 +17917,7 @@ BEG and END default to the buffer boundaries."
(org-defkey org-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull) (org-defkey org-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull)
(org-defkey org-mode-map "\C-c\C-x\C-mp" 'org-mobile-push) (org-defkey org-mode-map "\C-c\C-x\C-mp" 'org-mobile-push)
(org-defkey org-mode-map "\C-c@" 'org-mark-subtree) (org-defkey org-mode-map "\C-c@" 'org-mark-subtree)
(org-defkey org-mode-map "\C-c\C-@" 'org-mark-list) (org-defkey org-mode-map "\C-c\C-@" 'org-element-mark-element)
(org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree) (org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree)
;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree) ;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree)