emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/replace-region-contents f9d9fe4 1/2: Merge branch


From: Tassilo Horn
Subject: [Emacs-diffs] scratch/replace-region-contents f9d9fe4 1/2: Merge branch 'origin/master' into scratch/replace-region-contents
Date: Tue, 12 Feb 2019 15:15:02 -0500 (EST)

branch: scratch/replace-region-contents
commit f9d9fe4de180762513d8c0c34fb72118041a8333
Merge: 28a5d77 d41f912
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>

    Merge branch 'origin/master' into scratch/replace-region-contents
---
 doc/lispref/searching.texi            |  2 +-
 lisp/calendar/cal-dst.el              |  4 +-
 lisp/calendar/icalendar.el            |  2 +-
 lisp/calendar/time-date.el            |  7 ++--
 lisp/calendar/timeclock.el            | 37 +++++++-----------
 lisp/ecomplete.el                     |  2 +-
 lisp/emacs-lisp/checkdoc.el           | 14 +------
 lisp/emacs-lisp/rx.el                 |  8 +++-
 lisp/emacs-lisp/timer.el              |  2 +-
 lisp/eshell/esh-util.el               |  2 +-
 lisp/find-lisp.el                     | 11 ++----
 lisp/gnus/gnus-art.el                 |  2 +-
 lisp/gnus/gnus-delay.el               | 26 +++++--------
 lisp/gnus/gnus-group.el               | 11 +++---
 lisp/gnus/gnus-icalendar.el           |  7 +---
 lisp/gnus/gnus-logic.el               |  6 +--
 lisp/gnus/gnus-sum.el                 |  2 +-
 lisp/gnus/message.el                  |  2 +-
 lisp/gnus/nndiary.el                  | 24 ++++++------
 lisp/gnus/nnmail.el                   |  7 +---
 lisp/gnus/nnmaildir.el                | 15 ++------
 lisp/gnus/nnrss.el                    |  2 +-
 lisp/ido.el                           | 31 ++++++++-------
 lisp/mail/ietf-drums.el               |  2 +-
 lisp/mh-e/mh-alias.el                 |  4 +-
 lisp/net/newst-backend.el             | 22 ++---------
 lisp/net/rcirc.el                     |  4 +-
 lisp/net/soap-client.el               |  2 +-
 lisp/net/tramp-adb.el                 |  9 ++---
 lisp/obsolete/xesam.el                |  2 +-
 lisp/org/org-agenda.el                | 18 ++++-----
 lisp/org/org-capture.el               |  5 +--
 lisp/org/org-clock.el                 | 70 ++++++++++++++++------------------
 lisp/org/org-colview.el               |  4 +-
 lisp/org/org-element.el               |  4 +-
 lisp/org/org-macro.el                 |  2 +-
 lisp/org/org-table.el                 |  4 +-
 lisp/org/org-timer.el                 |  8 ++--
 lisp/org/org.el                       | 72 +++++++++++++++++------------------
 lisp/progmodes/flymake.el             | 24 +++++++-----
 lisp/url/url-auth.el                  |  3 +-
 lisp/url/url-cache.el                 |  4 +-
 lisp/url/url-cookie.el                |  4 +-
 lisp/url/url-dav.el                   |  2 +-
 lisp/vc/vc-cvs.el                     |  7 ++--
 lisp/woman.el                         |  6 +--
 src/emacs.c                           |  4 +-
 test/lisp/emacs-lisp/package-tests.el | 66 ++++++++++++++++++++++++--------
 test/src/regex-emacs-tests.el         |  6 +--
 49 files changed, 274 insertions(+), 310 deletions(-)

diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 05fc328..cfbd244 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -559,7 +559,7 @@ tabs, and other characters whose Unicode 
@samp{general-category}
 property (@pxref{Character Properties}) indicates they are spacing
 separators.
 @item [:cntrl:]
-This matches any @acronym{ASCII} control character.
+This matches any character whose code is in the range 0--31.
 @item [:digit:]
 This matches @samp{0} through @samp{9}.  Thus, @samp{[-+[:digit:]]}
 matches any digit, as well as @samp{+} and @samp{-}.
diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el
index 567ba9c..57747c6 100644
--- a/lisp/calendar/cal-dst.el
+++ b/lisp/calendar/cal-dst.el
@@ -279,8 +279,8 @@ expressions that when evaluated return the start and end 
dates,
 respectively. This function first attempts to use pre-calculated
 data from `calendar-dst-transition-cache', otherwise it calls
 `calendar-dst-find-data' (and adds the results to the cache).
