diff options
Diffstat (limited to '.config/emacs')
-rw-r--r-- | .config/emacs/custom.el | 11 | ||||
-rw-r--r-- | .config/emacs/emacsutils.el | 13 | ||||
-rw-r--r-- | .config/emacs/init.el | 221 | ||||
-rw-r--r-- | .config/emacs/wl.el | 14 |
4 files changed, 146 insertions, 113 deletions
diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el index 646f467..aca35b0 100644 --- a/.config/emacs/custom.el +++ b/.config/emacs/custom.el @@ -4,7 +4,9 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(custom-enabled-themes (quote (tango-dark))) - '(custom-safe-themes (quote ("9f443833deb3412a34d2d2c912247349d4bd1b09e0f5eaba11a3ea7872892000" "bb08c73af94ee74453c90422485b29e5643b73b05e8de029a6909af6a3fb3f58" "82d2cac368ccdec2fcc7573f24c3f79654b78bf133096f9b40c20d97ec1d8016" "1b8d67b43ff1723960eb5e0cba512a2c7a2ad544ddb2533a90101fd1852b426e" "628278136f88aa1a151bb2d6c8a86bf2b7631fbea5f0f76cba2a0079cd910f7d" "06f0b439b62164c6f8f84fdda32b62fb50b6d00e8b01c2208e55543a6337433a" "1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365" "71b172ea4aad108801421cc5251edb6c792f3adbaecfa1c52e94e3d99634dee7" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" default))) + '(custom-safe-themes + (quote + ("9f443833deb3412a34d2d2c912247349d4bd1b09e0f5eaba11a3ea7872892000" "bb08c73af94ee74453c90422485b29e5643b73b05e8de029a6909af6a3fb3f58" "82d2cac368ccdec2fcc7573f24c3f79654b78bf133096f9b40c20d97ec1d8016" "1b8d67b43ff1723960eb5e0cba512a2c7a2ad544ddb2533a90101fd1852b426e" "628278136f88aa1a151bb2d6c8a86bf2b7631fbea5f0f76cba2a0079cd910f7d" "06f0b439b62164c6f8f84fdda32b62fb50b6d00e8b01c2208e55543a6337433a" "1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365" "71b172ea4aad108801421cc5251edb6c792f3adbaecfa1c52e94e3d99634dee7" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" default))) '(erc-nick "lukeshu") '(explicit-shell-file-name "/bin/bash") '(global-whitespace-mode nil) @@ -17,10 +19,13 @@ '(safe-local-variable-values (quote ((Nginx-indent-tabs-mode) (Nginx-indent-level . 4) (Nginx-indent-level . 8)))) '(scroll-bar-mode nil) '(scss-compile-at-save nil) - '(send-mail-function (quote smtpmail-send-it))) + '(send-mail-function (quote smtpmail-send-it)) + '(smtpmail-smtp-server "plus.smtp.mail.yahoo.com") + '(smtpmail-smtp-service 587) + '(uniquify-buffer-name-style (quote post-forward-angle-brackets) nil (uniquify))) (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. - ) + '(term-color-blue ((t (:background "#729fcf" :foreground "#729fcf"))))) diff --git a/.config/emacs/emacsutils.el b/.config/emacs/emacsutils.el deleted file mode 100644 index 966d16e..0000000 --- a/.config/emacs/emacsutils.el +++ /dev/null @@ -1,13 +0,0 @@ -(defun mailto-compose-mail (mailto-url) - (if (and (stringp mailto-url) - (string-match "\\`mailto:" mailto-url)) - (progn - (require 'rfc2368) - (let* ((headers (mapcar (lambda (h) (cons (intern (car h)) (cdr h))) - (rfc2368-parse-mailto-url mailto-url))) - (good-headers (remove-if (lambda (h) (member (car h) '(Body))) headers)) - (body (cdr (assoc 'Body headers)))) - (wl-draft good-headers nil nil body))))) - -(defun emacs-terminal-emulator (program) - (ansi-term program))
\ No newline at end of file diff --git a/.config/emacs/init.el b/.config/emacs/init.el index c21e19b..08b356f 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -1,14 +1,26 @@ -;; Preliminary settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(setq notify-method 'notify-via-libnotify) -(add-to-list 'load-path "~/.emacs.d/") -(setq server-auth-dir (locate-user-emacs-file (concat "server-" (system-name) "/"))) -(setq custom-file "~/.emacs.d/custom.el") +;; This config requires Emacs 24(+?) +;;;; Use XDG-ish locations ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(setq xdg-cache-home (file-name-as-directory (or (getenv "XDG_CACHE_HOME") "~/.cache"))) +(setq + package-user-dir (concat xdg-cache-home "emacs/elpa") + ido-save-directory-list-file (concat xdg-cache-home "emacs/ido.last.el") + el-get-dir (concat xdg-cache-home "emacs/el-get/") + eshell-directory-name (concat xdg-cache-home "emacs/eshell/") + wl-score-files-directory (concat xdg-cache-home "emacs/wl-score-files/") + elmo-msgdb-directory (concat xdg-cache-home "emacs/elmo-msgdb/") + elmo-cache-directory (concat xdg-cache-home "emacs/elmo-cache/") + auto-save-list-file-prefix (concat xdg-cache-home "emacs/auto-save-list/saves-") + tramp-persistency-file-name (concat xdg-cache-home "emacs/tramp-cache.el") + custom-file (concat user-emacs-directory "custom.el") + wl-init-file (concat user-emacs-directory "wl.el") + ) ;;;; The basics that I can't use Emacs without ;;;;;;;;;;;;;;;;;;;;;;; (show-paren-mode 1) (column-number-mode 1) (line-number-mode 1) (ido-mode 1) +(unless (daemonp) (server-mode 1)) (when (require 'whitespace nil t) (setq whitespace-style '( tab-mark @@ -17,11 +29,18 @@ empty )) (global-set-key "\C-cw" 'global-whitespace-mode)) +(setq minibuffer-prompt-properties '( + read-only t + point-entered minibuffer-avoid-prompt + face minibuffer-prompt + )) (load custom-file 'noerror) + ;;;; Early settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This isn't particularly important, but set it before doing a whole ;; lot (loading packages), so there isn't a weird change in text size. +(setq notify-method 'notify-via-libnotify) (set-face-attribute 'default nil :height 93) @@ -40,39 +59,105 @@ (eval-region (point) (point-max)) (kill-buffer (current-buffer))))) -(add-to-list 'load-path "~/.emacs.d/el-get/el-get") +(add-to-list 'load-path (concat el-get-dir "el-get")) (unless (require 'el-get nil t) (let ((el-get-install-branch "master")) ;; live life on the edge (eval-url "https://github.com/dimitri/el-get/raw/master/el-get-install.el"))) ;;;; Install packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; This is kinda funny how it works. +;; +;; package.el/ELPA (The standard package manager in Emacs 24) has +;; terrible programatic management. It's great at installing packages, +;; but only interactively. So, I +;; 1) Disable package.el from getting loading all downloaded packages +;; 2) Use el-get to load a specified list of packages from elpa. +;; +;; This is also nice because I can do event-base programming for what +;; to do once a package is loaded, using :after. (add-to-list 'package-archives '("ELPA" . "http://tromey.com/elpa/")) (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) +(setq package-enable-at-startup nil) +;; What packages el-get should get from ELPA (if it gets them at all) (setq el-get-sources '( - (:name nxhtml - :type http - :url "http://ourcomments.org/Emacs/DL/elisp/nxhtml/zip/nxhtml-2.08-100425.zip" - :build ("unzip nxhtml-2.08-100425.zip") - :load "nxhtml/autostart.el") - )) - + ;; Minor modes + (:name dtrt-indent :type elpa ;; Detect indent style for existing files + :after (dtrt-indent-mode 1)) + (:name page-break-lines :type elpa ;; Display form-feeds pretty + :after (progn + (define-global-minor-mode global-page-break-lines-mode + page-break-lines-mode page-break-lines-mode + :group 'page-break-lines) + (global-page-break-lines-mode 1))) + (:name smart-tabs-mode :type elpa ;; Indent with tabs, align with spaces + :after (progn + (smart-tabs-mode 1) + (apply 'smart-tabs-insinuate (mapcar 'car smart-tabs-insinuate-alist)))) + ;; Major modes + (:name coffee-mode :type elpa + :after (add-hook 'coffee-mode-hook + '(lambda () + (set (make-local-variable 'tab-width) 2) + (set (make-local-variable 'indent-tabs-mode) nil) + ))) + (:name graphviz-dot-mode :type elpa) + (:name markdown-mode :type elpa + :after (add-to-list 'auto-mode-alist '("\\.ronn\\'" . markdown-mode))) + (:name nginx-mode :type elpa + :after (put 'nginx-indent-level 'safe-local-variable 'integerp)) + (:name scss-mode :type elpa) + )) +;; What packages el-get should install, both from above, and it's +;; internal list of sources. (el-get 'sync '(el-get -; nxhtml - apel flim semi wanderlust - smarttabs - )) - + ;; Minor modes + dtrt-indent + smart-tabs-mode + page-break-lines + ;; Major modes + apel flim semi wanderlust + graphviz-dot-mode + markdown-mode + nginx-mode + ;;nxhtml ; nxhtml is invasive, only enable if actively using + php-mode-improved + )) + ;; Misc. crap -(tool-bar-mode -1) +(when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) + +(defun align-regexp--use-spaces (orig-fun &rest args) + "Use spaces for alignment" + (let ((indent-tabs-mode nil)) + (apply orig-fun args))) +(advice-add 'align-regexp :around #'align-regexp--use-spaces) -;(require 'go-mode-load) +(defun sh-smie-sh-rules--fix (args) + "Replace :after \"then\" with :after \"if\" because Emacs 24 +sh-script.el is broken." + (if (equal args (list :after "then")) + (list :after "if") + args)) +(advice-add 'sh-smie-sh-rules :filter-args #'sh-smie-sh-rules--fix) + +(require 'go-mode-load nil t) + +;; Make the mouse work in an xterm +(when (fboundp 'xterm-mouse-mode) + (xterm-mouse-mode 1) + (add-hook 'after-make-frame-functions + '(lambda (frame) + (if xterm-mouse-mode (xterm-mouse-mode 1)) + ))) + +;; Use mailcrypt to encrypt/decrypt email (when (require 'mailcrypt nil t) (mc-setversion "gpg") (add-hook 'wl-summary-mode-hook 'mc-install-read-mode) @@ -111,7 +196,7 @@ ;; Backup settings (setq backup-by-copying t ;; don't clobber symlinks - backup-directory-alist '(("." . "~/.emacs.d/saves")) ;; don't litter my fs tree + backup-directory-alist '(("." . "~/.cache/emacs/saves")) ;; don't litter my fs tree delete-old-versions t kept-new-versions 6 kept-old-versions 2 @@ -124,47 +209,29 @@ browse-url-browser-function 'browse-url-generic ) -;(load "mdmua") -(load "emacsutils") +;; Ediff settings +(setq + ediff-window-setup-function 'ediff-setup-windows-plain + ediff-split-window-function 'split-window-horizontally + ) + (set-default 'truncate-lines t) (setq inhibit-startup-screen t server-use-tcp t) -(setq org-log-done 'time) -(setq gamegrid-user-score-file-directory "/var/games/emacs/") -;(xclip-mode 1) - -(defun toggle-fullscreen (&optional f) - (interactive) - (let ((current-value (frame-parameter nil 'fullscreen))) - (set-frame-parameter nil 'fullscreen - (if (equal 'fullboth current-value) - (if (boundp 'old-fullscreen) old-fullscreen nil) - (progn (setq old-fullscreen current-value) - 'fullboth))))) -(global-set-key [f11] 'toggle-fullscreen) ;; Automatically load smerge mode for merge files -(defun sm-try-smerge () +(defun try-smerge-mode () (save-excursion (goto-char (point-min)) (when (re-search-forward "^<<<<<<< " nil t) (smerge-mode 1)))) -(add-hook 'find-file-hook 'sm-try-smerge t) +(add-hook 'find-file-hook 'try-smerge-mode t) -;; Al my weird mode-specific settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; All my weird mode-specific settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (add-hook 'text-mode-hook 'turn-on-auto-fill) -; for term-mode -;; (add-hook 'after-make-frame-functions -;; (lambda (frame) -;; (set-variable 'term-default-fg-color -;; (face-foreground 'default)) -;; (set-variable 'term-default-bg-color -;; (face-background 'default))) -;; t) - (add-hook 'lisp-mode-hook '(lambda () (set (make-local-variable 'indent-tabs-mode) nil) @@ -175,21 +242,14 @@ (set (make-local-variable 'indent-tabs-mode) nil) )) -(add-hook 'coffee-mode-hook - '(lambda () - (set (make-local-variable 'tab-width) 2) - )) - (add-hook 'term-mode-hook '(lambda () - (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") - (make-local-variable 'mouse-yank-at-point) - ;(make-local-variable 'transient-mark-mode) - (setq mouse-yank-at-point t) - ;(setq transient-mark-mode nil) (auto-fill-mode -1) + (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") + (set (make-local-variable 'mouse-yank-at-point) t) (setq tab-width 8 ) - (setq autopair-dont-activate t) ;; Don't let autopair break ansi-term + (setq truncate-lines nil) + (set (make-local-variable 'autopair-dont-activate) t) ;; Don't let autopair break ansi-term )) (add-hook 'ruby-mode-hook @@ -199,38 +259,21 @@ (set (make-local-variable 'tab-width) 4) )) -(add-hook 'coffee-mode-hook +(add-hook 'php-mode-hook '(lambda () - (set (make-local-variable 'indent-tabs-mode) nil) + (c-set-offset 'cpp-macro 0) + )) + +(add-hook 'tex-mode-hook + '(lambda () + (set (make-local-variable 'tab-always-indent) nil) + (set (make-local-variable 'indent-tabs-mode) t) + )) + +(add-hook 'sh-mode-hook + '(lambda () + (sh-electric-here-document-mode 0) )) (add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) (add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) -(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) -(add-to-list 'auto-mode-alist '("\\.ronn\\'" . markdown-mode)) - -;(require 'flymake) -;(add-hook 'php-mode-hook (lambda() (flymake-mode 1))) -;(define-key php-mode-map '[M-S-up] 'flymake-goto-prev-error) -;(define-key php-mode-map '[M-S-down] 'flymake-goto-next-error) - -;(setq tramp-debug-buffer t) -;(setq tramp-verbose 10) - -;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e") -;; (require 'mu4e) -;; (require 'mu4e-speedbar) - -;; (setq -;; mu4e-maildir "~/Maildir" ;; top-level Maildir -;; mu4e-sent-folder "/.Sent" ;; folder for sent messages -;; mu4e-drafts-folder "/.Draft" ;; unfinished messages -;; mu4e-trash-folder "/.Trash" ;; trashed messages -;; mu4e-refile-folder "/archive") ;; saved messages -;; (setq mu4e-get-mail-command "offlineimap") -;; (setq mu4e-use-fancy-chars "t") -;; ;; enable inline images -;; (setq mu4e-view-show-images t) -;; ;; use imagemagick, if available -;; (when (fboundp 'imagemagick-register-types) -;; (imagemagick-register-types)) diff --git a/.config/emacs/wl.el b/.config/emacs/wl.el index a169249..e9e61bd 100644 --- a/.config/emacs/wl.el +++ b/.config/emacs/wl.el @@ -21,18 +21,16 @@ wl-message-id-domain user-mail-address ;; Folders/File system ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - elmo-msgdb-directory "~/.emacs.d/elmo" ;; where elmo keeps all its stuff - elmo-cache-directory "~/.emacs.d/elmo-cache" ;; where elmo keeps all its stuff elmo-maildir-folder-path "~/Maildir" ;; where I store my mail ;; note: all below are dirs (Maildirs) under elmo-maildir-folder-path ;; the '.'-prefix is for marking them as maildirs - wl-fcc "..Sent" ;; sent msgs go to the "sent"-folder - wl-default-folder "..Ham" ;; my main inbox - wl-draft-folder "..Draft" ;; store drafts in 'postponed' - wl-trash-folder "..Trash" ;; put trash in 'trash' - wl-spam-folder "..Bulk Mail" ;; put spam in 'Bulk Mail' - wl-queue-folder "..queue" ;; we don't use this + wl-fcc ".Sent" ;; sent msgs go to the "sent"-folder + wl-default-folder ".FOLDERS.Ham" ;; my main inbox + wl-draft-folder ".Draft" ;; store drafts in 'postponed' + wl-trash-folder ".Trash" ;; put trash in 'trash' + wl-spam-folder ".FOLDERS.Spam.training" ;; put spam in 'Bulk Mail' + wl-queue-folder ".FOLDERS.Queue" ;; we don't use this ;; check this folder periodically, and update modeline ;wl-biff-check-folder-list '(".todo") ;; check every 180 seconds |