emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/outline 8fc5ca4 15/15: lisp/outline.el (outline-sh


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

branch: scratch/outline
commit 8fc5ca46871b8451b838b70fdc84dcc7e3e6d1e4
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    lisp/outline.el (outline-show-branches): Rename from `show-branches'.
---
 lisp/ChangeLog  |    5 +
 lisp/outline.el |  400 ++++++++++++++++++++++++++++---------------------------
 2 files changed, 208 insertions(+), 197 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4bc184c..1146e73 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
 2015-01-28  Oleh Krehel  <address@hidden>
 
+       * outline.el (outline-show-branches): Rename from `show-branches'.
+       (show-branches): Declare as obsolete.
+
+2015-01-28  Oleh Krehel  <address@hidden>
+
        * outline.el (outline-show-children): Rename from `show-children'.
        (show-children): Declare as obsolete.
 
diff --git a/lisp/outline.el b/lisp/outline.el
index ed54eab..0f7dab2 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -73,7 +73,7 @@ in the file it applies to.")
     (define-key map "\C-c" 'outline-hide-entry)
     (define-key map "\C-e" 'outline-show-entry)
     (define-key map "\C-l" 'outline-hide-leaves)
-    (define-key map "\C-k" 'show-branches)
+    (define-key map "\C-k" 'outline-show-branches)
     (define-key map "\C-q" 'outline-hide-sublevels)
     (define-key map "\C-o" 'outline-hide-other)
     (define-key map "\C-^" 'outline-move-subtree-up)
@@ -111,8 +111,8 @@ in the file it applies to.")
     (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
+    (define-key map [show outline-show-branches]
+      '(menu-item "Show Branches" outline-show-branches
         :help "Show all subheadings of this heading, but not their bodies"))
     (define-key map [show outline-show-entry]
       '(menu-item "Show Entry" outline-show-entry
@@ -261,8 +261,9 @@ 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', 
`outline-show-children',
-`outline-hide-entry', `outline-show-entry', `outline-hide-leaves', and 
`show-branches'
+The commands `outline-hide-subtree', `outline-show-subtree',
+`outline-show-children', `outline-hide-entry',
+`outline-show-entry', `outline-hide-leaves', and `outline-show-branches'
 are used when point is on a heading line.
 
 The variable `outline-regexp' can be changed to control what is a heading.
@@ -365,7 +366,7 @@ or else the number of characters matched by 
`outline-regexp'."
 If there's no following heading line, stop before the newline
 at the end of the buffer."
   (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)")
-                        nil 'move)
+                         nil 'move)
       (goto-char (match-beginning 0)))
   (if (and (bolp) (or outline-blank-line (eobp)) (not (bobp)))
       (forward-char -1)))
