Emacs: Prepend timestamps to messages.

This commit is contained in:
tastytea 2020-01-01 03:42:25 +01:00
parent ebbca748f6
commit fa82276f7d
2 changed files with 25 additions and 1 deletions

23
init.d/basics/misc.el Normal file
View File

@ -0,0 +1,23 @@
;;; misc.el --- Basic things that do not fit any other category. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-01-01T03:42:07+0100>
;;; Commentary:
;;; Code:
(use-package emacs
:ensure nil
:config
(defun my/message-with-timestamp (old-func fmt-string &rest args)
"Prepend current timestamp to a message"
(apply old-func
(concat (format-time-string "[%FT%T%z] ") fmt-string)
args))
(advice-add 'message :around #'my/message-with-timestamp)
)
(provide 'basics/misc)
;;; misc.el ends here

View File

@ -1,6 +1,6 @@
;;; init.el --- tastytea's Emacs init file. -*- lexical-binding: t; -*-
;; Time-stamp: <2019-12-26T18:21:40+00:00>
;; Time-stamp: <2020-01-01T03:37:43+0100>
;;; Commentary:
;; Requires at least Emacs 26. Most of it will probably work with Emacs 24 and
@ -27,6 +27,7 @@
(setq gc-cons-threshold (* 20 1024 1024))
(setq gc-cons-threshold (* 100 1024 1024)))
(require 'basics/misc)
(require 'basics/input)
(require 'basics/buffers)
(require 'basics/appearance)