diff options
| author | Glenn Morris | 2008-02-16 03:31:19 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-02-16 03:31:19 +0000 |
| commit | 04e5613961922a9bd83f1255781b04b7a85dd8a9 (patch) | |
| tree | 26449f1b69c5d90b7bfd88f052c850d4a8811d03 | |
| parent | 99d8d5404b352255a311ece28eb41e9ddc4e37c7 (diff) | |
| download | emacs-04e5613961922a9bd83f1255781b04b7a85dd8a9.tar.gz emacs-04e5613961922a9bd83f1255781b04b7a85dd8a9.zip | |
(emacs-uptime): Add optional `format' argument. Doc fix. Use `%z'
rather than removed `nonzero' argument of format-seconds.
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/time.el | 11 |
2 files changed, 17 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1cdf82a55cd..35670906e20 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2008-02-16 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * composite.el (composition-function-table): Doc fix. | ||
| 4 | |||
| 5 | * calendar/time-date.el (format-seconds): Remove `nonzero' argument | ||
| 6 | in favor of `%z' specifier. | ||
| 7 | (emacs-uptime): Move to time.el. | ||
| 8 | * time.el (emacs-uptime): Move here from time-date.el. Add | ||
| 9 | optional `format' argument. Doc fix. Use `%z' rather than | ||
| 10 | removed `nonzero' argument of format-seconds. | ||
| 11 | |||
| 1 | 2008-02-16 Dan Nicolaescu <dann@ics.uci.edu> | 12 | 2008-02-16 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 13 | ||
| 3 | * bindings.el (mode-line-mule-info): Make the tooltips more explicit. | 14 | * bindings.el (mode-line-mule-info): Make the tooltips more explicit. |
diff --git a/lisp/time.el b/lisp/time.el index c9ca2059b7b..dc4e500cddc 100644 --- a/lisp/time.el +++ b/lisp/time.el | |||
| @@ -550,14 +550,15 @@ To turn off the world time display, go to that window and type `q'." | |||
| 550 | 550 | ||
| 551 | 551 | ||
| 552 | ;;;###autoload | 552 | ;;;###autoload |
| 553 | (defun emacs-uptime () | 553 | (defun emacs-uptime (&optional format) |
| 554 | "Return a string giving the uptime of this instance of Emacs." | 554 | "Return a string giving the uptime of this instance of Emacs. |
| 555 | FORMAT is a string to format the result, using `format-seconds'. | ||
| 556 | For example, the Unix uptime command format is \"%D, %z%2h:%.2m\"." | ||
| 555 | (interactive) | 557 | (interactive) |
| 556 | (let ((str | 558 | (let ((str |
| 557 | (format-seconds "%Y, %D, %H, %M, %S" | 559 | (format-seconds (or format "%Y, %D, %H, %M, %z%S") |
| 558 | (time-to-seconds | 560 | (time-to-seconds |
| 559 | (time-subtract (current-time) emacs-startup-time)) | 561 | (time-subtract (current-time) emacs-startup-time))))) |
| 560 | t))) | ||
| 561 | (if (interactive-p) | 562 | (if (interactive-p) |
| 562 | (message "%s" str) | 563 | (message "%s" str) |
| 563 | str))) | 564 | str))) |