unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 66261@debbugs.gnu.org
Subject: bug#66261: Disassembling a regexp's bytecode
Date: Fri, 29 Sep 2023 18:06:13 +0300	[thread overview]
Message-ID: <83bkdlyq6y.fsf@gnu.org> (raw)
In-Reply-To: <jwvsf6xaf27.fsf@iro.umontreal.ca> (bug-gnu-emacs@gnu.org)

> Date: Thu, 28 Sep 2023 22:28:16 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> - 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?

> - 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.)





  reply	other threads:[~2023-09-29 15:06 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 [this message]
2023-09-29 15:47   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83bkdlyq6y.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=66261@debbugs.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).