Merge branch 'maint' of orgmode.org:org-mode into maint
This commit is contained in:
commit
333211ff01
15
lisp/org.el
15
lisp/org.el
|
@ -8043,18 +8043,17 @@ See also `org-promote'."
|
||||||
(org-fix-position-after-promote))
|
(org-fix-position-after-promote))
|
||||||
|
|
||||||
(defun org-demote-subtree ()
|
(defun org-demote-subtree ()
|
||||||
"Demote the entire subtree. See `org-demote'.
|
"Demote the entire subtree.
|
||||||
See also `org-promote'."
|
See `org-demote' and `org-promote'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(org-with-limited-levels (org-map-tree 'org-demote)))
|
(org-with-limited-levels (org-map-tree 'org-demote)))
|
||||||
(org-fix-position-after-promote))
|
(org-fix-position-after-promote))
|
||||||
|
|
||||||
|
|
||||||
(defun org-do-promote ()
|
(defun org-do-promote ()
|
||||||
"Promote the current heading higher up the tree.
|
"Promote the current heading higher up the tree.
|
||||||
If the region is active in `transient-mark-mode', promote all headings
|
If the region is active in `transient-mark-mode', promote all
|
||||||
in the region."
|
headings in the region."
|
||||||
(interactive)
|
(interactive)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(if (org-region-active-p)
|
(if (org-region-active-p)
|
||||||
|
@ -8064,8 +8063,8 @@ in the region."
|
||||||
|
|
||||||
(defun org-do-demote ()
|
(defun org-do-demote ()
|
||||||
"Demote the current heading lower down the tree.
|
"Demote the current heading lower down the tree.
|
||||||
If the region is active in `transient-mark-mode', demote all headings
|
If the region is active in `transient-mark-mode', demote all
|
||||||
in the region."
|
headings in the region."
|
||||||
(interactive)
|
(interactive)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(if (org-region-active-p)
|
(if (org-region-active-p)
|
||||||
|
@ -8074,7 +8073,7 @@ in the region."
|
||||||
(org-fix-position-after-promote))
|
(org-fix-position-after-promote))
|
||||||
|
|
||||||
(defun org-fix-position-after-promote ()
|
(defun org-fix-position-after-promote ()
|
||||||
"Make sure that after pro/demotion cursor position is right."
|
"Fix cursor position and indentation after demoting/promoting."
|
||||||
(let ((pos (point)))
|
(let ((pos (point)))
|
||||||
(when (save-excursion
|
(when (save-excursion
|
||||||
(beginning-of-line 1)
|
(beginning-of-line 1)
|
||||||
|
|
Loading…
Reference in New Issue