Permalink
Browse files

Fix style.

  • Loading branch information...
uk-ar committed May 23, 2013
1 parent f2a99da commit 43de6e4eaa86f54fbdb646db639a4a662cb6ccbd
Showing with 666 additions and 613 deletions.
  1. +57 −0 README.md
  2. +4 −6 key-combo.el
  3. +605 −607 test/key-combo-test.el
View
@@ -2,3 +2,60 @@ key-combo.el
========
[![Build Status](https://secure.travis-ci.org/uk-ar/key-combo.png)](http://travis-ci.org/uk-ar/key-combo)
;;
;; (require 'key-combo)
;; (key-combo-mode 1)
;;
;; and some chords, for example
;;
;; (key-combo-define-global (kbd "=") '(" = " " == " " === " ))
;; (key-combo-define-global (kbd "=>") " => ")
;;
;; or load default settings
;;
;; (key-combo-load-default)
;; Integrating multiple commands into one command is sometimes
;; useful. Pressing C-e at the end of line is useless and adding the
;; other behavior in this situation is safe.
;;
;; For example, defining `my-end': if point is at the end of line, go
;; to the end of buffer, otherwise go to the end of line. Just evaluate it!
;;
;; (define-sequential-command my-end end-of-line end-of-buffer)
;; (global-set-key "\C-e" 'my-end)
;;
;; Consequently, pressing C-e C-e is `end-of-buffer'!
;;
;; `define-sequential-command' is a macro that defines a command whose
;; behavior is changed by sequence of calls of the same command.
;;
;; `seq-return' is a command to return to the position when sequence
;; of calls of the same command was started.
*key-combo* is a Emacs plugin to support input several candidates with a single
key, like ess-smart-underscore in Emacs Speaks Statistics -- when user types
"_" key, it inserts " <- " for the first time or it replaces " <- " by "_" for
the second time. This plugin provides functions to support to define such
key bindings easily. For example:
- <kbd>=</kbd>:insert ` = `
- <kbd>==</kbd>:insert ` == `
- <kbd>===</kbd>:insert ` === `
- <kbd>====</kbd>:insert ` = `
- <kbd>=</kbd>:insert ` = `
- <kbd>=></kbd>:insert ` => `
- <kbd>C-a</kbd>:move-beginning-of-line
- <kbd>C-a C-a</kbd>:beginning-of-buffer
- <kbd>C-a C-a C-a</kbd>:return
1st key|2nd key|3rd key|command
------|------|----|---
= ||| ` = `
=|=|| ` == `
=|=|=| ` === `
=|>|| ` => `
View
@@ -161,10 +161,6 @@ The binding is probably a symbol with a function definition."
t
nil))
;;(browse-url "http://q.hatena.ne.jp/1226571494")
(defun key-combo-count-boundary (last-undo-list)
(length (remove-if-not 'null last-undo-list)))
(defun key-combo-execute-macro (string)
(cond
((string-match "`!!'" string)
@@ -191,8 +187,6 @@ The binding is probably a symbol with a function definition."
((listp command) command)
((not (stringp command)) nil)
;; string
;; (t
;; command)
;; do not map string because it changes this-command-keys in post-command-hook
(t (lexical-let ((com command))
(lambda ()
@@ -293,6 +287,10 @@ which in most cases is shared with all other buffers in the same major mode.
;; (set-window-start (selected-window) (cdr key-combo-start-position))
)))
;;(browse-url "http://q.hatena.ne.jp/1226571494")
(defun key-combo-count-boundary (last-undo-list)
(length (remove-if-not 'null last-undo-list)))
(defun key-combo-undo ()
"returns buffer undo list"
(primitive-undo (1+ (key-combo-count-boundary buffer-undo-list))
Oops, something went wrong.

0 comments on commit 43de6e4

Please sign in to comment.