From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: HIST to read-from-minibuffer Date: Tue, 25 May 2010 19:20:11 +0100 Organization: University of Cambridge Message-ID: References: <8739xgta9l.fsf@mail.jurta.org> <87ljb7q33m.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1274811676 14400 80.91.229.12 (25 May 2010 18:21:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 25 May 2010 18:21:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 25 20:21:15 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OGyka-00006b-Kv for ged-emacs-devel@m.gmane.org; Tue, 25 May 2010 20:21:12 +0200 Original-Received: from localhost ([127.0.0.1]:58360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGykZ-0004Ce-NT for ged-emacs-devel@m.gmane.org; Tue, 25 May 2010 14:21:11 -0400 Original-Received: from [140.186.70.92] (port=35266 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGyjr-0003nK-K6 for emacs-devel@gnu.org; Tue, 25 May 2010 14:20:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OGyjq-0000xD-72 for emacs-devel@gnu.org; Tue, 25 May 2010 14:20:27 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:41903) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGyjp-0000wu-QD for emacs-devel@gnu.org; Tue, 25 May 2010 14:20:26 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OGyjk-0007y8-7j for emacs-devel@gnu.org; Tue, 25 May 2010 20:20:20 +0200 Original-Received: from smaug.linux.pwf.cam.ac.uk ([193.60.95.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 May 2010 20:20:20 +0200 Original-Received: from sdl.web by smaug.linux.pwf.cam.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 May 2010 20:20:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: smaug.linux.pwf.cam.ac.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:yv8vR8elBIbBlhba+e5nsfDrw/A= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125263 Archived-At: 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