From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: Improve `replace-regexp-in-string' ergonomics? Date: Tue, 12 Oct 2021 13:33:21 +0000 Message-ID: <87ily2v04e.fsf@posteo.net> References: <878rzpw7jo.fsf@gnus.org> <875yuban9b.fsf@mail.linkov.net> <871r4qalit.fsf@mail.linkov.net> <87h7dme953.fsf@gnus.org> <87r1cqct4f.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36967"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Juri Linkov , Stefan Monnier , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 12 15:40:24 2021 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 1maI11-0009Pf-Br for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Oct 2021 15:40:23 +0200 Original-Received: from localhost ([::1]:53958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maI0z-0004i8-RE for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Oct 2021 09:40:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maHuR-0004j5-Bc for emacs-devel@gnu.org; Tue, 12 Oct 2021 09:33:35 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:47525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maHuN-0003L0-5k for emacs-devel@gnu.org; Tue, 12 Oct 2021 09:33:34 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 06998240107 for ; Tue, 12 Oct 2021 15:33:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1634045607; bh=/mVxVmJsma2qnlw6m3VYFQZ5x/xExBtbH+ca153vYn4=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=Gl4KoPI1Yy70F+v35xAQu36pUbWgHUpU/pHf4fd4eKdb25MgKMkSm4zJF3BPFk4bZ 3Gd3URPGkt91z/C+VxGKCXXvzrrLWUl0AAiGg4uhVd5wqq8g3UVAbSLnIkHzrYvG31 wfQXiTxStI2ZEIFIe0DNw2TBKU8rPudGthn7osagLr2x9/A6RB2AhC07tq4CpJBYlN NFSxiKjjXuJ4IdyUoZHlsjOpO68PPIIEw92ZMOULAEdPpbSHLEHBddWCzU5PANyzaJ QOpu+TURRtHZBqgzA5Hmwu09mYSQx5umhjP15D4/ly+ap1nD4Q2mctYCxRUc7y9my6 jhPRJUkcxbMAA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HTGnw3g17z9rxK; Tue, 12 Oct 2021 15:33:24 +0200 (CEST) Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata= mQGNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA AbQSdGhpZXZvbEBwb3N0ZW8ubmV0iQHUBBMBCgA+FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAl8y lcICGwMFCQPCZwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQDsVtFB0W75MB3QwAlTsVzFmr +S/tMKwwwOibjhNPi/OZiUC2AYfaqfVAiIHDT3RbzDe03sAJoomJkJnYVjGzQZwibCMO2+ITkMPV 2wvrd4CbgS1KCVbrltwcuK/nxPCBaHytOCZUIInnhJo5PE/h03K In-Reply-To: <87r1cqct4f.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 12 Oct 2021 14:41:52 +0200") Received-SPF: pass client-ip=185.67.36.66; envelope-from=thievol@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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:276801 Archived-At: Lars Ingebrigtsen writes: > Stefan Monnier writes: > >> BTW, the current limit on backrefs is just due to a lack of syntax for >> higher-numbered backrefs, so it would be easy to lift this limit: it's >> a small matter of choosing an appropriate syntax and then adjusting the >> code that parses the regexps in regexp.c. > > A small matter indeed. :-/ > > But perhaps it would be worth doing -- arbitrary limitations like that > goes against everything GNU stands for! What about providing a simple anaphoric `and`? (let ((bar "bar")) (helm-aand bar (replace-regexp-in-string "b" "f" it) (replace-regexp-in-string "a" "o" it) (replace-regexp-in-string "r" "o" it))) =>"foo" And in addition it can be used for something else. -- Thierry