summaryrefslogtreecommitdiff
path: root/lisp/progmodes/vhdl-mode.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2007-08-13 11:39:45 +0000
committerJuanma Barranquero <lekktu@gmail.com>2007-08-13 11:39:45 +0000
commit86444e1bf0767b5daf853e390f3ac30b3c01e47f (patch)
tree788fb5d20312ba083ffbff7136f38f1ae92fcf96 /lisp/progmodes/vhdl-mode.el
parent0fad0ff9f7ba9c21c4d745e71d4aef27833c3b8a (diff)
downloademacs-86444e1bf0767b5daf853e390f3ac30b3c01e47f.tar.gz
emacs-86444e1bf0767b5daf853e390f3ac30b3c01e47f.tar.bz2
emacs-86444e1bf0767b5daf853e390f3ac30b3c01e47f.zip
(vhdl-update-progress-info): Avoid divide by zero error.
Diffstat (limited to 'lisp/progmodes/vhdl-mode.el')
-rw-r--r--lisp/progmodes/vhdl-mode.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index a1bd32a313d..0d909a4a3ff 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -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)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;