Function: kotl-mode:newline

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

Signature

(kotl-mode:newline &optional ARG)

Documentation

Insert a newline. With optional ARG, insert ARG newlines.

In Auto Fill mode, if no numeric arg, break the preceding line if it is too long.

Key Bindings

Aliases

kotl-mode:reindent-then-newline-and-indent kotl-mode:electric-newline-and-maybe-indent kotl-mode:electric-indent-just-newline kotl-mode:newline-and-indent

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kotl-mode.el
(defun kotl-mode:newline (&optional arg)
  "Insert a newline.  With optional ARG, insert ARG newlines.
In Auto Fill mode, if no numeric arg, break the preceding line if it is
too long."
  (interactive "*p")
  (kotl-mode:delete-horizontal-space)
  (let ((indent (kcell-view:indent)))
    (if (and arg (= arg 1))
	(progn
	  (save-excursion
	    (insert ?\n)
	    (insert-char ?\  indent))
	  (do-auto-fill)
	  (kfill:forward-line 1)
	  (kotl-mode:beginning-of-line))
      (while (> arg 0)
	(insert ?\n)
	(insert-char ?\  indent)
	(setq arg (1- arg))))))