From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thibaut Verron Newsgroups: gmane.emacs.help Subject: Re: How to open file unconditionally? Date: Sun, 16 Oct 2022 12:29:38 +0200 Message-ID: References: Reply-To: thibaut.verron@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13815"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help GNU Emacs To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 16 12:30:38 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ok0uk-0003QN-RE for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 12:30:38 +0200 Original-Received: from localhost ([::1]:44608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ok0uj-0002Kg-Lz for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 06:30:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok0u1-0002KY-6d for help-gnu-emacs@gnu.org; Sun, 16 Oct 2022 06:29:53 -0400 Original-Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]:45993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ok0tz-0006ab-Al for help-gnu-emacs@gnu.org; Sun, 16 Oct 2022 06:29:52 -0400 Original-Received: by mail-il1-x12b.google.com with SMTP id q18so4562598ils.12 for ; Sun, 16 Oct 2022 03:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sCxLfqH5qWUVgm5dGMVs4opY/Byl8soSalwaOVjtlRc=; b=Pj4UCi6QxU1YPykpP5novUzbNJk9rCMtdMPckmOB52+C6JqfZBs3Jd+M8Dfqv0FXAc a9kYLfVVGNE75UYhJ7weaDcC+hXz4M0856Aqwi24SQN6M9ZIqg/sbe1wYvW1VATOPhpO XNQk1rMaLN5aHku/IBFliD7+CGaE5SbP3TeiurCE3JJUxm0kETayBTGJBokvVnWTIdO6 NQhIkpARlhW21+9pMyVuXTzcAhkvQC9ZNFhU9L7X514Q+CulzqlW67+2zCP86gqkz7aN eyGYplX+dqOoY3zBXh3hZp9q3VYcst4fhsZDfPTrsxPwiJG0W3oJiV8i/G/v4gC1fb5n KpEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sCxLfqH5qWUVgm5dGMVs4opY/Byl8soSalwaOVjtlRc=; b=AsHfXEhfBqvSopG+yUiSdpoxkCHpWVGkgHl+90n9TaKC6iOeex+qkZVgF/Lu04Qkoj 8NN8E0tNPzmIjAKHClOfGDp+Mez8ic0an+OsD9e1b/gxJs4jqzTrU6dJp0r1kXzhVvYc nqIQ97XBGM4zunaOXvDGdfF8Gz3XroXyVwCuz+XOFDW4NZ6nUY1bgzOEdTmSTcQw7SNT GcXDL4YGiGMdVbsErBwv+rx8MZYGpX+hikttGTMLFQhzOsR15eSg/In3Yh4wzqnGPr7S /gAsF8HQUTt9rTXpVDo/XJh+v63Hgzr2EHu39VS+bvsEo34KtRxIr7g2JsgWD6SFEupZ dESg== X-Gm-Message-State: ACrzQf1ZZ+3XvW4xL0Gw4S/Pqek4UWPZ4wOB4yooTt5BXMZMlt8hLjxm khUQ2DsVkwL0g791HK47OyKroTWtmaO1ZaLVUgEEYp1/wYw= X-Google-Smtp-Source: AMsMyM6zgG4lU1CTXNnb5KUHmQLzu1ApuKxZoL96kW9dm3+9cC0Qgwqx28af0M0ocCjYp8VAlHq8j8DgSb4piuwNurM= X-Received: by 2002:a92:290f:0:b0:2fc:ef0e:5add with SMTP id l15-20020a92290f000000b002fcef0e5addmr2514330ilg.21.1665916189815; Sun, 16 Oct 2022 03:29:49 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::12b; envelope-from=thibaut.verron@gmail.com; helo=mail-il1-x12b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:139987 Archived-At: Le dim. 16 oct. 2022 =C3=A0 11:16, Jean Louis a =C3=A9cr= it : > 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