+2006-10-09 Ken Manheimer <ken.manheimer@gmail.com>
+
+ * allout.el (allout-back-to-current-heading): Base on lower-level
+ routines to get proper disqualification of aberrant topics.
+
2006-10-09 Richard Stallman <rms@gnu.org>
* textmodes/two-column.el (2C-two-columns): Doc fix.
(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 ()