From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: looping cursor position in dired Date: 17 Nov 2005 15:54:28 -0800 Organization: http://groups.google.com Message-ID: <1132271668.212323.80520@o13g2000cwo.googlegroups.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1132271809 831 80.91.229.2 (17 Nov 2005 23:56:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 Nov 2005 23:56:49 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 18 00:56:45 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ectbo-000863-Eb for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Nov 2005 00:56:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ectbn-0006Yl-WF for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Nov 2005 18:56:04 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Original-NNTP-Posting-Host: 198.74.20.77 Original-X-Trace: posting.google.com 1132271673 15733 127.0.0.1 (17 Nov 2005 23:54:33 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 17 Nov 2005 23:54:33 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: o13g2000cwo.googlegroups.com; posting-host=198.74.20.77; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:135535 Original-To: help-gnu-emacs@gnu.org 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:31131 Archived-At: Sebastian Luque wrote: > Hello, > > Before I start writing something too complicated, what is the best way to > allow the cursor to loop through the dired buffer? i.e. if the cursor is > at the end of the buffer and you hit [up] (dired-next-line), then the > cursor would move to the first line; likewise for the opposite action. > > Thanks, Yes it would be a shame if you did something complicated;) (defadvice dired-next-line (before my-buff-wrap activate compile) "With wrapping" (when (eobp) (goto-char (point-min)))) (defadvice dired-previous-line (before my-buff-wrap activate compile) "With wrapping" (when (bobp) (goto-char (point-max))))