Function: longlines-wrap-line

longlines-wrap-line is a byte-compiled function defined in longlines.el.gz.

Signature

(longlines-wrap-line)

Documentation

If the current line needs to be wrapped, wrap it and return nil.

If wrapping is performed, point remains on the line. If the line does not need to be wrapped, move point to the next line and return t.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/longlines.el.gz
(defun longlines-wrap-line ()
  "If the current line needs to be wrapped, wrap it and return nil.
If wrapping is performed, point remains on the line.  If the line does
not need to be wrapped, move point to the next line and return t."
  (if (longlines-set-breakpoint fill-column)
      (progn (insert-before-markers-and-inherit ?\n)
             nil)
    (if (longlines-merge-lines-p)
        (progn (end-of-line)
     ;; After certain commands (e.g. kill-line), there may be two
     ;; successive soft newlines in the buffer.  In this case, we
     ;; replace these two newlines by a single space.  Unfortunately,
     ;; this breaks the conservation of (spaces + newlines), so we
     ;; have to fiddle with longlines-wrap-point.
               (if (or (prog1 (bolp) (forward-char 1)) (eolp))
                   (progn
                     (delete-char -1)
                     (if (> longlines-wrap-point (point))
                         (setq longlines-wrap-point
                               (1- longlines-wrap-point))))
                 (delete-char -1))
               nil)
      (forward-line 1)
      t)))