Monorepo for Aesthetic.Computer aesthetic.computer
at main 23 lines 1.0 kB view raw
1(defun draw-x-in-new-buffer () 2 "Draws a visual X in a new buffer continuously." 3 (interactive) 4 (let* ((buffer (generate-new-buffer "X-Buffer")) 5 (size 5) ; Size of the X 6 (char "X") ; Character to use 7 (delay 1) ; Delay in seconds 8 (draw-x (lambda () 9 (with-current-buffer buffer 10 (read-only-mode -1) 11 (erase-buffer) 12 ;; Drawing the top half of the X 13 (dotimes (i size) 14 (insert (make-string i ?\s) char 15 (make-string (- size i 1) ?\s) char "\n")) 16 ;; Drawing the bottom half of the X 17 (dotimes (i size) 18 (insert (make-string (- size i 1) ?\s) char 19 (make-string i ?\s) char "\n")) 20 (read-only-mode 1))))) 21 (switch-to-buffer buffer) 22 (setq buffer-read-only t) 23 (run-with-timer 0 delay draw-x)))