Function: array-cursor-in-array-range

array-cursor-in-array-range is a byte-compiled function defined in array.el.gz.

Signature

(array-cursor-in-array-range)

Documentation

Return t if the cursor is in a valid array cell.

Its ok to be on a row number line.

Source Code

;; Defined in /usr/src/emacs/lisp/array.el.gz
;;; Internal information functions.

(defun array-cursor-in-array-range ()
  "Return t if the cursor is in a valid array cell.
Its ok to be on a row number line."
  (let ((columns-last-line (% array-max-column array-columns-per-line)))
    ;; Requires array-buffer-line and array-buffer-column to be current.
    (not (or
	  ;; The cursor is too far to the right.
	  (>= array-buffer-column array-line-length)
	  ;; The cursor is below the last row.
	  (>= array-buffer-line (* array-lines-per-row array-max-row))
	  ;; The cursor is on the last line of the row, the line is smaller
	  ;;  than the others, and the cursor is after the last array column
	  ;;  on the line.
	  (and (zerop (% (1+ array-buffer-line) array-lines-per-row))
	       (not (zerop columns-last-line))
	       (>= array-buffer-column (* columns-last-line array-field-width)))))))