From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Campbell Barton Newsgroups: gmane.emacs.devel Subject: Bug/regression in regex-replace (was fix for bug#67124) Date: Sat, 30 Nov 2024 12:24:01 +1100 Message-ID: <775b1c65-081c-4a91-8a2d-4e7aba04b32c@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6782"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 30 02:24:52 2024 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 1tHCE8-0001Zv-CO for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Nov 2024 02:24:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHCDR-0006S2-52; Fri, 29 Nov 2024 20:24:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHCDQ-0006Rf-Al for emacs-devel@gnu.org; Fri, 29 Nov 2024 20:24:08 -0500 Original-Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHCDO-0002Sn-Dx for emacs-devel@gnu.org; Fri, 29 Nov 2024 20:24:08 -0500 Original-Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7253bc4d25eso1631052b3a.0 for ; Fri, 29 Nov 2024 17:24:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732929844; x=1733534644; darn=gnu.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=iG/g6NaNP6IIMRo0ELpecaZ6THIT+II39lM6BPF2RV0=; b=MBJBbBQbCUA9AVy6bZZZxaUBNezpZgw5PMo5kR1a7pZn/MbwyT1mcHUbg4nvT3R/ux fvTUc2T2gBCMpQGA+z0YRTFknz9d3gYc25ebl3WQfs+48NLSyqYXjOEJz7oz6BA0P3QP xNdbff57p3WfxuQ9+ID+0KkOhSMhho/Pj19pljqrMUOBaGCFui/nQRf0lB07f2Ob0GWI HX0vwNcHgPNBBuhocCwabkE+4d8DYaz7cDk2IdkMdg7TPkEp/h3F9ZqVY/VK8ULbFUwk 2HvHNzTXt/5O7X2/XP+IFoy8lol0r+bVtAkwkoJD0dmZx/bjRKvkdFEIaZurXWsFzhlW 23AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732929844; x=1733534644; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=iG/g6NaNP6IIMRo0ELpecaZ6THIT+II39lM6BPF2RV0=; b=tBY9KQumdOYbHxu5jUA6H0oeZFs5F0ouFS/vUrT5OBywt5oRNqsEifKdcdozqjQqkL V+PYYiDCYAoYx5MeSPm11tcxmUNCJcEhwha9Dq6lVM0gi7vNoYmtPxV5hiwAh3ToyYOv QO106obUzFFE25rpA+UmDGfn9XCFe+dTURowCwWgHdkqL3Sk2e5BlY3Xl3uEcVNPMkeK Ualu4GnQDL3S+J4Kil1uw56QmHk8Hp4cWrFXi800/tW+W6keEf7+IVpb35wti0SGVumk VZ8H1Lv9Ln9Kh4zkdhACGhi+WM2QyXM7wbV4rg/S/icgVrYoFcv3mMC/h7ypCU3n0JAP 0wdA== X-Gm-Message-State: AOJu0Yz2dc9ckL8x8BLCJoH5zs+wL82P2hqoWgKHkBBSLUYXHuUkbL8i 87Z+o7aRooNkVNox2WMRloVz8irgy0M9ovOLRZppWmgXZcGQz7LyIAQgyw== X-Gm-Gg: ASbGncvd8sHGWuttvS6dtiYkv22Z6Wx6gEkTPANZ6O8dzI92k/pwx6UkIhKY/kShnwT Lw/x3QDHH1/UGHvttBA3Zuvl7ahCGR/3mgJ7ER+SvxUwFQkmBruQP3gtj+o83xfhzhG8gas1YES n0tkHuApNH9Ls21ZceDHDDoivROCoF9khqoB/SOBtoXxdmNJedwVA27/ZwGxZ7JcCiUDo63LpYB BYHOtyGLMewPqJIkSfJMRqE7iAcpgvJBFuOYfDG/+W2KQYbzItwjFTU X-Google-Smtp-Source: AGHT+IFqvImGlZ5Z8hfSxHdMlnuhyC+wLN0JD3hCsDqkZFVHgNn69DFckjkmagNpZI3kXIGCRnJGdg== X-Received: by 2002:aa7:93b5:0:b0:725:3fb5:5151 with SMTP id d2e1a72fcca58-7253fb5528amr12304671b3a.12.1732929844177; Fri, 29 Nov 2024 17:24:04 -0800 (PST) Original-Received: from ?IPV6:2402:b801:2c65:4b00::1? ([2402:b801:2c65:4b00::1]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725417fbacdsm4114571b3a.95.2024.11.29.17.24.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Nov 2024 17:24:03 -0800 (PST) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=ideasman42@gmail.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325861 Archived-At: Hi, the commit 47b497b4dac91e5ea56102018223bdeb5e21a93b by Stefan Monnier (an alternate fix for bug#67124) has broken the evil-numbers package [0], causing it's tests to fail. From a user perspective: `evil-numbers/dec-at-pt` on `0` to result in `1` instead of `-1`. The change seems to be caused by (set-match-data ...) using passing in a pair of identical points (a match with zero length), then a call to regex-replace to insert text into the empty match (the numbers "sign" in this case). I'm not sure if this would be considered a bug, or if creating an empty group is considers incorrect use of the API, in that case - invalid input might raise an error instead of failing silently. Whatever the case this used to work - and the commit doesn't indicate the change was intentional. [0]: https://github.com/juliapath/evil-numbers