Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
** What it do?
** What does it do?

Show event history and command history of some or all buffers.

** What it look like?
** What does it look like?

[[https://github.com/lewang/command-log-mode/raw/master/screenshot1.png]]

** Where it from?
** Where is it from?

This package is a fork of [[http://www.foldr.org/~michaelw/emacs/mwe-log-commands.el][mwe-log-commands.el]] by Michael Weber <michaelw@foldr.org>

** How it different?
** How is it different?

1. Remove "mwe-" prefix, but keep credits to mwe.
2. Make minor-mode and global minor-mode.
Expand Down
26 changes: 21 additions & 5 deletions command-log-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
;; (require 'command-log-mode)
;; (add-hook 'LaTeX-mode-hook 'command-log-mode)
;;
;; To enable, call M-x command-log-mode
;; To log globally, M-X global-command-log
;; To see the log buffer, call M-x clm/open-command-log-buffer.

;; The key strokes in the log are decorated with ISO9601 timestamps on
Expand Down Expand Up @@ -105,6 +107,17 @@ Frequently used non-interesting commands (like cursor movements) should be put h
(defgroup command-log nil
"Customization for the command log.")

(defface command-log-key
'((t (:foreground "cyan")))
"Face for keys in command log."
:group 'command-log)

(defface command-log-command
'((t (:foreground "pale green")))
"Face for commands in command log."
:group 'command-log)


(defcustom command-log-mode-auto-show nil
"Show the command-log window or frame automatically."
:group 'command-log
Expand Down Expand Up @@ -263,18 +276,21 @@ Scrolling up can be accomplished with:
(insert " times]"))
(t ;; (message "last cmd: %s cur: %s" last-command cmd)
;; showing accumulated text with interleaved key presses isn't very useful
(when (and clm/log-text (not clm/log-repeat))
(if (eq clm/last-keyboard-command 'self-insert-command)
(insert "[text: " clm/recent-history-string "]\n")))
(when (and clm/log-text (not clm/log-repeat))
(if (eq clm/last-keyboard-command 'self-insert-command)
(insert "[text: " clm/recent-history-string "]\n")))
(setq clm/command-repetitions 0)
(insert
(propertize
(key-description (this-command-keys))
:time (format-time-string clm/time-string (current-time))))
:time (format-time-string clm/time-string (current-time))
'face 'command-log-key))
(when (>= (current-column) clm/log-command-indentation)
(newline))
(move-to-column clm/log-command-indentation t)
(princ (if (byte-code-function-p cmd) "<bytecode>" cmd) current)
;;(princ (if (byte-code-function-p cmd) "<bytecode>" cmd) current)
(insert (propertize (format "%s" cmd)
'face 'command-log-command))
(newline)
(setq clm/last-keyboard-command cmd)))
(clm/scroll-buffer-window current))))))
Expand Down