-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathearly-init.el
50 lines (43 loc) · 1.92 KB
/
early-init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
;;-*- lexical-binding: t -*-
(add-hook 'emacs-startup-hook
(let ((old-list file-name-handler-alist)
;; If x10, half of cpu time is spent on gc when
;; scrolling.
;; (threshold (* 100 gc-cons-threshold))
;; Let’s try a smaller number, more frequent gc means
;; shorter gc pause.
(threshold (* 2 gc-cons-threshold))
(percentage gc-cons-percentage))
(lambda ()
(message "Emacs ready in %s with %d garbage collections."
(format "%.2f seconds"
(float-time
(time-subtract after-init-time before-init-time)))
gcs-done)
(setq file-name-handler-alist old-list
gc-cons-threshold threshold
gc-cons-percentage percentage)
(garbage-collect)))
t)
(setq package-enable-at-startup nil
file-name-handler-alist nil
message-log-max 16384
gc-cons-threshold most-positive-fixnum
gc-cons-percentage 0.6
auto-window-vscroll nil)
(push '(vertical-scroll-bars . nil) default-frame-alist)
(when (featurep 'ns)
(push '(ns-transparent-titlebar . t) default-frame-alist))
;; Have to enable menu bar on mac port, otherwise emacs lost focus.
;; (when (not (display-graphic-p))
;; (menu-bar-mode -1))
(defun tango-icons--tool-bar-image-advice (oldfn icon)
"Advice for ‘tool-bar--image-expression’.
OLDFN is ‘tool-bar--image-expression’, ICON is the icon name. Look for
the png version of ICON first, if not found, use OLDFN."
(or `(find-image ',(list (list :file (concat icon ".png"))))
(funcall oldfn icon)))
(add-to-list 'image-load-path
(expand-file-name "icons" user-emacs-directory))
(advice-add #'tool-bar--image-expression :around
#'tango-icons--tool-bar-image-advice)