From: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 49842@debbugs.gnu.org
Subject: bug#49842: re-builder restriction to region (lisp/emacs-lisp/re-builder)
Date: Wed, 04 Aug 2021 13:59:26 -0700 [thread overview]
Message-ID: <87bl6d3p01.fsf@gmail.com> (raw)
In-Reply-To: <874kc5fz13.fsf_-_@gnus.org>
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 <larsi@gnus.org> writes:
> Karthik Chikmagalur <karthikchikmagalur@gmail.com> 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
next prev parent reply other threads:[~2021-08-04 20:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-03 4:03 bug#49842: re-builder restriction to region (lisp/emacs-lisp/re-builder) Karthik Chikmagalur
2021-08-04 1:28 ` bug#49842: re-builder restriction to region Karthik Chikmagalur
2021-08-04 7:29 ` bug#49842: re-builder restriction to region (lisp/emacs-lisp/re-builder) Lars Ingebrigtsen
2021-08-04 20:59 ` Karthik Chikmagalur [this message]
2021-08-05 10:57 ` Lars Ingebrigtsen
2022-08-22 11:01 ` Lars Ingebrigtsen
2022-09-19 19:22 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bl6d3p01.fsf@gmail.com \
--to=karthikchikmagalur@gmail.com \
--cc=49842@debbugs.gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.