emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/outline 2046e5a 07/15: lisp/outline.el (outline-hi


From: Oleh Krehel
Subject: [Emacs-diffs] scratch/outline 2046e5a 07/15: lisp/outline.el (outline-hide-region-body): Rename.
Date: Wed, 28 Jan 2015 11:44:22 +0000

branch: scratch/outline
commit 2046e5aeb3fe4c3b2a1422581d8106495092f0a5
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    lisp/outline.el (outline-hide-region-body): Rename.
    
    * lisp/outline.el (outline-hide-region-body): Rename from
      `hide-region-body'.
---
 lisp/ChangeLog  |    6 ++++++
 lisp/outline.el |   31 +++++++++++++++++--------------
 2 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c452b31..523df94 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
 2015-01-28  Oleh Krehel  <address@hidden>
 
+       * outline.el (outline-hide-region-body): Rename from
+       `hide-region-body'.
+       (hide-region-body): Declare as obsolete.
+
+2015-01-28  Oleh Krehel  <address@hidden>
+
        * outline.el (outline-hide-body): Rename from `hide-body'.
        (hide-body): Declare as obsolete.
 
diff --git a/lisp/outline.el b/lisp/outline.el
index cfc19a0..8105eb1 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -778,12 +778,12 @@ Show the heading too, if it is currently invisible."
 (defun outline-hide-body ()
   "Hide all body lines in buffer, leaving all headings visible."
   (interactive)
-  (hide-region-body (point-min) (point-max)))
+  (outline-hide-region-body (point-min) (point-max)))
 
 (define-obsolete-function-alias
     'hide-body 'outline-hide-body "25.1")
 
-(defun hide-region-body (start end)
+(defun outline-hide-region-body (start end)
   "Hide all body lines in the region, but not headings."
   ;; Nullify the hook to avoid repeated calls to `outline-flag-region'
   ;; wasting lots of time running `lazy-lock-fontify-after-outline'
@@ -791,19 +791,22 @@ Show the heading too, if it is currently invisible."
   (let (outline-view-change-hook)
     (save-excursion
       (save-restriction
-       (narrow-to-region start end)
-       (goto-char (point-min))
-       (if (outline-on-heading-p)
-           (outline-end-of-heading)
-         (outline-next-preface))
-       (while (not (eobp))
-         (outline-flag-region (point)
-                              (progn (outline-next-preface) (point)) t)
-         (unless (eobp)
-           (forward-char (if (looking-at "\n\n") 2 1))
-           (outline-end-of-heading))))))
+        (narrow-to-region start end)
+        (goto-char (point-min))
+        (if (outline-on-heading-p)
+            (outline-end-of-heading)
+          (outline-next-preface))
+        (while (not (eobp))
+          (outline-flag-region (point)
+                               (progn (outline-next-preface) (point)) t)
+          (unless (eobp)
+            (forward-char (if (looking-at "\n\n") 2 1))
+            (outline-end-of-heading))))))
   (run-hooks 'outline-view-change-hook))
 
+(define-obsolete-function-alias
+    'hide-region-body 'outline-hide-region-body "25.1")
+
 (defun show-all ()
   "Show all of the text in the buffer."
   (interactive)
@@ -821,7 +824,7 @@ Show the heading too, if it is currently invisible."
     (outline-back-to-heading)
 ;; Turned off to fix bug reported by Otto Maddox on 22 Nov 2005.
 ;;    (outline-end-of-heading)
-    (hide-region-body (point) (progn (outline-end-of-subtree) (point)))))
+    (outline-hide-region-body (point) (progn (outline-end-of-subtree) 
(point)))))
 
 (defun show-subtree ()
   "Show everything after this heading at deeper levels."



reply via email to

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