;;; -*- lexical-binding: t -*- (require 'cl-lib) (cl-pushnew "." load-path :test #'string=) (require 'luki-lisp) (cl-defmethod bad-draw-fg-color (&optional (fg (face-fg 'our-blue)) (beg (point)) stay (end (1+ (point)))) (cl-loop with cap = (background-color-at-point) with prp = `(:foreground ,fg :background ,cap) do (put-text-property beg end 'face prp) finally (unless stay (forward-char)))) (cl-defmethod bad-draw-bg-color (&optional (bg (face-fg 'our-magenta)) (beg (point)) stay (end (1+ (point)))) (cl-loop with cap = (foreground-color-at-point) with prp = `(:foreground ,cap :background ,bg) do (put-text-property beg end 'face prp) finally (unless stay (forward-char)))) (cl-defmethod bad-put-color (&optional (cols (defined-colors))) (let ((c (or (& (lu cols) (seq-random-elt cols) cols)))) ; NOTE: OK (bad-draw-bg-color c (point)))) (cl-defmethod bad-cursor-pos (&optional (w (1+ (frame-width)))) (cl-loop with pos = (mouse-position) with (r c) = (cdr pos) with f = (+ 1 c (* r w)) return f)) (cl-defmethod bad-test-area () (cl-loop initially (@i ?\n) with len = (- (frame-width) 4) with beg = (point) for c in (list ?\█ ?\▓ ?\▒ ?\░) for str = (make-string len c) do (@i str ?\n) finally (@i "(font-lock-mode)") (comment-region beg (point)) (font-lock-mode 0))) ;; (bad-test-area) ;; █████████████████████████████████████████████████████████████████████████████████ ;; ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ;; ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ;; ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ;; (font-lock-mode) (<- 'bad-mouse)