summaryrefslogtreecommitdiff
path: root/lisp/allout.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-10-09 23:34:11 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-10-09 23:34:11 +0000
commit80f66ef4dfcb71320eab903660d6039118f6e1ef (patch)
tree5da6f1d633761d693cb02cd2599e43dabfa40fa7 /lisp/allout.el
parent4169c186297669d029b3e4aa5a16a7e01d1a990a (diff)
downloademacs-80f66ef4dfcb71320eab903660d6039118f6e1ef.tar.gz
* allout.el (allout-back-to-current-heading): Base on lower-level
routines to get proper disqualification of aberrant topics.
Diffstat (limited to 'lisp/allout.el')
-rw-r--r--lisp/allout.el28
1 files changed, 13 insertions, 15 deletions
diff --git a/lisp/allout.el b/lisp/allout.el
index 5f59e5e0103..b38d38d9e87 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -2736,24 +2736,22 @@ otherwise skip white space between bullet and ensuing text."
(1- allout-recent-prefix-end)))
;;;_ > allout-back-to-current-heading ()
(defun allout-back-to-current-heading ()
- "Move to heading line of current topic, or beginning if already on the line.
+ "Move to heading line of current topic, or beginning if not in a topic.
-Return value of point, unless we started outside of (before any) topics,
-in which case we return nil."
+If interactive, we position at the end of the prefix.
+
+Return value of resulting point, unless we started outside
+of (before any) topics, in which case we return nil."
(allout-beginning-of-current-line)
- (if (or (allout-on-current-heading-p)
- (and (re-search-backward (concat "^\\(" allout-regexp "\\)")
- nil 'move)
- (progn (while (allout-hidden-p)
- (allout-beginning-of-current-line)
- (if (not (looking-at allout-regexp))
- (re-search-backward allout-regexp
- nil 'move)))
- (allout-prefix-data))))
- (if (interactive-p)
- (allout-end-of-prefix)
- (point))))
+ (let ((bol-point (point)))
+ (allout-goto-prefix-doublechecked)
+ (if (<= (point) bol-point)
+ (if (interactive-p)
+ (allout-end-of-prefix)
+ (point))
+ (goto-char (point-min))
+ nil)))
;;;_ > allout-back-to-heading ()
(defalias 'allout-back-to-heading 'allout-back-to-current-heading)
;;;_ > allout-pre-next-prefix ()