From 86fc398a1e808c73f5727f729460ccab01258dd8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 4 Aug 2017 10:17:36 +0200 Subject: Emacs: Move post-startup de-optimisation code to top of file --- emacs/.emacs.d/init.el | 6 ++++-- emacs/.emacs.d/init.org | 17 ++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index ffde904a..fb5a75ed 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -17,6 +17,10 @@ (setq gc-cons-threshold 100000000) (defvar file-name-handler-alist-backup file-name-handler-alist) (setq file-name-handler-alist nil) +(add-hook 'after-init-hook + #'(lambda () + (setq gc-cons-threshold 800000 + file-name-handler-alist file-name-handler-alist-backup))) (remove-hook 'find-file-hooks #'vc-refresh-state) ;; #+END_SRC @@ -2822,8 +2826,6 @@ :if (not (daemonp)) :config (unless (server-running-p server-name) (server-start))) -(setq gc-cons-threshold 800000 - file-name-handler-alist file-name-handler-alist-backup) ;; #+END_SRC ;; Local Variables: diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index da79d68f..6ca4f65f 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -17,6 +17,10 @@ Open Emacs with just a plain window. No graphics or messages, please! (setq gc-cons-threshold 100000000) (defvar file-name-handler-alist-backup file-name-handler-alist) (setq file-name-handler-alist nil) +(add-hook 'after-init-hook + #'(lambda () + (setq gc-cons-threshold 800000 + file-name-handler-alist file-name-handler-alist-backup))) (remove-hook 'find-file-hooks #'vc-refresh-state) #+END_SRC @@ -604,7 +608,7 @@ ones. :demand t :diminish projectile-mode :config (progn - (projectile-mode -1) + (projectile-mode +1) (add-to-list 'projectile-globally-ignored-directories ".stversions") (defun yarn-install (&optional arg) @@ -1706,6 +1710,7 @@ works really nicely. #+BEGIN_SRC emacs-lisp (use-package ledger-mode :mode ("\\.ledger\\'" . ledger-mode) + :functions ledger-report :init (progn (defun open-budget () (interactive) @@ -2169,15 +2174,11 @@ an AST internally, so it can work with it almost like a lisp. (use-package js2-mode :mode (("\\.js\\'" . js2-mode)) :interpreter ("node" . js2-mode) - :functions js2-next-error + :functions (js2-next-error + js2--struct-put) :config (progn (define-key js2-mode-map [menu-bar Javascript] nil) - (defun js2--imenu-around (do-it name) - "Don't create a menu from js2-mode" - (if (not (string-equal name "IM-Javascript-IDE")) - (do-it name))) (add-hook 'js2-mode-hook #'js2-imenu-extras-mode) - (advice-add 'imenu-add-to-menubar :around #'js2--imenu-around) (defun ap/js2-prev-error () (interactive) (js2-next-error -1)) @@ -2825,8 +2826,6 @@ Start a server if possible. A daemon is already a server. :if (not (daemonp)) :config (unless (server-running-p server-name) (server-start))) -(setq gc-cons-threshold 800000 - file-name-handler-alist file-name-handler-alist-backup) #+END_SRC Local Variables: -- cgit 1.4.1