all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 66261@debbugs.gnu.org
Subject: bug#66261: Disassembling a regexp's bytecode
Date: Fri, 29 Sep 2023 11:47:50 -0400	[thread overview]
Message-ID: <jwva5t580k2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83bkdlyq6y.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 29 Sep 2023 18:06:13 +0300")

>> - First, in order to easily use the same code between REGEX_EMACS_DEBUG
>>   and my new `re--describe-compiled`, I need to print sometimes to
>>   `stderr` and sometimes to a string, which I do using `open_memstream`.
>>   AFAIK `open_memstream` is not directly available in Windows (and
>>   maybe under some other Unixes either, tho it's in POSIX-2008, IIUC).
>>   Could someone help me get an `opem_memstream` emulation working
>>   (maybe via gnulib)?
> Gnulib doesn't have such an emulation, AFAICT.
> Why cannot you fall back to temporary files when open_memstream is not
> available?

Doesn't seem worth the trouble (and I must admit that the idea of using
a temp file hurts my sense of aesthetics, on top of it 😀.  Tho, it'd be
OK if it were done for me by gnulib).

>> - I'm thinking of always providing this function.  Another option would
>>   be to do it under the control of a compilation flag, tho it doesn't
>>   seem worth adding a new flag just for that.  I guess we could
>>   reuse REGEX_EMACS_DEBUG (tho it's too invasive IMO), or
>>   ENABLE_CHECKING, but I'd rather just always offer the function.
>>   After all, it might encourage users to look more carefully at their
>>   regexps and maybe even to help us improve our regexp engine, who knows.
>
> I would suggest to have it under ENABLE_CHECKING first, and only
> remove the condition if there's a demand.  (I assume that most people
> who debug regexps build Emacs with --enable-checking.)

OK, I'll make it conditional on ENABLE_CHECKING as well as on the
presence of `open_memstream`.


        Stefan






  reply	other threads:[~2023-09-29 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29  2:28 bug#66261: Disassembling a regexp's bytecode Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-29 15:06 ` Eli Zaretskii
2023-09-29 15:47   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-09-29 16:24     ` Eli Zaretskii
2023-09-29 16:33       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-29 18:56         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=jwva5t580k2.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=66261@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.