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: Mon, 17 Oct 2022 10:59:28 +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="3685"; mail-complaints-to="usenet@ciao.gmane.io" To: Thibaut Verron , Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 17 11:03:53 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 1okM2L-0000bx-JQ for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 17 Oct 2022 11:03:53 +0200 Original-Received: from localhost ([::1]:49390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okM2K-0001tU-1x for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 17 Oct 2022 05:03:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okLyK-0001no-7J for help-gnu-emacs@gnu.org; Mon, 17 Oct 2022 04:59:44 -0400 Original-Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]:38610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okLyI-0006z1-80 for help-gnu-emacs@gnu.org; Mon, 17 Oct 2022 04:59:43 -0400 Original-Received: by mail-il1-x132.google.com with SMTP id u10so5491345ilm.5 for ; Mon, 17 Oct 2022 01:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=auIhKmf1pit+NViE6djPJYK/NgCuQFoIeTh91wKszr0=; b=XneKJw5HSiporDXdcvbjSCCNPjrzuUm1r4dsTdPLLXUr+dV4f0UWBoWhQZ8bMMWAxd B08F1IOXS4n+9e9Sw3YNR75SWADGkLtQYn/ccDnJUCZNE9J1FqaoEsDSUKXuEiHordbf AJF3DVRy9Q9GIa5np6RuPHbtlmA1/uBvngrEECrE6kAdkx6cBB+M7DlZSimBVMAUgNEI AacAdpdBo1qt0LYoDNSVsbSDDfQBMXMZAj36vS5EKpep202aHHjFNh5Ntqr1GKjzD6Z9 CP8OnQyhYq32WZiiEMqG1n4QVRfS7YhNScLtf5jWkPpqkq6ruwCqQo/2OIe1vimqJ5ya 7+EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=auIhKmf1pit+NViE6djPJYK/NgCuQFoIeTh91wKszr0=; b=uHx64/lImK3yDJ5jc5S9hpDBSOIm9S3dlzZOcnIK3D5yMj71zeDul0wshmRFn+PgMt VqT9HnOK8q9hdfnIwIlkS7EZOUimvU553L3zgB2g9Apbcl0ERwsM/8r/+GnSKHc2ZcQU oXqqF3+4lwrZPd6H04MP6TT4PFQTvWiSyEoYEQRt1K7zAkrUkO6gmsdreRheu5b7uniI 99KoxiqReSuWbLJN7IRZxYopc2YgTe02OmsqE7kKP0MMhbblew2bjlRttSvzjHj+Czx5 f2ChlQGFbgFWRevlMPq7fiQcjrc701Wj3l2L5PY1539IDV5RJQwR+GY4505bxLU52jVL hnRA== X-Gm-Message-State: ACrzQf01+O4CczNRvvBP4OlAs/4Ik1R0XsGJf2vPuRmlM0nCghNkNdK+ xdYywwtIm6gmfiyADSRF6BapAoVQf92sP7zRXno= X-Google-Smtp-Source: AMsMyM5R2LtOhEQhoepA+kkO6+YyDth2Pv6INoUVvhc/TTDJGMUb+CG+2uZR/B5+6hYiCnnl87qFcP0ulDHP861w28s= X-Received: by 2002:a05:6e02:1e02:b0:2fc:6288:e6e6 with SMTP id g2-20020a056e021e0200b002fc6288e6e6mr4368302ila.172.1665997180741; Mon, 17 Oct 2022 01:59:40 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::132; envelope-from=thibaut.verron@gmail.com; helo=mail-il1-x132.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:140071 Archived-At: Le lun. 17 oct. 2022 =C3=A0 06:05, Jean Louis a =C3=A9cr= it : > * Thibaut Verron [2022-10-16 13:30]: > > > > If it is the latter, this answer should do it: > > https://emacs.stackexchange.com/a/52513/184 > > That solution is incomplete. I am opening image, the above solution is > showing me the source of the SVG file, and not the SVG as image. > Crude answer: turning on image-mode (or whatever you use, I don't really know how people use emacs for images) in the new buffer should work. A more surgical answer would have to go through auto-mode-alist, magic-mode-alist and interpreter-mode-alist to select the correct mode for the new buffer. > > > 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 the above one, it does not overwrite the file in > buffer. It switches to the buffer. But newly modified picture is not > loaded. > Does adding a (revert-buffer nil t) work? If you always want to load the new picture as soon as it's generated, enabling auto-revert-mode in the buffer would also do the trick. Thibaut