From 75137467d90494170a2c0cd34489954196b6416a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 10 Jun 2024 23:11:15 -0500 Subject: Update init --- emacs.d/early-init.el | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'emacs.d') diff --git a/emacs.d/early-init.el b/emacs.d/early-init.el index 2a4f2b5..7374bd1 100644 --- a/emacs.d/early-init.el +++ b/emacs.d/early-init.el @@ -1,4 +1,4 @@ -;;; ~/.emacs.d/early-init.el -*- lexical-binding: t -*- +;;; ~/.emacs.d/early-init.el -*- lexical-binding: t; -*- ;; Author: Case Duckworth (setopt frame-inhibit-implied-resize t) @@ -12,18 +12,19 @@ (defvar *fonts* '((default - :family ("Recursive Mono Casual Static" "DejaVu Sans Mono") + :family ;;("Recursive Mono Casual Static" "DejaVu Sans Mono") + ("Public Sans" "DejaVu Sans") :height 100) (variable-pitch :family ("Public Sans" "DejaVu Sans") :height 1.0) (fixed-pitch - :family ("Recursive Mono Linear Static" "DejaVu Sans Mono")) + :family ("Recursive Mono Casual Static" "DejaVu Sans Mono")) (fixed-pitch-serif :family ("Recursive Mono Linear Static" "DejaVu Sans Mono")))) (require 'package) -(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize) ;;; Custom functions @@ -81,7 +82,7 @@ If already so, run FUNC immediately." :height (or (plist-get spec :height) 'unspecified))) ;; Specialized fonts - (cl-loop with ffl = (font-family-alist) + (cl-loop with ffl = (font-family-list) for (charset . font) in '((latin . "Noto Sans") (han . "Noto Sans CJK SC Regular") @@ -183,7 +184,7 @@ Whether it tabifies or untabifies depends on `space-indent-modes'." (defun package-ensure (pkg) "Install PKG if it's not already installed." (unless (package-installed-p pkg) - (package-install pkg))) + (package-vc-install pkg))) (defun minibuffer-delete-directory () "Delete the last directory in a file-completing minibuffer." @@ -196,3 +197,20 @@ Whether it tabifies or untabifies depends on `space-indent-modes'." (when (search-backward "/" (minibuffer-prompt-end) t) (delete-region (point) here)) (backward-kill-word 1)))) + +(defun save-buffers-kill* (arg) + "Save all the buffers and kill ... something. +If ARG is 1 (called normally), kill the current terminal. +If ARG is 4 (with C-u), kill emacs but ask if there are processes running. +If ARG is 16, kill emacs without asking about processes." + (interactive "p") + (pcase arg + (1 (save-buffers-kill-terminal)) + (4 (save-buffers-kill-emacs t)) + (16 (let ((confirm-kill-processes nil) + (kill-emacs-query-functions nil) + (confirm-kill-emacs nil)) + (save-buffers-kill-emacs t))))) + +(defun regexp-concat (&rest regexps) + (string-join regexps "\\|")) -- cgit 1.4.1-21-gabe81