Function: hyrolo-hdr-move-after-p

hyrolo-hdr-move-after-p is a byte-compiled function defined in hyrolo.el.

Signature

(hyrolo-hdr-move-after-p)

Documentation

If point is within a file header, move past the hdr and blank lines.

Return non-nil if point moves, else return nil.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hyrolo.el
(defun hyrolo-hdr-move-after-p ()
  "If point is within a file header, move past the hdr and blank lines.
Return non-nil if point moves, else return nil."
  (let ((opoint (point))
        in-file-hdr-first-line
	result)
    (when (save-excursion
	    (beginning-of-line)
	    (setq in-file-hdr-first-line
                  (zerop (% (count-matches hyrolo-hdr-regexp (point-min) (line-beginning-position)) 2))))
      (cond ((save-excursion
	       (beginning-of-line)
	       (looking-at hyrolo-hdr-regexp))
	     (setq result t)
	     ;; On the first line of a file header pair
	     (beginning-of-line)
	     (when (re-search-forward hyrolo-hdr-regexp nil t 2)
	       (forward-line 1)
	       (when (looking-at hbut:source-prefix)
		 ;; @loc> line after header
		 (forward-line 1))))
	    ((save-excursion
	       (beginning-of-line)
	       (looking-at hbut:source-prefix))
	     ;; @loc> line after header
	     (setq result t)
	     (forward-line 1))))

    ;; Within a file header pair, past the first header line
    (when (and (not in-file-hdr-first-line)
               (progn (beginning-of-line)
                      (re-search-forward hyrolo-hdr-regexp nil t)))
      (setq result t)
      (forward-line 1)
      (when (looking-at hbut:source-prefix)
	;; @loc> line after header
	(forward-line 1)))

    (if (> (point) opoint)
	(progn (when (outline-invisible-p)
                 (setq opoint (point))
                 (goto-char (or (next-single-char-property-change (point) 'invisible)
                                (point)))
                 ;; Have to move past end-of-line if have moved
                 (when (> (point) opoint)
                   (goto-char (1+ (point)))))
               (while (and (looking-at-p "^[ \t]*$")
                           (zerop (forward-line 1))))
	       result)
      (goto-char opoint)
      nil)))