summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2024-04-02 19:57:10 -0700
committerFranck Cuny <franck@fcuny.net>2024-04-02 19:57:10 -0700
commit3b7c324f769b3e6525440c8d1abd1228824e7eee (patch)
treed83e224d71332413a3b736079b8cbad975a0e721
parentsome cleanup around GC (diff)
downloademacs.d-3b7c324f769b3e6525440c8d1abd1228824e7eee.tar.gz
reorganize more configs
-rw-r--r--init.el69
1 files changed, 54 insertions, 15 deletions
diff --git a/init.el b/init.el
index c53ec86..0ef6f67 100644
--- a/init.el
+++ b/init.el
@@ -24,15 +24,63 @@
 (set-keyboard-coding-system 'utf-8)
 (setq locale-coding-system 'utf-8)
 
+;; no backups
+;; Disable backup.
+(setq backup-inhibited t)
+;; Disable auto save.
+(setq auto-save-default nil)
+(setq auto-save-list-file-prefix nil)
+;; really no backups
+(setq make-backup-files nil)
+
+;; Don't say anything on mode-line mouseover.
+(setq mode-line-default-help-echo nil)
+;; Keep cursors and highlights in current window only.
+(setq cursor-in-non-selected-windows nil)
+;; Don't highlight inactive windows.
+(setq highlight-nonselected-windows nil)
+;; Disable bidirectional text support for slight performance bonus.
+(setq bidi-display-reordering nil)
+
 (setq load-prefer-newer t)
 (setq init-file-debug t)
 
+;;; imenu
+(with-eval-after-load 'imenu
+  ;; Recenter buffer after jumping.
+  (add-hook
+   'imenu-after-jump-hook
+   (lambda () (recenter (max scroll-margin (/ (window-height) 3)))))
+
+  (setq-default imenu-auto-rescan t)
+  (setq-default imenu-auto-rescan-maxout (* 1024 1024))
+  (setq-default imenu--rescan-item '("" . -99)))
+
+;;; package
+(with-eval-after-load 'package
+  (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
+  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
+  (add-to-list 'package-archives '("elpa" . "https://elpa.nongnu.org/nongnu/"))
+  (add-to-list 'package-archives '("gnu-devel" . "https://elpa.gnu.org/devel/") t))
+
+(require 'package)
 (package-initialize)
 
-(setq package-archives (append
-                        package-archives
-                        '(("melpa" . "https://melpa.org/packages/")
-                          ("elpa" . "https://elpa.nongnu.org/nongnu/"))))
+;; Auto-install use-package.
+(unless (package-installed-p 'use-package)
+  (package-refresh-contents)
+  (package-install 'use-package))
+
+;; This is only needed once, near the top of the file
+(eval-when-compile
+  (require 'use-package))
+
+(setq debug-on-error init-file-debug)
+(setq use-package-always-defer t)
+(setq use-package-always-ensure nil)
+(setq use-package-compute-statistics nil)
+(setq use-package-expand-minimally (not init-file-debug))
+(setq use-package-verbose init-file-debug)
 
 (eval-and-compile
   (defsubst emacs-path (path)
@@ -44,19 +92,13 @@
 		(delete-dups load-path)
 		(list (emacs-path "lisp")))))
 
-(require 'use-package)
-
-(setq use-package-verbose init-file-debug
-      use-package-expand-minimally (not init-file-debug)
-      use-package-compute-statistics nil
-      debug-on-error init-file-debug)
-
 (use-package diminish :ensure t)
 
 (defconst user-data-directory
   (emacs-path "data"))
 
 (defun user-data (dir)
+  "Concat DIR under the user's directory."
   (expand-file-name dir user-data-directory))
 
 (setq custom-file (user-data "customizations.el"))
@@ -347,11 +389,9 @@
     (nobreak-space ((t nil)))
 
     :custom
-    (auto-save-default nil)                     ;; don't auto save files
-    (auto-save-list-file-prefix nil)            ;; no backups
+
     (create-lockfiles nil)                      ;; don't use a lock file
     (confirm-kill-emacs #'yes-or-no-p)          ;; ask before killing emacs
-    (make-backup-files nil)                     ;; really no backups
     (minibuffer-message-timeout 0.5)            ;; How long to display an echo-area message
     (next-screen-context-lines 5)               ;; scroll 5 lines at a time
     (require-final-newline t)                   ;; ensure newline exists at the end of the file
@@ -372,7 +412,6 @@
     (prettify-symbols-unprettify-at-point 'right-edge)
 
     ;; startup.el
-    (auto-save-list-file-prefix (user-data "auto-save-list/.saves-"))
     (initial-buffer-choice t)
     (initial-major-mode 'fundamental-mode)
     (initial-scratch-message "")