From 858ba5e0fc075cb3586a341433f27f7156176229 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Tue, 25 Aug 2026 01:47:15 -0700 Subject: [PATCH] More emacs 31.1 stuff --- init.el | 92 ++++++++++++++++++++++----------------------------------- 1 file changed, 36 insertions(+), 56 deletions(-) diff --git a/init.el b/init.el index 907d25a..0a3578f 100644 --- a/init.el +++ b/init.el @@ -45,6 +45,26 @@ ;; if this is not here, init.el fails to load from a freshly-initialized repo (use-package llama) +;; posframe +(use-package posframe + :init + (defun my/posframe-tip (name msg) + "Like `popup-tip', but with a posframe. +NAME should be the buffer name to pass to `posframe-show'. MSG is the message to +display." + (unwind-protect + (progn + (posframe-show name + :string msg + :position (point) + :max-width 80 + :border-width 2 + :border-color "white") + (clear-this-command-keys) + (push (read-event) unread-command-events) + (posframe-hide name)) + (posframe-hide name)))) + ;; no-littering (use-package no-littering :defer nil @@ -214,19 +234,6 @@ Apply OLDFUN with to ARGS." show-paren-not-in-comments-or-strings 'on-mismatch) (show-paren-mode 1) -;; Form feed characters -(face-spec-set 'whitespace-page-delimiter - '((((supports :strike-through t)) - :strike-through t :extend t :inherit shadow) - (t :extend t :inherit shadow :inverse-video t))) -(define-globalized-minor-mode my/global-whitespace-page-delimiters-mode - whitespace-page-delimiters-mode - whitespace-page-delimiters-mode - :group 'whitespace) -(my/global-whitespace-page-delimiters-mode 1) - - - ;; Display line numbers (global-display-line-numbers-mode 1) @@ -516,10 +523,10 @@ PRED is nil, the value of `my/kill-some-buffers-default-pred' is used." :ensure nil :bind (("C-x t s" . split-tab) ("C-x t e" . merge-tabs)) - :custom - (setq tab-bar-show 1 - tab-bar-tab-hints t - icon-preference '(symbol text image emoji)) + :config + (setopt tab-bar-show 1 + tab-bar-tab-hints t + icon-preference '(symbol text image emoji)) (tab-bar-mode 1) (tab-bar-history-mode 1)) @@ -1296,29 +1303,6 @@ environment variable accordingly." (setq xref-show-xrefs-function #'consult-xref xref-show-definitions-function #'consult-xref)) -;; popup.el -(use-package popup) - -;; posframe -(use-package posframe - :init - (defun my/posframe-tip (name msg) - "Like `popup-tip', but with a posframe. -NAME should be the buffer name to pass to `posframe-show'. MSG is the message to -display." - (unwind-protect - (progn - (posframe-show name - :string msg - :position (point) - :max-width 80 - :border-width 2 - :border-color "white") - (clear-this-command-keys) - (push (read-event) unread-command-events) - (posframe-hide name)) - (posframe-hide name)))) - (defun my/-floating-tooltip-fill-string (msg &optional width prefix) "Fill MSG to WIDTH, defaulting to 80 characters. If PREFIX is a number, add that many spaces before each continuation line. If @@ -1337,10 +1321,7 @@ it is a string, add that string. If it is nil, add 5 spaces." MSG is the message to show in the popup. NAME is the name of the buffer to pass to `posframe-show' if the display is graphical. WIDTH and PREFIX are as for `my/-floating-tooltip-fill-string'." - (let ((msg (my/-floating-tooltip-fill-string msg width prefix))) - (if (display-graphic-p) - (my/posframe-tip name msg) - (popup-tip msg)))) + (my/posframe-tip name (my/-floating-tooltip-fill-string msg width prefix))) ;; flymake (use-package flymake @@ -4131,7 +4112,7 @@ vising, and their major mode" ;; dashboard.el (use-package dashboard :custom - (initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) + (initial-buffer-choice #'dashboard-open) (dashboard-force-refresh t) (dashboard-display-icons-p t) (dashboard-icon-type 'nerd-icons) @@ -4141,19 +4122,18 @@ vising, and their major mode" (projects . 5) (bookmarks . 5))) :config - (defvar-local my/-dashboard-did-fix-image nil - "Weather or not the dashboard image has been fixed in this buffer.") - (defun my/-dashboard-fix-image () - (unless my/-dashboard-did-fix-image - (dashboard-refresh-buffer) - (setq my/-dashboard-did-fix-image t))) - (defun my/-dashboard-setup-function () - (add-hook 'window-configuration-change-hook 'my/-dashboard-fix-image nil t) - (setq-local display-line-numbers nil)) - (add-hook 'dashboard-mode-hook 'my/-dashboard-setup-function) - (set-face-background 'dashboard-banner-logo-title nil) + (add-hook 'server-after-make-frame-hook #'dashboard-open) (dashboard-setup-startup-hook)) +;; prettify ^L characters (emacs 31.1 mode breaks stuff) +(use-package form-feed + :custom-face + (form-feed-line ((((type graphic)) :strike-through "#555556") + (((type tty)) :inherit font-lock-comment-face :underline t))) + :config + (global-form-feed-mode 1)) + + ;; world clocks (setopt zoneinfo-style-world-list '(("America/Los_Angeles" "California")