;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/scale.el ;; ;; Moved: ;; https://dataswamp.org/~incal/emacs-init/draw.el (defun scale (end step &optional cur) (or cur (setq cur 0)) (when (<= cur end) (let* ((digit-str (if (zerop (% cur step)) (format "%s" cur) ".")) (digit-len (length digit-str))) (insert digit-str) (scale end step (+ digit-len cur))))) (defun scale-simple (&optional end) (interactive "P") (let* ((e (or (and (listp end) (car end)) (if (numberp end) end 30))) (step (max 1 (/ e 10)))) (scale e step))) ;; C-u M-x scale-simple RET 01234 ;; C-u C-u M-x scale-simple RET 012345678910121416 ;; M-x scale-simple RET 0..3..6..9..12.15.18.21.24.27.30 ;; C-u 100 M-x scale-simple RET 0.........10........20........30..[..]..100 (provide 'scale)