2023年の振り返り(Emacs編)
起動速度のこと init.elの初期化処理で時間がかかる事は起動後にやるようにした。 参考文書は定番とも言える下記2点。 Emacs の起動時間を""詰める"" Emacsを世界最速級で起動する方法 (defvar my/delayed-configs nil) (defvar my/delayed-config-timer nil) (eval-and-compile (defconst my/prio-low 1) (defconst my/prio-normal 10) (defconst my/prio-urgent 100)) (defun my/add-to-delayed-configs (priority config) "Add CONFIG with PRIORITY to delayed configs." (push (cons priority config) my/delayed-configs) ;; sort the configs by priority (setq my/delayed-configs (sort my/delayed-configs (lambda (a b) (> (car a) (car b)))))) (defun my/start-delayed-configs () "Execute `my/delayed-configs` list using a timer. Start a timer to run each config in the list with a default interval of 10ms. The timer runs until all configs are executed, then it stops. Customize interval with `my/delayed-config-interval`. Delayed configs can impact your Emacs environment." (setq my/delayed-config-timer (run-with-timer 0.0 0.01 ; start after 0ms with 10ms interval (lambda () (let ((inhibit-message t)) ;; if there is a config, execute it (if-let (config (cdr (pop my/delayed-configs))) (eval config) ;; if there is no config, cancel the timer (cancel-timer my/delayed-config-timer))))))) (add-hook 'after-init-hook 'my/start-delayed-configs) こんなのを書いて、 ...