aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/auto-dim-config.el48
-rw-r--r--modules/music-config.el89
2 files changed, 81 insertions, 56 deletions
diff --git a/modules/auto-dim-config.el b/modules/auto-dim-config.el
index efae5341..c7216655 100644
--- a/modules/auto-dim-config.el
+++ b/modules/auto-dim-config.el
@@ -23,6 +23,14 @@
;; terminal background, so -- unlike the old ghostel/vterm engines, which baked
;; color per-terminal with no per-window hook -- they follow the per-window
;; dimmed background like any other buffer.
+;;
+;; One caveat, so nobody chases it through this alist: ANSI-coloured spans in a
+;; terminal keep their colour when dimmed. EAT attaches those as anonymous face
+;; plists carrying a literal foreground, e.g. (:foreground "#AFD7FF" :inherit
+;; (eat-term-font-0)), and `face-remap-add-relative' only reaches named faces.
+;; There is no face name to add below. Reaching them would need an overlay
+;; (whose face outranks a text property), not a remap. Background and uncoloured
+;; text still dim, which is close enough; this is deliberate, not an oversight.
;;; Code:
@@ -75,6 +83,46 @@ focus cue on a split-displayed dashboard, accepted as a fair trade."
(font-lock-builtin-face . (auto-dim-other-buffers . nil))
(font-lock-preprocessor-face . (auto-dim-other-buffers . nil))
(font-lock-warning-face . (auto-dim-other-buffers . nil))
+ ;; Org structure faces flat-dim like font-lock rather than getting
+ ;; -dim variants: the active theme gives org-level-1..8 one shared
+ ;; foreground and no height or weight, so there is no level-by-colour
+ ;; signal to preserve. The remap is relative, so org-link keeps its
+ ;; underline and the heading stars / org-indent keep conveying depth.
+ ;; That premise is theme-dependent -- a theme that colours heading
+ ;; levels distinctly would make the flat dim discard real signal, and
+ ;; those levels would then want -dim variants like the keywords below.
+ (org-level-1 . (auto-dim-other-buffers . nil))
+ (org-level-2 . (auto-dim-other-buffers . nil))
+ (org-level-3 . (auto-dim-other-buffers . nil))
+ (org-level-4 . (auto-dim-other-buffers . nil))
+ (org-level-5 . (auto-dim-other-buffers . nil))
+ (org-level-6 . (auto-dim-other-buffers . nil))
+ (org-level-7 . (auto-dim-other-buffers . nil))
+ (org-level-8 . (auto-dim-other-buffers . nil))
+ (org-link . (auto-dim-other-buffers . nil))
+ (org-tag . (auto-dim-other-buffers . nil))
+ ;; org-todo and org-priority are deliberately absent: they are keyword
+ ;; class, like the org-faces-* set below, and flat-dimming them would
+ ;; erase the status colour those -dim variants exist to preserve.
+ ;; Document header: #+TITLE:, #+AUTHOR:, #+ARCHIVE: and their values.
+ (org-document-title . (auto-dim-other-buffers . nil))
+ (org-document-info . (auto-dim-other-buffers . nil))
+ (org-document-info-keyword . (auto-dim-other-buffers . nil))
+ (org-meta-line . (auto-dim-other-buffers . nil))
+ ;; Inline markup and source blocks.
+ (org-code . (auto-dim-other-buffers . nil))
+ (org-verbatim . (auto-dim-other-buffers . nil))
+ (org-block-begin-line . (auto-dim-other-buffers . nil))
+ (org-block-end-line . (auto-dim-other-buffers . nil))
+ ;; Drawers, properties, and planning lines.
+ (org-drawer . (auto-dim-other-buffers . nil))
+ (org-special-keyword . (auto-dim-other-buffers . nil))
+ (org-property-value . (auto-dim-other-buffers . nil))
+ (org-date . (auto-dim-other-buffers . nil))
+ ;; Tables and the fold indicator.
+ (org-table . (auto-dim-other-buffers . nil))
+ (org-table-row . (auto-dim-other-buffers . nil))
+ (org-ellipsis . (auto-dim-other-buffers . nil))
;; Org TODO-keyword + priority faces dim to their own -dim variant
;; (a darker shade of the same colour) rather than the flat gray, so
;; a dimmed window's keywords stay recognizable. Faces are defined
diff --git a/modules/music-config.el b/modules/music-config.el
index cd0d9d19..3559930b 100644
--- a/modules/music-config.el
+++ b/modules/music-config.el
@@ -30,7 +30,6 @@
(require 'subr-x)
(require 'user-constants)
(require 'keybindings) ;; provides cj/custom-keymap
-(require 'cj-window-geometry-lib) ;; cj/preferred-dock-direction (F10 dock side)
(require 'cj-window-toggle-lib) ;; side-window size memory (F10 toggle)
(require 'system-lib) ;; cj/confirm-strong (overwrite confirms)
@@ -778,40 +777,22 @@ Intended for use on `emms-player-finished-hook'."
(defvar cj/music-playlist-window-height 0.3
"Default fraction of frame height for the F10 music playlist side window.
-Used when the playlist docks at the bottom and hasn't been resized and
-toggled off this session; after that, the toggled-off height is remembered
-in `cj/--music-playlist-height'.")
-
-(defvar cj/music-playlist-window-width 0.4
- "Default fraction of frame width for the F10 music playlist side window.
-Used when the playlist docks as a right-side column (see
-`cj/--music-playlist-side') and hasn't been resized this session; after
-that the toggled-off width is remembered in `cj/--music-playlist-width'.")
+Used when the playlist hasn't been resized and toggled off this session;
+after that, the toggled-off height is remembered in
+`cj/--music-playlist-height'.")
(defvar cj/--music-playlist-height nil
- "Last height fraction the playlist was toggled off at while docked bottom.
+ "Last height fraction the playlist was toggled off at.
nil means fall back to `cj/music-playlist-window-height'. In-memory only --
resets each Emacs session.")
-(defvar cj/--music-playlist-width nil
- "Last width fraction the playlist was toggled off at while docked right.
-nil means fall back to `cj/music-playlist-window-width'. In-memory only --
-resets each Emacs session.")
-
-(defun cj/--music-playlist-side ()
- "Return the side the F10 playlist should dock on: `right' or `bottom'.
-Docks as a right-side column only when a side-by-side split would leave
-both panes at least `cj/window-dock-min-columns' wide (the playlist's
-share is `cj/music-playlist-window-width'); otherwise docks at the bottom.
-See `cj/preferred-dock-direction'."
- (if (eq (cj/preferred-dock-direction (frame-width)
- cj/music-playlist-window-width)
- 'right)
- 'right
- 'bottom))
-
(defun cj/music-playlist-toggle ()
"Toggle the EMMS playlist buffer in a bottom side window.
+The playlist always docks at the bottom, whatever the frame's shape. It
+used to dock as a right-side column on a wide frame (via
+`cj/preferred-dock-direction'), which split a wide frame three ways --
+unexpected often enough that Craig retired the rule (2026-07-09).
+
The window opens at `cj/music-playlist-window-height'; if it has been
resized and toggled off this session, it reopens at that remembered height."
(interactive)
@@ -820,28 +801,15 @@ resized and toggled off this session, it reopens at that remembered height."
(win (and buffer (get-buffer-window buffer))))
(if win
(progn
- ;; Capture the resized size into the var matching the window's
- ;; actual side, so width and height memories stay independent.
- ;; Guard the parameter lookup: a dead or non-window WIN (the
- ;; capture helpers tolerate one) must not error here.
- (let ((side (if (window-live-p win)
- (or (window-parameter win 'window-side) 'bottom)
- 'bottom)))
- (if (memq side '(left right))
- (cj/side-window-capture-size win side 'cj/--music-playlist-width)
- (cj/side-window-capture-size win 'bottom 'cj/--music-playlist-height)))
+ (cj/side-window-capture-size win 'bottom 'cj/--music-playlist-height)
(delete-window win)
(message "Playlist window closed"))
(progn
(cj/emms--setup)
(setq buffer (cj/music--ensure-playlist-buffer))
- (let* ((side (cj/--music-playlist-side))
- (right (eq side 'right)))
- (setq win (cj/side-window-display
- buffer side
- (if right 'cj/--music-playlist-width 'cj/--music-playlist-height)
- (if right cj/music-playlist-window-width
- cj/music-playlist-window-height))))
+ (setq win (cj/side-window-display
+ buffer 'bottom 'cj/--music-playlist-height
+ cj/music-playlist-window-height))
(select-window win)
(with-current-buffer buffer
(if (and (fboundp 'emms-playlist-current-selected-track)
@@ -898,19 +866,25 @@ Dirs added recursively."
;;; EMMS setup and keybindings
;; Music/EMMS keymap
+(defvar-keymap cj/music-radio-map
+ :doc "Radio prefix: mirrors the playlist buffer's n/t/m radio row."
+ "n" #'cj/music-radio-search-by-name
+ "t" #'cj/music-radio-search-by-tag
+ "m" #'cj/music-create-radio-station)
+
(defvar-keymap cj/music-map
- :doc "Keymap for music commands"
+ :doc "Keymap for music commands (all lowercase, chord-friendly)"
"m" #'cj/music-playlist-toggle
- "M" #'cj/music-playlist-show
+ "v" #'cj/music-playlist-show
"a" #'cj/music-fuzzy-select-and-add
- "R" #'cj/music-create-radio-station
+ "r" cj/music-radio-map
"SPC" #'emms-pause
"s" #'emms-stop
"n" #'cj/music-next
"p" #'cj/music-previous
"g" #'emms-playlist-mode-go
- "Z" #'emms-shuffle
- "r" #'emms-toggle-repeat-playlist
+ "u" #'emms-shuffle
+ "l" #'emms-toggle-repeat-playlist
"t" #'emms-toggle-repeat-track
"z" #'emms-toggle-random-playlist
"x" #'cj/music-toggle-consume)
@@ -920,16 +894,19 @@ Dirs added recursively."
(which-key-add-key-based-replacements
"C-; m" "music menu"
"C-; m m" "toggle playlist"
- "C-; m M" "show playlist"
+ "C-; m v" "show playlist"
"C-; m a" "add music"
- "C-; m R" "queue radio station"
+ "C-; m r" "+radio"
+ "C-; m r n" "radio by name"
+ "C-; m r t" "radio by tag"
+ "C-; m r m" "radio manual entry"
"C-; m SPC" "pause"
"C-; m s" "stop"
"C-; m n" "next track"
"C-; m p" "previous track"
"C-; m g" "goto playlist"
- "C-; m Z" "shuffle"
- "C-; m r" "repeat playlist"
+ "C-; m u" "shuffle"
+ "C-; m l" "repeat playlist"
"C-; m t" "repeat track"
"C-; m z" "random"
"C-; m x" "consume"))
@@ -1188,7 +1165,7 @@ The rule uses a resize-safe :align-to span, not a hardcoded character count."
(funcall mode-indicator "x" "consume" cj/music-consume-mode) "\n"
(propertize "Keys " 'face 'cj/music-header-face)
(propertize " : " 'face 'cj/music-header-face)
- (propertize "a:add c:clear L:load w:save S:stop SPC:pause <>:skip ↑↓:move C-↑↓:reorder q:dismiss"
+ (propertize "a:add c:clear L:load v:save S:stop SPC:pause <>:skip ↑↓:move C-↑↓:reorder q:dismiss"
'face 'cj/music-keyhint-face) "\n"
(propertize "Radio " 'face 'cj/music-header-face)
(propertize " : " 'face 'cj/music-header-face)
@@ -1404,7 +1381,7 @@ unless fancy."
("L" . cj/music-playlist-load)
("E" . cj/music-playlist-edit)
("g" . cj/music-playlist-reload)
- ("w" . cj/music-playlist-save)
+ ("v" . cj/music-playlist-save)
;; Track reordering
("S-<up>" . emms-playlist-mode-shift-track-up)
("S-<down>" . emms-playlist-mode-shift-track-down)