1 #+title: =aminb='s Emacs Init file
2 #+property: header-args :results silent :comments link :tangle ~/dotfiles/emacs/init.el
14 #+begin_src emacs-lisp :comments none
15 ;;; init.el --- Amin Bandali's Emacs config -*- lexical-binding: t ; eval: (view-mode 1)-*-
18 Enable =view-mode=, which both makes the file read-only (as a reminder
19 that =init.el= is an auto-generated file, not supposed to be edited),
20 and provides some convenient key bindings for browsing through the
25 #+begin_src emacs-lisp :comments none
26 ;; Copyright (C) 2018 Amin Bandali <amin@aminb.org>
28 ;; This program is free software: you can redistribute it and/or modify
29 ;; it under the terms of the GNU General Public License as published by
30 ;; the Free Software Foundation, either version 3 of the License, or
31 ;; (at your option) any later version.
33 ;; This program is distributed in the hope that it will be useful,
34 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
35 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 ;; GNU General Public License for more details.
38 ;; You should have received a copy of the GNU General Public License
39 ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
44 #+begin_src emacs-lisp :comments none
47 ;; Emacs configuration of Amin Bandali, computer scientist and functional
50 ;; THIS FILE IS AUTO-GENERATED FROM `init.org'.
55 #+begin_src emacs-lisp :comments none
61 #+begin_src emacs-lisp
62 (setq org-src-tab-acts-natively t
63 org-src-preserve-indentation nil
64 org-edit-src-content-indentation 0)
69 Measure and display startup time. Also, temporarily increase
70 ~gc-cons-threshhold~ during startup to reduce reduce garbage
71 collection frequency. Taken from [[https://github.com/dieggsy/dotfiles/tree/3d95bc08033920e077855caf545a975eba52d28d/emacs.d#startup-time][here]].
73 #+begin_src emacs-lisp
74 (defconst aminb/emacs-start-time (current-time))
75 (defconst aminb/gc-cons-threshold gc-cons-threshold)
76 (defconst aminb/gc-cons-percentage gc-cons-percentage)
77 (defvar aminb/file-name-handler-alist file-name-handler-alist)
78 (setq gc-cons-threshold 400000000
79 gc-cons-percentage 0.6
80 file-name-handler-alist nil
81 ;; sidesteps a bug when profiling with esup
82 esup-child-profile-require-level 0)
85 Reset the variables back to default after init.
87 #+begin_src emacs-lisp
91 (setq gc-cons-threshold aminb/gc-cons-threshold
92 gc-cons-percentage aminb/gc-cons-percentage
93 file-name-handler-alist aminb/file-name-handler-alist)
94 (let ((elapsed (float-time (time-subtract (current-time)
95 aminb/emacs-start-time))))
96 (message "Loading %s...done (%.3fs) [after-init]"
97 ,load-file-name elapsed))))
102 #+begin_src emacs-lisp :comments none
103 ;;; init.el ends here