From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions Date: Thu, 05 Mar 2020 09:13:32 -0500 Message-ID: <874kv299f7.fsf@gmail.com> References: <87mwaq74xg.fsf@fencepost.gnu.org> <87h7z86hs9.fsf@stefankangas.se> <86v9nooxcg.fsf@gmail.com> <87tv38kp33.fsf@fencepost.gnu.org> <83sgisypbd.fsf@gnu.org> <87pndwklz6.fsf@fencepost.gnu.org> <83o8tgyn1k.fsf@gnu.org> <874kv83pg7.fsf@fencepost.gnu.org> <83lfokylpp.fsf@gnu.org> <87r1yb8kbv.fsf@gmail.com> <87wo8340ct.fsf@stefankangas.se> <874kv7ozf9.fsf@fencepost.gnu.org> <87o8tf7xu3.fsf@gmail.com> <83mu8yyawu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="102181"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 05 15:14:12 2020 Return-path: Envelope-to: geb-bug-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 1j9rGO-000QSH-2E for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Mar 2020 15:14:12 +0100 Original-Received: from localhost ([::1]:49836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9rGN-0002yJ-1i for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Mar 2020 09:14:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60140) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9rGF-0002y6-6J for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2020 09:14:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9rGE-0002kB-3n for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2020 09:14:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j9rGE-0002jx-0P for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2020 09:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j9rGD-0004KR-S9 for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2020 09:14:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Mar 2020 14:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18336 X-GNU-PR-Package: emacs Original-Received: via spool by 18336-submit@debbugs.gnu.org id=B18336.158341762116606 (code B ref 18336); Thu, 05 Mar 2020 14:14:01 +0000 Original-Received: (at 18336) by debbugs.gnu.org; 5 Mar 2020 14:13:41 +0000 Original-Received: from localhost ([127.0.0.1]:42391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9rFt-0004Jm-Ds for submit@debbugs.gnu.org; Thu, 05 Mar 2020 09:13:41 -0500 Original-Received: from mail-qk1-f194.google.com ([209.85.222.194]:41687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9rFr-0004JO-Nc for 18336@debbugs.gnu.org; Thu, 05 Mar 2020 09:13:39 -0500 Original-Received: by mail-qk1-f194.google.com with SMTP id b5so5378330qkh.8 for <18336@debbugs.gnu.org>; Thu, 05 Mar 2020 06:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=pULp41xEucp4rseciLO+WHOYhVCskyCZYYJP+1cGw/c=; b=Z3ZWFge5VS3ljFeLIPfSSS9zkEh2jJbKGrMxGa5DbM28PWFtUt7gQUUcT5Z8X2uhI5 is2PFmjk0zNvaBpyF2/oO74temIDEs5MdXYm3OyjXRcyBKMfJ523wnYmAjRVTjBOR5oo YcXAyZsac/AT3xEHGMZvmpauk4e/Z3zYpEyNVregUWCvOyyaqAYXm+ErpxAPEwRNiz9/ bx/kkkj38jmUx8RJpdocqeXwXoMc/4F+afW6cJHBBQd4qgYLsY1GlH7PwPfWO+YvD6Wk qMvtKaNTAJ/NRDwJz7usO9nvMUfNDRNsW8wdHhS/PpYrJ+TLeJSILzL4zep/biU6YI6c 9fCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=pULp41xEucp4rseciLO+WHOYhVCskyCZYYJP+1cGw/c=; b=l/1X41Cchk3BWrypz6TNyIQIZ5o0SgCL90OtjQi37/KEzepBLmnkKEAun6QXrugY09 3p1L4on3TkSa2xffIrfRksDJjSx4AkEEZ4ap56LvzCHB3IB43QIZSE/3VL5td9xTU2v3 h4Z1NNvrZKDQ3+nWe2NyM/JcErIBXN5jUu8+Hg1XfcqRNRTl43qqCx8niZzln32SwifU 2TPWnrV7jkOBzq30KbnaysSrSpNFubksQgPdpVqoNW0XZ9uu39u4Df6PBvFwvKZ2uzDX 1S+7CxgiTErfow/B+fs5n3PCCZukRh4nshSvwSIOiapnPG241kipePz069Vh05WpoNpb obTw== X-Gm-Message-State: ANhLgQ21Nhb+jJDIh/B8fJvm4yN1GSb3phxV+dh6lraPkySQA1IKzhqe ygpJiRTZcV85Oj2OrMFo0CLEGkwBuoM= X-Google-Smtp-Source: ADFU+vuHAWtrBwYisyjOwqevpPCCa/e/srH/b0p8dcS64AE1KOoNM7JtGhvPirB3HVoDCss+S1GhPg== X-Received: by 2002:a37:b285:: with SMTP id b127mr8069749qkf.413.1583417613916; Thu, 05 Mar 2020 06:13:33 -0800 (PST) Original-Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id j7sm11992442qti.14.2020.03.05.06.13.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Mar 2020 06:13:33 -0800 (PST) In-Reply-To: <83mu8yyawu.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Mar 2020 18:33:05 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176907 Archived-At: Eli Zaretskii writes: >> > and my /tmp file system where I also saw this is >> I ran my initial experiment in ~/tmp,[...] >> When I do the same on /tmp, which is mounted noatime I see the extra >> " changed on disk; really edit the buffer?" question on C-x C-s. > lock_file calls verify-visited-file-modtime, which might be affected > by the noatime option. But I don't understand how noatime could > affect verify-visited-file-modtime since the latter looks at mtime, > not atime. > Can someone who sees this step with GDB through lock_file and its > callees, and see what goes wrong there and why? Ah, looks like the noatime thing is just a coincidence. What happens in the ~/tmp case is that when lock_file is called from write_region, the file doesn't exist, so the extra "changed on disk" question doesn't get asked. The reason the file doesn't exist, is because it was moved to the backup name, in backup-buffer. Files under /tmp/ are not backed up by default, so in that case the file still exists and there is an extra query. lock_file (Lisp_Object fn) { [...] if (!NILP (subject_buf) && NILP (Fverify_visited_file_modtime (subject_buf)) && !NILP (Ffile_exists_p (fn))) call1 (intern ("userlock--ask-user-about-supersession-threat"), fn); (defun backup-buffer () [...] (rename-file real-file-name backupname t) If I do (setq backup-enable-predicate #'ignore), i.e., disable backup, then I get the extra query for ~/tmp/foo as well. The OP mentions version control, that also affects this because of the vc-make-backup-files option (defaulting to nil, i.e., backup doesn't happen for files under vc).