Function: syntax-propertize-wholelines
syntax-propertize-wholelines is a byte-compiled function defined in
syntax.el.gz.
Signature
(syntax-propertize-wholelines BEG END)
Documentation
Extend the region delimited by BEG and END to whole lines.
This function is useful for
syntax-propertize-extend-region-functions;
see Info node (elisp) Syntax Properties.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/syntax.el.gz
(defun syntax-propertize-wholelines (beg end)
"Extend the region delimited by BEG and END to whole lines.
This function is useful for
`syntax-propertize-extend-region-functions';
see Info node `(elisp) Syntax Properties'."
;; This let-binding was taken from
;; `font-lock-extend-region-wholelines' where it was used to avoid
;; inf-looping (Bug#21615) but for some reason it was not applied
;; here in syntax.el and was used only for the "beg" side.
(let ((inhibit-field-text-motion t))
(let ((new-beg (progn (goto-char beg)
(if (bolp) beg
(syntax--lbp))))
(new-end (progn (goto-char end)
(if (bolp) end
(syntax--lbp 2)))))
(unless (and (eql beg new-beg) (eql end new-end))
(cons new-beg new-end)))))