Emacs

From DesigningPatterns

Jump to: navigation, search

Contents

Customization

General

There is a file called site_start.el which is loaded automatically by emacs at start-up (before the user's .emacs file). This file essentially loads up all .el files in site_start.d. In-house site-wide emacs customization will be put into /usr/designingpatterns/etc/default_emacs_settings.el and symbolic linked into site_start.d (symbolic linked to /usr/share/emacs/site-lisp/site-start.d/default_emacs_settings.el on CentOS).

emacs' default font may be unavailable or unsuitable. In this case, adding emacs.font: 8x13 to /usr/share/X11/app-defaults/Emacs probably will fix the issue.

Installation

yum install emacs

Configuration

Emacs' default font (and other X attributes) can be configured in /usr/share/X11/app-defaults/Emacs.

All of this should be in /usr/designingpatterns/etc/default_emacs_settings.el:

  • Install ruby-mode with yum install ruby-mode.
  • Install nxml-mode (yum install emacs-nxml-mode); load up nxml-mode in default_emacs_settings.el as per the README.
  • Install nxhtml-mode (for html, jsp, rhtml, etc), which can be found here. Follow the instructions in readme.txt. Note that this will not work if a css-mode is installed already. Note also that this package requires nxml.
  • Install javascript-mode (javascript.el, which can be found here) into /usr/share/emacs/site-lisp. This has the necessary default_emacs_settings.el lisp code snippet.
  • Install haml-mode (found here); load up in default_emacs_settings.el similarly to the javascript mode (for .haml files).
  • Install sass-mode (found here); load up in default_emacs_settings.el similarly to the javascript mode (for .sass files).
  • Install yaml-mode (found here); load up in default_emacs_settings.el similarly to the javascript mode (for .yml and .yaml files). If using version 0.0.3, line 228 in yaml-mode.el must be commented out before make install (and the file is compiled into yaml-mode.elc), because there is a bug in the mode with font locking that can cause infinite loops.
  • Associate Ruby mode with .rcfg files.
  • Install slime-mode (for lisp; found here). The slime code directory should be moved into the site-lisp directory; the slime README file has the necessary elisp for default_emacs_settings.el.
  • Install java annotations support for java-mode. This needs to be copied/pasted manually from the download location for now, as wget gets HTML (rather than text). Add the following to default_emacs_settings.el in order to load it with java-mode:
;; Make java mode support Java 1.5 annotations.
(require 'java-mode-indent-annotations)
(add-hook 'java-mode-hook 'java-mode-indent-annotations-setup)
Personal tools