From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Unit tests and lexical-binding for delim-col.el Date: Mon, 20 May 2019 15:40:52 +0100 Message-ID: <87lfz1i3yj.fsf@tcd.ie> References: <87woj1anpx.fsf@tcd.ie> <87woj117h2.fsf@tcd.ie> <87bm0boifx.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="231534"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 20 16:43:07 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSjVL-000y4c-8a for ged-emacs-devel@m.gmane.org; Mon, 20 May 2019 16:43:07 +0200 Original-Received: from localhost ([127.0.0.1]:36651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSjVK-0004N0-AY for ged-emacs-devel@m.gmane.org; Mon, 20 May 2019 10:43:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSjTN-0003R6-CA for emacs-devel@gnu.org; Mon, 20 May 2019 10:41:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSjTL-0007fQ-S3 for emacs-devel@gnu.org; Mon, 20 May 2019 10:41:05 -0400 Original-Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]:41965) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSjTL-0007eP-21 for emacs-devel@gnu.org; Mon, 20 May 2019 10:41:03 -0400 Original-Received: by mail-ed1-x544.google.com with SMTP id m4so24233221edd.8 for ; Mon, 20 May 2019 07:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ZYnxuC/FxtzNErcAP+9zqEGBpGd7LswW7dcbjzse5PI=; b=ZE0tlR9udgdJu6PexWgLOvPSvvpUA8a7nZIMcWjyE8YUEue7ojkx1O7EjIRWewV8gW oZQocHNp3uJiNr0FnkuyR3Inwc9a+S2fuxHO/umeI8IKc+xMSfpXF0/7yl/a2LQ+cR3O VRgeYvRavYlKcBmf77T+ayK4Gsf6/Ory1Jcf+27oveWigj2HqrKpG4Lk1AlFAsvTeysi TZbjx8f4b4oAndiaLaXwL0pSNbfEYnfCs8rpCDnrguECM+90BLzQIBbPec4dnz3OLKdD UiDMqCjaIYneL1690V2szz70DcZ2NFQx7R/d8S0WZwwc70WUR0fAV0/a1xWvXAnX0TsL AjyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ZYnxuC/FxtzNErcAP+9zqEGBpGd7LswW7dcbjzse5PI=; b=sV9m/khyMutEnxMVthUczkk2rt54iLjsXZgRbYGix/wM8JKAZtxV22XSxe+3Hix8oT QR5Qp5+Cfkg0roG/jrYQaWgvluIFOK0T+BcrpkQWHhE1whTcgzh2iJRfjdrhoHS9wGce 6+VFVmIDZzc5EXqrC5JxXbjtvhpBrPbPKQLXybRTFoqwE9cA1+KSLmRzE0rnzmbGiOQi /6if8LyHMVTjfVm+4OxM7Q5vwAEvi8cqZiFqcXQDycin7kIBJF8Xd8dNuQJ8T4J1gQSZ VULmspBOZtZFKSMTMDuF8DpsUsaRYofYVvyDL8f9G6obXYgs6fJQ84bACGzIUTHSdJK0 aMeA== X-Gm-Message-State: APjAAAXo0TJ1dWtaeSwNFOXqQr0FQz5g6O67+CEXi5QrGgseyL9RC7Vd RLCXPKRuRO+ziiSdkN+dg4CN7Q== X-Google-Smtp-Source: APXvYqzZlO4DMv4eeYqb2oM4hOI8N1aTThAHnNEHZApyZ+pCnq5sDDvgBZ0ig5DHF6nMFtp3QXSxAw== X-Received: by 2002:a17:906:488e:: with SMTP id v14mr19595796ejq.216.1558363259971; Mon, 20 May 2019 07:40:59 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:6fa:38d6:1fce:ddb3]) by smtp.gmail.com with ESMTPSA id t19sm3146670ejq.51.2019.05.20.07.40.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 20 May 2019 07:40:58 -0700 (PDT) In-Reply-To: (Stefan Kangas's message of "Sat, 11 May 2019 12:46:43 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::544 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:236799 Archived-At: --=-=-= Content-Type: text/plain Stefan Kangas writes: > Basil L. Contovounesios writes: >> if no-one objects within the next few days, I or someone else will push the >> patch to master. > > Great. > >> I noticed an additional possible cleanup: > > I've included these cleanups in the attached patch. > > Could we also get rid of this comment? I don't see how it helps since this > has been in vanilla for 20 years now. > > ;; To use it, make sure that this file is in load-path and insert in your > ;; .emacs: > ;; > ;; (require 'delim-col) Sure. I added that, a link to this discussion, and a missing full stop to your first patch, refilled one of its long lines, and pushed to master[1]. [1: 4498e5a13a]: Use lexical-binding in delim-col.el and add tests 2019-05-20 15:29:26 +0100 https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4498e5a13a3b63a3024ceef102ae3b5c50f58be1 > Stefan Monnier writes: >> BTW, it would be nice to make it so that delimit-columns-region >> delegates to delimit-columns-rectangle when called with a rectangular >> region (i.e. using rectangle-mark-mode). > > Good idea. How about the second patch attached here? Looks fine to me, except for a minor question: > From 5b2ef61a06001c48a414df3c63f2588c18038f90 Mon Sep 17 00:00:00 2001 > From: Stefan Kangas > Date: Sat, 11 May 2019 12:17:18 +0200 > Subject: [PATCH 2/2] Delegate to rectangle version in delim-col when > appropriate > > * lisp/delim-col.el (delimit-columns-region): Delegate to > delimit-columns-rectangle when called with a rectangular region. > --- > etc/NEWS | 6 ++++ > lisp/delim-col.el | 92 +++++++++++++++++++++++++++++-------------------------- > 2 files changed, 54 insertions(+), 44 deletions(-) > > diff --git a/etc/NEWS b/etc/NEWS > index d10a553244..fb70de7902 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1422,6 +1422,12 @@ of an idle Emacs, but may fail on some network file systems; set > notification is not supported. The new variable currently has no > effect in 'global-auto-revert-mode'. The default value is nil. > > +** delim-col > + > +*** 'delimit-columns-region' now delegates to > +'delimit-columns-rectangle' when called with a rectangular region > +(i.e. using rectangle-mark-mode). > + > > * New Modes and Packages in Emacs 27.1 I'm personally fine with this, but I think NEWS entries usually comprise a summary on the first line, followed by an elaboration in the body. I'm not very good at writing these, but here's one way to do that: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=delim-col-modes.diff diff --git a/etc/NEWS b/etc/NEWS index d4638c17b1..1606d5b50e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1460,9 +1460,10 @@ buffer periodically when 'auto-revert-avoid-polling' is non-nil. ** delim-col -*** 'delimit-columns-region' now delegates to -'delimit-columns-rectangle' when called with a rectangular region -(i.e. using rectangle-mark-mode). +*** 'delimit-columns-region' acts differently on rectangular regions. +When called with a noncontiguous rectangular region, i.e., when +rectangle-mark-mode is enabled, 'delimit-columns-region' now acts like +'delimit-columns-rectangle'. * New Modes and Packages in Emacs 27.1 --=-=-= Content-Type: text/plain Here's another possibility to reuse an existing NEWS entry under "Editing Changes": --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=delim-col-editing.diff diff --git a/etc/NEWS b/etc/NEWS index d4638c17b1..e1213a036a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -407,7 +407,9 @@ interface that's more like functions like 'search-forward'. --- ** More commands support noncontiguous rectangular regions, namely -'upcase-dwim', 'downcase-dwim', 'replace-string', 'replace-regexp'. +'upcase-dwim', 'downcase-dwim', 'replace-string', 'replace-regexp', +and 'delimit-columns-region'. The latter delegates to +'delimit-columns-rectangle' when the region is rectangular. +++ ** When asked to visit a large file, Emacs now offers visiting it literally. @@ -1458,12 +1460,6 @@ the new variable 'buffer-auto-revert-by-notification' to a non-nil value. Auto Revert mode can use this information to avoid polling the buffer periodically when 'auto-revert-avoid-polling' is non-nil. -** delim-col - -*** 'delimit-columns-region' now delegates to -'delimit-columns-rectangle' when called with a rectangular region -(i.e. using rectangle-mark-mode). - * New Modes and Packages in Emacs 27.1 --=-=-= Content-Type: text/plain As soon as someone confirms which format is preferred or suggests a better wording, I'll push the second patch as well. Thanks, -- Basil --=-=-=--