From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: DWIM when yanking strings with leading or trailing spaces - an idea Date: Thu, 03 Mar 2016 20:31:24 +0100 Message-ID: <87y49z8ik3.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1457033520 28892 80.91.229.3 (3 Mar 2016 19:32:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2016 19:32:00 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 03 20:31:53 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1abYyW-0004sA-Oh for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Mar 2016 20:31:52 +0100 Original-Received: from localhost ([::1]:36987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abYyV-0004qf-Nx for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Mar 2016 14:31:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abYyL-0004qE-DM for help-gnu-emacs@gnu.org; Thu, 03 Mar 2016 14:31:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abYyG-0006zc-EW for help-gnu-emacs@gnu.org; Thu, 03 Mar 2016 14:31:41 -0500 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:50614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abYyG-0006yV-6x for help-gnu-emacs@gnu.org; Thu, 03 Mar 2016 14:31:36 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id C53D29D2003 for ; Thu, 3 Mar 2016 20:31:34 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L+nne2xcXPyB for ; Thu, 3 Mar 2016 20:31:31 +0100 (CET) Original-Received: from localhost (unknown [109.232.24.28]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 47E6E9D2002 for ; Thu, 3 Mar 2016 20:31:29 +0100 (CET) User-agent: mu4e 0.9.13; emacs 25.1.50.6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2a01:5e00:2:52::8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109423 Archived-At: Hi folks, take this example: --8<---------------cut here---------------start------------->8--- Lorem ipsum -!-dolor sit amet. --8<---------------cut here---------------end--------------->8--- As usual, -!- denotes the point (which can be here because e.g. of an earlier C-left). Now press C-backspace, C-right, C-y. This is the result: --8<---------------cut here---------------start------------->8--- Lorem doloripsum sit amet. --8<---------------cut here---------------end--------------->8--- Some other text processing software, whose name will not be mentioned, does "the right thing" in such a case, i.e., produces --8<---------------cut here---------------start------------->8--- Lorem dolor ipsum sit amet. --8<---------------cut here---------------end--------------->8--- Why couldn't Emacs do this? Of course, optionally. I could spend some time working on this issue, and e.g. submit the result to Elpa. Would anyone be interested? Of course, this particular example is rather bad, since a simple M-t would do. But you get the idea, and quite often transposing is not enough, e.g., when you want to transform --8<---------------cut here---------------start------------->8--- aaa bbb ccc ddd eee fff --8<---------------cut here---------------end--------------->8--- into --8<---------------cut here---------------start------------->8--- aaa ddd eee bbb ccc fff --8<---------------cut here---------------end--------------->8--- Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University