Emacs: Simplify my/message-with-timestamp.

This commit is contained in:
tastytea 2020-01-03 03:50:53 +01:00
parent 6bd6e9f5c3
commit 6ea6a99c87

View File

@ -1,6 +1,6 @@
;;; misc.el --- Basic things that do not fit any other category. -*- lexical-binding: t; -*- ;;; misc.el --- Basic things that do not fit any other category. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-01-01T03:42:07+0100> ;; Time-stamp: <2020-01-03T03:50:12+0100>
;;; Commentary: ;;; Commentary:
@ -10,13 +10,11 @@
:ensure nil :ensure nil
:config :config
(defun my/message-with-timestamp (old-func fmt-string &rest args) (defun my/message-with-timestamp (args)
"Prepend current timestamp to a message" "Prepend current timestamp to a `message' output."
(apply old-func (push (concat (format-time-string "[%FT%T] ") (car args)) (cdr args)))
(concat (format-time-string "[%FT%T%z] ") fmt-string)
args))
(advice-add 'message :around #'my/message-with-timestamp) (advice-add 'message :filter-args 'my/message-with-timestamp)
) )
(provide 'basics/misc) (provide 'basics/misc)