;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/scale.el (defun scale (end step &optional current) (let ((curr (or current 0))) (when (<= curr end) (let*((digit-str (if (zerop (% curr step)) (format "%s" curr) ".") ) (digit-str-len (length digit-str)) ) (insert digit-str) (scale end step (+ digit-str-len curr)) )))) (defun scale-simple (&optional end) (interactive "P") (let*((e (or (and (listp end) (car end)) (and (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 1 0 0 M-x scale-simple RET 0.........10........20........30 ... (provide 'scale)