Function: viper-separator-skipback-special

viper-separator-skipback-special is a byte-compiled function defined in viper-cmd.el.gz.

Signature

(viper-separator-skipback-special TWICE LIM)

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-cmd.el.gz
;; first skip non-newline separators backward, then skip \n.  Then, if TWICE is
;; non-nil, skip non-\n back again, but don't overshoot the limit LIM.
(defun viper-separator-skipback-special (twice lim)
  (let ((prev-char (viper-char-at-pos 'backward))
	(saved-point (point)))
    ;; skip non-newline separators backward
    (while (and (not (memq prev-char '(nil \n)))
		(< lim (point))
		;; must be non-newline separator
		(if (eq viper-syntax-preference 'strict-vi)
                    (memq prev-char '(?\  ?\t))
                  (memq (char-syntax prev-char) '(?\  ?-))))
      (viper-backward-char-carefully)
      (setq prev-char (viper-char-at-pos 'backward)))

    (if (and (< lim (point)) (eq prev-char ?\n))
	(backward-char)
      ;; If we skipped to the next word and the prefix of this line doesn't
      ;; consist of separators preceded by a newline, then don't skip backwards
      ;; at all.
      (goto-char saved-point))
    (setq prev-char (viper-char-at-pos 'backward))

    ;; skip again, but make sure we don't overshoot the limit
    (if twice
        (while (and (not (memq prev-char '(nil \n)))
		    (< lim (point))
		    ;; must be non-newline separator
		    (if (eq viper-syntax-preference 'strict-vi)
                        (memq prev-char '(?\  ?\t))
                      (memq (char-syntax prev-char) '(?\  ?-))))
	  (viper-backward-char-carefully)
	  (setq prev-char (viper-char-at-pos 'backward))))

    (if (= (point) lim)
	(viper-forward-char-carefully))
    ))