-If dates in YEAR cannot be handled by `encode-time' (e.g. if they
-are too large to be represented as a lisp integer), then rather
+If dates in YEAR cannot be handled by `encode-time' (e.g.,
+if they are out of range for POSIX time_t), then rather
 than an error this function returns the result appropriate for
 the current year."
   (let ((e (assoc year calendar-dst-transition-cache))
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 3bcb752..31ace6f 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -1621,7 +1621,7 @@ enumeration, given as a time value, in same format as 
returned by
                    (mapcar
                     (lambda (offset)
                       (let* ((day (decode-time (time-add now
-                                                         (seconds-to-time
+                                                        (encode-time
                                                           (* offset 60 60 
24)))))
                              (d (nth 3 day))
                              (m (nth 4 day))
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index 6fb0f22..cc30bd1 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -151,15 +151,14 @@ it is assumed that PICO was omitted and should be treated 
as zero."
 DATE should be in one of the forms recognized by `parse-time-string'.
 If DATE lacks timezone information, GMT is assumed."
   (condition-case err
-      (apply 'encode-time (parse-time-string date))
+      (encode-time (parse-time-string date))
     (error
      (let ((overflow-error '(error "Specified time is not representable")))
        (if (equal err overflow-error)
           (apply 'signal err)
         (condition-case err
-            (apply 'encode-time
-                   (parse-time-string
-                    (timezone-make-date-arpa-standard date)))
+            (encode-time (parse-time-string
+                          (timezone-make-date-arpa-standard date)))
           (error
            (if (equal err overflow-error)
                (apply 'signal err)
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index 0562f4a..5c3580d 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -528,14 +528,13 @@ non-nil, the amount returned will be relative to past 
time worked."
   "Return a time value representing the end of today's workday.
 If TODAY-ONLY is non-nil, the value returned will be relative only to
 the time worked today, and not to past time."
-  (seconds-to-time
-   (- (float-time)
-      (let ((discrep (timeclock-find-discrep)))
-       (if discrep
-           (if today-only
-               (cadr discrep)
-             (car discrep))
-         0.0)))))
+  (time-subtract nil
+                (let ((discrep (timeclock-find-discrep)))
+                  (if discrep
+                      (if today-only
+                          (cadr discrep)
+                        (car discrep))
+                    0))))
 
 ;;;###autoload
 (defun timeclock-when-to-leave-string (&optional show-seconds
@@ -1156,7 +1155,7 @@ If optional argument TIME is non-nil, use that instead of 
the current time."
     (setcar (nthcdr 0 decoded) 0)
     (setcar (nthcdr 1 decoded) 0)
     (setcar (nthcdr 2 decoded) 0)
-    (apply 'encode-time decoded)))
+    (encode-time decoded)))
 
 (defun timeclock-mean (l)
   "Compute the arithmetic mean of the values in the list L."
@@ -1196,9 +1195,7 @@ HTML-P is non-nil, HTML markup is added."
            (insert project "</b><br>\n")
          (insert project "*\n"))
        (let ((proj-data (cdr (assoc project (timeclock-project-alist log))))
-             (two-weeks-ago (seconds-to-time
-                             (- (float-time today)
-                                (* 2 7 24 60 60))))
+             (two-weeks-ago (time-subtract today (* 2 7 24 60 60)))
              two-week-len today-len)
          (while proj-data
            (if (not (time-less-p
@@ -1249,18 +1246,10 @@ HTML-P is non-nil, HTML markup is added."
     <th>-1 year</th>
 </tr>")
        (let* ((day-list (timeclock-day-list))
-              (thirty-days-ago (seconds-to-time
-                                (- (float-time today)
-                                   (* 30 24 60 60))))
-              (three-months-ago (seconds-to-time
-                                 (- (float-time today)
-                                    (* 90 24 60 60))))
-              (six-months-ago (seconds-to-time
-                               (- (float-time today)
-                                  (* 180 24 60 60))))
-              (one-year-ago (seconds-to-time
-                             (- (float-time today)
-                                (* 365 24 60 60))))
+              (thirty-days-ago (time-subtract today (* 30 24 60 60)))
+              (three-months-ago (time-subtract today (* 90 24 60 60)))
+              (six-months-ago (time-subtract today (* 180 24 60 60)))
+              (one-year-ago (time-subtract today (* 365 24 60 60)))
               (time-in  (vector (list t) (list t) (list t) (list t) (list t)))
               (time-out (vector (list t) (list t) (list t) (list t) (list t)))
               (breaks   (vector (list t) (list t) (list t) (list t) (list t)))
diff --git a/lisp/ecomplete.el b/lisp/ecomplete.el
index 9fc3f57..fb23ead 100644
--- a/lisp/ecomplete.el
+++ b/lisp/ecomplete.el
@@ -96,7 +96,7 @@ string that was matched."
 (defun ecomplete-add-item (type key text)
   "Add item TEXT of TYPE to the database, using KEY as the identifier."
   (let ((elems (assq type ecomplete-database))
-       (now (string-to-number (format-time-string "%s")))
+       (now (encode-time nil 'integer))
        entry)
     (unless elems
       (push (setq elems (list type)) ecomplete-database))
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index c0da61a..dca2f16 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -174,6 +174,7 @@
 (require 'cl-lib)
 (require 'help-mode) ;; for help-xref-info-regexp
 (require 'thingatpt) ;; for handy thing-at-point-looking-at
+(require 'lisp-mnt)
 
 (defvar compilation-error-regexp-alist)
 (defvar compilation-mode-font-lock-keywords)
@@ -2205,21 +2206,10 @@ News agents may remove it"
 ;;
 (defvar generate-autoload-cookie)
 
-(eval-when-compile (require 'lisp-mnt))        ; expand silly defsubsts
-(declare-function lm-summary "lisp-mnt" (&optional file))
-(declare-function lm-section-start "lisp-mnt" (header &optional after))
-(declare-function lm-section-end "lisp-mnt" (header))
-
 (defun checkdoc-file-comments-engine ()
   "Return a message list if this file does not match the Emacs standard.
 This checks for style only, such as the first line, Commentary:,
 Code:, and others referenced in the style guide."
-  (if (featurep 'lisp-mnt)
-      nil
-    (require 'lisp-mnt)
-    ;; Old XEmacs don't have `lm-commentary-mark'
-    (if (and (not (fboundp 'lm-commentary-mark)) (fboundp 'lm-commentary))
-       (defalias 'lm-commentary-mark #'lm-commentary)))
   (save-excursion
     (let* ((f1 (file-name-nondirectory (buffer-file-name)))
           (fn (file-name-sans-extension f1))
@@ -2280,7 +2270,7 @@ Code:, and others referenced in the style guide."
        (if (or (not checkdoc-force-history-flag)
                (file-exists-p "ChangeLog")
                (file-exists-p "../ChangeLog")
-                (and (fboundp 'lm-history-mark) (funcall #'lm-history-mark)))
+                (lm-history-mark))
            nil
          (progn
            (goto-char (or (lm-commentary-mark) (point-min)))
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 8b4551d..d00b868 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -246,7 +246,9 @@ regular expressions.")
 
 
 (defconst rx-categories
-  '((consonant                 . ?0)
+  '((space-for-indent           . ?\s)
+    (base                       . ?.)
+    (consonant                 . ?0)
     (base-vowel                        . ?1)
     (upper-diacritical-mark    . ?2)
     (lower-diacritical-mark    . ?3)
@@ -265,7 +267,9 @@ regular expressions.")
     (japanese-hiragana-two-byte . ?H)
     (indian-two-byte           . ?I)
     (japanese-katakana-two-byte . ?K)
+    (strong-left-to-right       . ?L)
     (korean-hangul-two-byte    . ?N)
+    (strong-right-to-left       . ?R)
     (cyrillic-two-byte         . ?Y)
     (combining-diacritic       . ?^)
     (ascii                     . ?a)
@@ -964,7 +968,7 @@ CHAR
      matches 0 through 9.
 
 `control', `cntrl'
-     matches ASCII control characters.
+     matches any character whose code is in the range 0-31.
 
 `hex-digit', `hex', `xdigit'
      matches 0 through 9, a through f and A through F.
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index 4bd19b7..51d7e6f 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -88,7 +88,7 @@ SECS may be an integer, floating point number, or the internal
 time format returned by, e.g., `current-idle-time'.
 If optional third argument REPEAT is non-nil, make the timer
 fire each time Emacs is idle for that many seconds."
-  (setf (timer--time timer) (if (consp secs) secs (seconds-to-time secs)))
+  (setf (timer--time timer) secs)
   (setf (timer--repeat-delay timer) repeat)
   timer)
 
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 7e6e39e..118978e 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -652,7 +652,7 @@ If NOSORT is non-nil, the list is not sorted--its order is 
unpredictable.
                        (setcar (nthcdr 0 moment) 0)
                        (setcar (nthcdr 1 moment) 0)
                        (setcar (nthcdr 2 moment) 0))
-                     (apply 'encode-time moment))
+                     (encode-time moment))
                  (ange-ftp-file-modtime (expand-file-name name dir))))
               symlink)
          (if (string-match "\\(.+\\) -> \\(.+\\)" name)
diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el
index c5febee..073e2bc 100644
--- a/lisp/find-lisp.el
+++ b/lisp/find-lisp.el
@@ -342,16 +342,11 @@ list of ls option letters of which c and u are 
recognized).  Use
 the same method as \"ls\" to decide whether to show time-of-day or
 year, depending on distance between file date and NOW."
   (let* ((time (nth (find-lisp-time-index switches) file-attr))
-        (diff16 (- (car time) (car now)))
-        (diff (+ (ash diff16 16) (- (car (cdr time)) (car (cdr now)))))
-        (past-cutoff (- (* 6 30 24 60 60)))    ; 6 30-day months
+        (diff (encode-time (time-subtract time now) 'integer))
+        (past-cutoff -15778476)                ; 1/2 of a Gregorian year
         (future-cutoff (* 60 60)))             ; 1 hour
     (format-time-string
-     (if (and
-         (<= past-cutoff diff) (<= diff future-cutoff)
-         ;; Sanity check in case `diff' computation overflowed.
-         (<= (1- (ash past-cutoff -16)) diff16)
-         (<= diff16 (1+ (ash future-cutoff -16))))
+     (if (<= past-cutoff diff future-cutoff)
         "%b %e %H:%M"
        "%b %e  %Y")
      time)))
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index e390118..191f623 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -3544,7 +3544,7 @@ possible values."
                  (substring
                   (message-make-date
                    (let* ((e (parse-time-string date))
-                          (tm (apply 'encode-time e))
+                          (tm (encode-time e))
                           (ms (car tm))
                           (ls (- (cadr tm) (car (current-time-zone time)))))
                      (cond ((< ls 0) (list (1- ms) (+ ls 65536)))
diff --git a/lisp/gnus/gnus-delay.el b/lisp/gnus/gnus-delay.el
index b15187b..aabf239 100644
--- a/lisp/gnus/gnus-delay.el
+++ b/lisp/gnus/gnus-delay.el
@@ -98,19 +98,15 @@ DELAY is a string, giving the length of the time.  Possible 
values are:
           (setq hour   (string-to-number (match-string 1 delay))
                 minute (string-to-number (match-string 2 delay)))
           ;; Use current time, except...
-          (setq deadline (apply 'vector (decode-time)))
+          (setq deadline (decode-time))
           ;; ... for minute and hour.
-          (aset deadline 1 minute)
-          (aset deadline 2 hour)
-          ;; Convert to seconds.
-          (setq deadline (float-time (apply 'encode-time
-                                            (append deadline nil))))
+          (setq deadline (apply #'encode-time (car deadline) minute hour
+                                (nthcdr 3 deadline)))
           ;; If this time has passed already, add a day.
-          (when (< deadline (float-time))
-            (setq deadline (+ 86400 deadline))) ; 86400 secs/day
+          (when (time-less-p deadline nil)
+            (setq deadline (time-add 86400 deadline))) ; 86400 secs/day
           ;; Convert seconds to date header.
-          (setq deadline (message-make-date
-                          (seconds-to-time deadline))))
+          (setq deadline (message-make-date deadline)))
          ((string-match "\\([0-9]+\\)\\s-*\\([mhdwMY]\\)" delay)
           (setq num (match-string 1 delay))
           (setq unit (match-string 2 delay))
@@ -128,8 +124,7 @@ DELAY is a string, giving the length of the time.  Possible 
values are:
                  (setq delay (* num 60 60)))
                 (t
                  (setq delay (* num 60))))
-          (setq deadline (message-make-date
-                          (seconds-to-time (+ (float-time) delay)))))
+          (setq deadline (message-make-date (time-add nil delay))))
          (t (error "Malformed delay `%s'" delay)))
     (message-add-header (format "%s: %s" gnus-delay-header deadline)))
   (set-buffer-modified-p t)
@@ -164,11 +159,8 @@ DELAY is a string, giving the length of the time.  
Possible values are:
               nil t)
              (progn
                (setq deadline (nnheader-header-value))
-               (setq deadline (apply 'encode-time
-                                     (parse-time-string deadline)))
-               (setq deadline (time-since deadline))
-               (when (and (>= (nth 0 deadline) 0)
-                          (>= (nth 1 deadline) 0))
+               (setq deadline (encode-time (parse-time-string deadline)))
+               (unless (time-less-p nil deadline)
                  (message "Sending delayed article %d" article)
                  (gnus-draft-send article group)
                  (message "Sending delayed article %d...done" article)))
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 510bd74..cf8423b 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -4578,8 +4578,7 @@ and the second element is the address."
 This function can be used in hooks like `gnus-select-group-hook'
 or `gnus-group-catchup-group-hook'."
   (when gnus-newsgroup-name
-    (let ((time (current-time)))
-      (setcdr (cdr time) nil)
+    (let ((time (encode-time nil 'integer)))
       (gnus-group-set-parameter gnus-newsgroup-name 'timestamp time))))
 
 (defsubst gnus-group-timestamp (group)
@@ -4588,11 +4587,11 @@ or `gnus-group-catchup-group-hook'."
 
 (defun gnus-group-timestamp-delta (group)
   "Return the offset in seconds from the timestamp for GROUP to the current 
time, as a floating point number."
-  (let* ((time (or (gnus-group-timestamp group)
-                  (list 0 0)))
+  ;; FIXME: This should return a Lisp integer, not a Lisp float,
+  ;; since it is always an integer.
+  (let* ((time (or (gnus-group-timestamp group) 0))
         (delta (time-subtract nil time)))
-    (+ (* (nth 0 delta) 65536.0)
-       (nth 1 delta))))
+    (float-time delta)))
 
 (defun gnus-group-timestamp-string (group)
   "Return a string of the timestamp for GROUP."
diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index e39561e..a9d15f9 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -147,7 +147,7 @@
                        (icalendar--get-event-property-attributes
                         event field) zone-map))
          (dtdate-dec (icalendar--decode-isodatetime dtdate nil dtdate-zone)))
-    (apply 'encode-time dtdate-dec)))
+    (encode-time dtdate-dec)))
 
 (defun gnus-icalendar-event--find-attendee (ical name-or-email)
   (let* ((event (car (icalendar--all-events ical)))
@@ -655,10 +655,7 @@ is searched."
 (defun gnus-icalendar-show-org-agenda (event)
   (let* ((time-delta (time-subtract (gnus-icalendar-event:end-time event)
                                     (gnus-icalendar-event:start-time event)))
-         (duration-days (1+ (/ (+ (* (car time-delta) (expt 2 16))
-                                  (cadr time-delta))
-                               86400))))
-
+         (duration-days (1+ (floor (encode-time time-delta 'integer) 86400))))
     (org-agenda-list nil (gnus-icalendar-event:start event) duration-days)))
 
 (cl-defmethod gnus-icalendar-event:sync-to-org ((event 
gnus-icalendar-event-request) reply-status)
diff --git a/lisp/gnus/gnus-logic.el b/lisp/gnus/gnus-logic.el
index 8bf15cf..90f7420 100644
--- a/lisp/gnus/gnus-logic.el
+++ b/lisp/gnus/gnus-logic.el
@@ -162,9 +162,9 @@
     (funcall type (or (aref gnus-advanced-headers index) 0) match)))
 
 (defun gnus-advanced-date (index match type)
-  (let ((date (apply 'encode-time (parse-time-string
-                                  (aref gnus-advanced-headers index))))
-       (match (apply 'encode-time (parse-time-string match))))
+  (let ((date (encode-time (parse-time-string
+                           (aref gnus-advanced-headers index))))
+       (match (encode-time (parse-time-string match))))
     (cond
      ((eq type 'at)
       (equal date match))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 911bf89..3a5886a 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3868,7 +3868,7 @@ Input should look like this: \"Sun, 14 Oct 2001 13:34:39 
+0200\"."
              (setq top (eval (caar templist)))))
          (if (stringp (cdr (car templist)))
              (setq my-format (cdr (car templist)))))
-       (format-time-string (eval my-format) (seconds-to-time messy-date)))
+       (format-time-string (eval my-format) (encode-time messy-date)))
     (error "  ?   ")))
 
 (defun gnus-summary-set-local-parameters (group)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 9d5445c..b067452 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -5542,7 +5542,7 @@ In posting styles use `(\"Expires\" (make-expires-date 
30))'."
   (let* ((cur (decode-time))
         (nday (+ days (nth 3 cur))))
     (setf (nth 3 cur) nday)
-    (message-make-date (apply 'encode-time cur))))
+    (message-make-date (encode-time cur))))
 
 (defun message-make-message-id ()
   "Make a unique Message-ID."
diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el
index c65f78d..c8b7eed 100644
--- a/lisp/gnus/nndiary.el
+++ b/lisp/gnus/nndiary.el
@@ -1278,28 +1278,28 @@ all.  This may very well take some time.")
       (push
        (cond ((eq (cdr reminder) 'minute)
              (time-subtract
-              (apply 'encode-time 0 (nthcdr 1 date-elts))
-              (seconds-to-time (* (car reminder) 60.0))))
+              (apply #'encode-time 0 (nthcdr 1 date-elts))
+              (encode-time (* (car reminder) 60.0))))
             ((eq (cdr reminder) 'hour)
              (time-subtract
-              (apply 'encode-time 0 0 (nthcdr 2 date-elts))
-              (seconds-to-time (* (car reminder) 3600.0))))
+              (apply #'encode-time 0 0 (nthcdr 2 date-elts))
+              (encode-time (* (car reminder) 3600.0))))
             ((eq (cdr reminder) 'day)
              (time-subtract
-              (apply 'encode-time 0 0 0 (nthcdr 3 date-elts))
-              (seconds-to-time (* (car reminder) 86400.0))))
+              (apply #'encode-time 0 0 0 (nthcdr 3 date-elts))
+              (encode-time (* (car reminder) 86400.0))))
             ((eq (cdr reminder) 'week)
              (time-subtract
-              (apply 'encode-time 0 0 0 monday (nthcdr 4 date-elts))
-              (seconds-to-time (* (car reminder) 604800.0))))
+              (apply #'encode-time 0 0 0 monday (nthcdr 4 date-elts))
+              (encode-time (* (car reminder) 604800.0))))
             ((eq (cdr reminder) 'month)
              (time-subtract
-              (apply 'encode-time 0 0 0 1 (nthcdr 4 date-elts))
-              (seconds-to-time (* (car reminder) 18748800.0))))
+              (apply #'encode-time 0 0 0 1 (nthcdr 4 date-elts))
+              (encode-time (* (car reminder) 18748800.0))))
             ((eq (cdr reminder) 'year)
              (time-subtract
-              (apply 'encode-time 0 0 0 1 1 (nthcdr 5 date-elts))
-              (seconds-to-time (* (car reminder) 400861056.0)))))
+              (apply #'encode-time 0 0 0 1 1 (nthcdr 5 date-elts))
+              (encode-time (* (car reminder) 400861056.0)))))
        res))
     (sort res 'time-less-p)))
 
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 2173e84..c2e84c4 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1543,11 +1543,8 @@ See the documentation for the variable 
`nnmail-split-fancy' for details."
                                               (format "%s-active-timestamp"
                                                       backend)))
                              (error 'none))))
-                    (not (consp timestamp))
-                    (equal timestamp '(0 0))
-                    (> (nth 0 file-time) (nth 0 timestamp))
-                    (and (= (nth 0 file-time) (nth 0 timestamp))
-                         (> (nth 1 file-time) (nth 1 timestamp))))))
+                    (eq timestamp 'none)
+                    (time-less-p timestamp file-time))))
        (save-excursion
          (or (eq timestamp 'none)
              (set (intern (format "%s-active-timestamp" backend))
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el
index afaf3dc..9df2292 100644
--- a/lisp/gnus/nnmaildir.el
+++ b/lisp/gnus/nnmaildir.el
@@ -1467,7 +1467,7 @@ This variable is set by `nnmaildir-request-article'.")
       (unless (string-equal nnmaildir--delivery-time file)
        (setq nnmaildir--delivery-time file
              nnmaildir--delivery-count 0))
-      (setq file (concat file "M" (number-to-string (caddr time))))
+      (setq file (concat file (format-time-string "M%6N" time)))
       (setq file (concat file nnmaildir--delivery-pid)
            file (concat file "Q" (number-to-string nnmaildir--delivery-count))
            file (concat file "." (nnmaildir--system-name))
@@ -1553,7 +1553,7 @@ This variable is set by `nnmaildir-request-article'.")
 (defun nnmaildir-request-expire-articles (ranges &optional gname server force)
   (let ((no-force (not force))
        (group (nnmaildir--prepare server gname))
-       pgname time boundary bound-iter high low target dir nlist
+       pgname time boundary high low target dir nlist
        didnt nnmaildir--file nnmaildir-article-file-name
        deactivate-mark)
     (catch 'return
@@ -1602,15 +1602,8 @@ This variable is set by `nnmaildir-request-article'.")
            ((null time)
             (nnmaildir--expired-article group article))
            ((and no-force
-                 (progn
-                   (setq time (file-attribute-modification-time time)
-                         bound-iter boundary)
-                   (while (and bound-iter time
-                               (= (car bound-iter) (car time)))
-                     (setq bound-iter (cdr bound-iter)
-                           time (cdr time)))
-                   (and bound-iter time
-                        (car-less-than-car bound-iter time))))
+                 (time-less-p boundary
+                              (file-attribute-modification-time time)))
             (setq didnt (cons (nnmaildir--art-num article) didnt)))
            (t
             (setq nnmaildir-article-file-name nnmaildir--file
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index db37e24..6a47596 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -454,7 +454,7 @@ which RSS 2.0 allows."
     (cond ((null date))                        ; do nothing for this case
          ;; if the date is just digits (unix time stamp):
          ((string-match "^[0-9]+$" date)
-          (setq given (seconds-to-time (string-to-number date))))
+          (setq given (encode-time (string-to-number date))))
          ;; RFC822
          ((string-match " [0-9]+ " date)
           (setq vector (timezone-parse-date date)
diff --git a/lisp/ido.el b/lisp/ido.el
index b32cacc..8078d18 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1515,20 +1515,20 @@ Removes badly formatted data and ignored directories."
                                (files (cdr (cdr (car l)))))
                            (and
                             (stringp dir)
-                            (consp time)
-                            (cond
-                             ((integerp (car time))
-                              (and (not (zerop (float-time time)))
-                                   (ido-may-cache-directory dir)))
-                             ((eq (car time) 'ftp)
-                              (and (numberp (cdr time))
-                                   (ido-is-ftp-directory dir)
-                                   (ido-cache-ftp-valid (cdr time))))
-                             ((eq (car time) 'unc)
-                              (and (numberp (cdr time))
-                                   (ido-is-unc-host dir)
-                                   (ido-cache-unc-valid (cdr time))))
-                             (t nil))
+                            (if (condition-case nil
+                                    (not (time-equal-p time 0))
+                                  (error))
+                                (ido-may-cache-directory dir)
+                              (and
+                               (consp time)
+                               (numberp (cdr time))
+                               (cond
+                                ((eq (car time) 'ftp)
+                                 (and (ido-is-ftp-directory dir)
+                                      (ido-cache-ftp-valid (cdr time))))
+                                ((eq (car time) 'unc)
+                                 (and (ido-is-unc-host dir)
+                                      (ido-cache-unc-valid (cdr time)))))))
                             (let ((s files) (ok t))
                               (while s
                                 (if (stringp (car s))
@@ -3621,8 +3621,7 @@ Uses and updates `ido-dir-file-cache'."
                             (ido-cache-unc-valid (cdr ctime)))))
           (t
            (if attr
-               (setq valid (and (= (car ctime) (car mtime))
-                                (= (car (cdr ctime)) (car (cdr mtime))))))))
+               (setq valid (time-equal-p ctime mtime)))))
          (unless valid
            (setq ido-dir-file-cache (delq cached ido-dir-file-cache)
                  cached nil)))
diff --git a/lisp/mail/ietf-drums.el b/lisp/mail/ietf-drums.el
index 6600657..81377c9 100644
--- a/lisp/mail/ietf-drums.el
+++ b/lisp/mail/ietf-drums.el
@@ -294,7 +294,7 @@ a list of address strings."
 
 (defun ietf-drums-parse-date (string)
   "Return an Emacs time spec from STRING."
-  (apply 'encode-time (parse-time-string string)))
+  (encode-time (parse-time-string string)))
 
 (defun ietf-drums-narrow-to-header ()
   "Narrow to the header section in the current buffer."
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index 3f895f4..49f5547 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -80,9 +80,7 @@ If ARG is non-nil, set timestamp with the current time."
                        (when (and file (file-exists-p file))
                          (setq stamp (file-attribute-modification-time
                                      (file-attributes file)))
-                         (or (> (car stamp) (car mh-alias-tstamp))
-                             (and (= (car stamp) (car mh-alias-tstamp))
-                                  (> (cadr stamp) (cadr mh-alias-tstamp)))))))
+                        (time-less-p mh-alias-tstamp stamp))))
                     (mh-alias-filenames t)))))))
 
 (defun mh-alias-filenames (arg)
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el
index bb7b7bc..ac58ed9 100644
--- a/lisp/net/newst-backend.el
+++ b/lisp/net/newst-backend.el
@@ -1802,7 +1802,7 @@ download it from URL first."
              (time-less-p nil
                           (time-add (file-attribute-modification-time
                                     (file-attributes image-name))
-                                    (seconds-to-time 86400))))
+                                   (encode-time 86400))))
         (newsticker--debug-msg "%s: Getting image for %s skipped"
                                (format-time-string "%A, %H:%M")
                                feed-name)
@@ -1996,7 +1996,7 @@ older than TIME."
           (lambda (item)
             (when (eq (newsticker--age item) old-age)
               (let ((exp-time (time-add (newsticker--time item)
-                                        (seconds-to-time time))))
+                                       (encode-time time))))
                 (when (time-less-p exp-time nil)
                   (newsticker--debug-msg
                    "Item `%s' from %s has expired on %s"
@@ -2171,22 +2171,8 @@ well."
                  (throw 'result nil))
                 ((eq age2 'obsolete)
                  (throw 'result t)))))
-    (let* ((time1 (newsticker--time item1))
-           (time2 (newsticker--time item2)))
-      (cond ((< (nth 0 time1) (nth 0 time2))
-             nil)
-            ((> (nth 0 time1) (nth 0 time2))
-             t)
-            ((< (nth 1 time1) (nth 1 time2))
-             nil)
-            ((> (nth 1 time1) (nth 1 time2))
-             t)
-            ((< (or (nth 2 time1) 0) (or (nth 2 time2) 0))
-             nil)
-            ((> (or (nth 2 time1) 0) (or (nth 2 time2) 0))
-             t)
-            (t
-             nil)))))
+    (time-less-p (newsticker--time item2)
+                (newsticker--time item1))))
 
 (defun newsticker--cache-item-compare-by-title (item1 item2)
   "Compare ITEM1 and ITEM2 by comparing their titles."
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 47681cc..24f1c42 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -2794,7 +2794,7 @@ the only argument."
   (let* ((nick (nth 1 args))
          (idle-secs (string-to-number (nth 2 args)))
          (idle-string (format-seconds "%yy %dd %hh %mm %z%ss" idle-secs))
-         (signon-time (seconds-to-time (string-to-number (nth 3 args))))
+        (signon-time (encode-time (string-to-number (nth 3 args))))
          (signon-string (format-time-string "%c" signon-time))
          (message (format "%s idle for %s, signed on %s"
                           nick idle-string signon-string)))
@@ -2815,7 +2815,7 @@ Not in rfc1459.txt"
     (with-current-buffer buffer
       (let ((setter (nth 2 args))
            (time (current-time-string
-                  (seconds-to-time
+                  (encode-time
                    (string-to-number (cl-cadddr args))))))
        (rcirc-print process sender "TOPIC" (cadr args)
                     (format "%s (%s on %s)" rcirc-topic setter time))))))
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el
index db8ed16..1632ee1 100644
--- a/lisp/net/soap-client.el
+++ b/lisp/net/soap-client.el
@@ -629,7 +629,7 @@ disallows them."
              (<= time-zone-minute 59))
       (error "Invalid or unsupported time: %s" date-time-string))
     ;; Return a value in a format similar to that returned by decode-time, and
-    ;; suitable for (apply 'encode-time ...).
+    ;; suitable for (apply #'encode-time ...).
     (list second minute hour day month year second-fraction datatype
           (if has-time-zone
               (* (rng-xsd-time-to-seconds
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index b9b1e4a..f8b0505 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -488,9 +488,9 @@ Emacs dired can't find files."
   "Sort \"ls\" output by time, descending."
   (let (time-a time-b)
     (string-match tramp-adb-ls-date-regexp a)
-    (setq time-a (apply 'encode-time (parse-time-string (match-string 0 a))))
+    (setq time-a (apply #'encode-time (parse-time-string (match-string 0 a))))
     (string-match tramp-adb-ls-date-regexp b)
-    (setq time-b (apply 'encode-time (parse-time-string (match-string 0 b))))
+    (setq time-b (apply #'encode-time (parse-time-string (match-string 0 b))))
     (time-less-p time-b time-a)))
 
 (defun tramp-adb-ls-output-name-less-p (a b)
@@ -679,9 +679,8 @@ But handle the case, if the \"test\" command is not 
available."
                    (current-time)
                  time)))
       (tramp-adb-send-command-and-check
-       ;; Use shell arithmetic because of Emacs integer size limit.
-       v (format "touch -t $(( %d * 65536 + %d )) %s"
-                (car time) (cadr time)
+       v (format "touch -t %s %s"
+                (format-time-string "%Y%m%d%H%M.%S" time)
                 (tramp-shell-quote-argument localname))))))
 
 (defun tramp-adb-handle-copy-file
diff --git a/lisp/obsolete/xesam.el b/lisp/obsolete/xesam.el
index 95ddb2c..a1a4639 100644
--- a/lisp/obsolete/xesam.el
+++ b/lisp/obsolete/xesam.el
@@ -622,7 +622,7 @@ Return propertized STRING."
        (or (widget-get widget :tag) "")
        (format-time-string
         "%d %B %Y, %T"
-        (seconds-to-time
+        (encode-time
          (string-to-number (widget-get widget :xesam:sourceModified)))))))
 
     ;; Second line: :value.
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 6f66807..d491dff 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -5491,8 +5491,8 @@ displayed in agenda view."
            (substring
             (format-time-string
              (car org-time-stamp-formats)
-             (apply #'encode-time      ; DATE bound by calendar
-                    (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
+             (encode-time      ; DATE bound by calendar
+              0 0 0 (nth 1 date) (car date) (nth 2 date)))
             1 11))
           "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[hdwmy]>\\)"
           "\\|\\(<%%\\(([^>\n]+)\\)>\\)"))
@@ -5742,8 +5742,8 @@ then those holidays will be skipped."
                   (substring
                    (format-time-string
                     (car org-time-stamp-formats)
-                    (apply 'encode-time  ; DATE bound by calendar
-                           (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
+                    (encode-time  ; DATE bound by calendar
+                     0 0 0 (nth 1 date) (car date) (nth 2 date)))
                    1 11))))
         (org-agenda-search-headline-for-time nil)
         marker hdmarker priority category level tags closedp
@@ -5860,10 +5860,8 @@ See also the user option 
`org-agenda-clock-consistency-checks'."
              (throw 'next t))
            (setq ts (match-string 1)
                  te (match-string 3)
-                 ts (float-time
-                     (apply #'encode-time (org-parse-time-string ts)))
-                 te (float-time
-                     (apply #'encode-time (org-parse-time-string te)))
+                 ts (float-time (org-time-string-to-time ts))
+                 te (float-time (org-time-string-to-time te))
                  dt (- te ts))))
        (cond
         ((> dt (* 60 maxtime))
@@ -5914,8 +5912,8 @@ See also the user option 
`org-agenda-clock-consistency-checks'."
        (throw 'exit t))
     ;; We have a shorter gap.
     ;; Now we have to get the minute of the day when these times are
-    (let* ((t1dec (decode-time (seconds-to-time t1)))
-          (t2dec (decode-time (seconds-to-time t2)))
+    (let* ((t1dec (decode-time (encode-time t1)))
+          (t2dec (decode-time (encode-time t2)))
           ;; compute the minute on the day
           (min1 (+ (nth 1 t1dec) (* 60 (nth 2 t1dec))))
           (min2 (+ (nth 1 t2dec) (* 60 (nth 2 t2dec)))))
diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el
index a699d2e..0c7f159 100644
--- a/lisp/org/org-capture.el
+++ b/lisp/org/org-capture.el
@@ -1009,9 +1009,8 @@ Store them in the capture property list."
                              (not (= (time-to-days prompt-time) (org-today))))
                         ;; Use 00:00 when no time is given for another
                         ;; date than today?
-                        (apply #'encode-time
-                               (append '(0 0 0)
-                                       (cl-cdddr (decode-time prompt-time)))))
+                        (apply #'encode-time 0 0 0
+                               (cl-cdddr (decode-time prompt-time))))
                        ((string-match "\\([^ ]+\\)--?[^ ]+[ ]+\\(.*\\)"
                                       org-read-date-final-answer)
                         ;; Replace any time range by its start.
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 9d05c83..babf1f7 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -723,8 +723,8 @@ menu\nmouse-2 will jump to task"))
 The time returned includes the time spent on this task in
 previous clocking intervals."
   (let ((currently-clocked-time
-        (floor (- (float-time)
-                  (float-time org-clock-start-time)) 60)))
+        (floor (encode-time (time-subtract nil org-clock-start-time) 'integer)
+               60)))
     (+ currently-clocked-time (or org-clock-total-time 0))))
 
 (defun org-clock-modify-effort-estimate (&optional value)
@@ -1033,8 +1033,9 @@ to be CLOCKED OUT."))))
                                   nil 45)))
                (and (not (memq char-pressed '(?i ?q))) char-pressed)))))
         (default
-          (floor (/ (float-time
-                     (time-subtract (current-time) last-valid)) 60)))
+          (floor (encode-time (time-subtract (current-time) last-valid)
+                              'integer)
+                 60))
         (keep
          (and (memq ch '(?k ?K))
               (read-number "Keep how many minutes? " default)))
@@ -1069,10 +1070,10 @@ to be CLOCKED OUT."))))
                   (and gotback (= gotback default)))
               'now)
              (keep
-              (time-add last-valid (seconds-to-time (* 60 keep))))
+              (time-add last-valid (encode-time (* 60 keep))))
              (gotback
               (time-subtract (current-time)
-                             (seconds-to-time (* 60 gotback))))
+                             (encode-time (* 60 gotback))))
              (t
               (error "Unexpected, please report this as a bug")))
        (and gotback last-valid)
@@ -1102,8 +1103,8 @@ If `only-dangling-p' is non-nil, only ask to resolve 
dangling
                        (lambda (clock)
                          (format
                           "Dangling clock started %d mins ago"
-                          (floor (- (float-time)
-                                    (float-time (cdr clock)))
+                          (floor (encode-time (time-subtract nil (cdr clock))
+                                              'integer)
                                  60)))))
                   (or last-valid
                       (cdr clock)))))))))))
@@ -1155,7 +1156,7 @@ so long."
     (let* ((org-clock-user-idle-seconds (org-user-idle-seconds))
           (org-clock-user-idle-start
            (time-subtract (current-time)
-                          (seconds-to-time org-clock-user-idle-seconds)))
+                          (encode-time org-clock-user-idle-seconds)))
           (org-clock-resolving-clocks-due-to-idleness t))
       (if (> org-clock-user-idle-seconds (* 60 org-clock-idle-time))
          (org-clock-resolve
@@ -1293,8 +1294,7 @@ the default behavior."
           (setq ts (concat "[" (match-string 1) "]"))
           (goto-char (match-end 1))
           (setq org-clock-start-time
-                (apply 'encode-time
-                       (org-parse-time-string (match-string 1))))
+                (org-time-string-to-time (match-string 1)))
           (setq org-clock-effort (org-entry-get (point) org-effort-property))
           (setq org-clock-total-time (org-clock-sum-current-item
                                       (org-clock-get-sum-start))))
@@ -1431,7 +1431,7 @@ The time is always returned as UTC."
             (day (nth 3 dt)))
        (if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day)))
        (setf (nth 2 dt) org-extend-today-until)
-       (apply #'encode-time (append (list 0 0) (nthcdr 2 dt)))))
+       (apply #'encode-time 0 0 (nthcdr 2 dt))))
      ((or (equal cmt "all")
          (and (or (not cmt) (equal cmt "auto"))
               (not lr)))
@@ -1577,14 +1577,12 @@ to, overriding the existing value of 
`org-clock-out-switch-to-state'."
          (delete-region (point) (point-at-eol))
          (insert "--")
          (setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
-         (setq s (- (float-time
-                     (apply #'encode-time (org-parse-time-string te)))
-                    (float-time
-                     (apply #'encode-time (org-parse-time-string ts))))
-               h (floor (/ s 3600))
+         (setq s (float-time (time-subtract
+                              (org-time-string-to-time te)
+                              (org-time-string-to-time ts)))
+               h (floor s 3600)
                s (- s (* 3600 h))
-               m (floor (/ s 60))
-               s (- s (* 60 s)))
+               m (floor s 60))
          (insert " => " (format "%2d:%02d" h m))
          (move-marker org-clock-marker nil)
          (move-marker org-clock-hd-marker nil)
@@ -1813,15 +1811,15 @@ PROPNAME lets you set a custom text property instead of 
:org-clock-minutes."
          ((match-end 2)
           ;; Two time stamps.
           (let* ((ts (float-time
-                      (apply #'encode-time
-                             (save-match-data
-                               (org-parse-time-string (match-string 2))))))
+                      (encode-time
+                       (save-match-data
+                         (org-parse-time-string (match-string 2))))))
                  (te (float-time
-                      (apply #'encode-time
-                             (org-parse-time-string (match-string 3)))))
+                      (encode-time
+                       (org-parse-time-string (match-string 3)))))
                  (dt (- (if tend (min te tend) te)
                         (if tstart (max ts tstart) ts))))
-            (when (> dt 0) (cl-incf t1 (floor (/ dt 60))))))
+            (when (> dt 0) (cl-incf t1 (floor dt 60)))))
          ((match-end 4)
           ;; A naked time.
           (setq t1 (+ t1 (string-to-number (match-string 5))
@@ -2704,24 +2702,24 @@ LEVEL is an integer.  Indent by two spaces per level 
above 1."
       (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute ts)))
        (setq ts (float-time (encode-time 0 0 0 day month year)))))
      (ts
-      (setq ts (float-time (apply #'encode-time (org-parse-time-string ts))))))
+      (setq ts (float-time (org-time-string-to-time ts)))))
     (cond
      ((numberp te)
       ;; Likewise for te.
       (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute te)))
        (setq te (float-time (encode-time 0 0 0 day month year)))))
      (te
-      (setq te (float-time (apply #'encode-time (org-parse-time-string te))))))
+      (setq te (float-time (org-time-string-to-time te)))))
     (setq tsb
          (if (eq step0 'week)
-             (let ((dow (nth 6 (decode-time (seconds-to-time ts)))))
+             (let ((dow (nth 6 (decode-time (encode-time ts)))))
                (if (<= dow ws) ts
                  (- ts (* 86400 (- dow ws)))))
            ts))
     (while (< tsb te)
       (unless (bolp) (insert "\n"))
-      (let ((start-time (seconds-to-time (max tsb ts))))
-       (cl-incf tsb (let ((dow (nth 6 (decode-time (seconds-to-time tsb)))))
+      (let ((start-time (max tsb ts)))
+       (cl-incf tsb (let ((dow (nth 6 (decode-time (encode-time tsb)))))
                       (if (or (eq step0 'day)
                               (= dow ws))
                           step
@@ -2741,7 +2739,7 @@ LEVEL is an integer.  Indent by two spaces per level 
above 1."
                  :tstart (format-time-string (org-time-stamp-format t t)
                                              start-time)
                  :tend (format-time-string (org-time-stamp-format t t)
-                                           (seconds-to-time (min te tsb))))))))
+                                           (encode-time (min te tsb))))))))
          (re-search-forward "^[ \t]*#\\+END:")
          (when (and stepskip0 (equal step-time 0))
            ;; Remove the empty table
@@ -2882,18 +2880,16 @@ Otherwise, return nil."
                     (<= org-clock-marker (point-at-eol)))
            ;; The clock is running here
            (setq org-clock-start-time
-                 (apply 'encode-time
-                        (org-parse-time-string (match-string 1))))
+                 (org-time-string-to-time (match-string 1)))
            (org-clock-update-mode-line)))
         (t
          (and (match-end 4) (delete-region (match-beginning 4) (match-end 4)))
          (end-of-line 1)
          (setq ts (match-string 1)
                te (match-string 3))
-         (setq s (- (float-time
-                     (apply #'encode-time (org-parse-time-string te)))
-                    (float-time
-                     (apply #'encode-time (org-parse-time-string ts))))
+         (setq s (float-time
+                  (time-subtract (org-time-string-to-time te)
+                                 (org-time-string-to-time ts)))
                neg (< s 0)
                s (abs s)
                h (floor (/ s 3600))
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 2c34edd..f3e118b 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -719,7 +719,7 @@ around it."
       (setq time-after (copy-sequence time))
       (setf (nth 3 time-before) (1- (nth 3 time)))
       (setf (nth 3 time-after) (1+ (nth 3 time)))
-      (mapcar (lambda (x) (format-time-string fmt (apply 'encode-time x)))
+      (mapcar (lambda (x) (format-time-string fmt (encode-time x)))
              (list time-before time time-after)))))
 
 (defun org-columns-open-link (&optional arg)
@@ -1070,7 +1070,7 @@ as a canonical duration, i.e., using units defined in
   (cond
    ((string-match-p org-ts-regexp s)
     (/ (- org-columns--time
-         (float-time (apply #'encode-time (org-parse-time-string s))))
+         (float-time (org-time-string-to-time s)))
        60))
    ((org-duration-p s) (org-duration-to-minutes s t)) ;skip user units
    (t (user-error "Invalid age: %S" s))))
diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el
index 75d46e2..e2ee0a0 100644
--- a/lisp/org/org-element.el
+++ b/lisp/org/org-element.el
@@ -4765,13 +4765,13 @@ you want to help debugging the issue.")
 (defvar org-element-cache-sync-idle-time 0.6
   "Length, in seconds, of idle time before syncing cache.")
 
-(defvar org-element-cache-sync-duration (seconds-to-time 0.04)
+(defvar org-element-cache-sync-duration (encode-time 0.04)
   "Maximum duration, as a time value, for a cache synchronization.
 If the synchronization is not over after this delay, the process
 pauses and resumes after `org-element-cache-sync-break'
 seconds.")
 
-(defvar org-element-cache-sync-break (seconds-to-time 0.3)
+(defvar org-element-cache-sync-break (encode-time 0.3)
   "Duration, as a time value, of the pause between synchronizations.
 See `org-element-cache-sync-duration' for more information.")
 
diff --git a/lisp/org/org-macro.el b/lisp/org/org-macro.el
index 7d04d02..a151e1e 100644
--- a/lisp/org/org-macro.el
+++ b/lisp/org/org-macro.el
@@ -313,7 +313,7 @@ Return a list of arguments, as strings.  This is the 
opposite of
                                  (buffer-substring
                                   (point) (line-end-position)))))
                       (when (cl-some #'identity time)
-                        (setq date (apply #'encode-time time))))))))
+                        (setq date (encode-time time))))))))
              (let ((proc (get-buffer-process buf)))
                (while (and proc (accept-process-output proc .5 nil t)))))
          (kill-buffer buf))
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 0a8382c..81a77fd 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -2909,8 +2909,8 @@ location of point."
                     (format-time-string
                      (org-time-stamp-format
                       (string-match-p "[0-9]\\{1,2\\}:[0-9]\\{2\\}" ts))
-                     (apply #'encode-time
-                            (save-match-data (org-parse-time-string ts))))))
+                     (encode-time
+                      (save-match-data (org-parse-time-string ts))))))
                 form t t))
 
          (setq ev (if (and duration (string-match 
"^[0-9]+:[0-9]+\\(?::[0-9]+\\)?$" form))
diff --git a/lisp/org/org-timer.el b/lisp/org/org-timer.el
index bf17de4..c9ca85c 100644
--- a/lisp/org/org-timer.el
+++ b/lisp/org/org-timer.el
@@ -140,7 +140,7 @@ the region 0:00:00."
          (unless (string-match "\\S-" s) (setq s def))
          (setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete s)))))
        (setq org-timer-start-time
-             (seconds-to-time
+             (encode-time
               ;; Pass `current-time' result to `float-time' (instead
               ;; of calling without arguments) so that only
               ;; `current-time' has to be overridden in tests.
@@ -168,12 +168,12 @@ With prefix arg STOP, stop it entirely."
                  (org-timer--run-countdown-timer
                   new-secs org-timer-countdown-timer-title))
            (setq org-timer-start-time
-                 (time-add (current-time) (seconds-to-time new-secs))))
+                 (time-add (current-time) (encode-time new-secs))))
        (setq org-timer-start-time
              ;; Pass `current-time' result to `float-time' (instead
              ;; of calling without arguments) so that only
              ;; `current-time' has to be overridden in tests.
-             (seconds-to-time (- (float-time (current-time))
+             (encode-time (- (float-time (current-time))
                                  (- pause-secs start-secs)))))
       (setq org-timer-pause-time nil)
       (org-timer-set-mode-line 'on)
@@ -464,7 +464,7 @@ using three `C-u' prefix arguments."
                 secs org-timer-countdown-timer-title))
          (run-hooks 'org-timer-set-hook)
          (setq org-timer-start-time
-               (time-add (current-time) (seconds-to-time secs)))
+               (time-add (current-time) (encode-time secs)))
          (setq org-timer-pause-time nil)
          (org-timer-set-mode-line 'on))))))
 
diff --git a/lisp/org/org.el b/lisp/org/org.el
index ef45ee66..b627282 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -5613,16 +5613,15 @@ When ROUNDING-MINUTES is not an integer, fall back on 
the car of
 the rounding returns a past time."
   (let ((r (or (and (integerp rounding-minutes) rounding-minutes)
               (car org-time-stamp-rounding-minutes)))
-       (time (decode-time)) res)
+       (now (current-time)))
     (if (< r 1)
-       (current-time)
-      (setq res
-           (apply 'encode-time
-                  (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) 
r)))))
-                          (nthcdr 2 time))))
-      (if (and past (< (float-time (time-subtract (current-time) res)) 0))
-         (seconds-to-time (- (float-time res) (* r 60)))
-       res))))
+       now
+      (let* ((time (decode-time now))
+            (res (apply #'encode-time 0 (* r (round (nth 1 time) r))
+                        (nthcdr 2 time))))
+       (if (or (not past) (time-less-p res now))
+           res
+         (time-subtract res (* r 60)))))))
 
 (defun org-today ()
   "Return today date, considering `org-extend-today-until'."
@@ -9743,9 +9742,7 @@ active region."
          (setq link
                (format-time-string
                 (car org-time-stamp-formats)
-                (apply 'encode-time
-                       (list 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd)
-                             nil nil nil))))
+                (encode-time 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd))))
          (org-store-link-props :type "calendar" :date cd)))
 
        ((eq major-mode 'help-mode)
@@ -13344,7 +13341,7 @@ for calling org-schedule with, or if there is no 
scheduling,
 returns nil."
   (let ((time (org-entry-get pom "SCHEDULED" inherit)))
     (when time
-      (apply 'encode-time (org-parse-time-string time)))))
+      (org-time-string-to-time time))))
 
 (defun org-get-deadline-time (pom &optional inherit)
   "Get the deadline as a time tuple, of a format suitable for
@@ -13352,7 +13349,7 @@ calling org-deadline with, or if there is no 
scheduling, returns
 nil."
   (let ((time (org-entry-get pom "DEADLINE" inherit)))
     (when time
-      (apply 'encode-time (org-parse-time-string time)))))
+      (org-time-string-to-time time))))
 
 (defun org-remove-timestamp-with-keyword (keyword)
   "Remove all time stamps with KEYWORD in the current entry."
@@ -13411,7 +13408,7 @@ WHAT entry will also be removed."
                                       org-deadline-time-regexp)
                                     end t)
              (setq ts (match-string 1)
-                   default-time (apply 'encode-time (org-parse-time-string ts))
+                   default-time (org-time-string-to-time ts)
                    default-input (and ts (org-get-compact-tod ts)))))))
       (when what
        (setq time
@@ -14668,7 +14665,7 @@ it as a time string and apply `float-time' to it.  If S 
is nil, just return 0."
    ((numberp s) s)
    ((stringp s)
     (condition-case nil
-       (float-time (apply #'encode-time (org-parse-time-string s)))
+       (float-time (org-time-string-to-time s))
       (error 0.)))
    (t 0.)))
 
@@ -14676,8 +14673,7 @@ it as a time string and apply `float-time' to it.  If S 
is nil, just return 0."
   "Time in seconds today at 0:00.
 Returns the float number of seconds since the beginning of the
 epoch to the beginning of today (00:00)."
-  (float-time (apply 'encode-time
-                    (append '(0 0 0) (nthcdr 3 (decode-time))))))
+  (float-time (apply #'encode-time 0 0 0 (nthcdr 3 (decode-time)))))
 
 (defun org-matcher-time (s)
   "Interpret a time comparison value."
@@ -16573,7 +16569,7 @@ non-nil."
         ;; Default time is either the timestamp at point or today.
         ;; When entering a range, only the range start is considered.
          (default-time (if (not ts) (current-time)
-                        (apply #'encode-time (org-parse-time-string ts))))
+                        (org-time-string-to-time ts)))
          (default-input (and ts (org-get-compact-tod ts)))
          (repeater (and ts
                        (string-match "\\([.+-]+[0-9]+[hdwmy] ?\\)+" ts)
@@ -16820,7 +16816,7 @@ user."
     (when (< (nth 2 org-defdecode) org-extend-today-until)
       (setf (nth 2 org-defdecode) -1)
       (setf (nth 1 org-defdecode) 59)
-      (setq org-def (apply #'encode-time org-defdecode))
+      (setq org-def (encode-time org-defdecode))
       (setq org-defdecode (decode-time org-def)))
     (let* ((timestr (format-time-string
                     (if org-with-time "%Y-%m-%d %H:%M" "%Y-%m-%d")
@@ -16893,13 +16889,14 @@ user."
                 "range representable on this machine"))
       (ding))
 
-    ;; One round trip to get rid of 34th of August and stuff like that....
-    (setq final (decode-time (apply 'encode-time final)))
+    (setq final (apply #'encode-time final))
 
     (setq org-read-date-final-answer ans)
 
     (if to-time
-       (apply 'encode-time final)
+       final
+      ;; This round-trip gets rid of 34th of August and stuff like that....
+      (setq final (decode-time final))
       (if (and (boundp 'org-time-was-given) org-time-was-given)
          (format "%04d-%02d-%02d %02d:%02d"
                  (nth 5 final) (nth 4 final) (nth 3 final)
@@ -16929,7 +16926,7 @@ user."
                          (and (boundp 'org-time-was-given) org-time-was-given))
                      (cdr fmts)
                    (car fmts)))
-            (txt (format-time-string fmt (apply 'encode-time f)))
+            (txt (format-time-string fmt (apply #'encode-time f)))
             (txt (if org-read-date-inactive (concat "[" (substring txt 1 -1) 
"]") txt))
             (txt (concat "=> " txt)))
        (when (and org-end-time-was-given
@@ -17296,7 +17293,7 @@ The command returns the inserted time stamp."
          time (org-fix-decoded-time t1)
          str (org-add-props
                  (format-time-string
-                  (substring tf 1 -1) (apply 'encode-time time))
+                  (substring tf 1 -1) (encode-time time))
                  nil 'mouse-face 'highlight))
     (put-text-property beg end 'display str)))
 
@@ -17553,7 +17550,7 @@ days in order to avoid rounding problems."
 
 (defun org-time-string-to-time (s)
   "Convert timestamp string S into internal time."
-  (apply #'encode-time (org-parse-time-string s)))
+  (encode-time (org-parse-time-string s)))
 
 (defun org-time-string-to-seconds (s)
   "Convert a timestamp string S into a number of seconds."
@@ -17588,7 +17585,7 @@ signaled."
    (daynr (org-closest-date s daynr prefer))
    (t (time-to-days
        (condition-case errdata
-          (apply #'encode-time (org-parse-time-string s))
+          (org-time-string-to-time s)
         (error (error "Bad timestamp `%s'%s\nError was: %s"
                       s
                       (if (not (and buffer pos)) ""
@@ -17686,12 +17683,12 @@ stamp stay unchanged.  In any case, return value is 
an absolute
 day number."
   (if (not (string-match "\\+\\([0-9]+\\)\\([hdwmy]\\)" start))
       ;; No repeater.  Do not shift time stamp.
-      (time-to-days (apply #'encode-time (org-parse-time-string start)))
+      (time-to-days (org-time-string-to-time start))
     (let ((value (string-to-number (match-string 1 start)))
          (type (match-string 2 start)))
       (if (= 0 value)
          ;; Repeater with a 0-value is considered as void.
-         (time-to-days (apply #'encode-time (org-parse-time-string start)))
+         (time-to-days (org-time-string-to-time start))
        (let* ((base (org-date-to-gregorian start))
               (target (org-date-to-gregorian current))
               (sday (calendar-absolute-from-gregorian base))
@@ -17796,7 +17793,7 @@ NODEFAULT, hour and minute fields will be nil if not 
given."
         ;; second argument.  However, this requires at least Emacs
         ;; 25.1.  We can do it when we switch to this version as our
         ;; minimal requirement.
-        (decode-time (seconds-to-time (org-matcher-time s))))
+        (decode-time (encode-time (org-matcher-time s))))
        (t (error "Not a standard Org time string: %s" s))))
 
 (defun org-timestamp-up (&optional arg)
@@ -18000,7 +17997,7 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays 
like \"--2d\"."
          (setcar time0 (or (car time0) 0))
          (setcar (nthcdr 1 time0) (or (nth 1 time0) 0))
          (setcar (nthcdr 2 time0) (or (nth 2 time0) 0))
-         (setq time (apply 'encode-time time0))))
+         (setq time (encode-time time0))))
       ;; Insert the new time-stamp, and ensure point stays in the same
       ;; category as before (i.e. not after the last position in that
       ;; category).
@@ -23389,13 +23386,12 @@ strictly within a source block, use appropriate 
comment syntax."
 (defun org-timestamp--to-internal-time (timestamp &optional end)
   "Encode TIMESTAMP object into Emacs internal time.
 Use end of date range or time range when END is non-nil."
-  (apply #'encode-time
-        (cons 0
-              (mapcar
-               (lambda (prop) (or (org-element-property prop timestamp) 0))
-               (if end '(:minute-end :hour-end :day-end :month-end :year-end)
-                 '(:minute-start :hour-start :day-start :month-start
-                                 :year-start))))))
+  (apply #'encode-time 0
+        (mapcar
+         (lambda (prop) (or (org-element-property prop timestamp) 0))
+         (if end '(:minute-end :hour-end :day-end :month-end :year-end)
+           '(:minute-start :hour-start :day-start :month-start
+                           :year-start)))))
 
 (defun org-timestamp-has-time-p (timestamp)
   "Non-nil when TIMESTAMP has a time specified."
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index d7cb226..261e50a 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -4,7 +4,7 @@
 
 ;; Author:  Pavel Kobyakov <address@hidden>
 ;; Maintainer: João Távora <address@hidden>
-;; Version: 1.0.3
+;; Version: 1.0.5
 ;; Package-Requires: ((emacs "26.1"))
 ;; Keywords: c languages tools
 
@@ -742,14 +742,13 @@ report applies to that region."
           ;; the associated overlay.
           (cond
            (region
-            (dolist (diag (flymake--backend-state-diags state))
-              (let ((diag-beg (flymake--diag-beg diag))
-                    (diag-end (flymake--diag-beg diag)))
-                (when (and (< diag-beg (cdr region))
-                           (> diag-end (car region)))
-                  (delete-overlay (flymake--diag-overlay diag))
-                  (setf (flymake--backend-state-diags state)
-                        (delq diag (flymake--backend-state-diags state)))))))
+            (cl-loop for diag in (flymake--backend-state-diags state)
+                     if (or (> (flymake--diag-end diag) (car region))
+                            (< (flymake--diag-beg diag) (cdr region)))
+                     do (delete-overlay (flymake--diag-overlay diag))
+                     else collect diag into surviving
+                     finally (setf (flymake--backend-state-diags state)
+                                   surviving)))
            (first-report
             (dolist (diag (flymake--backend-state-diags state))
               (delete-overlay (flymake--diag-overlay diag)))
@@ -974,6 +973,11 @@ special *Flymake log* buffer."  :group 'flymake :lighter
     (add-hook 'after-save-hook 'flymake-after-save-hook nil t)
     (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t)
 
+    ;; If Flymake happened to be alrady already ON, we must cleanup
+    ;; existing diagnostic overlays, lest we forget them by blindly
+    ;; reinitializing `flymake--backend-state' in the next line.
+    ;; See https://github.com/joaotavora/eglot/issues/223.
+    (mapc #'delete-overlay (flymake--overlays))
     (setq flymake--backend-state (make-hash-table))
     (setq flymake--recent-changes nil)
 
@@ -1000,7 +1004,7 @@ Do it only if `flymake-no-changes-timeout' is non-nil."
     (setq
      flymake-timer
      (run-with-idle-timer
-      (seconds-to-time flymake-no-changes-timeout)
+      (encode-time flymake-no-changes-timeout)
       nil
       (lambda (buffer)
         (when (buffer-live-p buffer)
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index 1ef73a6..0746cfd 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -192,8 +192,7 @@ key cache `url-digest-auth-storage'."
 (defun url-digest-auth-make-cnonce ()
   "Compute a new unique client nonce value."
   (base64-encode-string
-   (apply #'format "%016x%08x%08x" (random)
-         (read (format-time-string "(%s %N)")))
+   (format "%016x%016x" (random) (car (encode-time nil t)))
    t))
 
 (defun url-digest-auth-nonce-count (_nonce)
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el
index 66a7223..a1cb0b9 100644
--- a/lisp/url/url-cache.el
+++ b/lisp/url/url-cache.el
@@ -205,7 +205,7 @@ If `url-standalone-mode' is non-nil, cached items never 
expire."
          (time-less-p
           (time-add
            cache-time
-           (seconds-to-time (or expire-time url-cache-expire-time)))
+           (encode-time (or expire-time url-cache-expire-time)))
           nil)))))
 
 (defun url-cache-prune-cache (&optional directory)
@@ -227,7 +227,7 @@ considered \"expired\"."
           ((time-less-p
             (time-add
              (file-attribute-modification-time (file-attributes file))
-             (seconds-to-time url-cache-expire-time))
+             (encode-time url-cache-expire-time))
             now)
            (delete-file file)
            (setq deleted-files (1+ deleted-files))))))
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index 0c27638..213dab2 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -105,10 +105,10 @@ i.e. 1970-1-1) are loaded as expiring one year from now 
instead."
                    ;; away, make it expire a year from now
                    (expires (format-time-string
                              "%d %b %Y %T [GMT]"
-                             (seconds-to-time
+                             (encode-time
                               (let ((s (string-to-number (nth 4 fields))))
                                 (if (and (= s 0) long-session)
-                                    (seconds-to-time (+ (* 365 24 60 60) 
(float-time)))
+                                    (encode-time (+ (* 365 24 60 60) 
(float-time)))
                                   s)))))
                    (key (nth 5 fields))
                    (val (nth 6 fields)))
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el
index 2cc2b18..a4cf0f0 100644
--- a/lisp/url/url-dav.el
+++ b/lisp/url/url-dav.el
@@ -146,7 +146,7 @@ Returns nil if WebDAV is not supported."
       (setq time (parse-time-string date-string)))
 
     (if time
-       (setq time (apply 'encode-time time))
+       (setq time (encode-time time))
       (url-debug 'dav "Unable to decode date (%S) (%s)"
                 (xml-node-name node) date-string))
     time))
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index 5df0a28..a4ff1cb 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -650,7 +650,7 @@ Optional arg REVISION is a revision to annotate from."
   "Return the current time, based at midnight of the current day, and
 encoded as fractional days."
   (vc-annotate-convert-time
-   (apply 'encode-time 0 0 0 (nthcdr 3 (decode-time)))))
+   (apply #'encode-time 0 0 0 (nthcdr 3 (decode-time)))))
 
 (defun vc-cvs-annotate-time ()
   "Return the time of the next annotation (as fraction of days)
@@ -1184,9 +1184,8 @@ is non-nil."
                   (car parsed-time)
                   ;; Compare just the seconds part of the file time,
                   ;; since CVS file time stamp resolution is just 1 second.
-                  (let ((ptime (apply 'encode-time parsed-time)))
-                    (and (eq (car mtime) (car ptime))
-                         (eq (cadr mtime) (cadr ptime)))))
+                 (= (encode-time mtime 'integer)
+                    (encode-time parsed-time 'integer)))
              (vc-file-setprop file 'vc-checkout-time mtime)
              (if set-state (vc-file-setprop file 'vc-state 'up-to-date)))
             (t
diff --git a/lisp/woman.el b/lisp/woman.el
index 9548fdc..1100693 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -2010,10 +2010,8 @@ Optional argument REDRAW, if non-nil, forces mode line 
to be updated."
 ;;   (after Man-bgproc-sentinel-advice activate)
 ;;   ;; Terminates man processing
 ;;   "Report formatting time."
-;;   (let* ((time (current-time))
-;;      (time (+ (* (- (car time) (car WoMan-Man-start-time)) 65536)
-;;               (- (cadr time) (cadr WoMan-Man-start-time)))))
-;;     (message "Man formatting done in %d seconds" time)))
+;;   (message "Man formatting done in %s seconds"
+;;            (float-time (time-subtract nil WoMan-Man-start-time))))
 
 
 ;;; Buffer handling:
diff --git a/src/emacs.c b/src/emacs.c
index 3f964a1..e16e230 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -912,7 +912,7 @@ main (int argc, char **argv)
     gflags.will_not_unexec_ = true;
 #endif
 
-#if defined WINDOWSNT || defined HAVE_NTGUI
+#ifdef WINDOWSNT
   /* Grab our malloc arena space now, before anything important
      happens.  This relies on the static heap being needed only in
      temacs and only if we are going to dump with unexec.  */
@@ -934,6 +934,8 @@ main (int argc, char **argv)
        }
     }
   init_heap (use_dynamic_heap);
+#endif
+#if defined WINDOWSNT || defined HAVE_NTGUI
   /* Set global variables used to detect Windows version.  Do this as
      early as possible.  (w32proc.c calls this function as well, but
      the additional call here is harmless.) */
diff --git a/test/lisp/emacs-lisp/package-tests.el 
b/test/lisp/emacs-lisp/package-tests.el
index 8f021bf..c757bcc 100644
--- a/test/lisp/emacs-lisp/package-tests.el
+++ b/test/lisp/emacs-lisp/package-tests.el
@@ -190,12 +190,33 @@ Must called from within a `tar-mode' buffer."
   "Return the package version as a string."
   (package-version-join (package-desc-version desc)))
 
+(defun package-test--compatible-p (pkg-desc pkg-sample &optional kind)
+  (and (cl-every (lambda (f)
+                   (equal (funcall f pkg-desc)
+                          (funcall f pkg-sample)))
+                 (cons (if kind #'package-desc-kind #'ignore)
+                       '(package-desc-name
+                         package-desc-version
+                         package-desc-summary
+                         package-desc-reqs
+                         package-desc-archive
+                         package-desc-dir
+                         package-desc-signed)))
+       ;; The `extras' field should contain at least the specified elements.
+       (let ((extras (package-desc-extras pkg-desc))
+             (extras-sample (package-desc-extras pkg-sample)))
+         (cl-every (lambda (sample-elem)
+                     (member sample-elem extras))
+                   extras-sample))))
+
 (ert-deftest package-test-desc-from-buffer ()
   "Parse an elisp buffer to get a `package-desc' object."
   (with-package-test (:basedir "package-resources" :file 
"simple-single-1.3.el")
-    (should (equal (package-buffer-info) simple-single-desc)))
+    (should (package-test--compatible-p
+             (package-buffer-info) simple-single-desc 'kind)))
   (with-package-test (:basedir "package-resources" :file 
"simple-depend-1.0.el")
-    (should (equal (package-buffer-info) simple-depend-desc)))
+    (should (package-test--compatible-p
+             (package-buffer-info) simple-depend-desc 'kind)))
   (with-package-test (:basedir "package-resources"
                                :file "multi-file-0.2.3.tar")
     (tar-mode)
@@ -223,15 +244,12 @@ Must called from within a `tar-mode' buffer."
       (with-temp-buffer
         (insert-file-contents (expand-file-name "simple-single-pkg.el"
                                                 simple-pkg-dir))
-        (should (string= (buffer-string)
-                         (concat ";;; -*- no-byte-compile: t -*-\n"
-                                 "(define-package \"simple-single\" \"1.3\" "
-                                 "\"A single-file package "
-                                 "with no dependencies\" 'nil "
-                                 ":authors '((\"J. R. Hacker\" . 
\"address@hidden")) "
-                                 ":maintainer '(\"J. R. Hacker\" . 
\"address@hidden") "
-                                 ":url \"http://doodles.au\"";
-                                 ")\n"))))
+        (goto-char (point-min))
+        (let ((sexp (read (current-buffer))))
+          (should (eq (car-safe sexp) 'define-package))
+          (should (package-test--compatible-p
+                   (apply #'package-desc-from-define (cdr sexp))
+                   simple-single-desc))))
       (should (file-exists-p autoloads-file))
       (should-not (get-file-buffer autoloads-file)))))
 
@@ -580,8 +598,17 @@ Must called from within a `tar-mode' buffer."
         (setq archive-contents
               (package-read-from-string
                (buffer-substring (point-min) (point-max)))))
-      (should (equal archive-contents
-                     (list 1 package-x-test--single-archive-entry-1-3))))))
+      (should (equal 1 (car archive-contents)))
+      (should (equal 2 (length archive-contents)))
+      (let ((pac (cadr archive-contents))
+            (pac-sample package-x-test--single-archive-entry-1-3))
+        (should (equal (pop pac) (pop pac-sample)))
+        (dotimes (i 4)
+          (should (equal (aref pac i) (aref pac-sample i))))
+        ;; The `extras' field should contain at least the specified elements.
+        (should (cl-every (lambda (sample-elem)
+                            (member sample-elem (aref pac 4)))
+                          (aref pac-sample 4)))))))
 
 (ert-deftest package-x-test-upload-new-version ()
   "Test uploading a new version of a package"
@@ -601,8 +628,17 @@ Must called from within a `tar-mode' buffer."
         (setq archive-contents
               (package-read-from-string
                (buffer-substring (point-min) (point-max)))))
-      (should (equal archive-contents
-                     (list 1 package-x-test--single-archive-entry-1-4))))))
+      (should (equal 1 (car archive-contents)))
+      (should (equal 2 (length archive-contents)))
+      (let ((pac (cadr archive-contents))
+            (pac-sample package-x-test--single-archive-entry-1-4))
+        (should (equal (pop pac) (pop pac-sample)))
+        (dotimes (i 4)
+          (should (equal (aref pac i) (aref pac-sample i))))
+        ;; The `extras' field should contain at least the specified elements.
+        (should (cl-every (lambda (sample-elem)
+                            (member sample-elem (aref pac 4)))
+                          (aref pac-sample 4)))))))
 
 (ert-deftest package-test-get-deps ()
   "Test `package--get-deps' with complex structures."
diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el
index e84af6b..9a40316 100644
--- a/test/src/regex-emacs-tests.el
+++ b/test/src/regex-emacs-tests.el
@@ -555,11 +555,11 @@ differences in behavior.")
 
 (defconst regex-tests-PTESTS-whitelist
   [
-   ;; emacs doesn't barf on weird ranges such as [b-a], but simply
-   ;; fails to match
+   ;; emacs doesn't see DEL (0x7f) as a [:cntrl:] character
    138
 
-   ;; emacs doesn't see DEL (0x78) as a [:cntrl:] character
+   ;; emacs doesn't barf on weird ranges such as [b-a], but simply
+   ;; fails to match
    168
   ]
   "Line numbers in the PTESTS test that should be skipped.  These



reply via email to

[Prev in Thread] Current Thread [Next in Thread]