[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Time of last command invoked
From: |
Jean Louis |
Subject: |
Re: Time of last command invoked |
Date: |
Sun, 7 Mar 2021 12:26:36 +0300 |
User-agent: |
Mutt/2.0 (3d08634) (2020-11-07) |
* Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> [2021-03-02 06:11]:
> 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"
Thanks, I know those. I have functions in development files and
packaged files (ready). Then functions are moved from one to other and
verified to those conventions.