From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.bugs Subject: Re: save-excursion doesn't save point? Date: Tue, 11 Jun 2002 19:06:18 GMT Organization: Global Online Japan // Exodus Communications KK. Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <87fzzt1vpy.fsf@tc-1-100.kawasaki.gol.ne.jp> References: <20020608055559.GA689668@bruegel.RZ.TU-Ilmenau.DE> <87hekep83a.fsf@tc-1-100.kawasaki.gol.ne.jp> <20020608072843.GA689936@bruegel.RZ.TU-Ilmenau.DE> <3D062F59.8070705@ihs.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1023822558 23952 127.0.0.1 (11 Jun 2002 19:09:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 11 Jun 2002 19:09:18 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17Hr14-0006ED-00 for ; Tue, 11 Jun 2002 21:09:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17Hr0v-00059N-00; Tue, 11 Jun 2002 15:09:09 -0400 Original-Received: from mailbox2.ucsd.edu ([132.239.1.54]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17HqyJ-00051N-00 for ; Tue, 11 Jun 2002 15:06:32 -0400 Original-Received: from smtp02.fields.gol.com (smtp02.fields.gol.com [203.216.5.132]) by mailbox2.ucsd.edu (8.12.1/8.12.1) with ESMTP id g5BJ6OxG024477 for ; Tue, 11 Jun 2002 12:06:25 -0700 (PDT) Original-Received: from nnrp.gol.com ([203.216.7.70]) by smtp02.fields.gol.com with esmtp (Magnetic Fields) id 17HqyG-0004vS-00 for ; Wed, 12 Jun 2002 04:06:24 +0900 Original-Received: by nnrp.gol.com (8.10.0.Beta6/8.9.1/891-NEWS-P) id g5BJ6I900676; Wed, 12 Jun 2002 04:06:18 +0900 (JST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: not-for-mail Original-Newsgroups: gnu.emacs.bug System-Type: i686-pc-linux-gnu Original-Lines: 19 Original-NNTP-Posting-Host: 203.216.25.154 Original-X-Complaints-To: abuse@gol.com Original-X-Trace: nnrp.gol.com 1023822378 203.216.25.154 (Wed, 12 Jun 2002 04:06:18 JST) Original-NNTP-Posting-Date: Wed, 12 Jun 2002 04:06:18 JST X-Abuse-Complaints: abuse@gol.com Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:1939 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:1939 kevinr@ihs.com (Kevin Rodgers) writes: > > It could be generally useful. Emacs already has shuffle-vector. > > Then it seems the simplest implementation would be to read the region > into a vector, shuffle the vector, then overwrite the region with the > vector's contents. Or better yet, do it indirectly, just have two vectors, one holding the position of the start of each line in the buffer, and the other holding indices into the first vectors. Use `shuffle-vector' to shuffle the second vector and do a single pass over it inserting the shuffled lines _after_ the original lines. Then just delete the region holding the original lines. That would be _much_ more efficient.... -Miles -- I'd rather be consing.