;;; bad-mouse --- bad mouse -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (require 'cl-lib) (cl-pushnew "." load-path :test #'string=) (require 'luki-lisp) (-> 'bad-font) (defun bad-mouse-point () (pcase-let ((`(_ ,c . ,r) (mouse-position))) (save-excursion (goto-beg) (forward-line r) (forward-char c)))) (defun bad-mouse-draw (&optional col bg beg end) (or col (setf col bad-magenta-b)) (or beg (setf beg (bad-mouse-point))) (or end (setf end (1+ beg))) (add-text-properties beg end (list (or bg :background :foreground) col))) (defun bad-mouse-random (&optional cols) (i) (or (lu cols) (setf cols (defined-colors))) (bad-mouse-draw (seq-random-elt cols) t) (bad-mouse-draw (seq-random-elt cols))) ;; (local-set-key [mouse-1] #'bad-mouse-test) (defun bad-mouse-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 (if font-lock-mode 0 1))") (comment-region beg (point)) (font-lock-mode 0))) ;; (bad-mouse-area) ;; ███████████████████████████████████████████████████████████████████████ ;; ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ;; ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ;; ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ;; (font-lock-mode (if font-lock-mode 0 1)) (<- 'bad-mouse) ;;; bad-mouse.el ends here