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

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

Re: same data appears twice, interactive then function body


From: Emanuel Berg
Subject: Re: same data appears twice, interactive then function body
Date: Wed, 16 Dec 2020 05:02:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier wrote:

> Here's my take on it:
>
>     (defun insert-string-centered (string &optional width)
>       (interactive
>        (list (read-from-minibuffer "string: ")
>              (string-to-number (read-from-minibuffer "width [80]: "))) )
>       (let*((max         (if (< 0 width) width (+ 42 42 -4)))
>     [...]
>
> Now the question is how to avoid having 42 appear twice,
> I guess

Ha :)

No but do tell!

Maybe it can't be done, even?

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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