From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Leo Butler Newsgroups: gmane.emacs.help Subject: Re: saving/restoring text and overlays Date: Sun, 29 Mar 2020 15:21:39 -0500 Message-ID: <86h7y6hpyk.fsf@x201.butler.org> References: <86zhc3iwg1.fsf@x201.butler.org> <87zhc2eowk.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="32240"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 29 22:22:05 2020 Return-path: Envelope-to: geh-help-gnu-emacs@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 1jIeRZ-0008IA-C6 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 29 Mar 2020 22:22:05 +0200 Original-Received: from localhost ([::1]:41328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIeRY-0001EF-Ds for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 29 Mar 2020 16:22:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45352) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIeRG-0001Du-A7 for help-gnu-emacs@gnu.org; Sun, 29 Mar 2020 16:21:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIeRE-0000SU-Pi for help-gnu-emacs@gnu.org; Sun, 29 Mar 2020 16:21:45 -0400 Original-Received: from smtp.ad.umanitoba.ca ([130.179.21.18]:60183 helo=umce3cip03.ad.umanitoba.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jIeRD-0000N0-Mh for help-gnu-emacs@gnu.org; Sun, 29 Mar 2020 16:21:44 -0400 IronPort-SDR: sd3g6v98eOdpGkUPekwN4UVw7vkdUEuewe03xZ6e2eMjDEEgOAfyvOGt1JWFmgMwg4bglj+nyl ROlpc2MiX+4agMdy+z557BwWGy73gGxHExBGVNtn6VY9ea2iHTokXeYMfj7DPN28XKWpGglB/U kDqHdcKmefb6QXkpgSoa8jz7Yoic7xhVjT3TtxZa/ep5tiC4UKuUszaA3r22N/PEOx+uT+16lV 8dJryFrGPYXi2trAGa9u3j+ZkzYukaTdtyFeyY2nN2w8gdK/o1N+wyP7UnfAnwHMOlIe9cE+Fq H5q8Nr/pBtBKfbY9oi/5WKUU X-IronPort-AV: E=Sophos;i="5.72,321,1580796000"; d="scan'208";a="46493723" Original-Received: from 194.33.44.45.in-addr.arpa (HELO x201) ([45.44.33.194]) by umce3cip03.ad.umanitoba.ca with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2020 15:21:44 -0500 In-Reply-To: <87zhc2eowk.fsf@web.de> (Michael Heerdegen's message of "Thu, 26 Mar 2020 23:23:39 +0100") X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 130.179.21.18 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122708 Archived-At: Michael Heerdegen writes: > ******************************************************** > Caution: This message was sent from outside the University of Manitoba. > ******************************************************** > > Leo Butler 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