Skip to content

Commit

Permalink
Make command log colorful
Browse files Browse the repository at this point in the history
Add two faces - one for keys and one for commands.
  • Loading branch information
Bar Magal committed Dec 7, 2015
1 parent 7408c0c commit 842a7e0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions command-log-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@

(eval-when-compile (require 'cl))

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

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

(defvar clm/log-text t
"A non-nil setting means text will be saved to the command log.")

Expand Down Expand Up @@ -266,11 +274,13 @@ Scrolling up can be accomplished with:
(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 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

0 comments on commit 842a7e0

Please sign in to comment.