+'(iswitchb-mode on)
+(custom-set-faces
+ ;; custom-set-faces was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(menu ((((type x-toolkit)) (:background "black" :foreground "grey90")))))
+
+(defun ess-change-directory (path)
+ "Set the current working directory to PATH for both *R* and Emacs."
+ (interactive "DDirectory to change to: ")
+
+ (when (file-exists-p path)
+ (ess-command (concat "setwd(\"" path "\")\n"))
+ ;; use file-name-as-directory to ensure it has trailing /
+ (setq default-directory (file-name-as-directory path))))
+
+(put 'upcase-region 'disabled nil)
+
+(put 'downcase-region 'disabled nil)
+
+;; The following lines are always needed. Choose your own keys.
+(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
+(add-hook 'org-mode-hook 'turn-on-font-lock) ; not needed when global-font-lock-mode is on
+(global-set-key "\C-cl" 'org-store-link)
+(global-set-key "\C-ca" 'org-agenda)
+(global-set-key "\C-cb" 'org-iswitchb)
+(setq-default org-log-done 'time)
+(setq-default org-agenda-ndays 5)
+
+
+(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
+(add-hook 'message-mode-hook 'turn-on-flyspell)
+(add-hook 'text-mode-hook 'turn-on-flyspell)
+(add-hook 'c-mode-common-hook 'flyspell-prog-mode)
+(add-hook 'cperl-mode-hook 'flyspell-prog-mode)
+(add-hook 'tcl-mode-hook 'flyspell-prog-mode)
+(add-hook 'ess-mode-hook 'flyspell-prog-mode)
+(defun turn-on-flyspell ()
+ "Force flyspell-mode on using a positive arg. For use in hooks."
+ (interactive)
+ (flyspell-mode 1))
+
+;;; outlining support for ess modes
+(add-hook 'ess-mode-hook
+ '(lambda ()
+ (outline-minor-mode)
+ (setq outline-regexp "\\(^#\\{4,5\\} \\)\\|\\(^[a-zA-Z0-9_\.]+ ?<- ?function(.*{\\)")
+ (defun outline-level
+ (lambda () (interactive) (cond ((looking-at "^##### ") 1)((looking-at "^#### ") 2)((looking-at "^[a-zA-Z0-9_\.]+ ?<- ?function(.*{") 3) (t 1000)))
+ )))
+
+ ; Outline-minor-mode key map
+ (define-prefix-command 'cm-map nil "Outline-")
+ ; HIDE
+ (define-key cm-map "q" 'hide-sublevels) ; Hide everything but the top-level headings
+ (define-key cm-map "t" 'hide-body) ; Hide everything but headings (all body lines)
+ (define-key cm-map "o" 'hide-other) ; Hide other branches
+ (define-key cm-map "c" 'hide-entry) ; Hide this entry's body
+ (define-key cm-map "l" 'hide-leaves) ; Hide body lines in this entry and sub-entries
+ (define-key cm-map "d" 'hide-subtree) ; Hide everything in this entry and sub-entries
+ ; SHOW
+ (define-key cm-map "a" 'show-all) ; Show (expand) everything
+ (define-key cm-map "e" 'show-entry) ; Show this heading's body
+ (define-key cm-map "i" 'show-children) ; Show this heading's immediate child sub-headings
+ (define-key cm-map "k" 'show-branches) ; Show all sub-headings under this heading
+ (define-key cm-map "s" 'show-subtree) ; Show (expand) everything in this heading & below
+ ; MOVE
+ (define-key cm-map "u" 'outline-up-heading) ; Up
+ (define-key cm-map "n" 'outline-next-visible-heading) ; Next
+ (define-key cm-map "p" 'outline-previous-visible-heading) ; Previous
+ (define-key cm-map "f" 'outline-forward-same-level) ; Forward - same level
+ (define-key cm-map "b" 'outline-backward-same-level) ; Backward - same level
+ (global-set-key "\M-o" cm-map)
+
+(defun my-org-mode-setup ()
+ (when (and (buffer-file-name)
+ (file-exists-p (buffer-file-name)))
+ (load-library "reftex")
+ (and (buffer-file-name)
+ (file-exists-p (buffer-file-name))
+ (reftex-parse-all))
+ (reftex-set-cite-format
+ '((?b . "[[bib::%l]]")
+ (?n . "[[note::%l]]"))))
+ (define-key org-mode-map "\C-c\C-g" 'reftex-citation)
+)
+(add-hook 'org-mode-hook 'my-org-mode-setup)
+
+(setq-default org-mobile-directory "/rzlab.ucr.edu:/sites/dav.donarmstrong.com/root/org/")
+(setq-default org-directory "/home/don/org-mode/")
+(setq-default org-mobile-inbox-for-pull "/home/don/org-mode/from-mobile.org")
+
+; debian stuff
+(setq-default debian-changelog-mailing-address "don@debian.org")
+(setq-default debian-changelog-full-name "Don Armstrong")
+
+; use iedit
+(require 'iedit)
+(define-key global-map (kbd "C-;") 'iedit-mode)
+
+(require 'multi-web-mode)
+(setq mweb-default-major-mode 'html-mode)
+(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
+ (js-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>")
+ (css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))
+(setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5"))
+(multi-web-global-mode 1)