This is normal text.
| ;; Simple test exhibiting motion errors with inline images. | |
| ;; See Bug#67604 | |
| ;; 1. Eval this buffer (M-x eval-buffer). | |
| ;; 2. A buffer with 3 colored SVG blocks will appear. | |
| ;; 3. Adjust your frame's width until the green image just wraps to | |
| ;; the 2nd screen line, then reduce width by one more char. | |
| ;; 4. In the buffer with the images, M-x my/find-skip-bug. If it | |
| ;; succeeds, it will report the pixel offset where the bug | |
| ;; occurred. NOTE: The Green image must appear at the start of a | |
| ;; line, or a "false positive" bug ID has occurred. Increase your |
| ;;; test-svg-wrapped --- test pixel position for SVG images -*- lexical-binding: t; -*- | |
| ;; This small code creates a buffer with a couple long lines with | |
| ;; several SVG images of varying height interspersed. It also | |
| ;; includes a tool to check if the pixel height information one pixel | |
| ;; above each character agrees with expectations. To use: | |
| ;; M-x my/test-svg-positions | |
| ;; (use a C-u prefix to create SVG overlays instead of text properties) | |
| ;; |
| ;; Maximize a window vertically or horizontally within its frame | |
| (defun maximize-window-in-direction (&optional horizontally) | |
| "Maximize window. | |
| Default vertically, unless HORIZONTALLY is non-nil." | |
| (interactive) | |
| (unless (seq-every-p | |
| (apply-partially #'window-at-side-p nil) | |
| (if horizontally '(left right) '(top bottom))) | |
| (let* ((buf (window-buffer)) | |
| (top-size (window-size (frame-root-window) (not horizontally))) |
| (let ((orig (default-value 'repeat-echo-function)) | |
| rcol ccol in-repeat) | |
| (setq | |
| repeat-echo-function | |
| (lambda (map) | |
| (if orig (funcall orig map)) | |
| (unless rcol (setq rcol (face-foreground 'error))) | |
| (if map | |
| (unless in-repeat ; new repeat sequence | |
| (setq in-repeat t |
| (let ((buf (get-buffer-create "*stipple-box*"))) | |
| (switch-to-buffer-other-window buf) | |
| (cl-flet ((srot (s r) (concat (substring s (- r)) (substring s 0 (- r))))) | |
| (let* ((bar-width 0.3) | |
| (w (window-font-width)) | |
| (h (window-font-height)) | |
| (rot (indent-bars--stipple-rot w)) | |
| (bsz (round (* bar-width w))) | |
| (vrot (mod (cadr (window-edges nil t nil t)) h)) | |
| (pad (make-string (- h bsz) ?\s)) |
| (let (cnt tm node res) | |
| (goto-char (point-min)) | |
| (while (< (point) (point-max)) | |
| (setq tm | |
| (benchmark-run 100 | |
| (setq node (treesit-node-at (point))) | |
| (while node | |
| (setq node (treesit-node-parent node)))) | |
| node (treesit-node-at (point))) | |
| (setq cnt 0) |
WLED supports a variety of network control protocols, including “realtime UDP” and (for audio-reactive ports) “Sound Sync”. UDP data “frames” comprising one or more packets are typically sent to WLED devices at fixed intervals, e.g. 20ms for the default 50Hz SoundSync update. Unfortunately, consumer-grade WiFi suffers from jitter of 20-80ms. Packets can occasionally arrive in rapid “floods” (several packets in <10ms), followed by long “droughts” of 75ms or more.
The solution? Store up a fixed number of “frames” from the sporadically arriving packet data stream, then play them back at smooth intervals, essentially using the buffer to help “weather the droughts and floods”. This dramatically smooths playback. This approach effectively trades latency for smoothness of playback. This buffering approach is referred to as Realtime Smoothing (RTS).
| (use-package highlight-indentation | |
| :ensure highlight-indentation | |
| :init | |
| ;; Add a timer delay to the current column highlight for efficiency, | |
| ;; and to avoid flashing when scrolling or moving by line | |
| (defvar my/highlight-indentation-current-column-timer nil) | |
| (defun my/highlight-indentation-current-column () | |
| (highlight-indentation-redraw-window (selected-window) | |
| 'highlight-indentation-current-column-overlay | |
| 'highlight-indentation-current-column-put-overlays-region)) |
| ;; Stress tests of the undo/vundo system | |
| (require 'vundo) | |
| (require 'lorem-ipsum) | |
| (eval-when-compile | |
| (require 'cl-lib)) | |
| (require 'memory-report) | |
| (add-hook 'vundo-mode-hook (lambda () (setq jit-lock-mode nil))) |