Function: rst-font-lock-find-unindented-line-limit

rst-font-lock-find-unindented-line-limit is a byte-compiled function defined in rst.el.gz.

Signature

(rst-font-lock-find-unindented-line-limit IND-PNT)

Documentation

Find the next unindented line relative to indentation at IND-PNT.

Return this point, the end of the buffer or nil if nothing found. If IND-PNT is next take the indentation from the next line if this is not empty and indented more than the current one. If IND-PNT is non-nil but not a number take the indentation from the next non-empty line if this is indented more than the current one.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
(defun rst-font-lock-find-unindented-line-limit (ind-pnt)
  "Find the next unindented line relative to indentation at IND-PNT.
Return this point, the end of the buffer or nil if nothing found.
If IND-PNT is `next' take the indentation from the next line if
this is not empty and indented more than the current one.  If
IND-PNT is non-nil but not a number take the indentation from the
next non-empty line if this is indented more than the current one."
  (setq rst-font-lock-find-unindented-line-begin ind-pnt)
  (setq rst-font-lock-find-unindented-line-end
	(save-match-data
	  (save-excursion
	    (when (not (numberp ind-pnt))
	      ;; Find indentation point in next line if any.
	      (setq ind-pnt
		    ;; FIXME: Should be refactored to two different functions
		    ;;        giving their result to this function, may be
		    ;;        integrated in caller.
		    (save-match-data
		      (let ((cur-ind (current-indentation)))
			(if (eq ind-pnt 'next)
			    (when (and (rst-forward-line-strict 1 (point-max))
				       (< (point) (point-max)))
			      ;; Not at EOF.
			      (setq rst-font-lock-find-unindented-line-begin
				    (point))
			      (when (and (not (looking-at (rst-re 'lin-end)))
					 (> (current-indentation) cur-ind))
                                ;; Use end of indentation if non-empty line.
				(looking-at (rst-re 'hws-tag))
				(match-end 0)))
			  ;; Skip until non-empty line or EOF.
			  (while (and (rst-forward-line-strict 1 (point-max))
				      (< (point) (point-max))
				      (looking-at (rst-re 'lin-end))))
			  (when (< (point) (point-max))
			    ;; Not at EOF.
			    (setq rst-font-lock-find-unindented-line-begin
				  (point))
			    (when (> (current-indentation) cur-ind)
			      ;; Indentation bigger than line of departure.
			      (looking-at (rst-re 'hws-tag))
			      (match-end 0))))))))
	    (when ind-pnt
	      (goto-char ind-pnt)
	      (or (rst-forward-indented-block nil (point-max))
		  (point-max)))))))