1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-19 18:13:55 +00:00

(vhdl-update-progress-info): Avoid divide by zero error.

This commit is contained in:
Juanma Barranquero 2007-08-13 11:39:45 +00:00
parent 0fad0ff9f7
commit 86444e1bf0

View File

@ -6982,10 +6982,13 @@ only-lines."
(when (and vhdl-progress-info (not noninteractive)
(< vhdl-progress-interval
(- (nth 1 (current-time)) (aref vhdl-progress-info 2))))
(message (concat string "... (%2d%s)")
(/ (* 100 (- pos (aref vhdl-progress-info 0)))
(- (aref vhdl-progress-info 1)
(aref vhdl-progress-info 0))) "%")
(let ((delta (- (aref vhdl-progress-info 1)
(aref vhdl-progress-info 0))))
(if (= 0 delta)
(message (concat string "... (100%s)") "%")
(message (concat string "... (%2d%s)")
(/ (* 100 (- pos (aref vhdl-progress-info 0)))
delta) "%")))
(aset vhdl-progress-info 2 (nth 1 (current-time)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;