Function: kotl-mode:forward-sentence

kotl-mode:forward-sentence is an interactive and byte-compiled function defined in kotl-mode.el.

Signature

(kotl-mode:forward-sentence &optional ARG)

Documentation

Move point forward ARG (or 1) sentences and return point.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kotl-mode.el
(defun kotl-mode:forward-sentence (&optional arg)
  "Move point forward ARG (or 1) sentences and return point."
  (interactive "P")
  (kotl-mode:maintain-region-highlight)
  (let* ((lbl-sep-len (kview:label-separator-length kotl-kview))
	 ;; Setting fill prefix makes sentence commands properly recognize
	 ;; indented paragraphs.
	 (fill-prefix (make-string (kcell-view:indent nil lbl-sep-len) ?\ )))
    (if (kotl-mode:eobp)
	(error "(kotl-mode:forward-sentence): Last sentence")
      (if (kotl-mode:eocp) (kcell-view:next nil lbl-sep-len))
      (unless arg
	(setq arg 1))
      (save-restriction
	(when (= arg 1)
	  (narrow-to-region
	   (- (kcell-view:start nil lbl-sep-len)
	      (kcell-view:indent nil lbl-sep-len))
	   (kcell-view:end-contents)))
	(unwind-protect
	    (let ((opoint (point)))
	      (forward-sentence arg)
	      (when (= opoint (point))
		(kcell-view:next nil lbl-sep-len)
		(forward-sentence arg)))
	  (kotl-mode:to-valid-position)))))
  (point))