From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: master 87e422f: Beef up the Emacs string utility set a bit Date: Tue, 22 Dec 2020 15:48:17 +0100 Message-ID: <87h7od99se.fsf@gnus.org> References: <20201221175345.27592.89597@vcs0.savannah.gnu.org> <20201221175347.9F1B820B76@vcs0.savannah.gnu.org> <87eejjdn8e.fsf@gnus.org> <87a6u7dmnw.fsf@gnus.org> <84D3EA2C-C81C-4056-AE71-0458905F231D@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29341"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Kangas , emacs-devel@gnu.org To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 22 15:49:06 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 1kriyE-0007Qy-Lt for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Dec 2020 15:49:02 +0100 Original-Received: from localhost ([::1]:55916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kriyD-0002jy-NK for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Dec 2020 09:49:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krixh-0002It-6J for emacs-devel@gnu.org; Tue, 22 Dec 2020 09:48:29 -0500 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:43492) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krixf-0006Jv-HT for emacs-devel@gnu.org; Tue, 22 Dec 2020 09:48:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=CcwDeVY9fPs0xwDkmhO7u1vBWa1i5f3FtTomruNCNDE=; b=f+Iuzh/CEKi1h24S/1gagpaNrR IVZ82OCu8sykVyxY4wJ7TWzxJsSiMJ+wCFe2FY2RyfOz7ll9EmOMP9Lcz2Gwdmo+MtJSfRQiiRmwO zCEHEOqxWAOGb9hyODI3AToyZ0NTIEbW1a6MUqqbHp7hmRH4TNW0nPDvLi4ceUxuIR3c=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1krixX-0007zC-04; Tue, 22 Dec 2020 15:48:23 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEXViIqxChShGyT8 /PynVVxjFBliWlvTzM03IiO3NT7gp6zLYmmdmprPfYH///9/Mt3QAAAAAWJLR0QOb70wTwAAAAd0 SU1FB+QMFg4gKSwrh7IAAAFKSURBVDjLndIxT8JAFAfwYljUhbtITFOXKmCYHVwdPIJMtoGmhM3o ycDGwHITiYTB5UAiyKgORAeuYWk6mtTlBvkAfhdx7r+D/oc3vN/wkveekTlipQZJxsjsV1PgkU0x PL8wDONFsw1h+XTFIYR7TgnDQd+HoPYGENbKaVQCAKF085UdBHber9cALEzpO5cAlDX1+wU7CTJ/ XWE1mQSbjlyWA0BMaTommEHIzEqBwtwpI3De+4c2ANpc3dURkMJNHV6QPFRdBiHrNSGYr37DRWBN ii6EOS2Oygi2Qk9C2H7zbAhR6IUQltGkNUMwVqx1kexT43g3GwQIzsi5vUYgySxQCAhRK5kCFANN g5wCr/ALFqEANiuJIiP6/jISOUnJP4AP79vD4YALznnc3pRO3NGcdw2hb+NYd/SpFronekJ/ig+h RffvM34AFqmtzNJH+loAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMTItMjJUMTQ6MzI6NDErMDA6 MDCsT9ZzAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTEyLTIyVDE0OjMyOjQxKzAwOjAw3RJuzwAA AABJRU5ErkJggg== X-Now-Playing: The Names's _Spectators Of Life_: "Mirrors" In-Reply-To: <84D3EA2C-C81C-4056-AE71-0458905F231D@acm.org> ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Tue, 22 Dec 2020 11:41:01 +0100") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org 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, 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:261489 Archived-At: Mattias Engdeg=C3=A5rd writes: > Thanks for the good work! I suggest that 'string-limit' be replaced > with two separate functions, 'string-prefix' and 'string-suffix', > because these are two different operations and it makes no sense to > multiplex them onto a single function with an argument saying which > one we are going to use. > > Suggested patch attached. The names can be discussed; for example, > 'string-left' and 'string-right' would do just as well. I'm not really enthusiastic about any of these names. When we're talking about suffixes, we're usually talking about file name suffixes like ".png", and this has nothing to do with that. These are functions for limiting the length of a string, and would be called `string-truncate' if it hadn't been for `string-truncate-left' already existing and doing something else, and `truncate-string-to-width' doing something else yet again. That is, these functions are not for picking out a part of a string, but for limiting the length, which makes `string-prefix' misleading as for what the intention is. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no