;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; GNU Emacs .emacs file for Tomás Aragón ;; ;; Updated: 2009-02-17, Email: aragon@berkeley.edu ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; * Recommended GNU Emacs distributions ;; ;; * Ubuntu Linux: emacs-snapshot-gtk ;; ;; * Mac OS: Carbaon Emacs, available from ;; ;; http://homepage.mac.com/zenitani/emacs-e.html ;; ;; * Windows: http://www.gnu.org/software/emacs/windows/ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Cameron D, et al. Learning GNU Emacs (2005), 3rd Ed, p. 47 ;; "M-x q" creates formatted paragraphs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq default-major-mode 'text-mode) (add-hook 'text-mode-hook 'turn-on-auto-fill) ;; Word wrap ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Functions to open my preferred files or directories. ;; "M-x gtd" opens gtd.org; "M-x docs" opens Documents directory ;; http://members.optusnet.com.au/~charles57/GTD/orgmode.html ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun docs () (interactive) (find-file "~/Documents/")) (defun gtd () (interactive) (find-file "~/org/gtd.org")) (defun dot-emacs () (interactive) (find-file "~/.emacs")) (defun wip () (interactive) (find-file "~/Documents/wip/")) (defun notes () (interactive) (find-file "~/Documents/notes/")) (defun talks () (interactive) (find-file "~/Documents/talks/")) (defun slides () (interactive) (find-file "~/Documents/slides/")) (defun epir () (interactive) (find-file "~/Documents/wip/epir/")) (defun epix () (interactive) (find-file "~/Documents/wip/epix/")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Two different ways to do word count ;; Use "M-x wc" or "M-x wc-shell" ;; http://www.neverfriday.com/sweetfriday/2008/06/ ;; emacs-tip-word-counting-with-a.html ;; Uses elisp ;; http://www.cis.upenn.edu/~maoy/faqs/emacs.html ;; Uses shell ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun wc () (interactive) (message "Word count: %s" (how-many "\\w+" (point-min) (point-max)))) (defun wc-shell nil "Count words in buffer" (interactive) (shell-command-on-region (point-min) (point-max) "wc -w")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; GNU Emacs remember-mode ;; http://www.emacswiki.org/emacs/PlannerModeQuickStart ;; Install 'remember' here ~/elisp (not needed for Linux) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (add-to-list 'load-path "~/elisp/remember") ;; not needed for Linux (require 'remember) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; CDLaTeX: Fast input methods for LaTeX environments and math ;; http://staff.science.uva.nl/~dominik/Tools/cdlatex/cdlatex.el ;; To turn CDLaTeX Minor Mode on and off in a particular buffer, ;; use "M-x cdlatex-mode". ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq load-path (cons "~/elisp/cdlatex" load-path)) (autoload 'cdlatex-mode "cdlatex" "CDLaTeX Mode" t) (autoload 'turn-on-cdlatex "cdlatex" "CDLaTeX Mode" nil) (add-hook 'LaTeX-mode-hook 'turn-on-cdlatex) ; with AUCTeX LaTeX mode (add-hook 'latex-mode-hook 'turn-on-cdlatex) ; with Emacs latex mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; GNU Emacs org-mode ;; http://www.emacswiki.org/emacs/PlannerModeQuickStart ;; http://orgmode.org/manual/Installation.html#Installation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq load-path (cons "~/elisp/org-mode/lisp" load-path)) (setq load-path (cons "~/elisp/org-mode/contrib/lisp" load-path)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; http://orgmode.org/manual/Activation.html#Activation ;; The following lines are always needed. Choose your own keys. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) (global-set-key "\C-cl" 'org-store-link) (global-set-key "\C-ca" 'org-agenda) (global-set-key "\C-cb" 'org-iswitchb) (global-font-lock-mode 1) ; for all buffers (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Convert to clean view ;; http://orgmode.org/manual/Clean-view.html#Clean-view ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq org-hide-leading-stars t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; http://dto.mamalala.org/notebook/orgtutorial.html ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq org-agenda-files (list "~/org/gtd.org")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Org Manual: 5.3.2 Tracking TODO state changes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq org-todo-keywords '((sequence "TODO(t)" "|" "DONE(d)" "WAITING(w)" "DELEGATED(l)" "CANCELED(c)"))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Org Man: 5.5 Breaking tasks down into subtasks TODO entry to ;; automatically changes to DONE when all chilrden are done: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun org-summary-todo (n-done n-not-done) "Switch entry to DONE when all subentries are done, to TODO otherwise." (let (org-log-done org-log-states) ; turn off logging (org-todo (if (= n-not-done 0) "DONE" "TODO")))) (add-hook 'org-after-todo-statistics-hook 'org-summary-todo) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Org Man: 6.2 Setting tags ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq org-tag-alist '(("Auto" . ?a) ; Automobile ("Comp" . ?c) ; Computer ("Home" . ?h) ; Home ("Mail" . ?m) ; e/mail ("Offi" . ?o) ; Office ("PROJ" . ?p) ; Project ("Read" . ?r) ; Read; e.g., BART ("Tele" . ?t) ; Telephone )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; 11.5 Using CDLaTeX to enter math ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (add-hook 'org-mode-hook 'turn-on-org-cdlatex) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Activates HTML Helper Mode for HTML pages ;; http://homepage.mac.com/zenitani/emacs-e.html ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (add-to-list 'auto-mode-alist '("\\.html\\'" . html-helper-mode)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Load Emacs Speaks Statistics: http://ess.r-project.org/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'ess-site) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; AUCTeX: http://www.gnu.org/software/auctex/manual/auctex.html ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; RefTeX: http://www.gnu.org/software/auctex/manual/reftex.html ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode (setq reftex-plug-into-AUCTeX t) ;; CUSTOMIZATION: DO NOT EDIT ;; For 9pt, set :height 89 ;; For 10pt, set :height 102 ;; For 11pt, set :height 109 ;; For 12pt, set :height 123 (custom-set-variables ;; custom-set-variables 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. '(scroll-bar-mode (quote right)) '(show-paren-mode t) '(transient-mark-mode t)) (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. '(default ((t (:inherit nil :stipple nil :background "#ffffff" :foreground "#1a1a1a" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 123 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))