help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crash-proof emacs use


From: Jean Louis
Subject: Re: crash-proof emacs use
Date: Mon, 12 Sep 2022 09:08:02 +0300
User-agent: Mutt/+ () (2022-06-11)

* 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/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]