commit a578c7b1e4231a438637b03706559680f1ff7d91
parent 91de2878d2cfe89fd18b68aae655be88aa33efb9
Author: Vincent Demeester <vincent@sbr.pm>
Date: Thu, 4 Jul 2024 22:33:38 +0200
tools/emacs: re-organize some basic configurations
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
3 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/tools/emacs/config/00-base.el b/tools/emacs/config/00-base.el
@@ -3,14 +3,8 @@
;;; Emacs *absolute* base configuration
;;; Code:
-(setq frame-title-form '("%b")) ;; do not add "GNU Emacs at …"
-(setq use-short-answers t) ;; for emacs and above, replace defalias yes-or-no-p
-(setq read-answer-short t) ;; accepts single-character answers, very similar to above
-
(put 'overwrite-mode 'disabled t) ;; I don't really want to use overwrite-mod, ever
-(setq use-dialog-box nil) ;; never use dialog box (no mouse >:D)
-(setq use-file-dialog nil) ;; never use file dialog (gtk)
(setq echo-keystrokes 0.1) ;; display command keystrokes quickly
(global-unset-key (kbd "C-z"))
diff --git a/tools/emacs/early-init.el b/tools/emacs/early-init.el
@@ -36,12 +36,14 @@
;;; Code:
;; Do not initialize installed packages
-(setopt package-enable-at-startup nil)
+(setopt package-enable-at-startup nil
+ package-archives nil)
(setopt use-package-ensure-function 'ignore)
-;; (setopt package-archives nil)
;; Do not resize the frame at this early stage
-(setopt frame-inhibit-implied-resize t)
+(setopt frame-inhibit-implied-resize t
+ frame-resize-pixelwise t
+ frame-title-format '("%b")) ;; do not add "GNU Emacs at …"
;; Disable GUI elements
(push '(menu-bar-lines . 0) default-frame-alist)
@@ -52,22 +54,36 @@
(scroll-bar-mode -1)
(horizontal-scroll-bar-mode -1)
-(setq gc-cons-threshold 402653184
- gc-cons-percentage 0.6)
+(setopt use-dialog-box nil ;; never use dialog-box (no mouse)
+ use-file-dialog nil ;; never use file dialog (gtk)
+ use-short-answers t ;; replace defalias yes-or-no-p
+ read-answer-short t) ;; accepts single-character answer, similar to above
-(defvar file-name-handler-alist-original file-name-handler-alist)
-(setq file-name-handler-alist nil)
+(setopt inhibit-startup-message t
+ inhibit-startup-screen t
+ inhibit-startup-echo-area-message user-login-name ; read the docstring
+ inhibit-startup-buffer-menu t)
+
+(setq gc-cons-threshold most-positive-fixnum
+ gc-cons-percentage 0.5)
+
+(defvar vde--file-name-handler-alist file-name-handler-alist)
+(defvar vde--vc-handled-backends vc-handled-backends)
+(setq file-name-handler-alist nil
+ vc-handled-backends nil)
;; Ignore X resources; its settings would be redundant with the other settings
;; in this file and can conflict with later config (particularly where the
;; cursor color is concerned).
(advice-add #'x-apply-session-resources :override #'ignore)
+(setopt inhibit-x-resources t)
;; - Resetting garbage collection and file-name-handler values.
(add-hook 'after-init-hook
`(lambda ()
(setq gc-cons-threshold 67108864 ; 64mb
gc-cons-percentage 0.1
- file-name-handler-alist file-name-handler-alist-original)
+ file-name-handler-alist vde--file-name-handler-alist
+ vc-handled-backends vde--vc-handled-backends)
(garbage-collect)) t)
diff --git a/tools/emacs/init.el b/tools/emacs/init.el
@@ -39,9 +39,6 @@
(setq inhibit-default-init t) ; Disable the site default settings
-(setq inhibit-startup-message t
- inhibit-startup-screen t)
-
(setq confirm-kill-emacs #'y-or-n-p)
(setq initial-major-mode 'fundamental-mode
initial-scratch-message nil)