From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: ideasman42@gmail.com Newsgroups: gmane.emacs.devel Subject: Re: Bug/regression in regex-replace (was fix for bug#67124) Date: Sat, 30 Nov 2024 13:49:24 +1100 Message-ID: <6617d273-3f8a-4209-8ec6-ab378c14b450@gmail.com> References: <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="13473"; 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 03:50:17 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 1tHDYn-0003NE-Nj for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Nov 2024 03:50:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHDY4-0004CT-Tr; Fri, 29 Nov 2024 21:49:32 -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 1tHDY3-0004CJ-ME for emacs-devel@gnu.org; Fri, 29 Nov 2024 21:49:31 -0500 Original-Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHDY2-0006cs-3I for emacs-devel@gnu.org; Fri, 29 Nov 2024 21:49:31 -0500 Original-Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7f71f2b136eso1649319a12.1 for ; Fri, 29 Nov 2024 18:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732934968; x=1733539768; darn=gnu.org; h=content-transfer-encoding:in-reply-to:references:subject:to:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=W+qChxWgio8G7+xEmr5tWQZDyu9RB8ADKXxya0cfbso=; b=g6VXu9SG8dob6dY92WO2wFFoGZEM/GQTHmVzSx2uOBorM3D9u+4VquEqiBARyKWh1C Zn9EAmBBLH/tGVlYtb7QqkhNHe597Bki4sJq4E0wfbvtrw4PMDnJqdeHD3EcNXYFQo6r N7qxUpbafi0MT3q5uvgoaOqFeOWlnZp8VX+yH21hYAobEJJB9Q/erfa8oMBzHtqFHHag j4O6vtw/f2/yd24d5jQKTuR1uMBBOsk0Bq2bxRHtzD+dvzdcR0SRqSTdSuQWF+PJjztg jgdJRpdoHhO0rB/mp+iF/0LJsIvNG9Bj7GCX4MGyWmPd0lfsV+T60FfWBpmiqpQvn1f4 2ObA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732934968; x=1733539768; h=content-transfer-encoding:in-reply-to:references:subject:to:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=W+qChxWgio8G7+xEmr5tWQZDyu9RB8ADKXxya0cfbso=; b=qdsIbqqFQA0l9yVXTMF6T24gYEXaYS6asL+5FKCZKuys2kyShkpXo5+LyIh9p4N058 h3q/Tb8xDDF7Wmp7W3KTB3FJK+7TCLVo4eHWnXgmiCaP20UfXMj7neqyty0zBAXCbH0G t2nGE5WPCpck2NEOv4s2aJ30rQ1mAo209+1ZOfo11+9202/MXnd+kGV+1AaP08YRz3jt 7a1cqVjHkLUXgIz+XtqdZp2VQIUwoqSOmlAfF3I9nR3RyLvGO9+UqxmNBpQNDtysYygT 7zak8wQ0Q8s+8aFrFunPeWGOG7nXMje3xs4oQOUbkqyrO0ScKw5Jz+9Zo9SrNKDYJdo0 pn2Q== X-Gm-Message-State: AOJu0YxFbUqziWeTTNkPr7xzU2UHVBMTq4C3LRU4lALRuV6//2MdGoBd 5Fb9fBYNBCJTjqYHFmyLBXHoY7lYzheg3CANmfVpiNIIR83vQpE85ZAFOg== X-Gm-Gg: ASbGncskWZSLBUewBS/5bjwNI0RHkS24hQPfideWNhjwtvrrvhKCw2+N94iEm/0JobY E+LbdZsbYtnc38dZxAPodM54mpJ3w5oMj8MFPlVPsNP/ZPGktADJpzM9S4cdfqqo3YCnYvzEktn jRfY3jk9RwHNubNy76qX5yxpgk5Z/+NAyF+psMbGkyqgDD00Dg7JiWxE7XoWpiNuNInoT6h8gmJ BTXXiN4fOeQkTt6/J8RSOqwsE9XvanzI0/t4OeWvAE/euDnx5lfyDj7 X-Google-Smtp-Source: AGHT+IGnUMNQw3pXeM94kx23zuPWgbgrM6swLnR/XeLIGf65XGZTq+bArGBZ1yiA2tCIv+l4zETvpQ== X-Received: by 2002:a05:6a20:6a28:b0:1db:eecb:f7a1 with SMTP id adf61e73a8af0-1e0e0b4f376mr21397840637.17.1732934967948; Fri, 29 Nov 2024 18:49:27 -0800 (PST) Original-Received: from ?IPV6:2402:b801:2c65:4b00::1? ([2402:b801:2c65:4b00::1]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fc9c3248e5sm3305427a12.44.2024.11.29.18.49.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Nov 2024 18:49:27 -0800 (PST) In-Reply-To: <775b1c65-081c-4a91-8a2d-4e7aba04b32c@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=ideasman42@gmail.com; helo=mail-pg1-x536.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:325863 Archived-At: On 11/30/24 12:24 PM, Campbell Barton wrote: > 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 To follow up on this problem, this looks like a more typical bug since swapping the order, so the empty match is replaced after the later, non-empty match still works, so I assume it's preferred to handle this via the bug-tracker instead of the mailing list.