<commit_before>(defconst is-mac     (eq system-type 'darwin))
(defconst is-linux   (eq system-type 'gnu/linux))
(defconst is-windows (eq system-type 'windows-nt))

(when is-linux (add-to-list 'load-path "~/.cask"))
(setq use-package-verbose DEBUG-MODE)

(cd "~") ; instead of /

;; Make sure undo/backup folders exist
(defconst my-tmp-dir-undo     (expand-file-name "undo" my-tmp-dir))
(defconst my-tmp-dir-backup   (expand-file-name "backup" my-tmp-dir))
(defconst my-tmp-dir-autosave (expand-file-name "autosave" my-tmp-dir))
(unless (file-directory-p my-tmp-dir)
   (make-directory my-tmp-dir-undo t)
   (make-directory my-tmp-dir-backup t)
   (make-directory my-tmp-dir-autosave t))

(setq load-prefer-newer t)
(setq debug-on-quit DEBUG-MODE)

(require 'shut-up)
(setq shut-up-ignore DEBUG-MODE)
(when noninteractive (shut-up-silence-emacs)) ; http://youtu.be/Z6woIRLnbmE

(shut-up
  ;;;; Sane defaults ;;;;;;;;;;;;;;;;;;;;;;;
  (line-number-mode 1)         ; hide line no in modeline
  (column-number-mode 1)       ; hide col no in modeline
  (auto-compression-mode t)    ; Transparently open compressed files
  (global-font-lock-mode t)    ; Enable syntax highlighting for older emacs
  (global-auto-revert-mode 1)  ; revert buffers for changed files
  (electric-indent-mode 1)
  (setq electric-indent-chars '(?  ?: ?{))

  ;;; window layout undo/redo
  (setq winner-boring-buffers '("*Completions*" "*Compile-Log*" "*inferior-lisp*"
                                "*Fuzzy Completions*" "*Apropos*" "*Help*" "*cvs*"
                                "*Buffer List*" "*Ibuffer*" "*esh command on file*"))
  (winner-mode 1)

  (setq semanticdb-default-save-directory (expand-file-name "semanticdb" my-tmp-dir))
  (semantic-mode 1)

  ;;; UTF-8 please
  (setq locale-coding-system 'utf-8)    ; pretty
  (set-terminal-coding-system 'utf-8)   ; pretty
  (set-keyboard-coding-system 'utf-8)   ; pretty
  (set-selection-coding-system 'utf-8)  ; please
  (prefer-coding-system 'utf-8)         ; with sugar on top
  (fset 'yes-or-no-p 'y-or-n-p)         ; y/n instead of yes/no

  ;;; Show tab characters
  ;; (global-whitespace-mode 1)
  (setq whitespace-style '(trailing face tabs tab-mark) ; needs to be re-set in every buffer
        whitespace-display-mappings
        '((tab-mark   ?\t   [?| ?\t] [?\\ ?\t])
          (newline-mark 10 [36 10])))         ; for whitespace-newline-mode

  ;; avoid garbage collection (default is 400k)
  (setq-default gc-cons-threshold 20000000)
  (setq-default confirm-kill-emacs nil)

  (setq-default fill-column 80)

  ;; minibufferception? Yay!
  (setq-default enable-recursive-minibuffers t)

  ;; Sane scroll settings
  (setq scroll-margin 5)
  (setq scroll-conservatively 9999)
  (setq scroll-preserve-screen-position 1)

  ;; Show me those keystrokes
  (setq echo-keystrokes 0.02)

  ;; I'll use visual mode, kthxbai
  (setq shift-select-mode nil)

  (setq ring-bell-function 'ignore)

  (setq inhibit-startup-screen t)           ; don't show EMACs start screen
  (setq inhibit-splash-screen t)
  (setq inhibit-startup-buffer-menu t)

  (setq initial-major-mode 'text-mode)      ; initial scratch buffer mode
  (setq initial-scratch-message nil)
  (setq initial-scratch-buffer nil)         ; empty scratch buffer

  (setq compilation-always-kill t)
  (setq compilation-ask-about-save nil)
  (setq compilation-scroll-output t)

  (setq sentence-end-double-space nil)      ; sentences end with periods. Period.

  (setq show-paren-delay 0)

  (setq ediff-diff-options "-w")
  (setq ediff-split-window-function 'split-window-horizontally)  ; side-by-side diffs
  (setq ediff-window-setup-function 'ediff-setup-windows-plain) ; no extra frames

  ;; Fixes C-i's synonymity with TAB
  (keyboard-translate ?\C-i ?\H-i)

  ;; Don't save clipboard contents into kill-ring before replacing them
  (setq save-interprogram-paste-before-kill nil)

  ;; don't let the cursor go into minibuffer prompt
  ;; Tip taken from <NAME>: http://ergoemacs.org/emacs/emacs_stop_cursor_enter_prompt.html
  (setq minibuffer-prompt-properties
        '(read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt))

  ;; remove annoying ellipsis when printing sexp in message buffer
  (setq eval-expression-print-length nil
        eval-expression-print-level nil)


  ;;;; Backup ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Disable all backups (that's what git/dropbox are for)
  (setq bookmark-save-flag        t)
  (setq bookmark-default-file     (expand-file-name "bookmarks" my-tmp-dir))
  (setq auto-save-default         nil)
  (setq auto-save-list-file-name  (expand-file-name ".auto-save" my-tmp-dir-autosave))
  (setq auto-save-file-name-transforms `((".*" ,my-tmp-dir-autosave t)))
  ;; In case I want to reactivate backup files
  (setq make-backup-files         nil)
  (setq create-lockfiles          nil)
  (setq backup-directory-alist `((".*" . ,my-tmp-dir-backup)))
  ;; Remember undo history
  (setq-default undo-tree-auto-save-history t)
  (setq-default undo-tree-history-directory-alist `(("." . ,my-tmp-dir-undo)))

  ;; Save history across sessions
  (require 'savehist)
  (setq savehist-file (concat my-tmp-dir "savehist")  ; keep the home clean
        savehist-additional-variables '(kill-ring
                                        global-mark-ring
                                        search-ring
                                        regexp-search-ring
                                        extended-command-history)
        history-length 1000)
  (savehist-mode 1)

  ;; Save cursor location across sessions
  (require 'saveplace)
  (setq-default save-place-file (concat my-tmp-dir "saveplace"))
  ;; activate save-place only for files that exist
  (add-hook 'find-file-hook (lambda() (if (file-exists-p buffer-file-name) (setq save-place t))))

  (require 'recentf)
  (setq recentf-save-file (concat my-tmp-dir "recentf"))
  (setq recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last\\'" "\\.revive\\'", "/TAGS\\'"))
  (setq recentf-max-menu-items 0)
  (setq recentf-max-saved-items 1000)
  (setq recentf-auto-cleanup 'never)
  (add-hook 'kill-emacs-hook 'recentf-cleanup)
  (recentf-mode 1)

  ;; What we do every night, Pinkie...
  (defun display-startup-echo-area-message ()
    (message "What're we gonna do tonight, Brain? (Loaded in %s)" (emacs-init-time)))


  ;;;; Editor behavior ;;;;;;;;;;;;;;;;
  ;; spaces instead of tabs
  (setq-default indent-tabs-mode nil)     ; spaces instead of tabs
  (setq-default tab-always-indent t)
  (setq-default tab-width 4)<commit_msg>Don't date-check loads<commit_after>(defconst is-mac     (eq system-type 'darwin))
(defconst is-linux   (eq system-type 'gnu/linux))
(defconst is-windows (eq system-type 'windows-nt))

(when is-linux (add-to-list 'load-path "~/.cask"))
(setq use-package-verbose DEBUG-MODE)

(cd "~") ; instead of /

;; Make sure undo/backup folders exist
(defconst my-tmp-dir-undo     (expand-file-name "undo" my-tmp-dir))
(defconst my-tmp-dir-backup   (expand-file-name "backup" my-tmp-dir))
(defconst my-tmp-dir-autosave (expand-file-name "autosave" my-tmp-dir))
(unless (file-directory-p my-tmp-dir)
   (make-directory my-tmp-dir-undo t)
   (make-directory my-tmp-dir-backup t)
   (make-directory my-tmp-dir-autosave t))

;; (setq load-prefer-newer t)
(setq debug-on-quit DEBUG-MODE)

(require 'shut-up)
(setq shut-up-ignore DEBUG-MODE)
(when noninteractive (shut-up-silence-emacs)) ; http://youtu.be/Z6woIRLnbmE

(shut-up
  ;;;; Sane defaults ;;;;;;;;;;;;;;;;;;;;;;;
  (line-number-mode 1)         ; hide line no in modeline
  (column-number-mode 1)       ; hide col no in modeline
  (auto-compression-mode t)    ; Transparently open compressed files
  (global-font-lock-mode t)    ; Enable syntax highlighting for older emacs
  (global-auto-revert-mode 1)  ; revert buffers for changed files
  (electric-indent-mode 1)
  (setq electric-indent-chars '(?  ?: ?{))

  ;;; window layout undo/redo
  (setq winner-boring-buffers '("*Completions*" "*Compile-Log*" "*inferior-lisp*"
                                "*Fuzzy Completions*" "*Apropos*" "*Help*" "*cvs*"
                                "*Buffer List*" "*Ibuffer*" "*esh command on file*"))
  (winner-mode 1)

  (setq semanticdb-default-save-directory (expand-file-name "semanticdb" my-tmp-dir))
  (semantic-mode 1)

  ;;; UTF-8 please
  (setq locale-coding-system 'utf-8)    ; pretty
  (set-terminal-coding-system 'utf-8)   ; pretty
  (set-keyboard-coding-system 'utf-8)   ; pretty
  (set-selection-coding-system 'utf-8)  ; please
  (prefer-coding-system 'utf-8)         ; with sugar on top
  (fset 'yes-or-no-p 'y-or-n-p)         ; y/n instead of yes/no

  ;;; Show tab characters
  ;; (global-whitespace-mode 1)
  (setq whitespace-style '(trailing face tabs tab-mark) ; needs to be re-set in every buffer
        whitespace-display-mappings
        '((tab-mark   ?\t   [?| ?\t] [?\\ ?\t])
          (newline-mark 10 [36 10])))         ; for whitespace-newline-mode

  ;; avoid garbage collection (default is 400k)
  (setq-default gc-cons-threshold 20000000)
  (setq-default confirm-kill-emacs nil)

  (setq-default fill-column 80)

  ;; minibufferception? Yay!
  (setq-default enable-recursive-minibuffers t)

  ;; Sane scroll settings
  (setq scroll-margin 5)
  (setq scroll-conservatively 9999)
  (setq scroll-preserve-screen-position 1)

  ;; Show me those keystrokes
  (setq echo-keystrokes 0.02)

  ;; I'll use visual mode, kthxbai
  (setq shift-select-mode nil)

  (setq ring-bell-function 'ignore)

  (setq inhibit-startup-screen t)           ; don't show EMACs start screen
  (setq inhibit-splash-screen t)
  (setq inhibit-startup-buffer-menu t)

  (setq initial-major-mode 'text-mode)      ; initial scratch buffer mode
  (setq initial-scratch-message nil)
  (setq initial-scratch-buffer nil)         ; empty scratch buffer

  (setq compilation-always-kill t)
  (setq compilation-ask-about-save nil)
  (setq compilation-scroll-output t)

  (setq sentence-end-double-space nil)      ; sentences end with periods. Period.

  (setq show-paren-delay 0)

  (setq ediff-diff-options "-w")
  (setq ediff-split-window-function 'split-window-horizontally)  ; side-by-side diffs
  (setq ediff-window-setup-function 'ediff-setup-windows-plain) ; no extra frames

  ;; Fixes C-i's synonymity with TAB
  (keyboard-translate ?\C-i ?\H-i)

  ;; Don't save clipboard contents into kill-ring before replacing them
  (setq save-interprogram-paste-before-kill nil)

  ;; don't let the cursor go into minibuffer prompt
  ;; Tip taken from <NAME>: http://ergoemacs.org/emacs/emacs_stop_cursor_enter_prompt.html
  (setq minibuffer-prompt-properties
        '(read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt))

  ;; remove annoying ellipsis when printing sexp in message buffer
  (setq eval-expression-print-length nil
        eval-expression-print-level nil)


  ;;;; Backup ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Disable all backups (that's what git/dropbox are for)
  (setq bookmark-save-flag        t)
  (setq bookmark-default-file     (expand-file-name "bookmarks" my-tmp-dir))
  (setq auto-save-default         nil)
  (setq auto-save-list-file-name  (expand-file-name ".auto-save" my-tmp-dir-autosave))
  (setq auto-save-file-name-transforms `((".*" ,my-tmp-dir-autosave t)))
  ;; In case I want to reactivate backup files
  (setq make-backup-files         nil)
  (setq create-lockfiles          nil)
  (setq backup-directory-alist `((".*" . ,my-tmp-dir-backup)))
  ;; Remember undo history
  (setq-default undo-tree-auto-save-history t)
  (setq-default undo-tree-history-directory-alist `(("." . ,my-tmp-dir-undo)))

  ;; Save history across sessions
  (require 'savehist)
  (setq savehist-file (concat my-tmp-dir "savehist")  ; keep the home clean
        history-length 1000
        savehist-additional-variables '(kill-ring
                                        global-mark-ring
                                        search-ring
                                        regexp-search-ring
                                        extended-command-history))
  (savehist-mode 1)

  ;; Save cursor location across sessions
  (require 'saveplace)
  (setq-default save-place-file (concat my-tmp-dir "saveplace"))
  ;; activate save-place only for files that exist
  (add-hook 'find-file-hook (lambda() (if (file-exists-p buffer-file-name) (setq save-place t))))

  (require 'recentf)
  (setq recentf-save-file (concat my-tmp-dir "recentf"))
  (setq recentf-exclude '("/tmp/" "/ssh:" "\\.?ido\\.last\\'" "\\.revive\\'", "/TAGS\\'"))
  (setq recentf-max-menu-items 0)
  (setq recentf-max-saved-items 1000)
  (setq recentf-auto-cleanup 'never)
  (add-hook 'kill-emacs-hook 'recentf-cleanup)
  (recentf-mode 1)

  ;; What we do every night, Pinkie...
  (defun display-startup-echo-area-message ()
    (message "What're we gonna do tonight, Brain? (Loaded in %s)" (emacs-init-time)))


  ;;;; Editor behavior ;;;;;;;;;;;;;;;;
  ;; spaces instead of tabs
  (setq-default indent-tabs-mode nil)     ; spaces instead of tabs
  (setq-default tab-always-indent t)
  (setq-default tab-width 4)
{'fraction_non_alphanumeric': 0.14863003214449716, 'fraction_numerical': 0.008418796877391704, 'mean_word_length': 2.9370292256703827, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2426326', 'n_tokens_mistral': 4749, 'n_tokens_neox': 4396, 'n_words': 1091}