Function: viper-ring-rotate1

viper-ring-rotate1 is a byte-compiled function defined in viper-util.el.gz.

Signature

(viper-ring-rotate1 RING DIR)

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-util.el.gz
;;; Insertion ring

;; Rotate RING's index.  DIRection can be positive or negative.
(defun viper-ring-rotate1 (ring dir)
  (if (and (ring-p ring) (> (ring-length ring) 0))
      (progn
	(setcar ring (cond ((> dir 0)
			    (ring-plus1 (car ring) (ring-length ring)))
			   ((< dir 0)
			    (ring-minus1 (car ring) (ring-length ring)))
			   ;; don't rotate if dir = 0
			   (t (car ring))))
	(viper-current-ring-item ring)
	)))