@@ -376,14 +377,14 @@ at the end of the buffer."
   ;; Make sure we don't match the heading we're at.
   (if (and (bolp) (not (eobp))) (forward-char 1))
   (if (re-search-forward (concat "^\\(?:" outline-regexp "\\)")
-                        nil 'move)
+                         nil 'move)
       (goto-char (match-beginning 0))))
 
 (defun outline-previous-heading ()
   "Move to the previous (possibly invisible) heading line."
   (interactive)
   (re-search-backward (concat "^\\(?:" outline-regexp "\\)")
-                     nil 'move))
+                      nil 'move))
 
 (defsubst outline-invisible-p (&optional pos)
   "Non-nil if the character after point is invisible."
@@ -395,15 +396,15 @@ Only visible heading lines are considered, unless 
INVISIBLE-OK is non-nil."
   (beginning-of-line)
   (or (outline-on-heading-p invisible-ok)
       (let (found)
-       (save-excursion
-         (while (not found)
-           (or (re-search-backward (concat "^\\(?:" outline-regexp "\\)")
-                                   nil t)
-               (error "before first heading"))
-           (setq found (and (or invisible-ok (not (outline-invisible-p)))
-                            (point)))))
-       (goto-char found)
-       found)))
+        (save-excursion
+          (while (not found)
+            (or (re-search-backward (concat "^\\(?:" outline-regexp "\\)")
+                                    nil t)
+                (error "before first heading"))
+            (setq found (and (or invisible-ok (not (outline-invisible-p)))
+                             (point)))))
+        (goto-char found)
+        found)))
 
 (defun outline-on-heading-p (&optional invisible-ok)
   "Return t if point is on a (visible) heading line.
@@ -411,21 +412,21 @@ If INVISIBLE-OK is non-nil, an invisible heading line is 
ok too."
   (save-excursion
     (beginning-of-line)
     (and (bolp) (or invisible-ok (not (outline-invisible-p)))
-        (looking-at outline-regexp))))
+         (looking-at outline-regexp))))
 
 (defun outline-insert-heading ()
   "Insert a new heading at same depth at point."
   (interactive)
   (let ((head (save-excursion
-               (condition-case nil
-                   (outline-back-to-heading)
-                 (error (outline-next-heading)))
-               (if (eobp)
-                   (or (caar outline-heading-alist) "")
-                 (match-string 0)))))
+                (condition-case nil
+                    (outline-back-to-heading)
+                  (error (outline-next-heading)))
+                (if (eobp)
+                    (or (caar outline-heading-alist) "")
+                  (match-string 0)))))
     (unless (or (string-match "[ \t]\\'" head)
-               (not (string-match (concat "\\`\\(?:" outline-regexp "\\)")
-                                  (concat head " "))))
+                (not (string-match (concat "\\`\\(?:" outline-regexp "\\)")
+                                   (concat head " "))))
       (setq head (concat head " ")))
     (unless (bolp) (end-of-line) (newline))
     (insert head)
