1. Yaron Minsky
  2. js-elisp

Commits

seanmcl  committed 1822233

improved format-time-string

  • Participants
  • Parent commits 6eb43e6
  • Branches default

Comments (0)

Files changed (3)

File elisp/jane/jane-lib.el

View file
 (defconst Log.buffer-max-size 100000
   "Max size of the log buffer in characters")
 
-(defun Log.printf(log-buffer format-string &rest args)
+(defun Log.printf (log-buffer format-string &rest args)
   "Display the text in the log buffer at the very end of it."
   (let ((inhibit-read-only t) ;; the log is probably read-only
-	(auto-window-vscroll t)
-	(kill-whole-line t) ;; kill the newline as well as the line contents
+        (auto-window-vscroll t)
+        (kill-whole-line t) ;; kill the newline as well as the line contents
         (fmt (concat "[%s] " format-string "\n"))
-        (time (format-time-string "%y/%m/%d %H:%M:%S" (current-time)))
-	(user-buffer (current-buffer))
-	(user-window (selected-window))
-	(log-window (get-buffer-window log-buffer)))
+        (time (format-time-string "%y/%m/%d %H:%M:%S"))
+        (user-buffer (current-buffer))
+        (user-window (selected-window))
+        (log-window (get-buffer-window log-buffer)))
     (with-current-buffer log-buffer
       (let* ((marker (point-marker))
              (log-point (point))

File elisp/omake/omake-file.el

View file
 
 (defun Omake.File.server-log ()
   (expand-file-name
-   (format-time-string "%Y-%m-%d" (current-time))
+   (format-time-string "%Y-%m-%d")
    Omake.File.server-log-dir))
+;; (Omake.File.server-log)
+;; (format-time-string "%Y-%m-%d")
 
 (defconst Omake.File.server-state
   (expand-file-name "server-state.el" Omake.File.top))
 (defun Omake.File.emacs-log ()
   (format "%s/%s"
           Omake.File.emacs-log-pid-dir
-          (format-time-string "%Y-%m-%d" (current-time))))
+          (format-time-string "%Y-%m-%d")))
 ;; (Omake.File.emacs-log)
 
 (defconst Omake.File.socket

File elisp/omake/omake-server.el

View file
 
 ;; [2012-08-13 10:38:38.719056]
 (defun Omake.Server.logf (fmt &rest rest)
+  (apply 'Log.printf (cons (Omake.Buffer.get 'mode-log) (cons fmt rest)))
   ;; CR sweeks: turned off logging because it interferes with emacs's keystroke
   ;; responsiveness.
   (when nil
     ;; Write to the mode log buffer
-    (apply 'Log.printf (cons (Omake.Buffer.get 'mode-log) (cons fmt rest)))
     (with-temp-buffer
       ;; Write to the log file (with timestamp)
       (let* ((time (format-time-string "[%Y-%m-%d %H:%M:%S] "))