2013-01-03 23:55:57 +01:00
|
|
|
#+TITLE: Emacs init
|
|
|
|
#+STYLE: <link href="http://ryuslash.ninth.su/test2.css" rel="stylesheet">
|
|
|
|
#+OPTIONS: author:nil
|
2013-01-15 12:11:41 +01:00
|
|
|
#+STARTUP: showall
|
2013-01-25 00:32:30 +01:00
|
|
|
#+LINK: yoshi-theme http://ryuslash.org/projects/yoshi-theme.html
|
2013-01-03 23:55:57 +01:00
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
* Emacs init
|
2013-01-03 23:55:57 +01:00
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
Before doing anything else I should make sure that both the
|
|
|
|
directories ~/usr/local/emacs/share/emacs/site-lisp~ and
|
|
|
|
~/usr/share/emacs/site-list~ are included in =load-path=, along with
|
|
|
|
their subdirectories, but only if they haven't already been added
|
|
|
|
and exist. Place them at the end of =load-path= so they don't mess up
|
|
|
|
package precedence.
|
2013-01-04 01:34:02 +01:00
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
2013-01-25 00:32:30 +01:00
|
|
|
(eval-and-compile
|
|
|
|
(defun oni:path-init (dir)
|
|
|
|
"Add DIR to `load-path' and all its subdirectories, unless
|
|
|
|
DIR is already in `load-path'."
|
|
|
|
(unless (or (member dir load-path) (not (file-exists-p dir)))
|
|
|
|
(let ((default-directory dir))
|
|
|
|
(add-to-list 'load-path dir t)
|
|
|
|
(normal-top-level-add-subdirs-to-load-path))))
|
|
|
|
(oni:path-init "/usr/share/emacs/site-lisp")
|
|
|
|
(oni:path-init "/usr/local/emacs/share/emacs/site-lisp"))
|
2013-01-03 23:55:57 +01:00
|
|
|
#+END_SRC
|
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
Add my project [[yoshi-theme]] to =custom-theme-load-path= and load it.
|
2013-01-03 23:55:57 +01:00
|
|
|
|
2013-01-04 01:34:02 +01:00
|
|
|
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
2013-01-25 00:32:30 +01:00
|
|
|
(add-to-list 'custom-theme-load-path "~/projects/emacs/yoshi-theme/")
|
|
|
|
(load-theme 'yoshi t)
|
2013-01-03 23:55:57 +01:00
|
|
|
#+END_SRC
|
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
Remove the ~menu-bar~, ~tool-bar~ and ~scroll-bar~ from the UI since I
|
|
|
|
don't use them at all.
|
2013-01-04 02:08:31 +01:00
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
|
|
|
(menu-bar-mode -1)
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
#+END_SRC
|
2013-01-04 02:08:31 +01:00
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
Add any other interesting paths to =load-path= and, if it exists,
|
|
|
|
load the ~loaddefs.el~ file from these directories.
|
2013-01-04 02:08:31 +01:00
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
|
|
|
(mapc #'(lambda (dir)
|
|
|
|
(add-to-list 'load-path dir)
|
|
|
|
(let ((loaddefs (concat dir "/loaddefs.el")))
|
|
|
|
(when (file-exists-p loaddefs)
|
|
|
|
(load loaddefs))))
|
|
|
|
'("~/projects/emacs/mode-icons" "~/.emacs.d/site-lisp"
|
|
|
|
"~/projects/emacs/pony-mode/src" "~/projects/emacs/php-mode"))
|
|
|
|
#+END_SRC
|
2013-01-15 12:11:41 +01:00
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
Don't ask ~yes~ or ~no~, ask ~y~ or ~n~, I've never had an accidental ~y~ so
|
|
|
|
far.
|
2013-01-15 12:11:41 +01:00
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
2013-01-25 00:32:30 +01:00
|
|
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
2013-01-15 12:11:41 +01:00
|
|
|
#+END_SRC
|
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
Use =ibuffer= instead of the default =list-buffers= because it has many
|
|
|
|
more features.
|
2013-01-03 23:55:57 +01:00
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
|
|
|
(defalias 'list-buffers 'ibuffer)
|
|
|
|
#+END_SRC
|
2013-01-03 23:55:57 +01:00
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
Do the same with =hippie-expand= and =dabbrev-expand=.
|
2013-01-03 23:55:57 +01:00
|
|
|
|
2013-01-25 00:32:30 +01:00
|
|
|
#+BEGIN_SRC emacs-lisp :tangle init2.el
|
|
|
|
(defalias 'dabbrev-expand 'hippie-expand)
|
|
|
|
#+END_SRC
|