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

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

Re: How to open file unconditionally?


From: Thibaut Verron
Subject: Re: How to open file unconditionally?
Date: Sun, 16 Oct 2022 12:29:38 +0200

Le dim. 16 oct. 2022 à 11:16, Jean Louis <bugs@gnu.support> a écrit :

> I wish to open file unconditionally. In my case I am opening
> dynamically generated pictures. Once picture is in Emacs, another
> dynamic picture is generated. I wish that find-file does not ask me
> yes/no when opening a file that already has a buffer. I want to simply
> open it without disturbance.
>

Unless I'm mistaken, this message will only appear if the buffer or the
file has been modified.

Do you want to switch to the existing buffer, or create a new buffer?

If it is the latter, this answer should do it:
https://emacs.stackexchange.com/a/52513/184

If it is the former, and assuming that you want to show the on-disk content
of the file, find-file-noselect has a 'nowarn second argument disabling the
prompt.
So (switch-to-buffer (find-file-noselect FILE t)) should work.



>
> I have tried following:
>
>              (let ((confirm-nonexistent-file-or-buffer 1))
>                (find-file svg)))))))
>
> but that does not get noticed by find-file
>

confirm-nonexistent-file-or-buffer seems to be about the opposite problem,
whether to query when the file/buffer does not exist, rather than create a
new one.

Best wishes,
Thibaut


reply via email to

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