This is part of the Emacs Starter Kit.
Things that don’t fit anywhere else.
Determine whether required packages are installed. If not, use ELPA to install them. Other dependencies are provided by Emacs 24.
(starter-kit-install-if-needed 'magit)
Emacs24 has build in support for saving and loading themes.
A Theme builder is available at http://elpa.gnu.org/themes/ along with a list of pre-built themes at http://elpa.gnu.org/themes/view.html and themes are available through ELPA.
Downloaded themes may be saved to the themes/
directory in the base
of the starter kit which ignored by git. Once downloaded and
evaluated a theme is activated using the load-theme
function.
(when window-system
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
(blink-cursor-mode -1)
(when (require 'mwheel nil 'no-error) (mouse-wheel-mode t)))
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(setq visible-bell t
echo-keystrokes 0.1
font-lock-maximum-decoration t
inhibit-startup-message t
transient-mark-mode t
color-theme-is-global t
delete-by-moving-to-trash t
shift-select-mode nil
truncate-partial-width-windows nil
uniquify-buffer-name-style 'forward
whitespace-style '(trailing lines space-before-tab
indentation space-after-tab)
whitespace-line-column 100
ediff-window-setup-function 'ediff-setup-windows-plain
oddmuse-directory (concat starter-kit-dir "oddmuse")
xterm-mouse-mode t
save-place-file (concat starter-kit-dir "places"))
(auto-compression-mode t)
(recentf-mode 1)
(show-paren-mode 1)
ido-mode is like magic pixie dust!
(when (> emacs-major-version 21)
(ido-mode t)
(setq ido-enable-prefix nil
ido-enable-flex-matching t
ido-create-new-buffer 'always
ido-use-filename-at-point t
ido-max-prospects 10))
(set-default 'indent-tabs-mode nil)
(set-default 'indicate-empty-lines t)
(set-default 'imenu-auto-rescan t)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(eval-after-load "ispell"
'(when (executable-find ispell-program-name)
(add-hook 'text-mode-hook 'turn-on-flyspell)))
(defvar starter-kit-coding-hook nil
"Hook that gets run on activation of any programming mode.")
(defalias 'yes-or-no-p 'y-or-n-p)
;; Seed the random-number generator
(random t)
(defun starter-kit-pretty-lambdas ()
(font-lock-add-keywords
nil `(("(\\(lambda\\>\\)"
(0 (progn (compose-region (match-beginning 1) (match-end 1)
,(make-char 'greek-iso8859-7 107))
nil))))))
Most of the solution came from EmacsWiki-FlySpell. Here is one possible fix.
it’s possible aspell isn’t in your path
(setq exec-path (append exec-path '("/opt/local/bin")))
- This didn’t work at first, possibly because cocoAspell was building its dictionary. Now it seems to work fine.
(setq ispell-program-name "aspell"
ispell-dictionary "english"
ispell-dictionary-alist
(let ((default '("[A-Za-z]" "[^A-Za-z]" "[']" nil
("-B" "-d" "english" "--dict-dir"
"/Library/Application Support/cocoAspell/aspell6-en-6.0-0")
nil iso-8859-1)))
`((nil ,@default)
("english" ,@default))))
(when (boundp 'hippie-expand-try-functions-list)
(delete 'try-expand-line hippie-expand-try-functions-list)
(delete 'try-expand-list hippie-expand-try-functions-list))
Rather than saving backup files scattered all over the file system,
let them live in the backups/
directory inside of the starter kit.
(setq backup-directory-alist `(("." . ,(expand-file-name
(concat starter-kit-dir "backups")))))
(setq diff-switches "-u")
(eval-after-load 'diff-mode
'(progn
(set-face-foreground 'diff-added "green4")
(set-face-foreground 'diff-removed "red3")))
(eval-after-load 'magit
'(progn
(set-face-foreground 'magit-diff-add "green3")
(set-face-foreground 'magit-diff-del "red3")))