From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66261: Disassembling a regexp's bytecode Date: Fri, 29 Sep 2023 11:47:50 -0400 Message-ID: References: <83bkdlyq6y.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6061"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66261@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 29 17:49:24 2023 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 1qmFk1-0001G1-Ds for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Sep 2023 17:49:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmFjY-0006UK-Tn; Fri, 29 Sep 2023 11:48:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qmFjX-0006UA-M5 for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 11:48:51 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qmFjX-0008Jo-E2 for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 11:48:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qmFjh-0005DH-PZ for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 11:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Sep 2023 15:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66261 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66261-submit@debbugs.gnu.org id=B66261.169600251419885 (code B ref 66261); Fri, 29 Sep 2023 15:49:01 +0000 Original-Received: (at 66261) by debbugs.gnu.org; 29 Sep 2023 15:48:34 +0000 Original-Received: from localhost ([127.0.0.1]:56984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmFjB-0005AX-Tz for submit@debbugs.gnu.org; Fri, 29 Sep 2023 11:48:33 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmFiz-00059H-Od for 66261@debbugs.gnu.org; Fri, 29 Sep 2023 11:48:28 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2FE7E100046; Fri, 29 Sep 2023 11:47:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1696002471; bh=zkmeehEfpLvCsl1cNbvRxcjzVum1CEIY5woOLXvMgjk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pUEqUaFNEahiqCUccz8Bj3LT+QTOmhhj6AGpNdBRyrgdLA0hq6MOr79oqyM+qalqi fdA1Bpb1+WeMaLpcGEWntHVb1464LnKpTBDB6Tr4YDrTbZOIruBgYpFvWHAslZF4Fm lOXfEkePrwNdfmFGxOfRpCk5rf1CvmLV6y1XFyC2tzVMScoCDVfg4S9Uh8ulw5pHCP nBfX/o0+UlJPAh7PmtDoxqItC9yhPDnv8XKemNl6vgKuCSjxH8vmzTMolEVqfwg8xh ZFkYKg/7FqkPXLxCVH5Q2ZMWn8tPAB48gre2VRJSZ0Y9heMeaBtCCmGpgJLMFE1xZD NnLIrnrY8DKkQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B85DD100084; Fri, 29 Sep 2023 11:47:51 -0400 (EDT) Original-Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 99A7012020A; Fri, 29 Sep 2023 11:47:51 -0400 (EDT) In-Reply-To: <83bkdlyq6y.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 29 Sep 2023 18:06:13 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271505 Archived-At: >> - 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 =F0=9F=98=80. 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