emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Possible File Saving Bug with [/]?


From: Summer Emacs
Subject: Re: Possible File Saving Bug with [/]?
Date: Thu, 7 Sep 2023 12:55:12 +0200


> On Sep 7, 2023, at 12:49, Ihor Radchenko <yantar92@posteo.net> wrote:
> 
> Summer Emacs <summeremacs@summerstar.me> writes:
> 
>> 3) In one of the headers, it looked something like this:
>> * C-c C-c on [/] to update done items in todo list.
>> 
>> That [/] just like that was creating a backup file on every save named 
>> .#emacshelp.org# —> summer@summer.local.23434:882343 (those are made up 
>> numbers but it was always random and looked something like that in the ls 
>> -la command in terminal.)
> 
> Saving .#emacshelp.org# backup files is controlled by your configuration
> - it is the default Emacs behaviour to save them.
> 

Yes, I know. 🙃

>> Since I regularly add notes to my file, I also use Magit to save a backup 
>> copy (M-x g). But whenever I did that, it would ask if I wanted to save 
>> emacshelp.org. Obviously it was being affected by the backup file (which was 
>> never open in a buffer, it just was “there” in the directory).
>> 
>> An example of Magit interaction for adding/committing changes to that file 
>> would look something like this: (from emacshelp.org file)
>> 
>> 1) M-x g
>> 2) Minibuffer: Do you want to save emacshelp.org? Y/n/etc…
>> 3) s
>> 4) Minibuffer: Do you want to save emacshelp.org? Y/n/etc…
>> 5) c c
>> 6) Minibuffer: Do you want to save emacshelp.org? Y/n/etc…
>> ...
> 
> This is abnormal.

I know this too. 🙃

> 
>> You get the idea. Every single thing I did in Magit would ask me this. My 
>> file (the original - emacshelp.org) was saved with C-x C-s AND even C-x s to 
>> save all files. But it didn’t matter how I answered that question, it would 
>> keep asking it no matter what. No matter what I did, it kept asking me that 
>> question, over and over and over again. Because of that “backup” file.
>> 
>> Note: This is behaviour which *only* happened with this single file, not 
>> with any other file I use.
> 
> My suspicion that it is triggered by some kind of strange
> `after-save-hook' in your config.

Perhaps - but see below.

> 
>> Finally, putting = = around [/] in my notes to produce: =[/]= escaped that 
>> behaviour. It no longer does that. It took me an hour of rebuilding my file 
>> line by line to figure out *why* this was happening, but that was the line 
>> and that was the exact problem.
> 
> [/] in Org is called statistics cookie and some parts of Org may alter
> it to refresh TODO/checkbox statistics. See "5.5 Breaking Down Tasks
> into Subtasks".
> 
> However, I do not see why this should happen _after_ save, unless
> something in your config is triggering the update.
> 

This is why I reached out. It *only* happens if I put [/] in an org file and 
save it. I thought maybe that it was a bug in org because it’s trying to eval 
it without any numbers in it, and no list under it, so maybe it’s just borked 
in some way in that specific circumstance. Other than that, I have no idea.

> Without more information, I cannot provide more assistance
> unfortunately. I also do not see how we can help on Org side as the
> problem _appears_ to be with your personal config.
> 

Again: My config works with all of my other files. Every single one. Org files, 
md files, .txt files - you name it. It’s *only* when I put [/] in an org file 
just like that. That’s the only time my saves/backups ever borked on me. So 
that’s why I reached out. If my config was doing this in general, I wouldn’t 
have thought it was an Org issue. But since it *only* occurs with an org file 
which has an empty [/] and no list under it, I thought maybe it would be an org 
issue. I could be wrong, but since that’s what triggers it…you tell me.

As for it being an inconvenient: it’s not. Since I escape the [/] with = =, it 
doesn’t do that anymore. So no worries there. It’s the only example I have 
where I use that without a list under it for it to evaluate. So it’s not 
actually an issue anymore. I just figured I would call your attention to it 
possibly being a bug if that ever happens again to somebody else. 🙃

Thanks! 🙃

> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>




reply via email to

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