emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC] MIME attachments for comint


From: Augusto Stoffel
Subject: [RFC] MIME attachments for comint
Date: Mon, 27 Sep 2021 21:00:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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 “MIME attachments”.

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]