[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HOW TO GIVE A DEFAULT TO A TRULY INTERACTIVE FUNCTION
From: |
Edi Weitz |
Subject: |
Re: HOW TO GIVE A DEFAULT TO A TRULY INTERACTIVE FUNCTION |
Date: |
17 Oct 2002 17:03:23 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
gnuist006@hotmail.com (gnuist006) writes:
> Edi Weitz <edi@agharta.de> wrote in message
>
> > (require 'cl)
> >
> > (defun* bar (&optional (default 5))
> > (let* ((default-string (format "%s" default))
> > (string (read-string "Number: "
> > default-string
> > nil
> > default-string)))
> > ;; needs check for wrong input
> > (list (string-to-number string))))
> >
> > (defun foo (n)
> > (interactive
> > (bar 42))
> > (insert (format "%s" (* 3 n))))
>
> Pathetic solution. breaks one, fixes noone.
> It just accepted "u" as the input and did not do number
> validation.
Looks like I was right in my first posting: You obviously are a troll.
You didn't say anything about number validation and your icky little
"I look like a C program" Elisp demo didn't do that either. If you
could read you could have seen that there's a comment with respect to
validation in my code. Should be easy to add for every non-idiot.
But count me out on providing further free help to you. The next time
someone posts a solution you'll complain that it doesn't help you with
your tax declaration.
Edi.