summaryrefslogtreecommitdiff
path: root/lisp/progmodes/vhdl-mode.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-02-13 00:50:19 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2019-02-13 00:51:15 -0800
commitae4bfd52deecfccbbeb20ac852564b75a1bb83ff (patch)
tree168f67bb3fb5c684ec3096018cff019bf371642d /lisp/progmodes/vhdl-mode.el
parent8e0d35802cda844ccb6ddf417672b5a5845f4874 (diff)
downloademacs-ae4bfd52deecfccbbeb20ac852564b75a1bb83ff.tar.gz
Don’t assume CURRENT_TIME_LIST
* lisp/progmodes/cc-cmds.el (c-progress-init) (c-progress-update): * lisp/progmodes/cperl-mode.el (cperl-time-fontification): * lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info) (vhdl-fix-case-region-1): Don’t assume (current-time) returns a list. Fix unlikely bug if we’re called 65536 seconds apart.
Diffstat (limited to 'lisp/progmodes/vhdl-mode.el')
-rw-r--r--lisp/progmodes/vhdl-mode.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 3bcf9e50f05..27380b33adb 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -7392,8 +7392,8 @@ only-lines."
(defun vhdl-update-progress-info (string pos)
"Update progress information."
(when (and vhdl-progress-info (not noninteractive)
- (< vhdl-progress-interval
- (- (nth 1 (current-time)) (aref vhdl-progress-info 2))))
+ (time-less-p vhdl-progress-interval
+ (time-subtract nil (aref vhdl-progress-info 2))))
(let ((delta (- (aref vhdl-progress-info 1)
(aref vhdl-progress-info 0))))
(message "%s... (%2d%%)" string
@@ -7401,7 +7401,7 @@ only-lines."
100
(floor (* 100.0 (- pos (aref vhdl-progress-info 0)))
delta))))
- (aset vhdl-progress-info 2 (nth 1 (current-time)))))
+ (aset vhdl-progress-info 2 (encode-time nil 'integer))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Indentation commands
@@ -8142,12 +8142,12 @@ depending on parameter UPPER-CASE."
(upcase-word -1)
(downcase-word -1)))
(when (and count vhdl-progress-interval (not noninteractive)
- (< vhdl-progress-interval
- (- (nth 1 (current-time)) last-update)))
+ (time-less-p vhdl-progress-interval
+ (time-subtract nil last-update)))
(message "Fixing case... (%2d%s)"
(+ (* count 20) (/ (* 20 (- (point) beg)) (- end beg)))
"%")
- (setq last-update (nth 1 (current-time)))))
+ (setq last-update (encode-time nil 'integer))))
(goto-char end)))))
(defun vhdl-fix-case-region (beg end &optional arg)