From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jakub T. Jankiewicz" Newsgroups: gmane.emacs.devel Subject: Scheme Mode and Regular Expression Literals Date: Tue, 27 Feb 2024 15:46:55 +0100 Message-ID: <20240227154655.1f6057a0@jcubic> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31129"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 27 15:50:34 2024 Return-path: Envelope-to: ged-emacs-devel@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 1reymv-0007ke-QV for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Feb 2024 15:50:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reyjg-00034R-QM; Tue, 27 Feb 2024 09:47:13 -0500 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 1reyjd-0002vw-Gc for emacs-devel@gnu.org; Tue, 27 Feb 2024 09:47:09 -0500 Original-Received: from smtpo93.poczta.onet.pl ([213.180.149.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reyja-0003Rb-N4 for emacs-devel@gnu.org; Tue, 27 Feb 2024 09:47:09 -0500 Original-Received: from jcubic (unknown [178.218.193.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jcubic@onet.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 4TkgL81b9nzlXC for ; Tue, 27 Feb 2024 15:46:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onet.pl; s=2011; t=1709045216; bh=w+usOZa46jgipRJsf2KBIDJURDfPpyKtLyH2o6y1Kic=; h=Date:From:To:Subject:From; b=jTpNaLwAI1XlMq6PENfrmcHSWi0IpOq4HbStn4WpKUDRL7ZYS0SlQPKXify988pKE W0YVFw9afV3kDfpOcLnZKhBa/ugXwDHyctOaqFXuG/PJiYeeNbg3JEipalB4UISu1o hB5p1tbbUWc11vCi7+wkIO1baNc89Pt1lxj5RxpA= X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Received-SPF: pass client-ip=213.180.149.146; envelope-from=jcubic@onet.pl; helo=smtpo93.poczta.onet.pl 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316589 Archived-At: Hi, I'm working on Scheme interpreter written in JavaScript called LIPS Scheme. It has the same syntax for [Regular expressions as Gauche][1] but with more flags, because they are just JavaScript RegExp. Is there a way to add support for regular expressions in the native scheme mode without modification of the code? Something I can do from my .emacs file? Regexes in LIPS and Gauche look like this `#/[a-b]+/`, it gives a lot of problems inside Emacs. Sometimes you need to add comments with stuff after to make the syntax highlighting and indentation work. Example: (let ((x #/foo|bar/)) ;; |)) (write x)) Emacs thinks that the vertical bar is a scheme extended symbol syntax and you need to add a comment to close the symbol and close the lists otherwise the code will not display and evaluate properly. And if you want to send this to scheme REPL and have proper highlighting you need something like this: (let ((x #/foo|bar/)) ;; |)) (write x) (display " ;; |") (newline)) it would be cool if you could configure the scheme mode to allow such syntax. [1]: https://practical-scheme.net/gauche/man/gauche-refe/Regular-expressions.html Jakub -- Jakub T. Jankiewicz, Senior Front-End Developer https://jcubic.pl/me https://lips.js.org https://koduj.org