Function: viper-forward-char

viper-forward-char is an interactive and byte-compiled function defined in viper-cmd.el.gz.

Signature

(viper-forward-char ARG)

Documentation

Move point right ARG characters (left if ARG negative).

On reaching end of line, stop and signal error.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-cmd.el.gz
;; basic cursor movement.  j, k, l, h commands.

(defun viper-forward-char (arg)
  "Move point right ARG characters (left if ARG negative).
On reaching end of line, stop and signal error."
  (interactive "P")
  (let ((val (viper-p-val arg))
	(com (viper-getcom arg)))
    (if com (viper-move-marker-locally 'viper-com-point (point)))
    (if viper-ex-style-motion
	(progn
	  ;; the boundary condition check gets weird here because
	  ;; forward-char may be the parameter of a delete, and 'dl' works
	  ;; just like 'x' for the last char on a line, so we have to allow
	  ;; the forward motion before the 'viper-execute-com', but, of
	  ;; course, 'dl' doesn't work on an empty line, so we have to
	  ;; catch that condition before 'viper-execute-com'
	  (if (and (eolp) (bolp)) (user-error viper-ViperBell) (forward-char val))
	  (if com (viper-execute-com 'viper-forward-char val com))
	  (if (eolp) (progn (backward-char 1) (user-error viper-ViperBell))))
      (forward-char val)
      (if com (viper-execute-com 'viper-forward-char val com)))))