emacs: fix some minor warnings
Alan Pearce alan@alanpearce.eu
Thu, 13 Apr 2023 10:19:44 +0200
1 files changed, 19 insertions(+), 14 deletions(-)
jump to
M user/emacs/init.el → user/emacs/init.el
@@ -1,17 +1,23 @@ ;;; init --- user init file -*- lexical-binding: t; -*- (eval '(setq inhibit-startup-echo-area-message "alan")) -(let ((default-gc-cons-threshold (* 16 1024 1024)) - (default-file-name-handler-alist file-name-handler-alist)) - (setq gc-cons-threshold most-positive-fixnum - gc-cons-percentage 0.6 - file-name-handler-alist nil) - (add-hook 'minibuffer-setup-hook (lambda () (setq gc-cons-threshold most-positive-fixnum))) - (add-hook 'minibuffer-exit-hook (lambda () (setq gc-cons-threshold default-gc-cons-threshold))) - (add-hook 'emacs-startup-hook (lambda () (setq file-name-handler-alist default-file-name-handler-alist))) - (add-hook 'after-init-hook (lambda () - (server-start) - (setq gc-cons-threshold default-gc-cons-threshold - gc-cons-percentage 0.1)))) +(setq gc-cons-threshold most-positive-fixnum + gc-cons-percentage 0.6 + file-name-handler-alist nil) +(defun set-max-gc-cons () + (setq gc-cons-threshold most-positive-fixnum)) +(defun set-default-gc-cons () + (setq gc-cons-threshold (* 16 1024 1024) + gc-cons-percentage 0.1)) +(add-hook 'minibuffer-setup-hook #'set-max-gc-cons) +(add-hook 'minibuffer-exit-hook #'set-default-gc-cons) +(add-hook 'after-init-hook #'set-default-gc-cons) + +(defvar default-file-name-handler-alist file-name-handler-alist) +(defun restore-file-name-handler-alist () + (setq file-name-handler-alist default-file-name-handler-alist)) +(add-hook 'emacs-startup-hook #'restore-file-name-handler-alist) + +(add-hook 'after-init-hook #'server-start) (eval-when-compile (require 'fringe-helper)) @@ -87,7 +93,7 @@ (setq font-lock-maximum-decoration '((t . 1))) (when (and (eq system-type 'darwin) - (fboundp #'mac-mouse-wheel-mode)) + (fboundp 'mac-mouse-wheel-mode)) (mac-mouse-wheel-mode +1)) (context-menu-mode +1) @@ -450,7 +456,6 @@ :init (progn (add-hook 'org-agenda-mode-hook #'evil-org-agenda-set-keys)) :ghook ('org-mode-hook #'evil-org-mode) :gfhook #'evil-org-set-key-theme) - ;;; Completion