From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michal Newsgroups: gmane.emacs.help Subject: Re: something like ring.el needed, but not circular Date: Mon, 10 Mar 2008 10:00:47 +0100 Organization: education Message-ID: References: <002801c88217$bdaefe40$0600a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205139861 9973 80.91.229.12 (10 Mar 2008 09:04:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Mar 2008 09:04:21 +0000 (UTC) Cc: 'emacs mailing list' To: "Drew Adams" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 10 10:04:49 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JYdw8-0002TP-6F for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Mar 2008 10:04:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYdva-0004AF-1F for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Mar 2008 05:04:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYdvC-00047O-9G for help-gnu-emacs@gnu.org; Mon, 10 Mar 2008 05:03:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYdvA-00045V-Vd for help-gnu-emacs@gnu.org; Mon, 10 Mar 2008 05:03:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYdvA-00045O-Qq for help-gnu-emacs@gnu.org; Mon, 10 Mar 2008 05:03:48 -0400 Original-Received: from cg-01.tenbit.pl ([213.180.131.136] helo=tenbit.pl) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JYdvA-0001gM-L8 for help-gnu-emacs@gnu.org; Mon, 10 Mar 2008 05:03:48 -0400 Original-Received: from [157.25.157.162] (account rabbit50 HELO localhost.localdomain) by tenbit.pl (CommuniGate Pro SMTP 4.1.8) with ESMTP id 77076166; Mon, 10 Mar 2008 10:01:34 +0100 X-MAILER: KMail/1.7.1 In-Reply-To: <002801c88217$bdaefe40$0600a8c0@us.oracle.com> (Drew Adams's message of "Sun\, 9 Mar 2008 10\:59\:45 -0800") User-Agent: mozilla news reader X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52210 Archived-At: Thanks "Drew Adams" writes: >> Is there in emacs a package that allows walking through >> a list in both directions, like ring.el, but which is NOT a >> ring (I mean circular)? > > Might one ask "why"? What do you have against rings? ;-) > > If you mean that you want the behavior of, say, Emacs input-history > traversal: two directions, but two endpoints, then take a look at the > input-history code. Look for command `next-history-element' in library > simple.el. > > Or you can use a ring and define an endpoint position on it - have your code > stop when it reaches that point from either direction.