Function: viper-same-line

viper-same-line is a byte-compiled function defined in viper-cmd.el.gz.

Signature

(viper-same-line BEG END)

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-cmd.el.gz
;;  Tells whether BEG is on the same line as END.
;;  If one of the args is nil, it'll return nil.
(defun viper-same-line (beg end)
   (let ((selective-display nil)
	 (incr 0)
	 temp)
     (if (and beg end (> beg end))
	 (setq temp beg
	       beg end
	       end temp))
     (if (and beg end)
	 (cond ((or (> beg (point-max)) (> end (point-max))) ; out of range
		nil)
	       (t
		;; This 'if' is needed because Emacs treats the next empty line
		;; as part of the previous line.
		(if (= (viper-line-pos 'start) end)
		    (setq incr 1))
		(<= (+ incr (count-lines beg end)) 1))))
     ))