From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: crash-proof emacs use Date: Sun, 11 Sep 2022 23:26:05 -0400 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23977"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:RISfE0w5Q/mJgoTSujuBhzylE1s= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 12 05:26:44 2022 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 1oXa5q-00069T-L2 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 12 Sep 2022 05:26:42 +0200 Original-Received: from localhost ([::1]:49320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXa5p-0002ni-Fp for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 23:26:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXa5N-0002nL-VV for help-gnu-emacs@gnu.org; Sun, 11 Sep 2022 23:26:13 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:57510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXa5M-0000dp-Cj for help-gnu-emacs@gnu.org; Sun, 11 Sep 2022 23:26:13 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oXa5K-0005Wt-AH for help-gnu-emacs@gnu.org; Mon, 12 Sep 2022 05:26:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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:139393 Archived-At: > this is open-ended, but would mean something like, you kill some text > with a "about to move" command so that killing is not conflated with > moving, and it gets marked as "move operation started". then you go > to the location to yank to, and you [if your stm is operating ok] yank > in the new place with a message that this is supposed to be > crash-proof. as part of that yanking, the old text gets deleted. > this is just a silly example. It probably depends on lots of things, but AFAIK the normal way Emacs solves this is by treating everything between two `C-x C-s` as a kind of transaction, so until you `C-x C-s` all the changes in your buffer are transient. Of course, it doesn't help you in cases such as: - kill, with the intent to yank elsewhere - forget all about it - save If you're worried about that, then most likely you're also worried about: - kill, with the intent to replace it with something else - forget all about it - save tho admittedly, in such a case you can easily workaround the problem by first typing in the replacement, then killing the old version (so that, if you forget all about it in the middle, you just get both versions and no info is lost). FWIW, I fairly often do that kind of "insert first" (or copy first) and only delete the original code later on. Stefan