mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-27 04:02:53 +00:00
Make C-M-a and C-M-e do the right thing in Org-mode
The commands now move back to the heading, and to the end of the subtree, respectively. Proposed by Lennard Borgmann.
This commit is contained in:
parent
be232c4c21
commit
f3b5524a2e
|
@ -1,5 +1,10 @@
|
|||
2010-05-13 Carsten Dominik <carsten.dominik@gmail.com>
|
||||
|
||||
* org.el (org-beginning-of-defun, org-end-of-defun): New
|
||||
functions.
|
||||
(org-mode): Install the `org-beginning-of-defun' and
|
||||
`org-end-of-defun' functions.
|
||||
|
||||
* org-latex.el (org-export-latex-keywords-maybe): Protect the
|
||||
TODO markup.
|
||||
|
||||
|
|
10
lisp/org.el
10
lisp/org.el
|
@ -4465,6 +4465,9 @@ The following commands are available:
|
|||
(org-set-autofill-regexps)
|
||||
(setq indent-line-function 'org-indent-line-function)
|
||||
(org-update-radio-target-regexp)
|
||||
;; Beginning/end of defun
|
||||
(org-set-local 'beginning-of-defun-function 'org-beginning-of-defun)
|
||||
(org-set-local 'end-of-defun-function 'org-end-of-defun)
|
||||
;; Make sure dependence stuff works reliably, even for users who set it
|
||||
;; too late :-(
|
||||
(if org-enforce-todo-dependencies
|
||||
|
@ -18349,6 +18352,13 @@ interactive command with similar behavior."
|
|||
(error (error "Before first headline at position %d in buffer %s"
|
||||
(point) (current-buffer)))))
|
||||
|
||||
(defun org-beginning-of-defun ()
|
||||
"Go to the beginning of the subtree, i.e. back to the heading."
|
||||
(org-back-to-heading))
|
||||
(defun org-end-of-defun ()
|
||||
"Go to the end of the subtree."
|
||||
(org-end-of-subtree nil t))
|
||||
|
||||
(defun org-before-first-heading-p ()
|
||||
"Before first heading?"
|
||||
(save-excursion
|
||||
|
|
Loading…
Reference in a new issue