Mercurial > emacs
changeset 75441:6e4c04850090
(outline-promote, outline-demote): Doc fix. Rename the arg CHILDREN -> WHICH.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 27 Jan 2007 18:47:55 +0000 |
parents | 5d87b83ca1ea |
children | 09eed2796001 |
files | lisp/outline.el |
diffstat | 1 files changed, 18 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/outline.el Sat Jan 27 18:47:50 2007 +0000 +++ b/lisp/outline.el Sat Jan 27 18:47:55 2007 +0000 @@ -471,19 +471,22 @@ (if up "Parent" "Demoted") head) head nil nil t))))) -(defun outline-promote (&optional children) +(defun outline-promote (&optional which) "Promote headings higher up the tree. -If prefix argument CHILDREN is given, promote also all the children. -If the region is active in `transient-mark-mode', promote all headings -in the region." +If transient-mark-mode is on, and mark is active, promote headings in +the region (from a Lisp program, pass `region' for WHICH). Otherwise: +without prefix argument, promote current heading and all headings in the +subtree (from a Lisp program, pass `subtree' for WHICH); with prefix +argument, promote just the current heading (from a Lisp program, pass +nil for WHICH, or do not pass any argument)." (interactive (list (if (and transient-mark-mode mark-active) 'region (outline-back-to-heading) (if current-prefix-arg nil 'subtree)))) (cond - ((eq children 'region) + ((eq which 'region) (outline-map-region 'outline-promote (region-beginning) (region-end))) - (children + (which (outline-map-region 'outline-promote (point) (save-excursion (outline-get-next-sibling) (point)))) @@ -507,19 +510,22 @@ (replace-match up-head nil t))))) -(defun outline-demote (&optional children) +(defun outline-demote (&optional which) "Demote headings lower down the tree. -If prefix argument CHILDREN is given, demote also all the children. -If the region is active in `transient-mark-mode', demote all headings -in the region." +If transient-mark-mode is on, and mark is active, demote headings in +the region (from a Lisp program, pass `region' for WHICH). Otherwise: +without prefix argument, demote current heading and all headings in the +subtree (from a Lisp program, pass `subtree' for WHICH); with prefix +argument, demote just the current heading (from a Lisp program, pass +nil for WHICH, or do not pass any argument)." (interactive (list (if (and transient-mark-mode mark-active) 'region (outline-back-to-heading) (if current-prefix-arg nil 'subtree)))) (cond - ((eq children 'region) + ((eq which 'region) (outline-map-region 'outline-demote (region-beginning) (region-end))) - (children + (which (outline-map-region 'outline-demote (point) (save-excursion (outline-get-next-sibling) (point))))