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.bugs Subject: bug#74666: 31.0.50; Regression in replace-match with empty-adjacent groups Date: Tue, 3 Dec 2024 21:56:02 +1100 Message-ID: <5aad7547-5fd7-4eba-a6eb-38b1b4753dd8@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="13265"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 74666@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 03 11:57:26 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tIQar-0003Fb-Sh for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Dec 2024 11:57:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIQaY-0000Dm-2L; Tue, 03 Dec 2024 05:57:06 -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 1tIQaV-0000DO-OE for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2024 05:57:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIQaV-0004oy-FW for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2024 05:57:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:MIME-Version:Date:To:Subject; bh=KcokF8Nal4aDfysvWVCuV4Yx7WketgdS0G8fQqm3EL8=; b=Er8y+EJCKbYRmO6cAwUU8mTRwEMRRI0K/3VRmrXXgYO4BmZK0Rly4wwe60ctz/u28IchEOgCVm4b9odNvXQgQ6Z5RV9WKsvrfKPnLc+bbbY7davz2HnmnLqDHVgOBluO2A0YfkDFv07TPCgy+pCcHpsgzvHSpVxbKxf0uKAE7lgpK2xgfS5E0SU8fmlCjJxdN5y75FT2DRI5H7nS9lnzdeyPkl8XF2eUA5Idz5xYBI/7xCY9SxSh2JTyjfwlDYpEl5BNxzOCM5aO5aIzvyYWw4hIXPWmfPn/Ngq7mSPi2SZ3o98SDOkpUwRUjcmCaiDxFDNE/PwNldaTCTTdb01ElQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIQaU-0007Rf-Bi for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2024 05:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Campbell Barton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Dec 2024 10:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74666 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173322337328550 (code B ref -1); Tue, 03 Dec 2024 10:57:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Dec 2024 10:56:13 +0000 Original-Received: from localhost ([127.0.0.1]:58411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIQZg-0007QP-IO for submit@debbugs.gnu.org; Tue, 03 Dec 2024 05:56:13 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:33932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIQZd-0007QE-Kt for submit@debbugs.gnu.org; Tue, 03 Dec 2024 05:56:10 -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 1tIQZd-00008x-2H for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2024 05:56:09 -0500 Original-Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIQZb-0004kQ-AV for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2024 05:56:08 -0500 Original-Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-7fbc1ca1046so4880551a12.0 for ; Tue, 03 Dec 2024 02:56:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733223365; x=1733828165; darn=gnu.org; h=content-transfer-encoding:from:content-language:subject:to :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=KcokF8Nal4aDfysvWVCuV4Yx7WketgdS0G8fQqm3EL8=; b=WTNlCb9S+NNKoGY0ZMbadNBRMLF6T1IHcfA7Lrid17Rj0Vav9wonbyf3AoMiN10eMb PGXP62SzgGu/PcH/NdO8jpiAJugO/gfhQPBS2icN3lCaBpdY/UEoG+SND1l0usnzcdDf gYfpuAmS/dGOLQp1BZXHQPvMR6QVArXdXds8M8Bj8a0K5psJ6MtA/noBs3Eg2lMq2gjp KTwoADQJ5Ys4v+hlggklXQ5c202lyf7PiQ1CNbQiU2krg1tUuxZ1wp5BKDanST4v2n4j 020YPpY5zW+q7jVtj51coqLhgq3AoUnBhpjLSDbV+1M8orZnZMMq1ksOXeyCNSxgtu6w DbeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733223365; x=1733828165; h=content-transfer-encoding:from:content-language:subject:to :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=KcokF8Nal4aDfysvWVCuV4Yx7WketgdS0G8fQqm3EL8=; b=MhF0M0Uk5I3n0HAAFQ3+AlJoJKODUIwyBp91UDBl/rjQYXhuK/BNDPJ7DY5+EM8TgQ OYhkaLT/ZaWkjJt+6ZoegL33+tMsc7EFomvf2lvVuRt9b0Dy4LallyE+Ogmfx+fHqKKt YqoE52D+BOQyaox5ywVj60/kRgjxYeqZONClbSExXDzFzu9rCH3x6e5lKjNaLtcJdXVV /OxWp0vfR4C03iytsDdsFqE5hGxaLqnEoTpA4F1XfI+Zn02MBj1mSso6MJCfifK9w+uY 0ZNmPwD0fGFyXDjRGuvoqwSqMuj+j6ccl/4CMpJxUtCpcsBQHB8UHuG9dTgg7xjghvRm yXRg== X-Gm-Message-State: AOJu0Yx3sdV5rqToFpLFfYEaj6IwiLMn3PGbdl38cxzSlwBksnsVbVbp vtIvq7DqgLivRoRwXjU0s0G+5IYpLdsqtpK7/qC9epvxi1d5he3w9Z9fCA== X-Gm-Gg: ASbGncsMrnkx/M5GX1mENQCP16WjJSxTu+gm4zi2lWIaucR20uPlTaXZ4HRsqoWs/hS hMly9eZNMRLFKVanC9E2OtyJicQbKNN6xmaYtYcxMl3X168HWe8hb0FpwVkBV/mj+1yiBNnwgId ysPkJDNGVmpBjzVCgQKAntlypghbI0Hk4fOMQ1FONeFF1Yme4cseeyUaTndbRa33M8+VKnsV1N9 uR3NSr335f3/BBQ6c7SwUbV6+fsIs7uSoqzgDCP5s6Kl2T5Ufx0nrtL X-Google-Smtp-Source: AGHT+IH+PMZKqz8QKp+DPbrTu63vuOQ+ZY+dZJ0l4v8WRmjHIvcbTxJhP8Yn4UfEwKIFlHH4YvB2Hg== X-Received: by 2002:a17:90b:2f08:b0:2ee:aef4:2c5d with SMTP id 98e67ed59e1d1-2ef01259f1cmr2476579a91.26.1733223365060; Tue, 03 Dec 2024 02:56:05 -0800 (PST) Original-Received: from ?IPV6:2402:b801:2c65:4b00::1? ([2402:b801:2c65:4b00::1]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee61638836sm7523528a91.48.2024.12.03.02.56.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Dec 2024 02:56:04 -0800 (PST) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=ideasman42@gmail.com; helo=mail-pg1-x52e.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: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296362 Archived-At: Run the following file as an executable script: emacs -Q --batch -l ./emacs-test.el ;; BEGIN SCRIPT: #!/usr/bin/env -S emacs --batch -l ;;; emacs-git-log --- Batch check emacs-lisp. -*- lexical-binding: t -*- (defun printf (&rest args) (princ (apply #'format args) #'external-debugging-output)) (defun test-me (is-forward) (let ((result "")) (with-temp-buffer (insert "__B_\n") (save-match-data (set-match-data (list 2 4 2 2 2 4)) (cond (is-forward (replace-match "HELLO" t t nil 1) (replace-match "WORLD" t t nil 2)) (t (replace-match "WORLD" t t nil 2) (replace-match "HELLO" t t nil 1)))) (setq result (buffer-substring-no-properties (point-min) (point-max)))) result)) (printf "A: %s" (test-me t)) (printf "B: %s" (test-me nil)) ;; END SCRIPT: In emacs 29.4 this prints: A: _HELLOWORLD_ B: _HELLOWORLD_ In emacs 31.0.50 this prints: A: _WORLD_ B: _HELLOWORLD_ This is a regression in 47b497b4dac91e5ea56102018223bdeb5e21a93b. In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) of 2024-12-03 built on campbell-trx40aorusmaster Repository revision: 04d035acd72823e82dd61c4894f9c09113e65dd6 Repository branch: master System Description: Arch Linux Configured using: 'configure --prefix=/opt/emacs --with-sound=no --disable-acl --with-file-notification=no --with-xpm --with-native-compilation --with-jpeg --with-tiff --with-gif --with-png --without-compress-install --without-rsvg --without-lcms2 --without-libsystemd --without-gsettings --without-harfbuzz --without-m17n-flt --without-libotf --without-gpm --without-dbus --without-gsettings --without-gconf --without-selinux --without-gnutls --without-makeinfo --without-libgmp --with-zlib --with-threads --with-x-toolkit=gtk3 --with-xft --with-pgtk --with-tree-sitter --with-modules 'CFLAGS=-O3 -mtune=native -march=native -pipe -fomit-frame-pointer'' Configured features: CAIRO FREETYPE GIF GLIB JPEG LIBXML2 MODULES NATIVE_COMP PDUMPER PGTK PNG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LC_MONETARY: en_US.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: en_US.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dynamic-setting font-render-setting cairo gtk pgtk multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 53518 10389) (symbols 48 5294 0) (strings 32 18752 1367) (string-bytes 1 607905) (vectors 16 9151) (vector-slots 8 128466 8940) (floats 8 22 2) (intervals 56 268 3) (buffers 992 10))