[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: saving/restoring text and overlays
From: |
Leo Butler |
Subject: |
Re: saving/restoring text and overlays |
Date: |
Sun, 29 Mar 2020 15:21:39 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Michael Heerdegen <michael_heerdegen@web.de> writes:
> ********************************************************
> Caution: This message was sent from outside the University of Manitoba.
> ********************************************************
>
> Leo Butler <leo.butler@umanitoba.ca> writes:
>
>> If I have a buffer with, e.g. display properties set to images, how can
>> I save that to disk and re-open the saved data so that emacs displays the
>> same "stuff"? I am not looking to export the buffer using html or latex
>> or any other markup.
>
> Without _any_ form of markup? No, Emacs can't save buffers containing
> images directly to a file.
Yes, what I mean is that I want something like enriched text mode or a
wysiwyg mode that let's me copy text with properties from other buffers
(or create it and insert it), including images, save the buffer to disk
and when I open it in another emacs I see the same thing and can
continue editing the document if need be. In other words, I am not
looking to export to another document format using e.g. html or latex.
My use case is copying snippets from *imaxima* (a front-end for Maxima
that uses latex to create its output) into another buffer that contains
text and so on.
>
> We often had a discussion whether `enriched-mode' should be improved, or
> something new could be created, to do what you want (among other things
> like saving text properties). But nobody has done it yet.
>
> Michael.
Well, after poking around a bit, I found this in NEWS.25:
* Changes in Emacs 25.3
This is an emergency release to fix a security vulnerability in Emacs.
** Security vulnerability related to Enriched Text mode is removed.
*** Enriched Text mode has its support for decoding 'x-display' disabled.
This feature allows saving 'display' properties as part of text.
Emacs 'display' properties support evaluation of arbitrary Lisp forms
as part of instantiating the property, so decoding 'x-display' is
vulnerable to executing arbitrary malicious Lisp code included in the
text (e.g., sent as part of an email message).
So it appears that enriched text mode did do what I want, but the way
Emacs handles display properties is too permissive...
This leads me to ask why the feature was nuked rather than handling it
like file variables
(https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html).
Leo