emacs-devel
[Top][All Lists]
Advanced

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

Re: HIST to read-from-minibuffer


From: Leo
Subject: Re: HIST to read-from-minibuffer
Date: Tue, 25 May 2010 19:20:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On 2010-05-25 18:54 +0100, Juri Linkov wrote:
>>> (let ((hist '("a" "b" "c")))
>>>   (read-from-minibuffer "Prompt: " nil nil nil '(hist . 2)))
>>>
>
>>> M-p => "c"
>>
>> I think I don't understand this sentence:
>>
>> "Positions are counted starting from 1 at the beginning of the list."
>>
>> I thought HIST is a 1-based list, but it is still 0-based. Could you
>> make the doc-string a bit clearer? Thanks.
>
> It is 1-based.
>
>> For example, 0 works just fine:
>>
>>  (let ((hist '("a" "b" "c")))
>>    (read-from-minibuffer "Prompt: " nil nil nil '(hist . 0)))
>>
>> M-p => "a"
>
> "a" is the 1st element of HIST.  M-p moves to the 1st history element here.

This bit is what confuses me:

(hist . 0) 
        ^
        +----- why '0' here to mean first element?

Leo




reply via email to

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