[emacs-w3m:13863] Emergency hack to get old programs work with new Emacs time functions
Katsumi Yamaoka <[email protected]> Tue, 26 Apr 2022 09:13:31 +0900
| Newsgroups | gmane.emacs.w3m |
|---|---|
| Organization | Emacsen advocacy group |
| Message-ID | <[email protected]> |
In the latest Emacs build from git, etc/NEWS says:
,----
| ** current-time and related functions now yield (TICKS . HZ) timestamps.
| Previously they yielded timestamps of the forms (HI LO US PS), (HI LO
| US) or (HI LO), which were less regular and less efficient and which
| lacked information about clock resolution. This long-planned change
| was documented in Emacs 27. To convert a timestamp X to the old
| 4-element list form, you can use (time-convert X 'list).
`----
Because of this, not only emacs-w3m (and shimbun) but also some
other programs got not to work.
Here are quick hacks to make those programs work:
(fset 'orig-current-time (symbol-function 'current-time))
(fset 'current-time (lambda nil (time-convert nil 'list)))
(fset 'orig-encode-time (symbol-function 'encode-time))
(fset 'encode-time
(lambda (&rest args)
(time-convert (apply #'orig-encode-time args) 'list)))
I seem to be able to live with latest Emacs by these two, though
there might be the other time functions that need to be hacked.