From 9c20c7e8c6898c98359e58087a4e5c4b8005649b Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Wed, 16 Sep 2015 11:47:15 -0400 Subject: More work on emacs config... working now --- .emacs | 149 ++++++++++++++++++++++++---------------------------- .gitmodules | 3 -- emacsen/Makefile | 11 ++-- emacsen/popup | 1 - emacsen/use-package | 1 - 5 files changed, 74 insertions(+), 91 deletions(-) delete mode 160000 emacsen/popup delete mode 160000 emacsen/use-package diff --git a/.emacs b/.emacs index 222692c..b9c63b8 100644 --- a/.emacs +++ b/.emacs @@ -1,58 +1,93 @@ -(add-to-list 'load-path "~/.emacs.d") -(add-to-list 'load-path "~/.emacs.d/auto-indent-mode") -(add-to-list 'load-path "~/.emacs.d/auto-complete") -(add-to-list 'load-path "~/.emacs.d/bbdb") -(add-to-list 'load-path "~/.emacs.d/dictem") -(add-to-list 'load-path "~/.emacs.d/dtrt-indent") -(add-to-list 'load-path "~/.emacs.d/haskell-mode") -(add-to-list 'load-path "~/.emacs.d/popup") -(add-to-list 'load-path "~/.emacs.d/magit") -(add-to-list 'load-path "~/.emacs.d/markdown-mode") -(add-to-list 'load-path "~/.emacs.d/proofgeneral/") -(add-to-list 'load-path "~/.emacs.d/share/emacs/site-lisp/vm") (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/") -;;;; AUCTEX -(setq TeX-view-program-list '(("Evince" "evince --page-index=%(outpage) %o"))) -(setq TeX-view-program-selection '((output-pdf "Evince"))) - -;;;; AUTO COMPLETE -(require 'auto-complete-config) -(ac-config-default) -(ac-set-trigger-key "TAB") -(add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete/ac-dict") -(add-to-list 'ac-modes 'Coq-mode) -(add-to-list 'ac-modes 'latex-mode) +(require 'package) +(setq package-enable-at-startup nil) +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) +(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) +(package-initialize) + +;; Bootstrap `use-package' +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(eval-when-compile + (require 'use-package)) + +;;; LaTeX with AUCTeX +(use-package tex-site ; AUCTeX initialization + :ensure auctex) + +(use-package tex ; TeX editing/processing + :ensure auctex + :defer t + :config + (progn + (setq TeX-parse-self t ; Parse documents to provide completion + ; for packages, etc. + TeX-auto-save t ; Automatically save style information + TeX-electric-sub-and-superscript t ; Automatically insert braces after + ; sub- and superscripts in math mode + TeX-electric-math '("\\(" "\\)") + ;; Don't insert magic quotes right away. + TeX-quote-after-quote t + ;; Don't ask for confirmation when cleaning + TeX-clean-confirm nil + ;; Provide forward and inverse search with SyncTeX + TeX-source-correlate-mode t + TeX-source-correlate-method 'synctex) + (setq-default TeX-master nil ; Ask for the master file + TeX-engine 'luatex ; Use a modern engine + ;; Redundant in 11.88, but keep for older AUCTeX + TeX-PDF-mode t))) + +(use-package auto-complete + :ensure t + :config + (ac-config-default) + (ac-set-trigger-key "TAB") + (add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete/ac-dict") + (add-to-list 'ac-modes 'Coq-mode) + (add-to-list 'ac-modes 'latex-mode) + (add-to-list 'ac-modes 'sml-mode) + ) + +(use-package auto-indent-mode + :ensure t) + +(use-package dictem + :load-path "~/.emacs.d/dictem/") +(use-package dtrt-indent + :ensure t) +(use-package fill-column-indicator + :ensure t) +(use-package haskell-mode + :ensure t) +(use-package markdown-mode + :ensure t) +(use-package rainbow-mode + :ensure t) +(use-package sml-mode + :ensure t) ;;;; AUTO FILL ; We want auto-fill enabled for all text modes (add-hook 'text-mode-hook 'turn-on-auto-fill) ;;;; AUTO INDENT -(require 'auto-indent-mode) (auto-indent-global-mode) ;;;; CC-mode, bundled with emacs (setq c-default-style "bsd") -;;;; DICTEM -(require 'dictem) - -;;;; DTRT-INDENT -(require 'dtrt-indent) - ;;; EasyPG, bunled with emacs for encrypted files (require 'epa-file) (epa-file-enable) ;;;; HASKELL-MODE -(require 'haskell-mode) (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) -;;;; MAGIT -(require 'magit) - ;;;; MARKDOWN-MODE (autoload 'markdown-mode "markdown-mode" "Major mode for editing Markdown files" t) @@ -60,11 +95,9 @@ (add-to-list 'auto-mode-alist '("\\.mdown\\'" . markdown-mode)) ;;;; OCTAVE, bundled with emacs -(autoload 'octave-mode "octave-mod" nil t) (add-to-list 'auto-mode-alist '("\\.m$" . octave-mode)) ;;;; PROOFGENERAL -(load-file "~/.emacs.d/proofgeneral/generic/proof-site.el") (setq proof-three-window-enable t) (setq proof-three-window-mode-policy 'hybrid) @@ -78,14 +111,8 @@ (require 'tramp) ;;;; VC-GIT -(require 'vc-git) (when (featurep 'vc-git) (add-to-list 'vc-handled-backends 'git)) -;;;; VM -(require 'vm-autoloads) -; Make 'M-x compose-mail' (C-x m), create a VM-style composition buffer -(setq mail-user-agent 'vm-user-agent) - ;;;; Sending mail (setq mail-specify-envelope-from t) (setq mail-envelope-from 'header) @@ -129,41 +156,3 @@ (fset 'yes-or-no-p 'y-or-n-p) (put 'narrow-to-region 'disabled nil) - -;; Sentence-fill hack -;; ================== -;; -;; The macros here are based on emacs/23.3/lisp/textmodes/fill.el.gz. -;; To use them without modifying emacs, you can simply execute `cat -;; hack.el >> ~/.emacs` if you have downloaded this file (say, by -;; git). Otherwise, you can use -;; -;; curl http://fermi.mycloudnas.com/cgit.cgi/fill/plain/hack.el >> ~/.emacs - -(defun auto-fill-by-sentences () - (if (looking-back (sentence-end)) - ;; Break at a sentence - (progn - (LaTeX-newline) - t) - ;; Fall back to the default - (do-auto-fill))) -(add-hook 'LaTeX-mode-hook (lambda () (setq auto-fill-function 'auto-fill-by-sentences))) - -;; Modified from http://pleasefindattached.blogspot.com/2011/12/emacsauctex-sentence-fill-greatly.html -(defadvice LaTeX-fill-region-as-paragraph (around LaTeX-sentence-filling) - "Start each sentence on a new line." - (let ((from (ad-get-arg 0)) - (to-marker (set-marker (make-marker) (ad-get-arg 1))) - tmp-end) - (while (< from (marker-position to-marker)) - (forward-sentence) - ;; might have gone beyond to-marker---use whichever is smaller: - (ad-set-arg 1 (setq tmp-end (min (point) (marker-position to-marker)))) - ad-do-it - (ad-set-arg 0 (setq from (point))) - (unless (or (looking-back "^\\s *") - (looking-at "\\s *$")) - (LaTeX-newline))) - (set-marker to-marker nil))) -(ad-activate 'LaTeX-fill-region-as-paragraph) diff --git a/.gitmodules b/.gitmodules index b7d06cb..1bbee0f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,3 @@ [submodule ".rlwrap"] path = .rlwrap url = https://github.com/ryanakca/rlwrap_mail.git -[submodule "emacsen/use-package"] - path = emacsen/use-package - url = https://github.com/jwiegley/use-package.git diff --git a/emacsen/Makefile b/emacsen/Makefile index 402f081..7ebb4c1 100644 --- a/emacsen/Makefile +++ b/emacsen/Makefile @@ -4,8 +4,7 @@ EMACSD=$(ROOT)/build/.emacs.d/ export ELISPDIR EMACSEN=$(ROOT)/emacsen -SUBDIRS = dictem \ - use-package +SUBDIRS = dictem MAKEDIRS = $(SUBDIRS:%=make-%) INSTALLDIRS = $(SUBDIRS:%=install-%) @@ -20,7 +19,7 @@ $(MAKEDIRS): touch $@ install: $(INSTALLDIRS) - install-info $(EMACSD)/share/info/*.info $(EMACSD)/share/info/dir + [ ! -d $(EMACSD)/share/info ] || install-info $(EMACSD)/share/info/*.info $(EMACSD)/share/info/dir install-% : make-% $(INSTALLDIRS): @@ -34,13 +33,13 @@ $(CLEANDIRS): [ ! -f $(@:clean-%=%)/Makefile ] || $(MAKE) -C $(@:clean-%=%) clean # Manual overrides: -make-dictem install-use-package: +make-dictem: touch $@ -clean-dictem install-use-package: +clean-dictem: echo $@ -install-dictem install-use-package: +install-dictem: -mkdir -p $(EMACSD)/$(@:install-%=%) install -m 644 $(@:install-%=%)/*.el $(EMACSD)/$(@:install-%=%) diff --git a/emacsen/popup b/emacsen/popup deleted file mode 160000 index 748c109..0000000 --- a/emacsen/popup +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 748c109f3f7b5a5bd44472b398154341ccac3132 diff --git a/emacsen/use-package b/emacsen/use-package deleted file mode 160000 index 4b7917c..0000000 --- a/emacsen/use-package +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4b7917cc276b33cd7daff96ef764f4626baf0a5c -- cgit v1.2.3