Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mwe-log-commands #2006

Closed
wants to merge 1 commit into from
Closed
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
26 changes: 26 additions & 0 deletions contrib/!tools/mwe-log-commands/README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#+TITLE: mwe-log-commands contribution layer for Spacemacs

* Table of Contents :TOC@4:
- [[#description][Description]]
- [[#install][Install]]
- [[#layer][Layer]]
- [[#mwe-log-commands][mwe-log-commands]]
- [[#usage][Usage]]

* Description

mwe-log-commands can be used to demo Emacs to an audience. When activated, keystrokes get logged into a designated buffer, along with the command bound to them.

* Install

** Layer

To use this contribution add it to your =~/.spacemacs=

#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(mwe-log-commands))
#+END_SRC

* Usage

M-x spacemacs/mwe-log-commands
44 changes: 44 additions & 0 deletions contrib/!tools/mwe-log-commands/packages.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
;;; packages.el --- mwe-log-commands Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: blinkd <tshemeng@live.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

(setq mwe-log-commands-packages
'(mwe-log-commands))

(defun mwe-log-commands/post-init-mwe-log-commands ()
(defun spacemacs/mwe-log-commands ()
(interactive)
(let ((current-buffer (current-buffer)))
(mwe:log-keyboard-commands t)
(mwe:open-command-log-buffer)
(erase-buffer)
(linum-mode -1)
(delete-other-windows)
(split-window-horizontally -30)
(other-window 0)
(switch-to-buffer current-buffer)))

(define-minor-mode mwe-log-commands-mode
"log commands")

(defun mwe-log-commands-on ()
(unless (minibufferp)
(mwe:log-keyboard-commands t)))

(define-globalized-minor-mode global-mwe-log-commands-mode mwe-log-commands-mode mwe-log-commands-on)
(global-mwe-log-commands-mode))

(defun mwe-log-commands/init-mwe-log-commands ()
"Initialize my package"
(use-package mwe-log-commands)
:defer t
:init
(add-hook 'spacemacs-mode-hook (function mwe:log-keyboard-commands)))