From 6f810fb5df94e1c4c92b9e72f475cba64c81dfd1 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 6 Jun 2016 16:47:58 -0700 Subject: [PATCH] More literateization --- dotfiles/emacs.d/README.org | 74 +++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 6540dce1..138f56a9 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -19,13 +19,22 @@ custom-before.el is loaded before the rest of init.el, while custom-after.el is (defvar custom-after-file "~/.emacs.d/custom-after.el") (when (file-exists-p machine-custom) (load machine-custom)) #+END_SRC -* Custom emacs-lisp - +** GUI Disables +Death to any gui elements in emacs! Do this EARLY so that emacs doesn't redisplay in a way that is visually unpleasant on startup a bunch of times. #+BEGIN_SRC emacs-lisp - (defun emacs24_4-p () - (or (and (>= emacs-major-version 24) - (>= emacs-minor-version 4)) - (>= emacs-major-version 25))) + (when (fboundp 'menu-bar-mode) (menu-bar-mode -1)) + (when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) + (when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) +#+END_SRC +* Custom emacs-lisp +An emacs version predicate builder +#+BEGIN_SRC emacs-lisp + (defmacro emacs-version-predicate (major-version minor-version) + `(lambda () + (or (> emacs-major-version ,major-version) + (and (>= emacs-major-version ,major-version) + (>= emacs-minor-version ,minor-version))))) + (defalias emacs24_4-p (emacs-version-predicate 24 4)) #+END_SRC #+BEGIN_SRC emacs-lisp @@ -34,7 +43,8 @@ custom-before.el is loaded before the rest of init.el, while custom-after.el is * Packages ** Essential -Helm for almost all emacs completion +*** helm +I use helm for almost all emacs completion #+BEGIN_SRC emacs-lisp (use-package helm-config :ensure helm @@ -144,6 +154,22 @@ Helm for almost all emacs completion (helm-mode 1) (diminish 'helm-mode))) #+END_SRC +*** magit +#+BEGIN_SRC emacs-lisp + (use-package magit + :commands magit-status + :bind (("C-x g" . magit-status)) + :config + (progn + (defvar-setq magit-last-seen-setup-instructions "1.4.0") + (magit-auto-revert-mode) + (use-package magit-filenotify + ;; Seems like OSX does not support filenotify. + :disabled t + :if (funcall o(emacs-version-predicate 24 4)) + :config + :init (add-hook 'magit-status-mode-hook 'magit-filenotify-mode)))) +#+END_SRC ** Major-Mode * Keybindings #+BEGIN_SRC emacs-lisp @@ -175,23 +201,15 @@ Helm for almost all emacs completion (quote ([1 67108896 19 100 6 23 40 19 41 return backspace 32 46 6 4] 0 "%d")) arg))) #+END_SRC +** OSX +#+BEGIN_SRC emacs-lisp + (when (equal system-type 'darwin) + (setq mac-option-modifier 'meta) + (setq mac-command-modifier 'super)) +#+END_SRC * TODO Make the stuff under this heading literate #+BEGIN_SRC emacs-lisp -(when (equal system-type 'darwin) - (setq mac-option-modifier 'meta) - (setq mac-command-modifier 'super)) - - -;; ============================================================================= -;; GUI Disables -;; ============================================================================= - - ;; Turn off mouse interface early in startup to avoid momentary display -(when (fboundp 'menu-bar-mode) (menu-bar-mode -1)) -(when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) -(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) - ;; ============================================================================= ;; byte-compiler ;; ============================================================================= @@ -904,20 +922,6 @@ buffer is not visiting a file." :disabled t :config (github-notifier-mode)) -(use-package magit - :commands magit-status - :bind (("C-x g" . magit-status)) - :config - (progn - (defvar-setq magit-last-seen-setup-instructions "1.4.0") - (magit-auto-revert-mode) - (use-package magit-filenotify - ;; Seems like OSX does not support filenotify. - :disabled t - :if (emacs24_4-p) - :config - :init (add-hook 'magit-status-mode-hook 'magit-filenotify-mode)))) - (use-package company :commands company-mode imalison:company :bind (("C-\\" . imalison:company))