unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Samuel Wales <samologist@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: crash-proof emacs use
Date: Mon, 12 Sep 2022 09:08:02 +0300	[thread overview]
Message-ID: <Yx7Mwn1F7tSynFnP@protected.localdomain> (raw)
In-Reply-To: <CAJcAo8vAtN1-bQOK1qd_OBos8r_6N_mxjzkL_ERVyCDwg5FMag@mail.gmail.com>

* Samuel Wales <samologist@gmail.com> [2022-09-12 05:14]:
> 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.
> 
> there are many flaws in that design, but it is an examlpe of something
> i was wondering if anybody has thought about.  it is an issue i deal
> with frequently.  detecting after the fact is ok but there are edge
> cases where it is insufficient.
> 
> so it is an open-ended q about whether anybody has implemented
> crash-proof moving, or follows some kind of discipline /all the time/,
> or some kind of non-theoretical sw for this, and it doesn't require
> detecting after the fact.

I have something similar where I am entering text in Emacs, then
killing the text and yanking in other window. I don't like those texts
to disappear, for that reason I am logging them with `rcd-general-log'
below. They go into the database.

(defun read-to-clipboard ()
  (interactive)
  (set-input-method my-default-input-method)
  (let ((clipboard (rcd-ask "Insert into clipboard: "))
	(title (concat "Clipboard: " (rcd-timestamp))))
    ;; Here 
    (rcd-general-log title clipboard 1 nil nil nil 4) 
    (kill-new clipboard)
    (rcd-message "Killed: %s" (rcd-substring-soft clipboard 0 40))))

I have different log types:

 1          Default
 2          Word Lookup
 3          E-mail
 4          Clipboard
 5          DB Column

Thus any time later I can revert back to the log and see what was
entered in the clipboard.

 19459 emacs: message sent                                                    Default
 19460 Word query: censuring                                                  Word Lookup
 19461 Clipboard: 2022-06-25-17:03:15                                         Clipboard
 19462 Clipboard: 2022-06-25-17:05:56                                         Clipboard
 19463 Clipboard: 2022-06-25-17:06:31                                         Clipboard
 19464 Clipboard: 2022-06-25-17:07:46                                         Clipboard

Emacs in development version has now SQLite database built-in, it is
worth using it to capture pieces of information.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



  parent reply	other threads:[~2022-09-12  6:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  2:13 crash-proof emacs use Samuel Wales
2022-09-12  3:26 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-09-12  6:08 ` Jean Louis [this message]
2022-09-12  6:32 ` Yuri Khan
2022-09-12  7:32 ` Marcin Borkowski
2022-09-15  2:49   ` Samuel Wales
2022-09-17 14:22     ` Marcin Borkowski

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=Yx7Mwn1F7tSynFnP@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    --cc=samologist@gmail.com \
    /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).