unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Leo Butler <leo.butler@umanitoba.ca>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: saving/restoring text and overlays
Date: Sun, 29 Mar 2020 15:21:39 -0500	[thread overview]
Message-ID: <86h7y6hpyk.fsf@x201.butler.org> (raw)
In-Reply-To: <87zhc2eowk.fsf@web.de> (Michael Heerdegen's message of "Thu, 26 Mar 2020 23:23:39 +0100")

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



  reply	other threads:[~2020-03-29 20:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  4:14 saving/restoring text and overlays Leo Butler
2020-03-26 22:23 ` Michael Heerdegen
2020-03-29 20:21   ` Leo Butler [this message]
2020-03-30  0:14     ` Michael Heerdegen
2020-03-30  0:23       ` Michael Heerdegen
2020-03-30  1:23     ` Noam Postavsky
2020-03-30  2:25     ` Eli Zaretskii
2020-03-30 20:14       ` Leo Butler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86h7y6hpyk.fsf@x201.butler.org \
    --to=leo.butler@umanitoba.ca \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).