help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs scale generator?


From: Emanuel Berg
Subject: Re: Emacs scale generator?
Date: Fri, 13 Mar 2015 01:53:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Dan Espen <address@hidden> writes:

> Wow, never saw that before.
>
> Nope, I'm actually looking for something that puts
> the text in the buffer.

Try this:

    (defun scale (end step &optional current)
      (unless current (setq current 0))
      (if (<= current end)
          (progn
            (if (= (% current step) 0)
                (progn
                  (let*((digit-str      (format "%s" current))
                        (digit-str-len  (length digit-str)) )
                    (insert digit-str)
                    (setq current (+ digit-str-len current))))
              (progn
                (insert ".")
                (setq current (1+ current)) ))
            (scale end step current) )))

    (scale 100 10)

-- 
underground experts united


reply via email to

[Prev in Thread] Current Thread [Next in Thread]