Function: rst-Ttl-from-buffer
rst-Ttl-from-buffer is a byte-compiled function defined in rst.el.gz.
Signature
(rst-Ttl-from-buffer ADO BEG-OVR BEG-TXT BEG-UND TXT)
Documentation
Return a rst-Ttl constructed from information in the current buffer.
ADO is the adornment or nil for a title candidate. BEG-OVR and BEG-UND are the starting points of the overline or underline, respectively. They may be nil if the respective thing is missing. BEG-TXT is the beginning of the title line or the transition and must be given. The end of the line is used as the end point. TXT is the title text or nil. If TXT is given the indentation of the line containing BEG-TXT is used as indentation. Match group 0 is derived from the remaining information.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
;; Public class methods
(defun rst-Ttl-from-buffer (ado beg-ovr beg-txt beg-und txt)
;; testcover: ok.
"Return a `rst-Ttl' constructed from information in the current buffer.
ADO is the adornment or nil for a title candidate. BEG-OVR and
BEG-UND are the starting points of the overline or underline,
respectively. They may be nil if the respective thing is missing.
BEG-TXT is the beginning of the title line or the transition and
must be given. The end of the line is used as the end point. TXT
is the title text or nil. If TXT is given the indentation of the
line containing BEG-TXT is used as indentation. Match group 0 is
derived from the remaining information."
(cl-check-type beg-txt integer-or-marker)
(save-excursion
(let ((end-ovr (when beg-ovr
(goto-char beg-ovr)
(line-end-position)))
(end-txt (progn
(goto-char beg-txt)
(line-end-position)))
(end-und (when beg-und
(goto-char beg-und)
(line-end-position)))
(ind (when txt
(goto-char beg-txt)
(current-indentation))))
(rst-Ttl--new ado
(list
(or beg-ovr beg-txt) (or end-und end-txt)
beg-ovr end-ovr
beg-txt end-txt
beg-und end-und)
ind txt))))