From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Skip Montanaro Newsgroups: gmane.emacs.help Subject: Re: TIL about string-rectangle Date: Wed, 30 Dec 2020 16:11:57 -0600 Message-ID: References: <87a6tvkmaf.fsf@passepartout.tim-landscheidt.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21042"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help GNU Emacs To: Tim Landscheidt Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 30 23:13:57 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kujjA-0005OI-Rg for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 30 Dec 2020 23:13:56 +0100 Original-Received: from localhost ([::1]:37014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kujj9-0004w2-Tb for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 30 Dec 2020 17:13:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kujh0-0004OO-Ag for help-gnu-emacs@gnu.org; Wed, 30 Dec 2020 17:11:42 -0500 Original-Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]:44312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kujgy-0008RX-4g for help-gnu-emacs@gnu.org; Wed, 30 Dec 2020 17:11:42 -0500 Original-Received: by mail-yb1-xb34.google.com with SMTP id x2so15938573ybt.11 for ; Wed, 30 Dec 2020 14:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6I+Zj3d4VUF0IXpPR1JlYZjTVVnH68zmy+kMIreRgWg=; b=CP0fWjUJHd6Teql26IyqoETjAPb+9c9/0DnckQYp1qckTnSg22JOvs8UuJ51T4DMFE OcuIRdXyR1nxxFLmaBTL8TRLMNt0H1CQ4MEyuABez8O6GaHf04Zwp3Wt6wfUAif7WWPN l0x4jX/Lm5fNFin32Jy51O6739Gtf7ULjTbpXtfSoiCTZXFJ6vAhxkSeIbWJj1SxVxlj lJY47UKrPvTy8FVKlcbo/Pp1sEE1gNLymp4Gaui0AErn2i+uHCtKU5L23bSfbnije3+B w1geZS4WVSvdbCSbOrQ1kSMgCB6NNCpXk31QG2LTwZZZpcMOtTZxRonGAYQYWjyZInyo u/XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6I+Zj3d4VUF0IXpPR1JlYZjTVVnH68zmy+kMIreRgWg=; b=dH+o7ODWMl2YFG7ZAWZsxBMiEEa0sAUUaerjOtlDPT2hi9OZDhdzTXFWDgRP3QRUCe FLP6ofJMp13/LyG9TZrxLWLQiqpHdgSoOmrqG2Yzq8KpnaiI1uWU4FU3VxDHnpwEKT/g p1a98qunb/VweUpF8qDHbpGGDfRgExfM/+YGgtTEu4Dvg40yzGe1VKoM5PU0ibsLyBQp s5PiF3dp6yGyE9wwRqcJF7FKRpjC5Dd95QFhgkFKsj8XOM7CvaimtmlCTq21ooxVFQN2 ePJd3vGrvHZ0tchhavFk4ZdOUK1VgQAeoU6ju+7NkI/7bqVqeVj6iGsPQFNQNd4FpNeP YRtw== X-Gm-Message-State: AOAM5322dGrKcY7DXQXX4avS3te7+2TO3JlS4Gzy0+E/b/BNV6eceKrr GVxWMKg/1or3KL6us9yy8HDD0hndFDHXONsfSOm6AUpHn4Pb9nQ= X-Google-Smtp-Source: ABdhPJztn2HWbzi76S27r1C47I8xaTKyt6vEw16gjC+HrPAc041cK+5xIRXQoNBYGnun/SUWHePze83z23j2+r5jOaY= X-Received: by 2002:a25:73d7:: with SMTP id o206mr72610386ybc.200.1609366298966; Wed, 30 Dec 2020 14:11:38 -0800 (PST) In-Reply-To: <87a6tvkmaf.fsf@passepartout.tim-landscheidt.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::b34; envelope-from=skip.montanaro@gmail.com; helo=mail-yb1-xb34.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126927 Archived-At: > For complex sorts, I once wrote a function that enhances > sort-regexp-fields (and needs a docstring and comments that > I could understand after eight years): ... Thanks. I've used the Unix sort(1) command for a few decades now. It's kind of burned into my brain. I know Emacs Lisp is exceedingly powerful (I used it as my Lisp interpreter as the one and only Lisp class I took), but sort(1) does just what I wanted here other than not terminating the third (year) field at the comma. It's kind of hard to argue with its economy. Regular expressions are quite handy, but also pretty verbose for this task. Skip