Function: viper-join-lines

viper-join-lines is an interactive and byte-compiled function defined in viper-cmd.el.gz.

Signature

(viper-join-lines ARG)

Documentation

Join this line to next, if ARG is nil. Otherwise, join ARG lines.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-cmd.el.gz
;; join lines.

(defun viper-join-lines (arg)
  "Join this line to next, if ARG is nil.  Otherwise, join ARG lines."
  (interactive "*P")
  (let ((val (viper-P-val arg)))
    (viper-set-destructive-command
     (list 'viper-join-lines val nil nil nil nil))
    (viper-loop (if (null val) 1 (1- val))
		(end-of-line)
		(if (not (eobp))
		    (progn
		      (forward-line 1)
		      (delete-region (point) (1- (point)))
		      (fixup-whitespace)
		      ;; fixup-whitespace sometimes does not leave space
		      ;; between objects, so we insert it as in Vi
		      (or (looking-at " ")
			  (insert " ")
			  (backward-char 1))
		      )))))