@@ -457,34 +458,34 @@ 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))))
+           (outline-back-to-heading)
+           (if current-prefix-arg nil 'subtree))))
   (cond
-   ((eq which 'region)
-    (outline-map-region 'outline-promote (region-beginning) (region-end)))
-   (which
-    (outline-map-region 'outline-promote
-                       (point)
-                       (save-excursion (outline-get-next-sibling) (point))))
-   (t
-    (outline-back-to-heading t)
-    (let* ((head (match-string-no-properties 0))
-          (level (save-match-data (funcall outline-level)))
-          (up-head (or (outline-head-from-level (1- level) head)
-                       ;; Use the parent heading, if it is really
-                       ;; one level less.
-                       (save-excursion
-                         (save-match-data
-                           (outline-up-heading 1 t)
-                           (and (= (1- level) (funcall outline-level))
-                                (match-string-no-properties 0))))
-                        ;; Bummer!! There is no lower level heading.
-                        (outline-invent-heading head 'up))))
-
-      (unless (rassoc level outline-heading-alist)
-       (push (cons head level) outline-heading-alist))
-
-      (replace-match up-head nil t)))))
+    ((eq which 'region)
+     (outline-map-region 'outline-promote (region-beginning) (region-end)))
+    (which
+     (outline-map-region 'outline-promote
+                         (point)
+                         (save-excursion (outline-get-next-sibling) (point))))
+    (t
+     (outline-back-to-heading t)
+     (let* ((head (match-string-no-properties 0))
+            (level (save-match-data (funcall outline-level)))
+            (up-head (or (outline-head-from-level (1- level) head)
+                         ;; Use the parent heading, if it is really
+                         ;; one level less.
+                         (save-excursion
+                           (save-match-data
+                             (outline-up-heading 1 t)
+                             (and (= (1- level) (funcall outline-level))
+                                  (match-string-no-properties 0))))
+                         ;; Bummer!! There is no lower level heading.
+                         (outline-invent-heading head 'up))))
+
+       (unless (rassoc level outline-heading-alist)
+         (push (cons head level) outline-heading-alist))
+
+       (replace-match up-head nil t)))))
 
 (defun outline-demote (&optional which)
   "Demote headings lower down the tree.
@@ -496,38 +497,38 @@ 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))))
+           (outline-back-to-heading)
+           (if current-prefix-arg nil 'subtree))))
   (cond
-   ((eq which 'region)
-    (outline-map-region 'outline-demote (region-beginning) (region-end)))
-   (which
-    (outline-map-region 'outline-demote
-                       (point)
-                       (save-excursion (outline-get-next-sibling) (point))))
-   (t
-    (let* ((head (match-string-no-properties 0))
-          (level (save-match-data (funcall outline-level)))
-          (down-head
-           (or (outline-head-from-level (1+ level) head)
-               (save-excursion
-                 (save-match-data
-                   (while (and (progn (outline-next-heading) (not (eobp)))
-                               (<= (funcall outline-level) level)))
-                   (when (eobp)
-                     ;; Try again from the beginning of the buffer.
-                     (goto-char (point-min))
-                     (while (and (progn (outline-next-heading) (not (eobp)))
-                                 (<= (funcall outline-level) level))))
-                   (unless (eobp)
-                     (looking-at outline-regexp)
-                     (match-string-no-properties 0))))
-                ;; Bummer!! There is no higher-level heading in the buffer.
-                (outline-invent-heading head nil))))
-
-      (unless (rassoc level outline-heading-alist)
-       (push (cons head level) outline-heading-alist))
-      (replace-match down-head nil t)))))
+    ((eq which 'region)
+     (outline-map-region 'outline-demote (region-beginning) (region-end)))
+    (which
+     (outline-map-region 'outline-demote
+                         (point)
+                         (save-excursion (outline-get-next-sibling) (point))))
+    (t
+     (let* ((head (match-string-no-properties 0))
+            (level (save-match-data (funcall outline-level)))
+            (down-head
+             (or (outline-head-from-level (1+ level) head)
+                 (save-excursion
+                   (save-match-data
+                     (while (and (progn (outline-next-heading) (not (eobp)))
+                                 (<= (funcall outline-level) level)))
+                     (when (eobp)
+                       ;; Try again from the beginning of the buffer.
+                       (goto-char (point-min))
+                       (while (and (progn (outline-next-heading) (not (eobp)))
+                                   (<= (funcall outline-level) level))))
+                     (unless (eobp)
+                       (looking-at outline-regexp)
+                       (match-string-no-properties 0))))
+                 ;; Bummer!! There is no higher-level heading in the buffer.
+                 (outline-invent-heading head nil))))
+
+       (unless (rassoc level outline-heading-alist)
+         (push (cons head level) outline-heading-alist))
+       (replace-match down-head nil t)))))
 
 (defun outline-head-from-level (level head &optional alist)
   "Get new heading with level LEVEL from ALIST.
@@ -540,29 +541,29 @@ This makes it possible for promotion to work in modes 
with several
 independent sets of headings (numbered, unnumbered, appendix...)"
   (unless alist (setq alist outline-heading-alist))
   (let ((l (rassoc level alist))
-       ll h hl l2 l2l)
+        ll h hl l2 l2l)
     (cond
-     ((null l) nil)
-     ;; If there's no HEAD after L, any other entry for LEVEL after L
-     ;; can't be much better than L.
-     ((null (setq h (assoc head (setq ll (memq l alist))))) (car l))
-     ;; If there's no other entry for LEVEL, just keep L.
-     ((null (setq l2 (rassoc level (cdr ll)))) (car l))
-     ;; Now we have L, L2, and H: see if L2 seems better than L.
-     ;; If H is after L2, L2 is better.
-     ((memq h (setq l2l (memq l2 (cdr ll))))
-      (outline-head-from-level level head l2l))
-     ;; Now we have H between L and L2.
-     ;; If there's a separator between L and H, prefer L2.
-     ((memq h (memq nil ll))
-      (outline-head-from-level level head l2l))
-     ;; If there's a separator between L2 and H, prefer L.
-     ((memq l2 (memq nil (setq hl (memq h ll)))) (car l))
-     ;; No separator between L and L2, check the distance.
-     ((< (* 2 (length hl)) (+ (length ll) (length l2l)))
-      (outline-head-from-level level head l2l))
-     ;; If all else fails, just keep L.
-     (t (car l)))))
+      ((null l) nil)
+      ;; If there's no HEAD after L, any other entry for LEVEL after L
+      ;; can't be much better than L.
+      ((null (setq h (assoc head (setq ll (memq l alist))))) (car l))
+      ;; If there's no other entry for LEVEL, just keep L.
+      ((null (setq l2 (rassoc level (cdr ll)))) (car l))
+      ;; Now we have L, L2, and H: see if L2 seems better than L.
+      ;; If H is after L2, L2 is better.
+      ((memq h (setq l2l (memq l2 (cdr ll))))
+       (outline-head-from-level level head l2l))
+      ;; Now we have H between L and L2.
+      ;; If there's a separator between L and H, prefer L2.
+      ((memq h (memq nil ll))
+       (outline-head-from-level level head l2l))
+      ;; If there's a separator between L2 and H, prefer L.
+      ((memq l2 (memq nil (setq hl (memq h ll)))) (car l))
+      ;; No separator between L and L2, check the distance.
+      ((< (* 2 (length hl)) (+ (length ll) (length l2l)))
+       (outline-head-from-level level head l2l))
+      ;; If all else fails, just keep L.
+      (t (car l)))))
 
 (defun outline-map-region (fun beg end)
   "Call FUN for every heading between BEG and END.
@@ -575,10 +576,10 @@ the match data is set appropriately."
       (goto-char (match-beginning 0))
       (funcall fun)
       (while (and (progn
-                   (outline-next-heading)
-                   (< (point) end))
-                 (not (eobp)))
-       (funcall fun)))))
+                    (outline-next-heading)
+                    (< (point) end))
+                  (not (eobp)))
+        (funcall fun)))))
 
 ;; Vertical tree motion
 
@@ -591,34 +592,36 @@ the match data is set appropriately."
   "Move the current subtree down past ARG headlines of the same level."
   (interactive "p")
   (outline-back-to-heading)
-  (let* ((movfunc (if (> arg 0) 'outline-get-next-sibling
-                   'outline-get-last-sibling))
-        ;; Find the end of the subtree to be moved as well as the point to
-        ;; move it to, adding a newline if necessary, to ensure these points
-        ;; are at bol on the line below the subtree.
+  (let* ((movfunc (if (> arg 0)
+                      'outline-get-next-sibling
+                    'outline-get-last-sibling))
+         ;; Find the end of the subtree to be moved as well as the point to
+         ;; move it to, adding a newline if necessary, to ensure these points
+         ;; are at bol on the line below the subtree.
          (end-point-func (lambda ()
-                          (outline-end-of-subtree)
-                          (if (eq (char-after) ?\n) (forward-char 1)
-                               (if (and (eobp) (not (bolp))) (insert "\n")))
-                          (point)))
+                           (outline-end-of-subtree)
+                           (if (eq (char-after) ?\n)
+                               (forward-char 1)
+                             (if (and (eobp) (not (bolp))) (insert "\n")))
+                           (point)))
          (beg (point))
          (folded (save-match-data
-                  (outline-end-of-heading)
-                  (outline-invisible-p)))
+                   (outline-end-of-heading)
+                   (outline-invisible-p)))
          (end (save-match-data
-               (funcall end-point-func)))
+                (funcall end-point-func)))
          (ins-point (make-marker))
          (cnt (abs arg)))
     ;; Find insertion point, with error handling.
     (goto-char beg)
     (while (> cnt 0)
       (or (funcall movfunc)
-         (progn (goto-char beg)
-                (user-error "Cannot move past superior level")))
+          (progn (goto-char beg)
+                 (user-error "Cannot move past superior level")))
       (setq cnt (1- cnt)))
     (if (> arg 0)
-       ;; Moving forward - still need to move over subtree.
-       (funcall end-point-func))
+        ;; Moving forward - still need to move over subtree.
+        (funcall end-point-func))
     (move-marker ins-point (point))
     (insert (delete-and-extract-region beg end))
     (goto-char ins-point)
