Function: rst-forward-line-looking-at
rst-forward-line-looking-at is a byte-compiled function defined in
rst.el.gz.
Signature
(rst-forward-line-looking-at N RST-RE-ARGS &optional FUN)
Documentation
Move forward N lines and if successful check whether RST-RE-ARGS is matched.
Moving forward is done by rst-forward-line-strict. RST-RE-ARGS
is a single or a list of arguments for rst-re. FUN is a
function defaulting to identity which is called after the call
to looking-at receiving its return value as the first argument.
When FUN is called match data is just set by looking-at and
point is at the beginning of the line. Return nil if moving
forward failed or otherwise the return value of FUN. Preserve
global match data, point, mark and current buffer.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
(defun rst-forward-line-looking-at (n rst-re-args &optional fun)
;; testcover: ok.
"Move forward N lines and if successful check whether RST-RE-ARGS is matched.
Moving forward is done by `rst-forward-line-strict'. RST-RE-ARGS
is a single or a list of arguments for `rst-re'. FUN is a
function defaulting to `identity' which is called after the call
to `looking-at' receiving its return value as the first argument.
When FUN is called match data is just set by `looking-at' and
point is at the beginning of the line. Return nil if moving
forward failed or otherwise the return value of FUN. Preserve
global match data, point, mark and current buffer."
(setq rst-re-args (ensure-list rst-re-args))
(unless fun
(setq fun #'identity))
(save-match-data
(save-excursion
(when (rst-forward-line-strict n)
(funcall fun (looking-at (apply #'rst-re rst-re-args)))))))