Function: bibtex-progress-message

bibtex-progress-message is a byte-compiled function defined in bibtex.el.gz.

Signature

(bibtex-progress-message &optional FLAG INTERVAL)

Documentation

Echo a message about progress of current buffer.

If FLAG is a string, the message is initialized (in this case a value for INTERVAL may be given as well (if not this is set to 5)). If FLAG is done, the message is deinitialized. If FLAG is nil, a message is echoed if point was incremented at least bibtex-progress-interval percent since last message was echoed.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/bibtex.el.gz
(defun bibtex-progress-message (&optional flag interval)
  "Echo a message about progress of current buffer.
If FLAG is a string, the message is initialized (in this case a
value for INTERVAL may be given as well (if not this is set to 5)).
If FLAG is `done', the message is deinitialized.
If FLAG is nil, a message is echoed if point was incremented at least
`bibtex-progress-interval' percent since last message was echoed."
  (cond ((stringp flag)
         (setq bibtex-progress-lastmes flag
               bibtex-progress-interval (or interval 5)
               bibtex-progress-lastperc 0))
        ((eq flag 'done)
         (message  "%s (done)" bibtex-progress-lastmes)
         (setq bibtex-progress-lastmes nil))
        (t
         (let* ((size (- (point-max) (point-min)))
                (perc (if (= size 0)
                          100
                        (floor (* 100.0 (- (point) (point-min))) size))))
           (when (>= perc (+ bibtex-progress-lastperc
                             bibtex-progress-interval))
             (setq bibtex-progress-lastperc perc)
             (message "%s (%d%%)" bibtex-progress-lastmes perc))))))