Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 1.63 KB

starter-kit-defuns.org

File metadata and controls

53 lines (42 loc) · 1.63 KB

Starter Kit Defuns

This is part of the Emacs Starter Kit.

The starter-kit-coding-hook:

A single hook holding those functions which should be run in every code buffer.

We have a number of turn-on-* functions since it’s advised that lambda functions not go in hooks. Repeatedly evaling an add-to-list with a hook value will repeatedly add it since there’s no way to ensure that a lambda doesn’t already exist in the list.

(defun starter-kit-local-column-number-mode ()
  (make-local-variable 'column-number-mode)
  (column-number-mode t))

(defun starter-kit-local-comment-auto-fill ()
  (set (make-local-variable 'comment-auto-fill-only-comments) t)
  (auto-fill-mode t))

(defun starter-kit-turn-on-save-place-mode ()
  (setq save-place t))

(defun starter-kit-turn-on-whitespace ()
  (whitespace-mode t))
(add-hook 'starter-kit-coding-hook 'starter-kit-local-column-number-mode)
(add-hook 'starter-kit-coding-hook 'starter-kit-local-comment-auto-fill)
(when (window-system)
  (add-hook 'starter-kit-coding-hook 'starter-kit-pretty-lambdas))
(defun run-starter-kit-coding-hook ()
  "Enable things that are convenient across all coding buffers."
  (run-hooks 'starter-kit-coding-hook))