From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs scale generator?
Date: Fri, 13 Mar 2015 01:53:40 +0100 [thread overview]
Message-ID: <87wq2lsoob.fsf@debian.uxu> (raw)
In-Reply-To: mdta9r$20d$2@dont-email.me
Dan Espen <despen@verizon.net> 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
next prev parent reply other threads:[~2015-03-13 0:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 20:23 Emacs scale generator? Dan Espen
2015-03-12 20:33 ` J. David Boyd
[not found] ` <mailman.1916.1426192439.31049.help-gnu-emacs@gnu.org>
2015-03-13 0:07 ` Dan Espen
2015-03-13 0:07 ` Chris Van Dusen
[not found] ` <mailman.1923.1426205290.31049.help-gnu-emacs@gnu.org>
2015-03-13 0:17 ` Dan Espen
2015-03-13 0:38 ` Joost Kremers
2015-03-13 0:53 ` Emanuel Berg [this message]
2015-03-13 1:54 ` Emanuel Berg
2015-03-13 2:30 ` Dan Espen
2015-03-13 2:39 ` Emanuel Berg
2015-03-13 2:48 ` Dan Espen
2015-03-13 2:16 ` Dan Espen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wq2lsoob.fsf@debian.uxu \
--to=embe8573@student.uu.se \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).