From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: master 87e422f: Beef up the Emacs string utility set a bit Date: Mon, 21 Dec 2020 13:05:23 -0600 Message-ID: References: <20201221175345.27592.89597@vcs0.savannah.gnu.org> <20201221175347.9F1B820B76@vcs0.savannah.gnu.org> <87eejjdn8e.fsf@gnus.org> <87a6u7dmnw.fsf@gnus.org> 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="28786"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 21 20:06:31 2020 Return-path: Envelope-to: ged-emacs-devel@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 1krQVq-0007Lv-Fa for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Dec 2020 20:06:30 +0100 Original-Received: from localhost ([::1]:48352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1krQVp-0002wL-GE for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Dec 2020 14:06:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krQUq-0002RD-J7 for emacs-devel@gnu.org; Mon, 21 Dec 2020 14:05:28 -0500 Original-Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:39493) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1krQUo-00065i-QP for emacs-devel@gnu.org; Mon, 21 Dec 2020 14:05:28 -0500 Original-Received: by mail-pf1-x429.google.com with SMTP id m6so6968930pfm.6 for ; Mon, 21 Dec 2020 11:05:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :cc; bh=DNBP8FmS68ALz62JZooxQSHw/ZFCTltSw0vNHNU1pT0=; b=GemqDIqEvFL23CrZSHfn8U5Phq9/96l1Eal1MJ1OfxzASfoxhQd02NSO3LLNa2JMMU KfLMN7OjNFw5tczcyUXoP9ufN6ju8ffzjxGY2uzmyqomPtk4d834nqjWggcZ1HPqMM34 xm3+EGhloUBl3J6qDOs6lxsTWF8ikG2NKbpMv/oOx3Jb6hXtnrOHsf9H6hv5T6Q3PVtL v2bvNYPA3sHDaHIlkaMpyy/LR9QhTlXAoBvKoUkOQQn0pI8cgrKFI3Su5q7ZYuhTmaZO 9RfgSDtlOexhPyg/SN/9uuZhdXBmIsJhkSCTmjm8bXPCG3jQZV5DNg+dWrTDHWePkhxp fKZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=DNBP8FmS68ALz62JZooxQSHw/ZFCTltSw0vNHNU1pT0=; b=eeBP48qs/MzwegXPkAYEK0xKu8iwfJzrwjEkIMZxfu18d/gLgXF4GVirwtNiMMzpHn 3AmrnwYSMV4U4Fezxu5adR6NtzB0v/vDfy3PhLgVCSpoNyp5oBJJxLyxTF72iZU8p5u4 V5XzJkQHgO7xNlrXD0XMNyTI1SrnmTl/crmaJmJU2F+X4AqAIZmZh1fC7hmA9fl9SmVt nu9czbRWf1tEt5nKG0+yen7s18Upq8qE3Ihh4zY+Dvis+fKh9JNnnNjG1EV9txidtJ3/ VCSlZeWZdGEC+Gxnx0hGvWVoHKPR+2yLt1k53HLfvRWFBEIkt4XihMVRFGuL/jKrdKS/ GzVw== X-Gm-Message-State: AOAM532BQR4mtP/ka3I8L62hZWZwPe3zakM5b6Yh7jPVMPgLfUZlRWcu yb4VAelkbBg/YToa0aAJcve9TL6fADUKRoRfrhs= X-Google-Smtp-Source: ABdhPJw+sYDnleocOJ5w4jVdAmMMSz9DZjLv5axHrcaCB5gtyZXeBkBV2jDi5RY4K81I+AECzqB2GV+yIodmKgtaeHY= X-Received: by 2002:a63:e40e:: with SMTP id a14mr16407418pgi.345.1608577524505; Mon, 21 Dec 2020 11:05:24 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 21 Dec 2020 13:05:23 -0600 In-Reply-To: <87a6u7dmnw.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=stefankangas@gmail.com; helo=mail-pf1-x429.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261420 Archived-At: Lars Ingebrigtsen writes: > I've been going through > > https://github.com/magnars/s.el > > to see whether there's anything there that seems both 1) useful and 2) > Emacs doesn't have already, but there was less than I remembered, > really. With the five functions I added, the rest are mostly just > aliases for stuff we have in Emacs 28. I had a look at GitHub to get some data, in case that helps. > Things I wasn't sure about: > > s-chomp (s) > > Is this really useful? Emacs is so un-line-oriented that I can't recall > having removed newlines from a string ever... It seems to have some real world usage, at least: https://github.com/search?l=Emacs+Lisp&q=s-chomp&type=Code > s-center (len s) > > I can squint a bit and almost see how this would be useful, but not > really? I can only remember padding either to the left or right. Not used a lot: https://github.com/search?l=Emacs+Lisp&p=2&q=s-center&type=Code > s-shared-start (s1 s2) > s-shared-end (s1 s2) > > I don't see the utility. Not used a lot: https://github.com/search?l=Emacs+Lisp&p=2&q=s-shared-start&type=Code > s-repeat (num s) > > This neither. Seems to see some use, but not a lot: https://github.com/search?l=Emacs+Lisp&q=s-repeat&type=Code > There's also a bunch of "titleize" functions that just seem to quirky. > And the camelCase and SnakeCase functions? Dunno, I think they're best > left in the s.el for people that want that. Unsure about titleize, but here we have: https://github.com/search?l=Emacs+Lisp&q=s-titleize&type=Code