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

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

Re: Elisp - Function returning a list


From: Jean Louis
Subject: Re: Elisp - Function returning a list
Date: Wed, 16 Dec 2020 07:09:03 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* steve-humphreys@gmx.com <steve-humphreys@gmx.com> [2020-12-16 06:27]:
> 
> I am having a go at making a function that returns a list of numbers, but 
> need it interactive.
> Unsure this is good
> 
 (defun typh-agenda-tgrd (tstr tend tskp)
    (interactive "n Start_Time: n End_Time: n Skip_Time: ")
    (number-sequence tstr tend tskp))

You are asking for time and function is asking for number. To me time
is more like 10:01 something rather than 10.

The function definitely returns the list and is handy.

(number-sequence 10 20 2) => (10 12 14 16 18 20)

You need some formatting here:

(interactive "nStart Time: \nnEnd Time: \nnSkip_Time: ")

You can test `interactive' before doing it.

(defun typh-agenda-tgrd (tstr tend tskp)
  (interactive "nStart Time: \nnEnd Time: \nnSkip_Time: ")
  (number-sequence tstr tend tskp))




reply via email to

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