From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id B5AF12E7AE for ; Sat, 7 Sep 2024 13:22:58 +0200 (CEST) Received: from sirjofri.de ([5.45.105.127]) by 9front; Sat Sep 7 07:21:54 -0400 2024 Received: from dummy.faircode.eu ([31.16.254.19]) by sirjofri.de; Sat Sep 7 13:21:46 +0200 2024 Date: Sat, 7 Sep 2024 13:21:43 +0200 (GMT+02:00) From: sirjofri To: 9front@9front.org Message-ID: <92e415df-3594-42fc-8d8a-e9428dd61a68@sirjofri.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Correlation-ID: <92e415df-3594-42fc-8d8a-e9428dd61a68@sirjofri.de> List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: software-based session base-based map/reduce control Subject: [9front] Patch: snarf paste support for (e)enter, and refactoring Reply-To: 9front@9front.org Precedence: bulk Hello, This patch adds snarf and paste support to the two library functions enter and eenter. It also adds an internal function _genenter to share lots of the code. This does not change the interfaces of (e)enter though, for compatibility reasons. In total, this adds 100 lines of code, but removes duplicate code for drawing and interpreting input. I did test it with standard ascii, as well as some simple sequences of greek letters, but there could still be bugs. UTF-8 handling code is mostly inspired by/copied from acme. More importantly, I can imagine you don't like the structure here and there, as it's more complex than the simple approach we currently have. Just let me know and I'll adjust it accordingly. The patch is pretty long, so here's just a link to the file. If needed, I can also paste the data directly, just let me know. https://sirjofri.de/oat/patches/eesp.diff sirjofri