Skip to content

Instantly share code, notes, and snippets.

@xuchunyang
Created April 9, 2015 06:06
Show Gist options
  • Save xuchunyang/037221a8f5857a03d3d6 to your computer and use it in GitHub Desktop.
Save xuchunyang/037221a8f5857a03d3d6 to your computer and use it in GitHub Desktop.
;;; elisp-minor-mode.el --- Write Minor Mode
;;; Commentary:
;;
;; See Info node `(elisp) Minor Mode'
;;; `foo-mode' variable and functions, `foo-mode-hook' are define via this macro.
(define-minor-mode foo-mode
"Foo minor mode."
;; The initial value.
nil
;; The indicator for the mode line.
" Foo"
;; The minor mode bindings.
'(([f7] . foo-A)
("\C-x\M-l" . ; C-x M-l
(lambda () (interactive) (message "Hitted C-x M-l")))
([?\C-=] . 'emacs-version) ; C-=
("\C-x\ t" . 'emacs-uptime) ; C-x t
("\C-x\t" . 'emacs-init-time) ; C-x <TAB>
)
:group 'foo
:global nil
:after-hook nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment