From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Karthik Chikmagalur Newsgroups: gmane.emacs.bugs Subject: bug#49842: re-builder restriction to region Date: Tue, 03 Aug 2021 18:28:47 -0700 Message-ID: <877dh23smo.fsf@gmail.com> References: <87lf5jqing.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23610"; mail-complaints-to="usenet@ciao.gmane.io" To: 49842@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 04 03:30:27 2021 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 1mB5jn-0005wn-Cc for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Aug 2021 03:30:27 +0200 Original-Received: from localhost ([::1]:40400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mB5jm-0003pz-Dx for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Aug 2021 21:30:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mB5jP-0003pU-1Z for bug-gnu-emacs@gnu.org; Tue, 03 Aug 2021 21:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mB5jO-00040A-QV for bug-gnu-emacs@gnu.org; Tue, 03 Aug 2021 21:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mB5jO-00028T-M8 for bug-gnu-emacs@gnu.org; Tue, 03 Aug 2021 21:30:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87lf5jqing.fsf@gmail.com> Resent-From: Karthik Chikmagalur Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Aug 2021 01:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49842 X-GNU-PR-Package: emacs Original-Received: via spool by 49842-submit@debbugs.gnu.org id=B49842.16280405448112 (code B ref 49842); Wed, 04 Aug 2021 01:30:02 +0000 Original-Received: (at 49842) by debbugs.gnu.org; 4 Aug 2021 01:29:04 +0000 Original-Received: from localhost ([127.0.0.1]:41974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mB5iS-00026l-Iy for submit@debbugs.gnu.org; Tue, 03 Aug 2021 21:29:04 -0400 Original-Received: from mail-pj1-f50.google.com ([209.85.216.50]:53894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mB5iQ-00026A-KF for 49842@debbugs.gnu.org; Tue, 03 Aug 2021 21:29:03 -0400 Original-Received: by mail-pj1-f50.google.com with SMTP id j1so722086pjv.3 for <49842@debbugs.gnu.org>; Tue, 03 Aug 2021 18:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=xIKsHFeJJhePn33iqE+ldi93lhVjQb5dZCr1eturFdU=; b=qlIDdjvxDcXwUFg0+B51K0OYljg7fHsBHtAJDlVtx7B0twz3uCA7a9blDAIsDPR8w0 0E1vWvFzTIaGvCcYwSQNEOF0EbETLWu9bzNzdbJBKWTLNAeJeq2DoGRGJEPU8F9i3ETC 8fCpHANT279BlABI2tesv52PqG9jETmmHgFz5S6ilLJvqFnQDNK1ji06zlXij7mXTzfi FKUvvWopnEpkerbzWBBgX0yHU2OWKNg4r74LPIKRntVZEdkcTJv6+ELseoLSmT6iUUKE 8gKFLdOURJrHTvA/UdqErsbQkzBE0xK5qHhTWdCiWH83WZJVVZljCqGnJX+CDO4TuOeq CYXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=xIKsHFeJJhePn33iqE+ldi93lhVjQb5dZCr1eturFdU=; b=Ufv6lOEQTAhvbHu7VQb0CenzoFnio8XEVIQ15Yntien8FCDFGxnnoZPSNJ7NkVIBzy Iv6c9Sb5gGzQJZ90GWD93ze+bPApWGrve6TyEVJnv7yNeTZ840yLO2F0s4lbjnukfzFt eTTXZlAjnKRfvnq7v0WY8PZeG56zBe65F8EA3DYxAcxYSFqJq00Ph3gB3onPLjFJLp38 b7trBMcKxgUvYyCp/ElWJTqZ59nXogUz2zIFqUOD2wItsNneL53jJco4dSaj24cnEg80 AFhz75/wiMcAmKGpUU27SSk3h9DvzK1e03amF/+C34TR/4pz3N4JKaqWXAAi2bZfELqT lXjw== X-Gm-Message-State: AOAM533uvyJ2LkamnCaqstyWwA9Bbzv4TGAmCVvPqGXSO1Zi54hUJr6D OtcLkbdJDKzXqtSQU0TzweuyRA8LoM1ksA== X-Google-Smtp-Source: ABdhPJwnTppth5+h0Tdl/cXjSGZJnuW7u4XVoUsip/QlRRAgijj2fYsUcRMszX5Tx6II4UiFEteL/w== X-Received: by 2002:a17:90b:2284:: with SMTP id kx4mr24987176pjb.202.1628040536306; Tue, 03 Aug 2021 18:28:56 -0700 (PDT) Original-Received: from localhost (ip72-205-127-227.sb.sd.cox.net. [72.205.127.227]) by smtp.gmail.com with ESMTPSA id kr6sm4172612pjb.23.2021.08.03.18.28.55 for <49842@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 18:28:55 -0700 (PDT) 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" Xref: news.gmane.io gmane.emacs.bugs:211113 Archived-At: Hello, Please disregard this patch. With further testing this does not behave as expected. re-builder moves the point around in reb-target-buffer with each search, so (region-beginning) has a different meaning every time reb-update-overlays is called. As a result, this fails when, for example, we type in a regexp (in the re-builder buffer), then delete it and type in a new regexp. The new regexp is matched from the location of the first match of the old regexp instead of from the beginning of the region as originally specified by the user. IIRC, the right way to restrict this to the region would be to define a variable to hold the bounds of the region as specified by the user before starting re-builder and re-search-forward inside those bounds. Perhaps a closure that's tied to the specific re-builder session can be used to avoid issues with the value of this variable when running multiple simultaneous re-builder sessions. Karthik