From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: [RFC] MIME attachments for comint Date: Mon, 27 Sep 2021 21:00:48 +0200 Message-ID: <875yuln8rj.fsf@gmail.com> 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="30407"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 27 21:03:14 2021 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 1mUvuD-0007gU-IH for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Sep 2021 21:03:13 +0200 Original-Received: from localhost ([::1]:54146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUvuB-0003or-Lf for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Sep 2021 15:03:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUvs4-0002jB-5P for emacs-devel@gnu.org; Mon, 27 Sep 2021 15:01:00 -0400 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:36598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUvs0-0001NQ-L1 for emacs-devel@gnu.org; Mon, 27 Sep 2021 15:00:59 -0400 Original-Received: by mail-wm1-x331.google.com with SMTP id l18-20020a05600c4f1200b002f8cf606262so1491840wmq.1 for ; Mon, 27 Sep 2021 12:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=+u9s9ATH+AWs4PE0BKl2E6Jw7ziw9Q2QF5a0OZwFj4s=; b=CSF33Cr7vhgrojmSM43S9CR2bakei63ktTjcWNZM128sFiEIIBKcdBhVgX3XSvKEH0 ZMiY/gDOaQdzx5sYUDIPJz10397VtLT2M2peYXJecMxfeO+t9VZNObkGfuixlhtbzaKs Qj6FGZs+q+GHsgknVwTdDGW0goBpspAjawWsSbb0EJ5foyxSzc7h8yRkx6feh82hKW6y /p4IO0Q8PBkyonUXXutC9glcev3A0XyI+Ppelj01I1dimyK2kj9BKfybmDt4XPMP4kT0 tVRA9SaqUfPlmsy+iaWxroOrd77JHJfmE4rD6YqsUjAAjmXVIIeZyUpNpMNU88i9yUCv F+mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=+u9s9ATH+AWs4PE0BKl2E6Jw7ziw9Q2QF5a0OZwFj4s=; b=zY5NJN/NtfkIbZYHdCOSPNzTgEdt9OSlnwFpGJ8oWIP1LcSidLi78Z4RgyKwNQOYKp xNOhXIe3q4fSoWjlV+P8VLddYyQ6wup17QbxQzt6NwPXW/0pxv1RfRnoEEdeLsq1t4AS /f/47WZdYkkvET451sJ/i248yM5ZluOFNyehxB3P5apn2x2s3t1MDsm8r05yTkyvXE2B F1WYNBneig/4JMtuHRy24gZEMYySFoe62IdwgbWWQyPqNdWj4CKeadRYIvRPZbkTxLSV hK+ApoVUk1J+oCW34ToRDY1cyuwIJzJLk0XOY32lgzbL+sq7c7u/8b2aqXnX7ImOa48Q Z2dQ== X-Gm-Message-State: AOAM533C2Ee+7b+CkGz1MpIw/o/hRMIhUmz0hGLdLD8axnxGWFtiIQ87 hGEWYCauMEcYCrSQn+/OtETt7J/Y940= X-Google-Smtp-Source: ABdhPJxguuUZ3PeQc00a5krtnaNffcXjGCexPRvvlvjf+Xkap/VcAiEDwVnbegOF2oGBkT041hb6LA== X-Received: by 2002:a1c:1c7:: with SMTP id 190mr668210wmb.158.1632769251042; Mon, 27 Sep 2021 12:00:51 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::2f72]) by smtp.gmail.com with ESMTPSA id n26sm309469wmi.43.2021.09.27.12.00.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 12:00:50 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=arstoffel@gmail.com; helo=mail-wm1-x331.google.com 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_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:275606 Archived-At: In due time, I would like to submit the following as an ELPA package. For now, I'm writing to see if anyone would like to test or give feedback. https://github.com/astoff/comint-mime The main purpose of the package, for me at least, is to display graphics directly in the Python shell. But it can be extended to other comints and other kinds of =E2=80=9CMIME attachments=E2=80=9D. For instance, in Python it can pretty-print objects that define an HTML representation. In the regular shell, it provides a `mimecat' command, similar to the `imgcat' of other terminals, but mimetic. Here are some more assorted observations: - Although the feature seems rather desirable to have even built into Emacs, I can't see how a sufficiently canonical implementation would be possible. This package invents a little communication protocol between the inferior process and Emacs, which will obviously never be implemented by anyone else. - To add support for a new comint, one just needs to supply some setup code to teach the inferior process to print the appropriate escape sequences. Moreover, one needs a little bit of ELisp stuff to send the setup code to the inferior process (slightly tricky as usual). - Concerning packaging, the idea at the moment would be to just have this one package adding mimetics to as many comints as possible. (For now, I'm even including all ELisp code in one single file.) But this would mean that the package has many soft (non-mandatory) dependencies. Does that sound like a bad idea? - The package depends on Emacs 28 (it uses OSC escape sequences). I guess it would have to wait until Emacs 28 is released to be on ELPA? - It seems shr doesn't support right-aligned text in tables. Would this be hard to add? This is kind of important to display numeric tables sensibly.