[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Time of last command invoked
From: |
Emanuel Berg |
Subject: |
Re: Time of last command invoked |
Date: |
Tue, 02 Mar 2021 04:07:53 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Jean Louis wrote:
> Is "logger" some function that exists in Emacs, or should
> I simply make it?
Do it :)
Now we're talking some real overhead!
> (defun rcd/emacs-lisp-log (log)
> "Allows functions to log their usage"
> (let* ((function (second (backtrace-frame 5 nil)))
> (timestamp (format-time-string "%Y-%m-%d-%H:%M:%S"))
> (log (format "%s %s %s\n" timestamp function log))
> (save-silently t))
> (with-temp-buffer
> (insert log)
> (append-to-file (point-min) (point-max) *emacs-lisp-log*))))
OMG! Severe errors found:
First sentence should end with punctuation
Argument ‘log’ should appear (as LOG) in the doc string
Probably "Allows" should be imperative "Allow"
This is your friend:
(require 'checkdoc)
(setq checkdoc-permit-comma-termination-flag t)
(defun check-package-style ()
(interactive)
(let ((msg "Style check..."))
(message msg)
(checkdoc-current-buffer t) ; TAKE-NOTES
(message "%sdone" msg) ))
(defalias 'check-style #'check-package-style)
--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal