From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] New command to invert lines in region Date: Sun, 16 Oct 2016 09:24:25 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1476624382 13185 195.159.176.226 (16 Oct 2016 13:26:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 16 Oct 2016 13:26:22 +0000 (UTC) Cc: Kaushal Modi , Emacs developers , Tino Calancha To: Mathias Dahl Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 16 15:26:18 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvlRv-0000ZT-PU for ged-emacs-devel@m.gmane.org; Sun, 16 Oct 2016 15:25:59 +0200 Original-Received: from localhost ([::1]:56341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvlRx-0008QX-Rj for ged-emacs-devel@m.gmane.org; Sun, 16 Oct 2016 09:26:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvlQS-0007yZ-BX for emacs-devel@gnu.org; Sun, 16 Oct 2016 09:24:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvlQR-0002by-KU for emacs-devel@gnu.org; Sun, 16 Oct 2016 09:24:28 -0400 Original-Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:35606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvlQR-0002bk-GN for emacs-devel@gnu.org; Sun, 16 Oct 2016 09:24:27 -0400 Original-Received: by mail-oi0-x233.google.com with SMTP id d132so185744786oib.2 for ; Sun, 16 Oct 2016 06:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=Jid6xExMhHx1wLs36PmPse5LXNDZzSNRVepDupYsuDU=; b=jAOv/0u7qKaAWKupUmyp0obePVhyRENbz0TLjPKt7PuN3t1U4YCS2rU0kR/HSlnVTE T2v1GoDEfcTMnSA12cZQ/covYR1V5y0auOxrfCmAgvmkVAocP9hni/O4SnXvrkTi+MiZ 8c7KBW9vSmuo5ly332JPEUTKNYaXS8GQCTZQ6gz+m714Gg3aD+PYOJsLgpu6vlyQt7r4 0m9RRghZiykmwcvfd2s84wCoNbFpUm7qfMWVfIDw77600dpIj698PafYUBX6wRmtbw7D AtLNIM7VuHIxvB51LuEFgMuL1w06nS+FziEnkk1wWmB/dxzGfK8inSSXl/6A19wOej39 B7+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=Jid6xExMhHx1wLs36PmPse5LXNDZzSNRVepDupYsuDU=; b=b9vy2R4PdsII3ed4MJv9qtqTg9TM7QHGFY6oY30mLzONfONy+BpNw3aQYaQdqBUmdS Qe31YPwvSe7g1aF50Jd5nUU8vSFOmL4sgi+crydpeaO4GBLcZh7VbX3hSXYRw/acGWmi JZKGVCIEalk7GVD4pfLbQ6wgosN8QqRpdADKafDyTtTD2UH32q1gAeg193ON15w6P2bS Bsehpp+OVY+ZSE3HIGVJ3bchyaF8dSxx0c9ogMSjHM8f3Epn27cPlt7EGODgz2AMJdXU J9vVcw5VnNRTR6naqwGQTxjdLPd/aoljZ8JrWFXRBxJRGlQjlBrFEgqGtW1hdGKbE99v cXJQ== X-Gm-Message-State: AA6/9RnTteBNyv0CT+ghK7oQJIbjlfvAnrTnrMjC1EqBoA3BUNCHzMViwbBIdQiZVYNyzsmVeXFLF5K5ZVblPA== X-Received: by 10.202.84.213 with SMTP id i204mr14202889oib.100.1476624266535; Sun, 16 Oct 2016 06:24:26 -0700 (PDT) Original-Received: by 10.157.29.239 with HTTP; Sun, 16 Oct 2016 06:24:25 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: oU6-pcfHQLYWLc3RudZjoka4jD4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208328 Archived-At: On Sat, Oct 15, 2016 at 6:25 PM, Mathias Dahl wrot= e: > > Out of curiosity I had a look at the current implementation of > `reverse-region' and found it quite complicated and hard to understand wh= at > it does. I wrote my own na=C3=AFve version that I think is much simpler t= o > understand It looks to me that your version is simpler mainly because you dropped the handling of some corner cases. Having some tests to check those would be required before replacing the implementation. Using split-string does seem like a good idea though (probably that function didn't exist yet when reverse-region was written).