Optimize configuration reload to prevent UI freezing

Implemented non-blocking reload mechanism that processes files
incrementally during idle time to prevent Emacs from freezing.

Changes:
- New default reload-emacs-config: Non-blocking with idle timers
- reload-emacs-config-blocking: Original blocking version
- reload-emacs-config-fast: Uses byte-compiled files for speed
- reload-emacs-config-smart: Only reloads recently changed files
- reload-current-file: Quick reload of current .el file only

Keybindings:
- C-c C-r: Non-blocking reload (new default)
- C-u C-c C-r: Blocking reload (old behavior)
- C-c r: Reload current file
- C-c R: Fast byte-compiled reload

This fixes the lag issue during configuration reload by loading
files one at a time with 0.01s idle gaps between them.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jens Luedicke
2025-09-10 14:59:43 +02:00
parent 54d6fd3cce
commit 8644b5c469
3 changed files with 192 additions and 6 deletions

View File

@@ -8,7 +8,14 @@
(global-set-key (kbd "C-x k") 'kill-current-buffer-no-confirm)
;;; Configuration reload
;; Default: Non-blocking reload
(global-set-key (kbd "C-c C-r") 'reload-emacs-config)
;; C-u prefix: Blocking reload (old behavior)
(global-set-key (kbd "C-u C-c C-r") 'reload-emacs-config-blocking)
;; Quick reload for current file only
(global-set-key (kbd "C-c r") 'reload-current-file)
;; Fast reload using byte-compiled files
(global-set-key (kbd "C-c R") 'reload-emacs-config-fast)
;;; Portfolio tracker
(global-set-key (kbd "C-c $") 'portfolio-tracker)