diff options
| author | Juanma Barranquero | 2007-08-13 11:39:45 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2007-08-13 11:39:45 +0000 |
| commit | 86444e1bf0767b5daf853e390f3ac30b3c01e47f (patch) | |
| tree | 788fb5d20312ba083ffbff7136f38f1ae92fcf96 | |
| parent | 0fad0ff9f7ba9c21c4d745e71d4aef27833c3b8a (diff) | |
| download | emacs-86444e1bf0767b5daf853e390f3ac30b3c01e47f.tar.gz emacs-86444e1bf0767b5daf853e390f3ac30b3c01e47f.zip | |
(vhdl-update-progress-info): Avoid divide by zero error.
| -rw-r--r-- | lisp/progmodes/vhdl-mode.el | 11 |
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." | |||
| 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 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |