<commit_before>#+TITLE: Emacs config
#+AUTHOR: <NAME>
#+EMAIL: <EMAIL>
#+OPTIONS: toc:3

* Emacs Config

  This is a test of trying to keep my Emacs config in org mode, because
  obviously I need some new way to procrastinate.


* Packages

  This sections deals with all of the external packages I want.

  First, we'll add the repos and initialize everything.

#+BEGIN_SRC emacs-lisp

(require 'package)

(add-to-list 'package-archives
         '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
         '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)

#+END_SRC

  The variable =required-packages= lists everything I want.

#+BEGIN_SRC emacs-lisp

(defvar required-packages
  '(fill-column-indicator
    sublime-themes
    neotree
    paredit
    avy
    evil
    evil-leader
    evil-surround
    ledger-mode
    magit
    auctex
    yasnippet
    delight
    web-mode))

#+END_SRC

  This function runs through all of the required packages and installs them if
  they're missing.

#+BEGIN_SRC emacs-lisp

(defun required-packages-installed-p (packages)
  "Check if all required packages are installed"
  (let ((rest (cdr packages)))
    (if (package-installed-p (car packages))
        (if (eq rest nil) t (required-packages-installed-p rest))
      nil)))

(unless (required-packages-installed-p required-packages)
  (message "%s" "Installing required packages...")
  (package-refresh-contents)
  (dolist (pkg required-packages)
    (when (not (package-installed-p pkg))
      (package-install pkg)))
  (message "%s" "Packages installed"))

#+END_SRC



* UI settings

Set default font for frames.

#+BEGIN_SRC emacs-lisp
(add-to-list
 'default-frame-alist
 '(font . "Source Code Pro-10"))
#+END_SRC


  This contains all of the miscellaneous settings for the look and feel of
  Emacs.

** Packages

   Load up the packages we're gonna need.

#+BEGIN_SRC emacs-lisp

(require 'fill-column-indicator)
(add-to-list 'load-path "~/.emacs.d/lisp")
(autoload 'mto-mode "mto-mode" "Minor mode for MTO typesetting" t)


#+END_SRC

** Misc. settings

A bunch of random settings for what the window looks like, get rid of some
annoying default behavior.

#+BEGIN_SRC emacs-lisp
    (progn
      (column-number-mode t)                ; show column in mode line
      (line-number-mode t)                  ; show line numbers too
      (menu-bar-mode 1)                     ; show menus
      (tool-bar-mode -1)                    ; don't show toolbar
      (scroll-bar-mode -1)                  ; don't use scrollbars
      (show-paren-mode 1)                   ; flash parens
      (fci-mode 1)                          ; column ruler
      (ido-mode)                            ; better buffer switching
      (ido-vertical-mode))                  ; prettier

    (setq inhibit-startup-message t         ; no splash screen
          vc-follow-symlinks t              ; don't ask about symlinks
          echo-keystrokes 0.1               ; show in-progress keystrokes
          confirm-kill-emacs 'y-or-n-p      ; don't quit accidentally
          ido-enable-flex-matching t        ; better fuzzy matching
          ns-pop-up-frames nil              ; open new files in existing frame
          frame-title-format "%b"           ; buffer name in title bar
          ido-vertical-define-keys 'C-n-and-C-p-only)

    ; mode line
    (setq display-time-format "  %d-%b"
          display-time-mail-string ""
          display-time-default-load-average nil)
    (display-time-mode 1)

    ; clean up lighters of modes that are always on.
    (require 'delight)
    (delight 'undo-tree-mode nil 'undo-tree)<commit_msg>emacs: don't try to disable gui things in terminal<commit_after>#+TITLE: Emacs config
#+AUTHOR: <NAME>
#+EMAIL: <EMAIL>
#+OPTIONS: toc:3

* Emacs Config

  This is a test of trying to keep my Emacs config in org mode, because
  obviously I need some new way to procrastinate.


* Packages

  This sections deals with all of the external packages I want.

  First, we'll add the repos and initialize everything.

#+BEGIN_SRC emacs-lisp

(require 'package)

(add-to-list 'package-archives
         '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
         '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)

#+END_SRC

  The variable =required-packages= lists everything I want.

#+BEGIN_SRC emacs-lisp

(defvar required-packages
  '(fill-column-indicator
    sublime-themes
    neotree
    paredit
    avy
    evil
    evil-leader
    evil-surround
    ledger-mode
    magit
    auctex
    yasnippet
    delight
    web-mode))

#+END_SRC

  This function runs through all of the required packages and installs them if
  they're missing.

#+BEGIN_SRC emacs-lisp

(defun required-packages-installed-p (packages)
  "Check if all required packages are installed"
  (let ((rest (cdr packages)))
    (if (package-installed-p (car packages))
        (if (eq rest nil) t (required-packages-installed-p rest))
      nil)))

(unless (required-packages-installed-p required-packages)
  (message "%s" "Installing required packages...")
  (package-refresh-contents)
  (dolist (pkg required-packages)
    (when (not (package-installed-p pkg))
      (package-install pkg)))
  (message "%s" "Packages installed"))

#+END_SRC



* UI settings

Set default font for frames.

#+BEGIN_SRC emacs-lisp
(add-to-list
 'default-frame-alist
 '(font . "Source Code Pro-10"))
#+END_SRC


  This contains all of the miscellaneous settings for the look and feel of
  Emacs.

** Packages

   Load up the packages we're gonna need.

#+BEGIN_SRC emacs-lisp

(require 'fill-column-indicator)
(add-to-list 'load-path "~/.emacs.d/lisp")
(autoload 'mto-mode "mto-mode" "Minor mode for MTO typesetting" t)


#+END_SRC

** Misc. settings

A bunch of random settings for what the window looks like, get rid of some
annoying default behavior.

#+BEGIN_SRC emacs-lisp
    (progn
      (column-number-mode t)                ; show column in mode line
      (line-number-mode t)                  ; show line numbers too
      (menu-bar-mode 1)                     ; show menus
      (show-paren-mode 1)                   ; flash parens
      (fci-mode 1)                          ; column ruler
      (ido-mode)                            ; better buffer switching
      (ido-vertical-mode))                  ; prettier

    (if (display-graphic-p)
        (progn
            (tool-bar-mode -1)              ; don't show toolbar
            (scroll-bar-mode -1)))          ; don't use scrollbars

    (setq inhibit-startup-message t         ; no splash screen
          vc-follow-symlinks t              ; don't ask about symlinks
          echo-keystrokes 0.1               ; show in-progress keystrokes
          confirm-kill-emacs 'y-or-n-p      ; don't quit accidentally
          ido-enable-flex-matching t        ; better fuzzy matching
          ns-pop-up-frames nil              ; open new files in existing frame
          frame-title-format "%b"           ; buffer name in title bar
          ido-vertical-define-keys 'C-n-and-C-p-only)

    ; mode line
    (setq display-time-format "  %d-%b"
          display-time-mail-string ""
          display-time-default-load-average nil)
    (display-time-mode 1)

    ; clean up lighters of modes that are always on.
    (require 'delight)
    (delight 'undo-tree-mode nil 'undo-tree)
{'fraction_non_alphanumeric': 0.10453994341910279, 'fraction_numerical': 0.0029637612825003366, 'mean_word_length': 2.28932210899424, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1416716', 'n_tokens_mistral': 2452, 'n_tokens_neox': 2314, 'n_words': 708}