From unknown Wed Jun 18 23:13:09 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#49842 <49842@debbugs.gnu.org> To: bug#49842 <49842@debbugs.gnu.org> Subject: Status: re-builder restriction to region (lisp/emacs-lisp/re-builder) Reply-To: bug#49842 <49842@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:13:09 +0000 retitle 49842 re-builder restriction to region (lisp/emacs-lisp/re-builder) reassign 49842 emacs submitter 49842 Karthik Chikmagalur severity 49842 wishlist tag 49842 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 03 00:03:42 2021 Received: (at submit) by debbugs.gnu.org; 3 Aug 2021 04:03:42 +0000 Received: from localhost ([127.0.0.1]:39600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAleY-0001n5-3i for submit@debbugs.gnu.org; Tue, 03 Aug 2021 00:03:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:58656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAleW-0001my-VW for submit@debbugs.gnu.org; Tue, 03 Aug 2021 00:03:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAleW-00018Q-NQ for bug-gnu-emacs@gnu.org; Tue, 03 Aug 2021 00:03:40 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:54786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAleV-0000w4-2x for bug-gnu-emacs@gnu.org; Tue, 03 Aug 2021 00:03:40 -0400 Received: by mail-pj1-x1030.google.com with SMTP id a8so5000550pjk.4 for ; Mon, 02 Aug 2021 21:03:38 -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=mwq0tA6JoDe+3JxInZbJDEczSNXRCRb4mjcWR/eYPI8=; b=ZNzOOmSDkVbzvwE3kuTWTslUtoIn+PS72dHxnTAN8jPLc3ZSmSwMA5jw9GgeoGCurh GIR+m+FadN0Z5Rg+gL6ts9FB2GY0Vogx5fTW+Y4IQJCBteBsM6J+yqN72YdsEk8tovvn O2bcNw7sXtDLc/HxwnOx60SlCQteb+WZHz45FaaBKJ27R7YlXUwEx/EAlglrN97aTxtb EX7M/pgoJq77N07AZej3HgwZq3z/rL2ScuFDuXa/pOysjX0TpcHshvATt1xYv03khoKz Ea46HaD+KW63E2Vg9faw356LkW7M5QgLlr9zHxZ7q8JfSwZ07wgx/HIkHqJgJcw805qJ NUhA== 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=mwq0tA6JoDe+3JxInZbJDEczSNXRCRb4mjcWR/eYPI8=; b=um8BRSbdsn5/dJIrQC/fPLuBBZHvr5IUtSTKvQ9EMeWO9fEW2sM6L2v8eQ278s3Cun Bqo2YLIlrRPktyRtmncjzSndvimQVCIWBbunZKiEfy3TAgTtfdi+3cAhHYQ/EaeEl841 CW1MRBrnMlIswGMmQZHciab6L3gpAbk0qjK4dHJTevFZBdb4zshPvBMEkDAuz0M3K2Vd vbjwJhsZMYx6ShL1K0hrCYijUUjVXcMPxQjSMKcVXA4YNfmhr+IQ2XLcHChSeD2SC6M4 rZQCg/dNmSJ99LkY+5BqxYxhpciNmHbXs0Xp+HCoSFqvKCWwI0fDiSBa3y+nWUZooyN9 BkWQ== X-Gm-Message-State: AOAM5319HRvk77X6M/Z2pseEPmrzni7+cCI48eWqVAJJw8AA+KRiOOJq PJLidBilft5b1VltL9G4wmEUWT5mwDerWw== X-Google-Smtp-Source: ABdhPJyTAkmz0QTSKQpXutiCzTI8gm8lZOSYqS+UEFQND520h/cmTqAmWhM3RGsCC8VRhA5J+CNFVw== X-Received: by 2002:a63:e807:: with SMTP id s7mr805787pgh.200.1627963417138; Mon, 02 Aug 2021 21:03:37 -0700 (PDT) Received: from localhost (169-231-132-213.wireless.ucsb.edu. [169.231.132.213]) by smtp.gmail.com with ESMTPSA id y139sm13163843pfb.107.2021.08.02.21.03.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 21:03:36 -0700 (PDT) From: Karthik Chikmagalur To: bug-gnu-emacs@gnu.org Subject: re-builder restriction to region (lisp/emacs-lisp/re-builder) Date: Mon, 02 Aug 2021 21:03:31 -0700 Message-ID: <87lf5jqing.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=karthikchikmagalur@gmail.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Hello, The function "reb-update-overlays" (in lisp/emacs-lisp/re-builder.el) displays matches in the whole of reb-target-buffer starting at (point-min) even when the region is active. In keeping with the behavior of commands like query-replace, replace-regexp and query-replace-regexp, I modified it so that when the region is active re-builder only displays matches in the active region. It's behavior is unchanged when the region is inactive. I think this change makes sense without disrupting the expectations of re-builder users. More generally, I think re-builder needs some work: 1. When the user quits re-builder, the point in reb-target-buffer is not restored correctly. 2. Without an active region, there should be an option to match forward or backward from reb-target-buffer's point instead of always matching from (point-min), with the ability to customize the default behavior. 3. re-builder's overlay system (or some modification of it) can be used by query-replace-regexp to show matches as the user types. I am waiting to sign the copyright papers from FSF (which I have applied for) before sending in these larger patches. Commit log entry: * lisp/emacs-lisp/re-builder.el (reb-update-overlays): Restrict re-builder matches to region when the region is active. Karthik Chikmagalur --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=re-builder.patch diff -u emacs-src/lisp/emacs-lisp/re-builder.el emacs-src/lisp/emacs-lisp/re-builder-new.el --- /lisp/emacs-lisp/re-builder.el 2021-08-02 20:47:39.226669281 -0700 +++ /lisp/emacs-lisp/re-builder-new.el 2021-08-02 20:37:27.442020958 -0700 @@ -642,16 +642,19 @@ (submatches 0) firstmatch here + start end firstmatch-after-here) (with-current-buffer reb-target-buffer (setq here (if reb-target-window (with-selected-window reb-target-window (window-point)) - (point))) + (point)) + start (if (region-active-p) (region-beginning) (point-min)) + end (if (region-active-p) (region-end) (point-max))) (reb-delete-overlays) - (goto-char (point-min)) + (goto-char start) (while (and (not (eobp)) - (re-search-forward re (point-max) t) + (re-search-forward re end t) (or (not reb-auto-match-limit) (< matches reb-auto-match-limit))) (when (and (= 0 (length (match-string 0))) Diff finished. Mon Aug 2 20:48:01 2021 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 03 21:29:04 2021 Received: (at 49842) by debbugs.gnu.org; 4 Aug 2021 01:29:04 +0000 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 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 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) 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) From: Karthik Chikmagalur To: 49842@debbugs.gnu.org Subject: re-builder restriction to region Date: Tue, 03 Aug 2021 18:28:47 -0700 Message-ID: <877dh23smo.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49842 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 04 03:29:54 2021 Received: (at 49842) by debbugs.gnu.org; 4 Aug 2021 07:29:54 +0000 Received: from localhost ([127.0.0.1]:42525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBBLe-0003EM-Bw for submit@debbugs.gnu.org; Wed, 04 Aug 2021 03:29:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:37222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBBLd-0003E9-0J for 49842@debbugs.gnu.org; Wed, 04 Aug 2021 03:29:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4bVFKC0NaIZj+Vipub3RCfh1G1p6K0KqiJ8Utu7qThk=; b=fqLmP8Eo0Mv/uJ+ztYB9B9QiTe nz5iqRu0CYJMSdaRR/c+b1HVeqotV78caJpgatnK9GukEUxdjjwGrER4TpvyNbUijA6T6LW9ZDHrQ 2kCiAhrpq7HalaxYJwpREfXcGWqUQSGwZ6EyMSLpbUkFtdqN+hNcyxgRR9ad7RsvZFdo=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBBLU-00057t-MD; Wed, 04 Aug 2021 09:29:46 +0200 From: Lars Ingebrigtsen To: Karthik Chikmagalur Subject: Re: bug#49842: re-builder restriction to region (lisp/emacs-lisp/re-builder) References: <87lf5jqing.fsf@gmail.com> <877dh23smo.fsf@gmail.com> Date: Wed, 04 Aug 2021 09:29:44 +0200 In-Reply-To: <877dh23smo.fsf@gmail.com> (Karthik Chikmagalur's message of "Tue, 03 Aug 2021 18:28:47 -0700") Message-ID: <874kc5fz13.fsf_-_@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Karthik Chikmagalur writes: > 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 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49842 Cc: 49842@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Karthik Chikmagalur writes: > 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. I'm not very familiar with re-builder.el myself, but I think that sounds like a promising approach. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 04 16:59:37 2021 Received: (at 49842) by debbugs.gnu.org; 4 Aug 2021 20:59:37 +0000 Received: from localhost ([127.0.0.1]:45265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBNzE-0001wI-R2 for submit@debbugs.gnu.org; Wed, 04 Aug 2021 16:59:37 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:38611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBNzC-0001w4-HA for 49842@debbugs.gnu.org; Wed, 04 Aug 2021 16:59:35 -0400 Received: by mail-pj1-f48.google.com with SMTP id mz5-20020a17090b3785b0290176ecf64922so10632397pjb.3 for <49842@debbugs.gnu.org>; Wed, 04 Aug 2021 13:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Z9mmKAB8ccmnqoN2rJwKpJS19dOSLFLGtV1GC5Pq6Io=; b=V9OLjLU84HKcd3TSIWjluueyRaUDkTYpts0cC1DKNIlffWA6ky7v7HdNkDmTwOOl3V JTdFNgFNOlLGHbyFcrCiKq0fwyYjPyKysQ6j4vwRiie5g67LKNEac0SDi+Hg0oaxcDFz JJN6Uvydlivn5Z9djRHsuJPypEnHwiOGJyYa8aflR5TG6THsJ7Q1UdpSEQy+BMk8tQ7u YLLDpDlqMEBDPVZcWxwK0uzH5Iw1P3PhI5t+LFNiiYd4SwTcsH/BtHuUTnNwakaXVj9M Gqyp/1mt+YonHj/G6gr0uCnanum31rZEnGfIVEdW9dxiYaWAt89D8zbADsk7Ju1rx9NR G5RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Z9mmKAB8ccmnqoN2rJwKpJS19dOSLFLGtV1GC5Pq6Io=; b=J56YwF0Craci6xL/vu2NvD3v1ow8+iRDEddll0O3GJNiGezXsebP4xy2RYBed05tuF KYdy67Cf5Wq8bDZrIvb0s5skLtUPFCIZ4veGE4XjMKManC7YKQE+Osw1fq715+sakfhE hjvuMYUesI4VQG0PNIo77+4bfcOukkIKbHZ9wPP5I3htxcuWl9GcU5PYOf4fCAFHoaqd V0M99yNZUStqq5Devh+0KqL3hDC3xH3UF5zcTVfld8/rfsqFLmwN4E0CMgt4KsnDy2Lq zUUviaC1H/PWJ08GPCcGUgag+kUQLD3CWxseC1WKw3OxnO8i0sJTSwJZmwc7ZL947QLO 118Q== X-Gm-Message-State: AOAM532dWw4VLd7KMHUeowe375W56GuojOSr6Mjz9gWoZEa5PohrhbF5 m7ik6HGJp/KyzyEiD3uayBE= X-Google-Smtp-Source: ABdhPJybmOMpYUI1ziu7GgqzdFxcDx4AFo7bTbnllVluEeX4jt06fk0RWwHxyb/tvfnrZf0JG3643Q== X-Received: by 2002:a17:90b:818:: with SMTP id bk24mr11309839pjb.21.1628110768572; Wed, 04 Aug 2021 13:59:28 -0700 (PDT) Received: from localhost (169-231-132-213.wireless.ucsb.edu. [169.231.132.213]) by smtp.gmail.com with ESMTPSA id p2sm7114461pjz.33.2021.08.04.13.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 13:59:28 -0700 (PDT) From: Karthik Chikmagalur To: Lars Ingebrigtsen Subject: Re: bug#49842: re-builder restriction to region (lisp/emacs-lisp/re-builder) In-Reply-To: <874kc5fz13.fsf_-_@gnus.org> References: <87lf5jqing.fsf@gmail.com> <877dh23smo.fsf@gmail.com> <874kc5fz13.fsf_-_@gnus.org> Date: Wed, 04 Aug 2021 13:59:26 -0700 Message-ID: <87bl6d3p01.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49842 Cc: 49842@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I'm working on a few improvements to re-builder including the above, and need to store some state information (bounds of region, etc) that persists until the re-builder session is closed. I see two ways to do this: 1. With a buffer-local variable in reb-target-buffer, with the assumption that only one re-builder session can be run per buffer. 2. With a lexical closure in the re-builder update code. I'm not very familiar with elisp best practices, is there a reason to prefer one over the other beyond the direct effect on the re-builder code logic/complexity? Karthik Lars Ingebrigtsen writes: > Karthik Chikmagalur writes: > >> 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. > > I'm not very familiar with re-builder.el myself, but I think that sounds > like a promising approach. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 05 06:58:09 2021 Received: (at 49842) by debbugs.gnu.org; 5 Aug 2021 10:58:09 +0000 Received: from localhost ([127.0.0.1]:46029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBb4i-00069E-Nr for submit@debbugs.gnu.org; Thu, 05 Aug 2021 06:58:08 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBb4g-00068h-ST for 49842@debbugs.gnu.org; Thu, 05 Aug 2021 06:58:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=A4lSoFQoWnhFIPRvsCEw++quWAzVHXHMQ+tu0ZA3PjY=; b=J5Gmr4uIT3MezUeY5DZOUj5mch KqdaeeeiiNTJo5Y15FTYhgGSwH5wXEK63wD6xBvXUN6I2QRaTwImqQzzEr/gJIPr8GSvcNXI04Ybj wvreY7L7VY3BYIbg8i2sgLncsaO+vW5HOvEfalRVtr8a3SQwDMQHOG+HZBauCojhpT6U=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBb4Y-0002mj-HN; Thu, 05 Aug 2021 12:58:00 +0200 From: Lars Ingebrigtsen To: Karthik Chikmagalur Subject: Re: bug#49842: re-builder restriction to region (lisp/emacs-lisp/re-builder) References: <87lf5jqing.fsf@gmail.com> <877dh23smo.fsf@gmail.com> <874kc5fz13.fsf_-_@gnus.org> <87bl6d3p01.fsf@gmail.com> Date: Thu, 05 Aug 2021 12:57:58 +0200 In-Reply-To: <87bl6d3p01.fsf@gmail.com> (Karthik Chikmagalur's message of "Wed, 04 Aug 2021 13:59:26 -0700") Message-ID: <87a6lwi2fd.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Karthik Chikmagalur writes: > I'm working on a few improvements to re-builder including the above, > and need to store some state information (bounds of region, etc) that > persists until the re-builder session is closed. I see [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49842 Cc: 49842@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Karthik Chikmagalur writes: > I'm working on a few improvements to re-builder including the above, > and need to store some state information (bounds of region, etc) that > persists until the re-builder session is closed. I see two ways to do > this: > > 1. With a buffer-local variable in reb-target-buffer, with the > assumption that only one re-builder session can be run per buffer. > > 2. With a lexical closure in the re-builder update code. > > I'm not very familiar with elisp best practices, is there a reason to > prefer one over the other beyond the direct effect on the re-builder > code logic/complexity? Traditionally, Emacs Lisp didn't have lexical binding, so people usually stashed the data in buffer-local values. Now that all of the in-tree code uses lexical binding, I think using closures usually gives more readable and maintainable code. But it's up to the person implementing it what they prefer, or what makes most sense to them in that particular case, really. (Sometimes using buffer-local values is much more convenient, and sometimes closures are.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 22 07:02:06 2022 Received: (at 49842) by debbugs.gnu.org; 22 Aug 2022 11:02:06 +0000 Received: from localhost ([127.0.0.1]:38094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ5C1-0008GI-Ny for submit@debbugs.gnu.org; Mon, 22 Aug 2022 07:02:05 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ5C0-0008Fp-54 for 49842@debbugs.gnu.org; Mon, 22 Aug 2022 07:02:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AxkiEZjI8m5sHyldAUt83FLAlJwE7SQILoHYRydP25Q=; b=pYD9bkVheIEfyediMRG40XYF7x L0PTylsQzydVajbwS9LXtEPA6VT0XT6TSZFymIBbTK8b0J3dQcEUq6UnlQH5oyfsLMThpGA648sSs 3wwgZJNarxQRkizz+6gdKiU27KNZuTkrXiU7d2jMbu5OiA3VVNRfqpTHTtA3BpIqInYU=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQ5Bo-0004f5-Du; Mon, 22 Aug 2022 13:01:58 +0200 From: Lars Ingebrigtsen To: Karthik Chikmagalur Subject: Re: bug#49842: re-builder restriction to region (lisp/emacs-lisp/re-builder) In-Reply-To: <87bl6d3p01.fsf@gmail.com> (Karthik Chikmagalur's message of "Wed, 04 Aug 2021 13:59:26 -0700") References: <87lf5jqing.fsf@gmail.com> <877dh23smo.fsf@gmail.com> <874kc5fz13.fsf_-_@gnus.org> <87bl6d3p01.fsf@gmail.com> X-Now-Playing: DMX Krew's _Sound of the Street_: "Sound of the Street" Date: Mon, 22 Aug 2022 13:01:51 +0200 Message-ID: <871qt8a6e8.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Karthik Chikmagalur writes: > I'm working on a few improvements to re-builder including the above, > and need to store some state information (bounds of region, etc) that > persists until the re-builder session is closed. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49842 Cc: 49842@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Karthik Chikmagalur writes: > I'm working on a few improvements to re-builder including the above, > and need to store some state information (bounds of region, etc) that > persists until the re-builder session is closed. This was a year ago -- did you make any further progress here? From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 22 07:02:17 2022 Received: (at control) by debbugs.gnu.org; 22 Aug 2022 11:02:17 +0000 Received: from localhost ([127.0.0.1]:38097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ5CD-0008Gk-1O for submit@debbugs.gnu.org; Mon, 22 Aug 2022 07:02:17 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ5C7-0008GQ-UC for control@debbugs.gnu.org; Mon, 22 Aug 2022 07:02:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=UuyQ4fK0Z8lkV4imN8Hsq7RkC3WxqSjwuxEGyBbS02c=; b=DHhRdMjCWUfAGnNP/H4Y4eXsbt uZRYlI+BPpTGKrAXy3KO0wu18eNLVCBh1mOMqY8mshxIRo6xh3Vq+m9DmPrxplOjy+KwM8GHoM7a+ KTuzav09gDBcMXG+6VzKpPAUG4b0EQ2XQYSHBzYIpJ9zzyUSftpf6Q7ZI1aUDoo69YY8=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQ5Bw-0004fD-Cf for control@debbugs.gnu.org; Mon, 22 Aug 2022 13:02:06 +0200 Date: Mon, 22 Aug 2022 13:01:59 +0200 Message-Id: <87zgfw8rtk.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49842 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 49842 + moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 49842 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 15:22:47 2022 Received: (at 49842) by debbugs.gnu.org; 19 Sep 2022 19:22:47 +0000 Received: from localhost ([127.0.0.1]:55310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaMLv-0000Ab-Ha for submit@debbugs.gnu.org; Mon, 19 Sep 2022 15:22:47 -0400 Received: from quimby.gnus.org ([95.216.78.240]:37294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaMLu-0000AL-EX for 49842@debbugs.gnu.org; Mon, 19 Sep 2022 15:22:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9DhGgDKoaYOcPqULSjhzxbLEzH0UJN4fafL1hKUSQGA=; b=eStVhegfIWuTuRGi6ZUPmv2iDZ uJSM2/qh8jN1HBjYQYmUrh7Pnd9Hfhk+lE1QllKjY+/G1jUp7TyDsqKspMsO7/Ujt35X7ZeWE4pX/ SEswOTfscss+jNP+8a4hUvhFApqe7JEU9BI6ne2Ve5CS5333bSpkbmc/tuo3foXDIPPU=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaMLm-0003LZ-Lk; Mon, 19 Sep 2022 21:22:40 +0200 From: Lars Ingebrigtsen To: Karthik Chikmagalur Subject: Re: bug#49842: re-builder restriction to region (lisp/emacs-lisp/re-builder) In-Reply-To: <871qt8a6e8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 22 Aug 2022 13:01:51 +0200") References: <87lf5jqing.fsf@gmail.com> <877dh23smo.fsf@gmail.com> <874kc5fz13.fsf_-_@gnus.org> <87bl6d3p01.fsf@gmail.com> <871qt8a6e8.fsf@gnus.org> X-Now-Playing: Wrongtom Meets The Rockers - =?utf-8?Q?=E2=80=98Dub?= In The =?utf-8?Q?Supermarket=E2=80=99?= (Exclusive remix)'s _Late Night Tales: Version Excursions (Selected By Don Letts)_: "Originally recorded by The " Date: Mon, 19 Sep 2022 21:22:38 +0200 Message-ID: <87k05zp3sx.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: >> I'm working on a few improvements to re-builder including the above, >> and need to store some state information (bounds of region, etc) that >> persists until the re-builder session is closed. > > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49842 Cc: 49842@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: >> I'm working on a few improvements to re-builder including the above, >> and need to store some state information (bounds of region, etc) that >> persists until the re-builder session is closed. > > This was a year ago -- did you make any further progress here? And this was a month ago, so I'm guessing there isn't going to be any further progress in this bug report, so I'm closing it. If further progress can be made, please respond to the debbugs address and we'll reopen. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 15:22:52 2022 Received: (at control) by debbugs.gnu.org; 19 Sep 2022 19:22:52 +0000 Received: from localhost ([127.0.0.1]:55313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaMLz-0000As-Qg for submit@debbugs.gnu.org; Mon, 19 Sep 2022 15:22:52 -0400 Received: from quimby.gnus.org ([95.216.78.240]:37308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaMLy-0000AR-BV for control@debbugs.gnu.org; Mon, 19 Sep 2022 15:22:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NCd/y11SzQa6KvSO2/wc7ji2+ZDSQQdn5yZ7+98xmRs=; b=Qxxdm5pilT1IZxMFo3iUvQr6SK KdR6CI2BNZgemP9941382PiE98Xo7BIfydOr+a65ZuNnZj4igFXwGAMFIQGJ9rY3XiMbi0oMinpPF /JK56ofrNYYEkiX53t99/tU1gtm4DDWY6EPWTRtc6D0V6z42V9JtFCdxW+qP7i5QGyVo=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaMLq-0003Lj-R7 for control@debbugs.gnu.org; Mon, 19 Sep 2022 21:22:44 +0200 Date: Mon, 19 Sep 2022 21:22:42 +0200 Message-Id: <87illjp3st.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49842 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 49842 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 49842 quit From unknown Wed Jun 18 23:13:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 18 Oct 2022 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator