From d4abac11e4af6fabddc314b4445a7e7aea4d5d28 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 17 Aug 2025 00:07:48 -0500 Subject: adding tasks --- todo.org | 269 ++++++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 198 insertions(+), 71 deletions(-) diff --git a/todo.org b/todo.org index 412a539a0..1adf9952e 100644 --- a/todo.org +++ b/todo.org @@ -1,35 +1,6 @@ * Emacs Open Work -** PROJECT [#B] Fix Up Dupre Theme +** PROJECT [#B] Fix Dupre Theme Here are some ideas for making dupre-theme a bit more “complete” and future-proof as an Emacs theme. You don’t have to do all of them, of course, but most “modern” themes ship a fair number of these extra faces and integrations. -*** Example Sample Faces -Below is a small excerpt showing how you might start adding some of the “missing” standard faces and a couple org faces: - -#+begin_src elisp -(custom-theme-set-faces - 'dupre - - ;; … your existing faces … - - ;; standard global faces - `(error ((t (:foreground ,dupre-intense-red :weight bold)))) - `(warning ((t (:foreground ,dupre-yellow+1 :weight bold)))) - `(success ((t (:foreground ,dupre-green+1 :weight bold)))) - `(link ((t (:foreground ,dupre-blue+1 :underline t)))) - `(shadow ((t (:foreground ,dupre-gray)))) - `(highlight ((t (:background ,dupre-bg+1)))) - `(tooltip ((t (:foreground ,dupre-fg :background ,dupre-bg+2)))) - `(tooltip-selection ((t (:background ,dupre-bg+0)))) - - ;; Org-mode sample - `(org-document-title ((t (:foreground ,dupre-yellow+2 :weight bold :height 1.2)))) - `(org-level-1 ((t (:foreground ,dupre-blue+2 :weight bold)))) - `(org-level-2 ((t (:foreground ,dupre-green+1)))) - `(org-checkbox ((t (:foreground ,dupre-yellow :weight bold)))) - `(org-todo ((t (:foreground ,dupre-red :weight bold)))) - `(org-done ((t (:foreground ,dupre-green+2 :weight bold)))) - ) -#+end_src - *** TODO [#A] Fill out the “standard” Emacs faces • error / warning / success • link / link-visited / shadow @@ -38,47 +9,6 @@ Below is a small excerpt showing how you might start adding some of the “missi • underline / strike-through • match / search / lazy-highlight (you already have some isearch) • info-title-1…info-title-5, info-header-node, help-*-face -*** TODO [#C] Support the built-in “tab-bar” and “tab-group” faces (Emacs 27+) - • tab-bar / tab-bar-tab / tab-bar-tab-inactive - • tab-bar-close / tab-bar-separator - • tab-group-title / tab-group-separator -*** TODO [#C] Add faces for =dired=, =diff=, =flycheck=/=flymake=, =magit= (or git-gutter), - =ediff=, =erc= etc. For example: - • diff-added, diff-removed, diff-context, diff-file-header - • flycheck-error, flycheck-warning, flycheck-info - • magit-section, magit-log, magit-hunk-heading, magit-branch, etc. -*** TODO [#C] Org-mode - • org-level-1…org-level-8, org-document-title - • org-checkbox, org-code, org-date, org-todo, org-done, org-warning - • org-block, org-block-begin-line, org-block-end-line -*** TODO [#C] Completion frameworks & minibuffer enhancements - • ivy-current-match / ivy-minibuffer-match-face-1…4 - • swiper-line-face - • vertico-current / marginalia-… - • corfu-default / corfu-bar / cape / orderless-match-face-… -*** TODO [#C] LSP / tree-sitter / syntax-aware faces - • lsp-face-highlight-textual, lsp-face-highlight-read, etc. - • tree-sitter-hl-face:variable, :function, :property, etc. -*** TODO [#C] Which-Key, Hydras, rainbow-delimiters, etc. - • which-key-key-face, which-key-local-map-description-face - • hydra-face-red / teal / blue - • rainbow-delimiters-depth-1…9 - -*** TODO [#B] Make sure you define a “minimum package” set of faces so that folks don’t see glaring unstyled text in any part of Emacs, even if they never install extra packages. - -*** TODO [#B] Improve terminal support: - • Detect true-color (=(display-graphic-p)=) vs 256-color vs 16-color and fall-back gracefully. - • Provide “256-color” approximations (you already do this), but you might want a simpler palette for legacy terminals. - -*** TODO [#C] Theme Metadata & Packaging - • Add =;; Package-Requires: ((emacs "26.1"))= if you need a minimum. - • Consider adding a README with screenshots. - • A simple Makefile or script to refresh “theme metadata” (=M-x theme-inspect=, MELPA recipe). - -*** TODO [#C] Tests - • Extend your ERT suite to cover more faces (org, diff, flycheck…). - • You might write a small helper that loops over a list of faces and asserts they’re defined without errors. - *** TODO [#A] Cosmetic / code-style notes • Factor out a helper macro to reduce repetition: #+begin_src elisp @@ -88,6 +18,139 @@ Below is a small excerpt showing how you might start adding some of the “missi • Use =custom-theme-set-faces= only once; wrap your =when (>= emacs-major-version…)= inside it rather than nesting top-level. • Move your ERT tests into a separate file like =dupre-theme-test.el= so that the main theme file stays lean. +*** TODO [#A] Fix launch problem with dupre +**** cj [2025-08-16 23:45:50] +[[file:.emacs.d/themes/dupre-theme.el::;;; dupre-theme.el --- A dark and elegant theme for Emacs -*- lexical-binding: t -*-][dupre-theme.el]] + +I have an issue launching "emacsclient -c -a ''" with this theme. With the built-in wombat theme, emacsclient launches fine. When I specify this theme to load during launch, emacsclient does not launch. + +Here is what I see in the terminal when launching: + +[25-08-16 23:44:44] cjennings velox:~ [1] +% emacsclient -c -a '' +emacsclient: can't find socket; have you started the server? +emacsclient: To start the server in Emacs, type "M-x server-start". + +#+begin_src shell +Warning: due to a long standing Gtk+ bug +https://gitlab.gnome.org/GNOME/gtk/issues/221 +Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost. +Using an Emacs configured with --with-x-toolkit=lucid does not have this problem. +.emacs.d/elpa/hydra-0.15.0/hydra.el: Warning: ‘defadvice’ is an obsolete macro (as of 30.1); use ‘advice-add’ or ‘define-advice’ +Loading delsel (native compiled elisp)... +Loading delsel (native compiled elisp)...done +[yas] Prepared just-in-time loading of snippets successfully. +Starting new Ispell process aspell with en_US dictionary... \ +Starting new Ispell process aspell with en_US dictionary...done +Starting Emacs daemon. +Emacs daemon should have started, trying to connect again +Waiting for Emacs... +[25-08-16 23:44:56] cjennings velox:~ +% sudo killall emacs +#+end_src + +Is there something about how this theme is written that may be causing this? If it's unlikely, how would you recommend I diagnose this problem? + + + +**** ChatGPT: o4-mini [2025-08-16 23:51:03] +It turns out that nothing mystical is happening in your =dupre-theme.el= that would prevent the Emacs server from creating its socket. When =emacsclient= says: + + emacsclient: can't find socket; have you started the server? + +it really does mean “there is no running Emacs –daemon laying down =<…>/server/= for me to talk to.” By itself, loading a custom theme (even one with a few Unicode ellipses or =display-graphic-p= branches) will not stop the server socket from being created. What is much more often the culprit is: + + 1. Mis-using =emacsclient -a ''= so that it never actually starts the server, or + 2. Having a startup error in your init file (or theme) that aborts =server-start= before the socket ever gets written. + +Here is how I’d go about diagnosing (and fixing) the situation: + +1) Make sure you can start Emacs –daemon cleanly, /without/ any of your custom code. + + From a shell, run + + emacs --daemon --debug-init --eval "(message \"daemon ok\")" + + – you should see a process stick around, and if you look at =~/.emacs.d/server/= you should find a valid socket file. + + If that does not happen, Emacs itself is aborting in your init. Remove or comment out your calls to =load-theme=, your theme-specific code, all your =custom-set-…= blocks, and any other ELisp until you can get a clean daemon start. Once that is rock-solid, re-introduce your theme. + +2) Once you can start the daemon by hand, verify that =emacsclient -c= can actually talk to it: + + emacsclient -c -n + + The =-n= is “don’t wait for the client buffer to finish,” so you’ll get your GUI frame immediately. If that works, the server is up and your sockets are good. + +3) If you /really/ want =emacsclient -c -a ''= to both start Emacs –daemon /and/ immediately pop a graphical frame, you have two choices: + + • Let =-a= fall back to =emacs --daemon=. On many platforms simply omitting the =-a= will do this. + • Explicitly tell it: + + emacsclient -c -a "emacs --daemon" # note the command in quotes + + On macOS/Homebrew, for instance, people often do + + alias ec='emacsclient -c -a "emacs --daemon"' + + so that if there is no server, emacsclient will shell out to =emacs --daemon=, launch it, and /then/ connect. + +4) If you still suspect your theme is triggering a startup error (and killing the daemon before it gets to =(server-start)=), you can sprinkle a tiny bit of ELisp into your init: + + #+begin_src elisp + ;; very early in ~/.emacs or init.el + (setq debug-on-error t) + (add-hook 'after-init-hook + (lambda () + (message "finished init; about to (server-start)"))) + + (require 'server) + (unless (server-running-p) + (server-start)) + #+end_src + + Then run: + + emacs --daemon --debug-init + + and watch =~/.emacs.d/server/server= get created or watch the =*Messages*= buffer or your =~/.emacs.d/emacs-debug.log= (if you redirect =--debug-init= output). If there is a hard error in your theme, you will get a backtrace in your =*Backtrace*= buffer. + +5) Finally, a sanity check for your theme file. Launch Emacs /without/ your init: + + emacs -Q + + Then: + + M-x load-file RET /path/to/dupre-theme.el RET + M-x load-theme RET dupre RET + + If this produces any errors or warnings in =*Messages*= or =*Warnings*=, you have your smoking gun. + +--- + +Summary +------- + +• *The theme itself isn’t going to silently block server-socket creation.* +• *You almost certainly have either:* + – A mis-invocation of =emacsclient -a ''= so that it never starts Emacs –daemon. + – A genuine startup error in your init or in the theme that kills Emacs before =(server-start)= runs. +• *Use* + emacs --daemon --debug-init + plus removing chunks of your init until you find the offending form. +• *Test your theme in a vanilla Emacs (=-Q=)* to see any compile/load errors. + +Once you have a clean =emacs --daemon= up and running you will find that + + emacsclient -c # or with your favorite fallback: -a "emacs --daemon" + +just works, whether you are on wombat, solarized, or good old dupre. + +*** TODO [#B] Make sure you define a “minimum package” set of faces so that folks don’t see glaring unstyled text in any part of Emacs, even if they never install extra packages. + +*** TODO [#B] Improve terminal support: + • Detect true-color (=(display-graphic-p)=) vs 256-color vs 16-color and fall-back gracefully. + • Provide “256-color” approximations (you already do this), but you might want a simpler palette for legacy terminals. + *** TODO [#B] Other Packages The rest is just more of the same—pick the most common modes/packages you and your users rely on and give them a quick coat of paint. Once you’ve rounded out those faces you’ll have hit what most people expect from a “complete” modern Emacs theme. @@ -161,6 +224,70 @@ To figure out exactly which ones you have in your modules, you can do for exampl Then for each of those packages, grep in their repo for =defface= or check their manual to see which faces they define, and add reasonable dupre-colours for them. Once you’ve covered that list, you’ll have a “complete” theme that won’t leave any of your modules half-unstyled. +*** TODO [#C] Support the built-in “tab-bar” and “tab-group” faces (Emacs 27+) + • tab-bar / tab-bar-tab / tab-bar-tab-inactive + • tab-bar-close / tab-bar-separator + • tab-group-title / tab-group-separator +*** TODO [#C] Add faces for =dired=, =diff=, =flycheck=/=flymake=, =magit= (or git-gutter), + =ediff=, =erc= etc. For example: + • diff-added, diff-removed, diff-context, diff-file-header + • flycheck-error, flycheck-warning, flycheck-info + • magit-section, magit-log, magit-hunk-heading, magit-branch, etc. +*** TODO [#C] Org-mode + • org-level-1…org-level-8, org-document-title + • org-checkbox, org-code, org-date, org-todo, org-done, org-warning + • org-block, org-block-begin-line, org-block-end-line +*** TODO [#C] Completion frameworks & minibuffer enhancements + • ivy-current-match / ivy-minibuffer-match-face-1…4 + • swiper-line-face + • vertico-current / marginalia-… + • corfu-default / corfu-bar / cape / orderless-match-face-… +*** TODO [#C] LSP / tree-sitter / syntax-aware faces + • lsp-face-highlight-textual, lsp-face-highlight-read, etc. + • tree-sitter-hl-face:variable, :function, :property, etc. +*** TODO [#C] Which-Key, Hydras, rainbow-delimiters, etc. + • which-key-key-face, which-key-local-map-description-face + • hydra-face-red / teal / blue + • rainbow-delimiters-depth-1…9 + +*** TODO [#C] Theme Metadata & Packaging + • Add =;; Package-Requires: ((emacs "26.1"))= if you need a minimum. + • Consider adding a README with screenshots. + • A simple Makefile or script to refresh “theme metadata” (=M-x theme-inspect=, MELPA recipe). + +*** TODO [#C] Tests + • Extend your ERT suite to cover more faces (org, diff, flycheck…). + • You might write a small helper that loops over a list of faces and asserts they’re defined without errors. + +*** Example Sample Faces +Below is a small excerpt showing how you might start adding some of the “missing” standard faces and a couple org faces: + +#+begin_src elisp +(custom-theme-set-faces + 'dupre + + ;; … your existing faces … + + ;; standard global faces + `(error ((t (:foreground ,dupre-intense-red :weight bold)))) + `(warning ((t (:foreground ,dupre-yellow+1 :weight bold)))) + `(success ((t (:foreground ,dupre-green+1 :weight bold)))) + `(link ((t (:foreground ,dupre-blue+1 :underline t)))) + `(shadow ((t (:foreground ,dupre-gray)))) + `(highlight ((t (:background ,dupre-bg+1)))) + `(tooltip ((t (:foreground ,dupre-fg :background ,dupre-bg+2)))) + `(tooltip-selection ((t (:background ,dupre-bg+0)))) + + ;; Org-mode sample + `(org-document-title ((t (:foreground ,dupre-yellow+2 :weight bold :height 1.2)))) + `(org-level-1 ((t (:foreground ,dupre-blue+2 :weight bold)))) + `(org-level-2 ((t (:foreground ,dupre-green+1)))) + `(org-checkbox ((t (:foreground ,dupre-yellow :weight bold)))) + `(org-todo ((t (:foreground ,dupre-red :weight bold)))) + `(org-done ((t (:foreground ,dupre-green+2 :weight bold)))) + ) +#+end_src + ** PROJECT [#A] Reconfigure ai-config.el *** DONE Rewire commands to use base keybinding of C-c g, which is currently unused. CLOSED: [2025-08-13 Wed 16:45] -- cgit v1.2.3