Function: rectangle-dimensions

rectangle-dimensions is a byte-compiled function defined in rect.el.gz.

Signature

(rectangle-dimensions START END)

Documentation

Return the dimensions of the rectangle with corners at START and END.

The returned value has the form of (WIDTH . HEIGHT).

Source Code

;; Defined in /usr/src/emacs/lisp/rect.el.gz
(defun rectangle-dimensions (start end)
  "Return the dimensions of the rectangle with corners at START and END.
The returned value has the form of (WIDTH . HEIGHT)."
  (save-excursion
    (let* ((height (1+ (abs (- (line-number-at-pos end)
                               (line-number-at-pos start)))))
           (cols (rectangle--pos-cols start end))
           (width (abs (- (cdr cols) (car cols)))))
      (cons width height))))