emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/outline 4ad2134 14/15: lisp/outline.el (outline-sh


From: Oleh Krehel
Subject: [Emacs-diffs] scratch/outline 4ad2134 14/15: lisp/outline.el (outline-show-children): Rename from `show-children'.
Date: Wed, 28 Jan 2015 11:44:27 +0000

branch: scratch/outline
commit 4ad213422182dc18096dbd49fe2ffe5e3aebf0e0
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    lisp/outline.el (outline-show-children): Rename from `show-children'.
---
 lisp/ChangeLog  |    5 ++++
 lisp/outline.el |   63 ++++++++++++++++++++++++++++--------------------------
 2 files changed, 38 insertions(+), 30 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eb6b19c..4bc184c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
 2015-01-28  Oleh Krehel  <address@hidden>
 
+       * outline.el (outline-show-children): Rename from `show-children'.
+       (show-children): Declare as obsolete.
+
+2015-01-28  Oleh Krehel  <address@hidden>
+
        * outline.el (outline-hide-other): Rename from `hide-other'.
        (hide-other): Declare as obsolete.
 
diff --git a/lisp/outline.el b/lisp/outline.el
index 5061a8e..ed54eab 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -62,7 +62,7 @@ in the file it applies to.")
     (define-key map "@" 'outline-mark-subtree)
     (define-key map "\C-n" 'outline-next-visible-heading)
     (define-key map "\C-p" 'outline-previous-visible-heading)
-    (define-key map "\C-i" 'show-children)
+    (define-key map "\C-i" 'outline-show-children)
     (define-key map "\C-s" 'outline-show-subtree)
     (define-key map "\C-d" 'outline-hide-subtree)
     (define-key map "\C-u" 'outline-up-heading)
@@ -108,8 +108,8 @@ in the file it applies to.")
     (define-key map [show outline-show-subtree]
       '(menu-item "Show Subtree" outline-show-subtree
         :help "Show everything after this heading at deeper levels"))
-    (define-key map [show show-children]
-      '(menu-item "Show Children" show-children
+    (define-key map [show outline-show-children]
+      '(menu-item "Show Children" outline-show-children
         :help "Show all direct subheadings of this heading"))
     (define-key map [show show-branches]
       '(menu-item "Show Branches" show-branches
@@ -261,7 +261,7 @@ of the heading, so they move with it, if the line is killed 
and yanked
 back.  A heading with text hidden under it is marked with an ellipsis (...).
 
 \\{outline-mode-map}
-The commands `outline-hide-subtree', `outline-show-subtree', `show-children',
+The commands `outline-hide-subtree', `outline-show-subtree', 
`outline-show-children',
 `outline-hide-entry', `outline-show-entry', `outline-hide-leaves', and 
`show-branches'
 are used when point is on a heading line.
 
@@ -732,7 +732,7 @@ If FLAG is nil then text is shown, while if FLAG is t the 
text is hidden."
        (overlay-put o 'invisible nil)  ;Show (most of) the text.
        (while (progn
                 (outline-show-entry)
-                (show-children)
+                (outline-show-children)
                 ;; Normally just the above is needed.
                 ;; But in odd cases, the above might fail to show anything.
                 ;; To avoid an infinite loop, we have to make sure that
@@ -920,8 +920,8 @@ Show the heading too, if it is currently invisible."
   (save-excursion
     (outline-back-to-heading)
     (if (not (outline-invisible-p (line-end-position)))
-       (outline-hide-subtree)
-      (show-children)
+        (outline-hide-subtree)
+      (outline-show-children)
       (outline-show-entry))))
 
 (defun outline-flag-subtree (flag)
@@ -929,58 +929,61 @@ Show the heading too, if it is currently invisible."
     (outline-back-to-heading)
     (outline-end-of-heading)
     (outline-flag-region (point)
-                         (progn (outline-end-of-subtree) (point))
-                         flag)))
+                         (progn (outline-end-of-subtree) (point))
+                         flag)))
 
 (defun outline-end-of-subtree ()
   (outline-back-to-heading)
   (let ((first t)
-       (level (funcall outline-level)))
+        (level (funcall outline-level)))
     (while (and (not (eobp))
-               (or first (> (funcall outline-level) level)))
+                (or first (> (funcall outline-level) level)))
       (setq first nil)
       (outline-next-heading))
     (if (and (bolp) (not (eolp)))
-       ;; We stopped at a nonempty line (the next heading).
-       (progn
-         ;; Go to end of line before heading
-         (forward-char -1)
+        ;; We stopped at a nonempty line (the next heading).
+        (progn
+          ;; Go to end of line before heading
+          (forward-char -1)
           (if (and outline-blank-line (bolp))
-             ;; leave blank line before heading
-             (forward-char -1))))))
+              ;; leave blank line before heading
+              (forward-char -1))))))
 
 (defun show-branches ()
   "Show all subheadings of this heading, but not their bodies."
   (interactive)
-  (show-children 1000))
+  (outline-show-children 1000))
 
-(defun show-children (&optional level)
+(defun outline-show-children (&optional level)
   "Show all direct subheadings of this heading.
 Prefix arg LEVEL is how many levels below the current level should be shown.
 Default is enough to cause the following heading to appear."
   (interactive "P")
   (setq level
-       (if level (prefix-numeric-value level)
-         (save-excursion
-           (outline-back-to-heading)
-           (let ((start-level (funcall outline-level)))
-             (outline-next-heading)
-             (if (eobp)
-                 1
-               (max 1 (- (funcall outline-level) start-level)))))))
+        (if level (prefix-numeric-value level)
+          (save-excursion
+            (outline-back-to-heading)
+            (let ((start-level (funcall outline-level)))
+              (outline-next-heading)
+              (if (eobp)
+                  1
+                (max 1 (- (funcall outline-level) start-level)))))))
   (let (outline-view-change-hook)
     (save-excursion
       (outline-back-to-heading)
       (setq level (+ level (funcall outline-level)))
       (outline-map-region
        (lambda ()
-        (if (<= (funcall outline-level) level)
-            (outline-show-heading)))
+         (if (<= (funcall outline-level) level)
+             (outline-show-heading)))
        (point)
        (progn (outline-end-of-subtree)
-             (if (eobp) (point-max) (1+ (point)))))))
+              (if (eobp) (point-max) (1+ (point)))))))
   (run-hooks 'outline-view-change-hook))
 
+(define-obsolete-function-alias
+    'show-children 'outline-show-children "25.1")
+
 
 
 (defun outline-up-heading (arg &optional invisible-ok)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]