Function: viper-replace-state-carriage-return

viper-replace-state-carriage-return is an interactive and byte-compiled function defined in viper-cmd.el.gz.

Signature

(viper-replace-state-carriage-return)

Documentation

Carriage return in Viper replace state.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-cmd.el.gz
(defun viper-replace-state-carriage-return ()
  "Carriage return in Viper replace state."
  (interactive)
  ;; If Emacs start supporting overlay maps, as it currently supports
  ;; text-property maps, we could do away with viper-replace-minor-mode and
  ;; just have keymap attached to replace overlay.  Then the "if part" of this
  ;; statement can be deleted.
  (if (or (< (point) (viper-replace-start))
	  (> (point) (viper-replace-end)))
      (let (viper-replace-minor-mode com)
	(viper-set-unread-command-events last-input-event)
	(setq com (key-binding (read-key-sequence nil)))
	(condition-case conds
	    (command-execute com)
	  (error
	   (viper-message-conditions conds))))
    (if (not viper-allow-multiline-replace-regions)
	(viper-replace-state-exit-cmd)
      (if (viper-same-line (point) (viper-replace-end))
	  (viper-replace-state-exit-cmd)
	;; delete the rest of line
	(delete-region (point) (viper-line-pos 'end))
	(save-excursion
	  (end-of-line)
	  (if (eobp) (error "Last line in buffer")))
	;; skip to the next line
	(forward-line 1)
	(back-to-indentation)
	))))