@@ -641,19 +644,19 @@ A heading line is one that starts with a `*' (or that
   (let (found-heading-p)
     (while (and (not (bobp)) (< arg 0))
       (while (and (not (bobp))
-                 (setq found-heading-p
-                       (re-search-backward
-                        (concat "^\\(?:" outline-regexp "\\)")
-                        nil 'move))
-                 (outline-invisible-p)))
+                  (setq found-heading-p
+                        (re-search-backward
+                         (concat "^\\(?:" outline-regexp "\\)")
+                         nil 'move))
+                  (outline-invisible-p)))
       (setq arg (1+ arg)))
     (while (and (not (eobp)) (> arg 0))
       (while (and (not (eobp))
-                 (setq found-heading-p
-                       (re-search-forward
-                        (concat "^\\(?:" outline-regexp "\\)")
-                        nil 'move))
-                 (outline-invisible-p (match-beginning 0))))
+                  (setq found-heading-p
+                        (re-search-forward
+                         (concat "^\\(?:" outline-regexp "\\)")
+                         nil 'move))
+                  (outline-invisible-p (match-beginning 0))))
       (setq arg (1- arg)))
     (if found-heading-p (beginning-of-line))))
 
@@ -671,8 +674,8 @@ This puts point at the start of the current subtree, and 
mark at the end."
   (interactive)
   (let ((beg))
     (if (outline-on-heading-p)
-       ;; we are already looking at a heading
-       (beginning-of-line)
+        ;; we are already looking at a heading
+        (beginning-of-line)
       ;; else go back to previous heading
       (outline-previous-visible-heading 1))
     (setq beg (point))
@@ -699,8 +702,8 @@ If FLAG is nil then text is shown, while if FLAG is t the 
text is hidden."
       (overlay-put o 'evaporate t)
       (overlay-put o 'invisible 'outline)
       (overlay-put o 'isearch-open-invisible
-                  (or outline-isearch-open-invisible-function
-                      'outline-isearch-open-invisible))))
+                   (or outline-isearch-open-invisible-function
+                       'outline-isearch-open-invisible))))
   ;; Seems only used by lazy-lock.  I.e. obsolete.
   (run-hooks 'outline-view-change-hook))
 
@@ -708,42 +711,42 @@ If FLAG is nil then text is shown, while if FLAG is t the 
text is hidden."
   (save-excursion
     (goto-char (overlay-start o))
     (if hidep
-       ;; When hiding the area again, we could just clean it up and let
-       ;; reveal do the rest, by simply doing:
-       ;; (remove-overlays (overlay-start o) (overlay-end o)
-       ;;                  'invisible 'outline)
-       ;;
-       ;; That works fine as long as everything is in sync, but if the
-       ;; structure of the document is changed while revealing parts of it,
-       ;; the resulting behavior can be ugly.  I.e. we need to make
-       ;; sure that we hide exactly a subtree.
-       (progn
-         (let ((end (overlay-end o)))
-           (delete-overlay o)
-           (while (progn
-                    (outline-hide-subtree)
-                    (outline-next-visible-heading 1)
-                    (and (not (eobp)) (< (point) end))))))
+        ;; When hiding the area again, we could just clean it up and let
+        ;; reveal do the rest, by simply doing:
+        ;; (remove-overlays (overlay-start o) (overlay-end o)
+        ;;                  'invisible 'outline)
+        ;;
+        ;; That works fine as long as everything is in sync, but if the
+        ;; structure of the document is changed while revealing parts of it,
+        ;; the resulting behavior can be ugly.  I.e. we need to make
+        ;; sure that we hide exactly a subtree.
+        (progn
+          (let ((end (overlay-end o)))
+            (delete-overlay o)
+            (while (progn
+                     (outline-hide-subtree)
+                     (outline-next-visible-heading 1)
+                     (and (not (eobp)) (< (point) end))))))
 
       ;; When revealing, we just need to reveal sublevels.  If point is
       ;; inside one of the sublevels, reveal will call us again.
       ;; But we need to preserve the original overlay.
       (let ((o1 (copy-overlay o)))
-       (overlay-put o 'invisible nil)  ;Show (most of) the text.
-       (while (progn
-                (outline-show-entry)
-                (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
-                ;; *something* gets shown.
-                (and (equal (overlay-start o) (overlay-start o1))
-                     (< (point) (overlay-end o))
-                     (= 0 (forward-line 1)))))
-       ;; If still nothing was shown, just kill the damn thing.
-       (when (equal (overlay-start o) (overlay-start o1))
-         ;; I've seen it happen at the end of buffer.
-         (delete-overlay o1))))))
+        (overlay-put o 'invisible nil)  ;Show (most of) the text.
+        (while (progn
+                 (outline-show-entry)
+                 (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
+                 ;; *something* gets shown.
+                 (and (equal (overlay-start o) (overlay-start o1))
+                      (< (point) (overlay-end o))
+                      (= 0 (forward-line 1)))))
+        ;; If still nothing was shown, just kill the damn thing.
+        (when (equal (overlay-start o) (overlay-start o1))
+          ;; I've seen it happen at the end of buffer.
+          (delete-overlay o1))))))
 
 ;; Function to be set as an outline-isearch-open-invisible' property
 ;; to the overlay that makes the outline invisible (see
@@ -949,11 +952,14 @@ Show the heading too, if it is currently invisible."
               ;; leave blank line before heading
               (forward-char -1))))))
 
-(defun show-branches ()
+(defun outline-show-branches ()
   "Show all subheadings of this heading, but not their bodies."
   (interactive)
   (outline-show-children 1000))
 
+(define-obsolete-function-alias
+    'show-branches 'outline-show-branches "25.1")
+
 (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.
@@ -999,12 +1005,12 @@ If INVISIBLE-OK is non-nil, also consider invisible 
lines."
       (error "Already at top level of the outline"))
     (while (and (> start-level 1) (> arg 0) (not (bobp)))
       (let ((level start-level))
-       (while (not (or (< level start-level) (bobp)))
-         (if invisible-ok
-             (outline-previous-heading)
-           (outline-previous-visible-heading 1))
-         (setq level (funcall outline-level)))
-       (setq start-level level))
+        (while (not (or (< level start-level) (bobp)))
+          (if invisible-ok
+              (outline-previous-heading)
+            (outline-previous-visible-heading 1))
+          (setq level (funcall outline-level)))
+        (setq start-level level))
       (setq arg (- arg 1))))
   (looking-at outline-regexp))
 
@@ -1015,14 +1021,14 @@ Stop at the first and last subheadings of a superior 
heading."
   (outline-back-to-heading)
   (while (> arg 0)
     (let ((point-to-move-to (save-excursion
-                             (outline-get-next-sibling))))
+                              (outline-get-next-sibling))))
       (if point-to-move-to
-         (progn
-           (goto-char point-to-move-to)
-           (setq arg (1- arg)))
-       (progn
-         (setq arg 0)
-         (error "No following same-level heading"))))))
+          (progn
+            (goto-char point-to-move-to)
+            (setq arg (1- arg)))
+        (progn
+          (setq arg 0)
+          (error "No following same-level heading"))))))
 
 (defun outline-get-next-sibling ()
   "Move to next heading of the same level, and return point.
@@ -1032,7 +1038,7 @@ If there is no such heading, return nil."
     (while (and (not (eobp)) (> (funcall outline-level) level))
       (outline-next-visible-heading 1))
     (if (or (eobp) (< (funcall outline-level) level))
-       nil
+        nil
       (point))))
 
 (defun outline-backward-same-level (arg)
@@ -1042,27 +1048,27 @@ Stop at the first and last subheadings of a superior 
heading."
   (outline-back-to-heading)
   (while (> arg 0)
     (let ((point-to-move-to (save-excursion
-                             (outline-get-last-sibling))))
+                              (outline-get-last-sibling))))
       (if point-to-move-to
-         (progn
-           (goto-char point-to-move-to)
-           (setq arg (1- arg)))
-       (progn
-         (setq arg 0)
-         (error "No previous same-level heading"))))))
+          (progn
+            (goto-char point-to-move-to)
+            (setq arg (1- arg)))
+        (progn
+          (setq arg 0)
+          (error "No previous same-level heading"))))))
 
 (defun outline-get-last-sibling ()
   "Move to previous heading of the same level, and return point.
 If there is no such heading, return nil."
   (let ((opoint (point))
-       (level (funcall outline-level)))
+        (level (funcall outline-level)))
     (outline-previous-visible-heading 1)
     (when (and (/= (point) opoint) (outline-on-heading-p))
       (while (and (> (funcall outline-level) level)
-                 (not (bobp)))
-       (outline-previous-visible-heading 1))
+                  (not (bobp)))
+        (outline-previous-visible-heading 1))
       (if (< (funcall outline-level) level)
-         nil
+          nil
         (point)))))
 
 (defun outline-headers-as-kill (beg end)



reply via email to

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