From 0a2ec2c69d65d354313eb34cce526d919feda1af Mon Sep 17 00:00:00 2001 From: Henry Webster Date: Fri, 24 Jul 2026 12:37:57 -0500 Subject: changes before I threw it all away --- emacs/init.el | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index b321e1b..a94b20d 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -16,6 +16,20 @@ (global-display-line-numbers-mode 1) (setq-default indent-tabs-mode nil) +;; Translucent background (text stays opaque). Needs a pgtk build under a +;; compositing WM; provided via nixos-config's emacs-pgtk package. +;;(defvar my/frame-alpha 90 +;; "Background opacity percentage for Emacs frames (100 = opaque).") +;;(set-frame-parameter nil 'alpha-background my/frame-alpha) +;;(add-to-list 'default-frame-alist `(alpha-background . ,my/frame-alpha)) +;;(defun my/toggle-transparency () +;; "Toggle the selected frame between translucent and fully opaque." +;; (interactive) +;; (set-frame-parameter +;; nil 'alpha-background +;; (if (eql (frame-parameter nil 'alpha-background) 100) my/frame-alpha 100))) +;;(global-set-key (kbd "C-c t") #'my/toggle-transparency) + (setq custom-file (make-temp-file "emacs-custom-")) @@ -103,12 +117,22 @@ (defun my/mpdel-restore-ret () (evil-local-set-key 'normal (kbd "") #'tablist-find-entry) (evil-local-set-key 'normal (kbd "") #'tablist-find-entry)) - (add-hook 'mpdel-tablist-mode-hook #'my/mpdel-restore-ret) - - ;; "Recently added" view. MPD has no such entity, so subclass mpdel's filter - ;; (which already renders a browsable, addable song list) and issue a search - ;; sorted by modification time, newest first. + (add-hook 'mpdel-tablist-mode-hook #'my/mpdel-restore-ret)) + +;; "Recently added" view. MPD has no such entity, so subclass mpdel's filter +;; (which already renders a browsable, addable song list) and issue a search +;; sorted by modification time, newest first. +;; +;; This lives in its own top-level `with-eval-after-load' rather than in the +;; mpdel `:config' above: the `cl-defstruct' below `:include's libmpdel-filter, +;; which must exist when the struct is *macro-expanded*. Emacs eager-expands +;; each top-level form before evaluating it, so inside :config the struct is +;; expanded before (mpdel-mode) has loaded libmpdel -- failing with +;; "libmpdel-filter is not a struct name". By the time this separate form is +;; loaded, the use-package above has already pulled in mpdel/libmpdel. +(with-eval-after-load 'mpdel (require 'cl-lib) + (require 'libmpdel) (defvar my/mpdel-recent-count 50 "How many recently added songs `my/mpdel-recent' lists.") (cl-defstruct (my/mpdel-recent-entity (:include libmpdel-filter))) -- cgit v1.3