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: Re: DWIM when yanking strings with leading or trailing spaces - an idea Date: Fri, 04 Mar 2016 13:57:53 +0100 Message-ID: <871t7qo0xa.fsf@mbork.pl> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1457096327 25653 80.91.229.3 (4 Mar 2016 12:58:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Mar 2016 12:58:47 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Joost Kremers Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 04 13:58:38 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 1abpJU-0000NP-G9 for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Mar 2016 13:58:36 +0100 Original-Received: from localhost ([::1]:40885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abpJO-0006Ix-Ns for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Mar 2016 07:58:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abpJ6-0006B0-Ls for help-gnu-emacs@gnu.org; Fri, 04 Mar 2016 07:58:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abpJ3-0003Mx-GC for help-gnu-emacs@gnu.org; Fri, 04 Mar 2016 07:58:12 -0500 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:47480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abpJ3-0003Ma-94 for help-gnu-emacs@gnu.org; Fri, 04 Mar 2016 07:58:09 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 792119D2003; Fri, 4 Mar 2016 13:57:59 +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 npDDQL3AsPAX; Fri, 4 Mar 2016 13:57:57 +0100 (CET) Original-Received: from localhost (c68-229.wmi.amu.edu.pl [150.254.68.229]) by mail.mojserwer.eu (Postfix) with ESMTPSA id EF0339D2002; Fri, 4 Mar 2016 13:57:56 +0100 (CET) User-agent: mu4e 0.9.13; emacs 25.1.50.6 In-reply-to: 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:109441 Archived-At: On 2016-03-04, at 10:45, Joost Kremers wrote: > Marcin Borkowski wrote: >> In one case, it's easy: I have a function which inserts a dash, killing >> any other punctuation in that place, and if region is active, it >> surrounds it with dashes. /Extremely/ useful. Also, this: >> http://mbork.pl/2015-10-31_Smart_comma_and_other_punctuation . > > Nice. Thanks! > For me, though, this: > > ,---- > | And now that I have this, I think I could do a similar thing with C-t, > | so that it transposes two chars before the point (as opposed as two > | chars around the point) if there is a space before the point. > `---- > > would be a bad idea, because I often use `transpose-chars' to correct > things like "th emistake". Which I unfortunately type quite often... Ah, I see. I seldom make this kind of mistake. Though it turned out I didn't do that anyway. >>> Anyway, my opinion shouldn't stop you from creating such a package, of >>> course. I mean, it bugs you, so that should be enough of a reason, >>> >>> right? ;-) >> >> Yes and no. It's on the limit of the "automation horizon" (see >> https://xkcd.com/1205/) ;-) > > So you basically posted your question looking for an excuse to do some > coding? ;-) Exactly. ;-) As Emperor Palpatine once put it, "now feel the power of procrastination!" Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University