From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Paul W. Rankin" Newsgroups: gmane.emacs.devel Subject: Can we add a delete-match function to subr(-x).el? Date: Sat, 25 Jan 2020 14:55:09 +1000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="35748"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.2.0; emacs 27.0.60 To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 25 05:56:09 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 1ivDUP-0009GK-B4 for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Jan 2020 05:56:09 +0100 Original-Received: from localhost ([::1]:50792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ivDUO-00050y-Ew for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Jan 2020 23:56:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44577) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ivDTp-0004ZN-F9 for emacs-devel@gnu.org; Fri, 24 Jan 2020 23:55:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ivDTo-0003VX-D6 for emacs-devel@gnu.org; Fri, 24 Jan 2020 23:55:33 -0500 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:58983) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ivDTn-0003Ta-UQ for emacs-devel@gnu.org; Fri, 24 Jan 2020 23:55:32 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 36D4C528 for ; Fri, 24 Jan 2020 23:55:29 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 24 Jan 2020 23:55:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=from:to:subject:date:message-id:mime-version:content-type; s= fm1; bh=FMOfgzYJ0JP+Vafkzjo37ezEv1qAomTgZDLHRjjvL40=; b=D1IQ9Yov +g6VA3KsItQlgEexeYbbIUMJ2cK5mhaBli2tdYx3LH36a+QwoNj6ioQJHiUxx/Pe q0mQLFGWJ9c1rOY7j/sm3EhfIcJqEypLFSRvL6G0Bq7Q6rCdlywTxyVdtuCd+LNq dDmOav6UsMgDBIQkQ71RTXfqef/Ewtqp4rqMRPYBE5jBExFDc7AxfNYtHwZSzIvA L/i5MTm0EpEbE0jeQgLVSloim/lADggEdzUcFrImHuv0WNIehMGLurQmGHmPvhFs 6Dubnyy7TkLle5jC7h0ypeP1f2Y0qCVyR92RTpz0vf4V5fBdjmIxW2153w4githE n1QRf7gskLdhiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=FMOfgzYJ0JP+Vafkzjo37ezEv1qAo mTgZDLHRjjvL40=; b=ZZtCULjVOzpA0Fcvf3m2ou7JCMCqli5M70lw5yGqYwtsh IpJK5MapvdtmhbA6hg+fg+cfPESD8hn7IhekaP/G6wZS0JqY/OOsFjRnAD7uH9jW h9+tQQ/z3AmsLxA2k+hl8JMTbc6mgKEUf9qASlkqy6rjw6ME1W3EiNe5PejEdYWE hnYVB5ZYkgYREzregK2h++kPsNomL95wElPA83BNmKTlvqNhAdpTHDMacX6VoWQo RD//R3u+uQF0hgij5kzvuZHLt3pdZY2IBUu14wpZ6OHjNa0NG+B8ajhATPOEotHj JYXl2v1d1Qhii62PVZOP4O7C3Mehd8cGN4y3NfYvg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrvdeigdejhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegfhffvufffkfggtgesthdtredttdertdenucfhrhhomhepfdfrrghulhcuhgdr ucftrghnkhhinhdfuceohhgvlhhlohesphgruhhlfihrrghnkhhinhdrtghomheqnecukf hppedugeegrddufedtrdduheeirdduvdelnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhephhgvlhhlohesphgruhhlfihrrghnkhhinhdrtghomh X-ME-Proxy: Original-Received: from localhost (unknown [144.130.156.129]) by mail.messagingengine.com (Postfix) with ESMTPA id 8C3DD3280059 for ; Fri, 24 Jan 2020 23:55:21 -0500 (EST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.147.123.20 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:244593 Archived-At: Hello Emacizens, I frequently forget that Emacs doesn't include a delete-match function to be called after (re-)search-forward or the like. Can we add something like the following to subr(-x).el? (defun delete-match (&optional subexp) "Delete text matched by last search. Optional argument SUBEXP specifies the subexpression to delete, or delete the entire match." (when (consp (match-data)) (unless group (setq subexp 0)) (delete-region (match-beginning subexp) (match-end subexp))))