Skip to content

Instantly share code, notes, and snippets.

View xenodium's full-sized avatar
😸
[in Emacs]

xenodium

😸
[in Emacs]
View GitHub Profile
;;; repro-719.el --- Minimal reproducer for agent-shell #719 -*- lexical-binding: t; -*-
;; Maybe isolates the hang reported in
;; https://github.com/xenodium/agent-shell/issues/719 down to a single
;; overlay whose `before-string'/`display' strings contain embedded
;; newlines. No agent-shell (or any package) required.
;;
;; Run in a THROWAWAY Emacs -- this may hang the session:
;;
;; emacs -Q -l repro-719.el
(require 'agent-shell-ui)
(ert-deftest agent-shell-markdown-fragment-tool-call-body-survives-toggle ()
;; Regression for PR #597: a tool-call fragment with label-left
;; \" done run \", label-right \"Find the first commit date\" and
;; a body of two console-fenced blocks (matching the shape
;; agent-shell emits on a real tool_call_update) must render under
;; the experimental markdown renderer without dropping the
;; `invisible' property the UI layer puts on collapsed bodies.
;; Two checks:
:direction outgoing
:kind request
:object
jsonrpc 2.0
method initialize
id 1
params
clientInfo
name agent-shell
title Emacs Agent Shell
# [2026-02-25 Wed 20:48] @ Harding House
<!-- ---
LATITUDE: 51.XXXXXXX
LONGITUDE: -0.XXXXXXX
WEATHER_TEMPERATURE: 11.6Β°C
WEATHER_CONDITION: Mostly Clear
WEATHER_SYMBOL: moon.stars
--- -->
View from the window
@xenodium
xenodium / emacs-lisp
Created December 23, 2025 18:00
Basic agent-shell CI failure
-*- mode: compilation; default-directory: "~/stuff/active/code/agent-shell/" -*-
Compilation started at Tue Dec 23 13:38:21
make
emacs -Q --eval "(progn (require 'package) (push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) (package-initialize) (dolist (pkg '(shell-maker acp package-lint)) (unless (package-installed-p pkg) (unless (assoc pkg package-archive-contents) (package-refresh-contents)) (package-install pkg))) (unless package-archive-contents (package-refresh-contents)) )" -batch -L . -L tests \
--eval "(setq byte-compile-error-on-warn t)" \
-f batch-byte-compile agent-shell*.el; \
(ret=$? ; rm *.elc && exit $ret)
Setting β€˜package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Setting β€˜package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β•β•
β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•
β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β• β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β•β•
@xenodium
xenodium / prettify-org-source-block.el
Created October 8, 2025 20:04
Prettify org source block with overlay
(defun org-deck-hide-code-block-delimiters ()
"Hide #+begin_src and #+end_src lines."
(save-excursion
(goto-char (point-min))
(while (re-search-forward "^[ \t]*#\\+begin_src\\s-*\\S-*" nil t)
(let* ((begin-start (line-beginning-position))
(lang-end (match-end 0))
(end-pos (save-excursion
(when (re-search-forward "^[ \t]*#\\+end_src" nil t)
(point)))))
diff --git a/chatgpt-shell-google.el b/chatgpt-shell-google.el
index 2a97a9b..21665a2 100644
--- a/chatgpt-shell-google.el
+++ b/chatgpt-shell-google.el
@@ -50,7 +50,7 @@ If you use Gemini through a proxy service, change the URL base."
;; https://ai.google.dev/gemini-api/docs/tokens
;; A token is equivalent to _about_ 4 characters.
-(cl-defun chatgpt-shell-google-make-model (&key version short-version path token-width context-window)
+(cl-defun chatgpt-shell-google-make-model (&key version short-version path token-width context-window grounding-search)

ChatGPT(o1-preview)> I would like to restream #EmacsConf from Icecast video to a Youtube live stream for extra discoverability, but I'm having a hard time figuring out an ffmpeg command that I can run on my P52 without having the audio stutter. what is the correct ffmpeg incantation?

To restream an Icecast video stream to YouTube Live without audio stuttering on your ThinkPad P52, you can use the following ffmpeg command:

ffmpeg -re -i "INPUT_URL" \
  -use_wallclock_as_timestamps 1 \
  -c:v copy \
  -c:a aac -b:a 128k -ar 44100 \
  -af aresample=async=1 \
@xenodium
xenodium / expand-context-region.el
Last active September 17, 2024 08:56
Expand context region interactively
(defun expand-context-region ()
(interactive)
(let* ((buffer (current-buffer))
(saved-location (point))
(origin (save-excursion
(forward-line 0)
(point))))
(goto-char (line-beginning-position))
(set-mark (save-excursion
(forward-line 1)