comparison lisp/progmodes/vhdl-mode.el @ 82363:f0b6bf720515

(vhdl-update-progress-info): Avoid divide by zero error.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 13 Aug 2007 11:12:50 +0000
parents c1ec1c8a8d2e
children a1342e6e097a 85483f68777e aaccdab0ee26
comparison
equal deleted inserted replaced
82362:8d7512ea727b 82363:f0b6bf720515
6980 (defun vhdl-update-progress-info (string pos) 6980 (defun vhdl-update-progress-info (string pos)
6981 "Update progress information." 6981 "Update progress information."
6982 (when (and vhdl-progress-info (not noninteractive) 6982 (when (and vhdl-progress-info (not noninteractive)
6983 (< vhdl-progress-interval 6983 (< vhdl-progress-interval
6984 (- (nth 1 (current-time)) (aref vhdl-progress-info 2)))) 6984 (- (nth 1 (current-time)) (aref vhdl-progress-info 2))))
6985 (message (concat string "... (%2d%s)") 6985 (let ((delta (- (aref vhdl-progress-info 1)
6986 (/ (* 100 (- pos (aref vhdl-progress-info 0))) 6986 (aref vhdl-progress-info 0))))
6987 (- (aref vhdl-progress-info 1) 6987 (if (= 0 delta)
6988 (aref vhdl-progress-info 0))) "%") 6988 (message (concat string "... (100%s)") "%")
6989 (message (concat string "... (%2d%s)")
6990 (/ (* 100 (- pos (aref vhdl-progress-info 0)))
6991 delta) "%")))
6989 (aset vhdl-progress-info 2 (nth 1 (current-time))))) 6992 (aset vhdl-progress-info 2 (nth 1 (current-time)))))
6990 6993
6991 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6994 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6992 ;; Indentation commands 6995 ;; Indentation commands
6993 6996