Mercurial > emacs
comparison lisp/textmodes/outline.el @ 12604:140e46e751a0
(outline-next-visible-heading): Rewritten to handle
backwards motion and handle beg/end of buffer properly.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 19 Jul 1995 03:19:03 +0000 |
parents | 07ac8009368c |
children | 11899bfa541c |
comparison
equal
deleted
inserted
replaced
12603:6d033c8501d4 | 12604:140e46e751a0 |
---|---|
329 `outline-regexp' matches)." | 329 `outline-regexp' matches)." |
330 (interactive "p") | 330 (interactive "p") |
331 (if (< arg 0) | 331 (if (< arg 0) |
332 (beginning-of-line) | 332 (beginning-of-line) |
333 (end-of-line)) | 333 (end-of-line)) |
334 (let (found) | 334 (while (and (not (bobp)) (< arg 0)) |
335 (or (while (and found (> arg 0)) | 335 (while (and (not (bobp)) |
336 (setq found nil) | 336 (re-search-backward (concat "^\\(" outline-regexp "\\)") |
337 (while (not found) | 337 nil 'move) |
338 (setq found | 338 (not (outline-visible)))) |
339 (and (re-search-backward (concat "^\\(" outline-regexp "\\)") | 339 (setq arg (1+ arg))) |
340 nil t) | 340 (while (and (not (eobp)) (> arg 0)) |
341 (outline-visible)))) | 341 (while (and (not (eobp)) |
342 (setq arg (1- arg))) | 342 (re-search-forward (concat "^\\(" outline-regexp "\\)") |
343 (error ""))) | 343 nil 'move) |
344 (not (outline-visible)))) | |
345 (setq arg (1- arg))) | |
344 (beginning-of-line)) | 346 (beginning-of-line)) |
345 | 347 |
346 (defun outline-previous-visible-heading (arg) | 348 (defun outline-previous-visible-heading (arg) |
347 "Move to the previous heading line. | 349 "Move to the previous heading line. |
348 With argument, repeats or can move forward if negative. | 350 With argument, repeats or can move forward if negative. |