From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: Move line Date: Sun, 01 Jun 2008 07:48:55 +0200 Message-ID: <87lk1p7liw.fsf@ambire.localdomain> References: <41e8769d-18d4-4a36-82ba-adb0b26a0b9e@s50g2000hsb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1212299551 30989 80.91.229.12 (1 Jun 2008 05:52:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Jun 2008 05:52:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 01 07:53:13 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 1K2gVC-0005oT-Um for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Jun 2008 07:53:11 +0200 Original-Received: from localhost ([127.0.0.1]:40249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2gUQ-00054a-UY for geh-help-gnu-emacs@m.gmane.org; Sun, 01 Jun 2008 01:52:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2gUB-00054O-Mu for help-gnu-emacs@gnu.org; Sun, 01 Jun 2008 01:52:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2gU9-00053r-K4 for help-gnu-emacs@gnu.org; Sun, 01 Jun 2008 01:52:06 -0400 Original-Received: from [199.232.76.173] (port=47745 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2gU9-00053o-GQ for help-gnu-emacs@gnu.org; Sun, 01 Jun 2008 01:52:05 -0400 Original-Received: from [151.61.140.135] (port=48058 helo=ambire.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K2gU9-0002rt-2K for help-gnu-emacs@gnu.org; Sun, 01 Jun 2008 01:52:05 -0400 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1K2gR5-0001Tp-T8 for help-gnu-emacs@gnu.org; Sun, 01 Jun 2008 07:48:55 +0200 In-Reply-To: (Joost Kremers's message of "31 May 2008 23:03:20 GMT") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-Greylist: delayed 83232 seconds by postgrey-1.27 at monty-python; Sun, 01 Jun 2008 01:52:04 EDT 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:54398 Archived-At: =E2=8E=9B=E2=8E=9E Joost Kremers =E2=8E=9D=E2=8E=A0 31 May 2008 23:03:20 GMT it's much simpler and shorter, and does something completely different... I think OP wants some fusion of transpose-lines plus "save-excursion", something like: (defun transpose-lines/stay-put () (let ((col (current-column))) (forward-line 1) (transpose-lines 1) (forward-line -1) (forward-char col))) thi