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

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

Re: disappearing lines


From: Panagiotis Koutsourakis
Subject: Re: disappearing lines
Date: Tue, 17 Jan 2023 10:20:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

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.



reply via email to

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