(emacs-uptime): Add optional `format' argument. Doc fix. Use `%z'
authorGlenn Morris <rgm@gnu.org>
Sat, 16 Feb 2008 03:31:19 +0000 (03:31 +0000)
committerGlenn Morris <rgm@gnu.org>
Sat, 16 Feb 2008 03:31:19 +0000 (03:31 +0000)
rather than removed `nonzero' argument of format-seconds.

lisp/ChangeLog
lisp/time.el

index 1cdf82a..3567090 100644 (file)
@@ -1,3 +1,14 @@
+2008-02-16  Glenn Morris  <rgm@gnu.org>
+
+       * composite.el (composition-function-table): Doc fix.
+
+       * calendar/time-date.el (format-seconds): Remove `nonzero' argument
+       in favor of `%z' specifier.
+       (emacs-uptime): Move to time.el.
+       * time.el (emacs-uptime): Move here from time-date.el.  Add
+       optional `format' argument.  Doc fix.  Use `%z' rather than
+       removed `nonzero' argument of format-seconds.
+
 2008-02-16  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * bindings.el (mode-line-mule-info): Make the tooltips more explicit.
index c9ca205..dc4e500 100644 (file)
@@ -550,14 +550,15 @@ To turn off the world time display, go to that window and type `q'."
 
 \f
 ;;;###autoload
-(defun emacs-uptime ()
-  "Return a string giving the uptime of this instance of Emacs."
+(defun emacs-uptime (&optional format)
+  "Return a string giving the uptime of this instance of Emacs.
+FORMAT is a string to format the result, using `format-seconds'.
+For example, the Unix uptime command format is \"%D, %z%2h:%.2m\"."
   (interactive)
   (let ((str
-         (format-seconds "%Y, %D, %H, %M, %S"
+         (format-seconds (or format "%Y, %D, %H, %M, %z%S")
                          (time-to-seconds
-                          (time-subtract (current-time) emacs-startup-time))
-                         t)))
+                          (time-subtract (current-time) emacs-startup-time)))))
     (if (interactive-p)
         (message "%s" str)
       str)))