unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Panagiotis Koutsourakis <kutsurak@slartibartfast.net>
To: help-gnu-emacs@gnu.org
Subject: Re: disappearing lines
Date: Tue, 17 Jan 2023 10:20:54 +0200	[thread overview]
Message-ID: <87k01lo9ll.fsf@panoramix.zarniwoop.org> (raw)
In-Reply-To: <871qnukz1n.fsf@mbork.pl> (Marcin Borkowski's message of "Mon, 16 Jan 2023 21:24:52 +0100")

On Mon, Jan 16 2023, Marcin Borkowski wrote:

> On 2023-01-16, at 20:31, Peter Münster <pm@a16n.net> wrote:
>
>> On Mon, Jan 16 2023, Arash Esbati wrote:
>>
>>> You can check your last keystrokes with `C-h l':
>>
>> This is not so easy, it works only in the same emacs session.
>> Last time, I've discovered the disappearance of the lines 9 days later.
>> I make daily backups, so I've used the diff between backup of 9 days ago
>> and 8 days ago, to restore my file. It's annoying, because it's a very
>> big file, with all things that I need to remember. About 20k lines.
>> And about 300 lines have vanished...
>> I would really like to understand, how this could happen...
>
> I know that won't help you /right now/, but I had similar problems in
> the past, and I pretty much got rid of them by commiting all my Org mode
> files to Git every day (well, almost every day - my average over the
> last 640 days is 0.90 times per day, although I'm getting closer to 1

I have something like this in my emacs configuration:

(run-at-time t 600
             (lambda ()
               (org-save-all-org-buffers)
               (call-process "org-git-sync.sh" nil "*Org git sync*" nil)))

The script org-git-sync.sh performs a git commit. Essentially this
autosaves my org directory every 10 minutes. One nice property is that
if nothing has changed in the last 10 minutes git commit will fail, so I
only get meaningful history in my git repository.

> recently).  It would be great if Org mode had some way to warn me when
> I delete something that is invisible (or undo in invisible parts of the
> buffer), but I know of no such feature, so I do what I do.  It takes
> literally a minute or two every day, and I find it a very useful habit.

There is the option `org-fold-catch-invisible-edits'
(`org-catch-invisible-edits' in older versions of org mode) that will
warn you or throw an error or both if you make changes in an invisible
part of the org buffer. I am not sure if it works for undo, though.

>
> Hth,

-- 
Best regards,
Panos.



  parent reply	other threads:[~2023-01-17  8:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16 13:19 disappearing lines Peter Münster
2023-01-16 14:42 ` Panagiotis Koutsourakis
2023-01-16 16:57 ` Arash Esbati
2023-01-16 19:31   ` Peter Münster
2023-01-16 19:46     ` Jean Louis
2023-01-17  6:50       ` Peter Münster
2023-01-17 15:00         ` Jean Louis
2023-01-16 20:24     ` Marcin Borkowski
2023-01-16 21:14       ` H. Dieter Wilhelm
2023-01-17  1:11         ` Samuel Wales
2023-01-17  6:56           ` Peter Münster
2023-01-17 19:47           ` H. Dieter Wilhelm
2023-01-17  8:20       ` Panagiotis Koutsourakis [this message]
2023-01-17 11:28         ` Peter Münster

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=87k01lo9ll.fsf@panoramix.zarniwoop.org \
    --to=kutsurak@slartibartfast.net \
    --cc=help-gnu-emacs@gnu.org \
    /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).