Big re-write :)

I reordered the code in a more clean an organized way. Also this improves a lot
the emacs startup time again, bucause after some updates it becomes a bit slow
with the old configuration, so i did it again in a new way.
This commit is contained in:
kj
2025-07-20 13:18:05 -03:00
parent 6ca3a756ad
commit dabaf86f28
29 changed files with 1426 additions and 838 deletions

View File

@ -20,23 +20,29 @@
;;
;;; Code:
;; Disable GC during init
(put 'gc-cons-percentage 'original-value-before-init gc-cons-percentage)
(put 'gc-cons-percentage 'value-during-init 0.6)
(defun restore-gc-cons-percentage-after-init ()
"Restaura el garbaje collection luego de iniciar."
(let ((expected-value (get 'gc-cons-percentage 'value-during-init))
(value-to-restore (get 'gc-cons-percentage 'original-value-before-init)))
(when (and value-to-restore (equal gc-cons-percentage expected-value))
(message "Setting `gc-cons-percentage' back to starting value %s" value-to-restore)
(setq gc-cons-percentage value-to-restore))))
(add-hook 'after-init-hook #'restore-gc-cons-percentage-after-init)
(setq gc-cons-percentage (get 'gc-cons-percentage 'value-during-init))
;; Defer garbage collection further back in the startup process
(setq gc-cons-threshold most-positive-fixnum)
;; Color de fondo similar al theme para evitar que se vea blanco al iniciar
;; (add-to-list 'default-frame-alist '(background-color . "#282a36"))
;; Prevent unwanted runtime compilation for gccemacs (native-comp) users;
;; packages are compiled ahead-of-time when they are installed and site files
;; are compiled when gccemacs is installed.
(setq native-comp-deferred-compilation nil ;; obsolete since 29.1
native-comp-jit-compilation nil)
;; Permitir solo la búsqueda de archivos a cargar en la config en case sensitive.
;; 'use-package' is builtin since 29.
;; It must be set before loading 'use-package'.
(setq use-package-enable-imenu-support t)
;; In noninteractive sessions, prioritize non-byte-compiled source files to
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
;; to skip the mtime checks on every *.elc file.
(setq load-prefer-newer noninteractive)
;; Explicitly set the prefered coding systems to avoid annoying prompt
;; from emacs (especially on Microsoft Windows)
(prefer-coding-system 'utf-8)
;; Permitir solo la búsqueda de archivos a cargar en la carpeta config case sensitive.
(setq auto-mode-case-fold nil)
;; Definimos que la shell por defecto será bash
@ -45,6 +51,12 @@
;; Personalizaciones (Tedrían que ir en init-base, pero por optimización, las pongo acá)
(push '(menu-bar-lines . 0) default-frame-alist) ; Quitar menús.
(push '(tool-bar-lines . 0) default-frame-alist) ; Quitar toolbar.
(push '(vertical-scroll-bars) default-frame-alist)
(when (featurep 'ns)
(push '(ns-transparent-titlebar . t) default-frame-alist))
;; Prevent flash of unstyled mode line
(setq mode-line-format nil)
;; Iniciar emacs maximizado
;; (add-hook 'window-setup-hook 'toggle-frame-maximized t) ; Hacerlo mediante window-setup-hook (se maximiza al terminar de cargar la ventana)