Function: imenu--relative-position

imenu--relative-position is a byte-compiled function defined in imenu.el.gz.

Signature

(imenu--relative-position &optional REVERSE)

Documentation

Support function to calculate relative position in buffer.

Beginning of buffer is 0 and end of buffer is 100 If REVERSE is non-nil then the beginning is 100 and the end is 0.

Source Code

;; Defined in /usr/src/emacs/lisp/imenu.el.gz
(defun imenu--relative-position (&optional reverse)
  "Support function to calculate relative position in buffer.
Beginning of buffer is 0 and end of buffer is 100
If REVERSE is non-nil then the beginning is 100 and the end is 0."
  (let ((pos (point))
	(total (buffer-size)))
    (and reverse (setq pos (- total pos)))
    (floor (* 100.0 (1- pos)) (max total 1))))