Function: allout-back-to-current-heading

allout-back-to-current-heading is an interactive and byte-compiled function defined in allout.el.gz.

Signature

(allout-back-to-current-heading &optional INTERACTIVE)

Documentation

Move to heading line of current topic, or beginning if not in a topic.

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.

Key Bindings

Aliases

allout-back-to-heading

Source Code

;; Defined in /usr/src/emacs/lisp/allout.el.gz
;;;_   > allout-back-to-current-heading (&optional interactive)
(defun allout-back-to-current-heading (&optional interactive)
  "Move to heading line of current topic, or beginning if not in a topic.

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."

  (interactive "p")

  (allout-beginning-of-current-line)
  (let ((bol-point (point)))
    (when (allout-goto-prefix-doublechecked)
      (if (<= (point) bol-point)
          (progn
            (setq bol-point (point))
            (allout-beginning-of-current-line)
            (if (not (= bol-point (point)))
                (if (looking-at allout-regexp)
                    (allout-prefix-data)))
            (if interactive
                (allout-end-of-prefix)
              (point)))
        (goto-char (point-min))
        nil))))