From unknown Sun Aug 17 09:10:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18336 <18336@debbugs.gnu.org> To: bug#18336 <18336@debbugs.gnu.org> Subject: Status: 24.4.50; When editing externally changed file, Emacs asks too many questions Reply-To: bug#18336 <18336@debbugs.gnu.org> Date: Sun, 17 Aug 2025 16:10:40 +0000 retitle 18336 24.4.50; When editing externally changed file, Emacs asks too= many questions reassign 18336 emacs submitter 18336 David Kastrup severity 18336 minor tag 18336 fixed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 04:18:42 2014 Received: (at submit) by debbugs.gnu.org; 27 Aug 2014 08:18:42 +0000 Received: from localhost ([127.0.0.1]:53183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMYRE-000494-Mc for submit@debbugs.gnu.org; Wed, 27 Aug 2014 04:18:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35926) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMYRB-00048p-Jp for submit@debbugs.gnu.org; Wed, 27 Aug 2014 04:18:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMYR5-0005kI-0w for submit@debbugs.gnu.org; Wed, 27 Aug 2014 04:18:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMYR4-0005kE-Td for submit@debbugs.gnu.org; Wed, 27 Aug 2014 04:18:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMYR3-0007Tj-Fy for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2014 04:18:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMYR1-0005jz-U6 for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2014 04:18:29 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMYR1-0005jv-QS for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2014 04:18:27 -0400 Received: from localhost ([127.0.0.1]:56021 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMYR1-0002z6-D2 for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2014 04:18:27 -0400 Received: by lola (Postfix, from userid 1000) id 37ADFE0C21; Wed, 27 Aug 2014 09:44:11 +0200 (CEST) From: David Kastrup To: bug-gnu-emacs@gnu.org Subject: 24.4.50; When editing externally changed file, Emacs asks too many questions Date: Wed, 27 Aug 2014 09:44:11 +0200 Message-ID: <87mwaq74xg.fsf@fencepost.gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) When editing an externally changed file (under version control, no idea whether that is related), I get the following questions (see below in the input and output section). It does not make sense at all for Emacs to ask smob-convert.sh changed on disk; really edit the buffer? (y, n, r or C-h) y as a reply to me typing C-x C-s since C-x C-s is _not_ a request to edit the buffer. It is a request to save the file _after_ editing the buffer, and I already discussed the consequences of editing and saving with Emacs previously. Apart from being annoying by asking me the same question several times, the question does not even make any sense the second time round. I=A0never know whether Emacs requires me to answer this quite nonsensical question with "y" or "n" in order to write the changed buffer, and what will happen in either of the two cases of answering this no longer applicable question. In GNU Emacs 24.4.50.1 (i686-pc-linux-gnu, GTK+ Version 3.10.8) of 2014-07-28 on lola Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS Configured using: `configure --without-toolkit-scroll-bars' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB Important settings: value of $LC_MONETARY: en_US.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: en_US.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Shell-script Minor modes in effect: sh-electric-here-document-mode: t shell-dirtrack-mode: t diff-auto-refine-mode: t TeX-PDF-mode: t desktop-save-mode: t minibuffer-electric-default-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Recent input: C-x r t # SPC y =20 C-x C-s y e s y Recent messages: smob-convert.sh changed on disk; really edit the buffer? (y, n, r or C-h) y File on disk now will become a backup file if you save these changes. Saving file /usr/local/tmp/lilypond/scripts/auxiliar/smob-convert.sh... smob-convert.sh changed on disk; really edit the buffer? (y, n, r or C-h) y File on disk now will become a backup file if you save these changes. Wrote /usr/local/tmp/lilypond/scripts/auxiliar/smob-convert.sh Load-path shadows: None found. Features: (shadow emacsbug org-element org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view image-mode org-bibtex bibtex org-bbdb org-w3m org org-macro org-footnote org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs cal-menu calendar cal-loaddefs nroff-mode ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff skeleton diff texmathp reftex-parse deuglify talk ffap vc-bzr vc-sccs vc-svn vc-cvs vc-rcs gnus-topic canlock sh-script smie executable rect url-util url-parse url-vars calc-alg calc-ext calc-menu calc calc-loaddefs calc-macs shr-color color sendmail nnir shell pcomplete imenu view woman man gnus-fun debug smerge-mode vc vc-dispatcher shr gnus-dup eieio-opt speedbar sb-image ezimage dframe find-func dabbrev browse-url flyspell ispell git-commit-mode log-edit pcvs-util add-log misearch multi-isearch help-mode git-rebase-mode thingatpt diff-mode gnus-kill qp mule-util sort smiley gnus-cite flow-fill mm-archive mail-extr gnus-async gnus-bcklg gnus-ml disp-table pop3 nndir nndraft nnmh gnutls network-stream auth-source eieio eieio-core starttls nnml nnfolder nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime password-cache dig mailcap nntp gnus-cache gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win jka-compr autorevert filenotify latexenc preview prv-emacs tex-bar toolbar-x noutline outline font-latex byte-opt bytecomp byte-compile cconv latex easy-mmode edmacro kmacro tex-style reftex-dcr reftex-auc reftex reftex-vars tex-buf tex-info texinfo tex dbus xml crm python json message dired-x dired format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader scheme lilypond-mode compile comint ansi-color ring vc-git cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs info easymenu package advice desktop frameset minibuf-eldef gnus gnus-ems nnheader gnus-util mail-utils mm-util help-fns mail-prsvr wid-edit cl-loaddefs cl-lib cus-start cus-load preview-latex tex-site auto-loads server time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 8 936702 107452) (symbols 24 62111 274) (miscs 20 1517 5186) (strings 16 173785 25925) (string-bytes 1 4819519) (vectors 8 55012) (vector-slots 4 1881617 31930) (floats 8 524 1344) (intervals 28 65318 2112) (buffers 512 230) (heap 1024 73167 13542)) --=20 David Kastrup From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 29 19:27:44 2020 Received: (at 18336) by debbugs.gnu.org; 1 Mar 2020 00:27:44 +0000 Received: from localhost ([127.0.0.1]:35592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8CSO-0003zU-9a for submit@debbugs.gnu.org; Sat, 29 Feb 2020 19:27:44 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:59170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8CSM-0003zH-FY for 18336@debbugs.gnu.org; Sat, 29 Feb 2020 19:27:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7Nrz1UpOwHjKU/e9fSI+DMjREwWOLslXNXOROazyfIo=; b=T0D8HkGD2s7o6ZyoLZaYeklIDT T6TZU0B0MfvbeYCkMum4CmiT9C54dIJXmrWDw2GIuMROLyDmKDhtPQ7ry5TP5SypJTr7X66QeDlRC 9HY+B1hDzI5ukqDjBmhNykh3Jm/XNTsJ0igay36qRJA7kge9ah3xWgaEN/SVXBYELRz3cQ4eW8UsQ i5zVVqX7Zvi2IK3ABjj01mWnFP73hKDtjQrbxdk42P8GtukbgqaNd+Sb1ONVPew/TZOfSqZ7A7JvY N8EePYS2pK2wrKZJnF7Sfvx0fqlzvMRskyOZWV6pJLwOZPkI+RozaiosTeBxNF7aKToxeNw3zNU4J zM6bkOUg==; Received: from h-4-70-69.a785.priv.bahnhof.se ([155.4.70.69]:50350 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1j8CSG-001lkc-Q6; Sat, 29 Feb 2020 19:27:37 -0500 From: Stefan Kangas To: David Kastrup Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions In-Reply-To: <87mwaq74xg.fsf@fencepost.gnu.org> (David Kastrup's message of "Wed, 27 Aug 2014 09:44:11 +0200") References: <87mwaq74xg.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Date: Sun, 01 Mar 2020 01:27:34 +0100 Message-ID: <87h7z86hs9.fsf@stefankangas.se> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18336 Cc: 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) David Kastrup writes: > When editing an externally changed file (under version control, no idea > whether that is related), I get the following questions (see below in > the input and output section). > > It does not make sense at all for Emacs to ask > > smob-convert.sh changed on disk; really edit the buffer? (y, n, r or C-h)= y > > as a reply to me typing C-x C-s since C-x C-s is _not_ a request to edit > the buffer. It is a request to save the file _after_ editing the > buffer, and I already discussed the consequences of editing and saving > with Emacs previously. > > Apart from being annoying by asking me the same question several times, > the question does not even make any sense the second time round. > I=C2=A0never know whether Emacs requires me to answer this quite nonsensi= cal > question with "y" or "n" in order to write the changed buffer, and what > will happen in either of the two cases of answering this no longer > applicable question. Thanks for the report. Unfortunately, it didn't get a reply at the time. Maybe something has changed since you reported this, because I'm seeing the following messages: (New file) Saving file /tmp/foo.txt... Wrote /tmp/foo.txt foo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y File on disk now will become a backup file if you save these changes. Saving file /tmp/foo.txt... foo.txt has changed since visited or saved. Save anyway? (y or n) y This makes a lot of sense to me. The prompts are really about two different things, which seems to now be fully clear. Given the above, I don't see any need to do any further changes here. I'll close this bug in a couple of weeks unless there is more to discuss. Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 11:26:39 2020 Received: (at 18336) by debbugs.gnu.org; 1 Mar 2020 16:26:39 +0000 Received: from localhost ([127.0.0.1]:36882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8RQN-00075u-7M for submit@debbugs.gnu.org; Sun, 01 Mar 2020 11:26:39 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:41886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8RQL-00075Z-2k for 18336@debbugs.gnu.org; Sun, 01 Mar 2020 11:26:38 -0500 Received: by mail-qt1-f180.google.com with SMTP id l21so5747516qtr.8 for <18336@debbugs.gnu.org>; Sun, 01 Mar 2020 08:26:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=WFqYHD9F4COJGxV1jAU91zPGasnVhWi4kbtv2ecA4M0=; b=LCgKLNhdV0b3DHb2/KIwWNFjK0csnGQk4PkzzjuIAzYjyPjCPXscQDFHvAmunsKitO BfiKLr2cacDfebcEYdi7091HzyI3WcHc3uuNAzWJxHEU5F9NlLzyOFESya22IaBvJqYx zEZhzjS9ELYEZyoziJDfR1HB9Q8v9V8TCEoKnUkWrEDJvFdF3uuDFs0jXY84pJl2XmDd kL7HQXSXj46b8y4mmHuqlHdhBVe+l7K0dbb6kpSNJBPOuj5Mi2+XAu7XJcRJmXIvOli0 dulUSC+Rjol4vC2NzmKQOiEqC76ql02wreo/3nl3MlrOpqdTact3xJYxjnoHDc+IQ7kM ERqQ== 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:in-reply-to:references :user-agent:date:message-id:mime-version; bh=WFqYHD9F4COJGxV1jAU91zPGasnVhWi4kbtv2ecA4M0=; b=O+fzNc/Vwcn9h+eM4yzIpMerGGv6UUyymnHZqWk0tNjKiIceGOlUq8hF3tjwT7rgJK oBy6ovyulTPhjzy6yRMhY23F32hwIqGSpNLY+6fZ818eepb9MHr59UCtxKW1VUaG9kmU rVHt7Tv8lVTuIC51iV8jPS8BX3nQQTBsiNPHyyo/Ol4cKzEsmXfuS2YKJXDDewyLeIpS Xe4NoJZMvy6ez3ogZq1MsdEq5OiMjYeTkXOCaqdHUbSRi2izya/k6u7reYnMQxLABKW7 +QgJbyFAxg+Ker50rfXfdJm6l4rKVxtSePIYS9WzrOWG+xkkyI49XVsx7/KOgNF6m0ZR KHIQ== X-Gm-Message-State: APjAAAV4izhMXVYtw2MYQDdH66ZbgdZwwhbglB4YLJaCVn1N6BoKSfYj zPRyv+6lrOJL/PYdHxISySgIeTmBr14= X-Google-Smtp-Source: APXvYqxccQCUNQSRqD6tLBZgs60xM7RNChATvQTxa2pdfz7vGDaxt9nwShvXWJ68iU/5xgMmRyWAlA== X-Received: by 2002:ac8:1205:: with SMTP id x5mr12160447qti.238.1583079991176; Sun, 01 Mar 2020 08:26:31 -0800 (PST) Received: from LAPTOP-5NDQIUP9 (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id a18sm7615136qkg.48.2020.03.01.08.26.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 01 Mar 2020 08:26:30 -0800 (PST) From: Noam Postavsky To: Stefan Kangas Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions In-Reply-To: <87h7z86hs9.fsf@stefankangas.se> (Stefan Kangas's message of "Sun, 01 Mar 2020 01:27:34 +0100") References: <87mwaq74xg.fsf@fencepost.gnu.org> <87h7z86hs9.fsf@stefankangas.se> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt) Date: Sun, 01 Mar 2020 11:26:23 -0500 Message-ID: <86v9nooxcg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 18336 Cc: David Kastrup , 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > David Kastrup writes: >> It does not make sense at all for Emacs to ask >> >> smob-convert.sh changed on disk; really edit the buffer? (y, n, r or C-h) y >> >> as a reply to me typing C-x C-s since C-x C-s is _not_ a request to edit >> the buffer. It is a request to save the file _after_ editing the >> buffer, and I already discussed the consequences of editing and saving >> with Emacs previously. > Maybe something has changed since you reported this, because I'm > seeing the following messages: > > (New file) > Saving file /tmp/foo.txt... > Wrote /tmp/foo.txt > foo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y > File on disk now will become a backup file if you save these changes. > Saving file /tmp/foo.txt... > foo.txt has changed since visited or saved. Save anyway? (y or n) y > > This makes a lot of sense to me. The prompts are really about two > different things, which seems to now be fully clear. > > Given the above, I don't see any need to do any further changes here. > I'll close this bug in a couple of weeks unless there is more to > discuss. I would agree with you that the second question is now more clear, but I think the first question shouldn't be asked in this case, since there was no edit attempt (as described in the original report). From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 11:38:35 2020 Received: (at 18336) by debbugs.gnu.org; 1 Mar 2020 16:38:35 +0000 Received: from localhost ([127.0.0.1]:36894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8Rbu-0007V6-Ux for submit@debbugs.gnu.org; Sun, 01 Mar 2020 11:38:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38113) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8Rbs-0007Uo-S4 for 18336@debbugs.gnu.org; Sun, 01 Mar 2020 11:38:33 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8Rbn-0001H5-Gz; Sun, 01 Mar 2020 11:38:27 -0500 Received: from x4e307dec.dyn.telefonica.de ([78.48.125.236]:57216 helo=lola) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8Rbm-0004eU-Uj; Sun, 01 Mar 2020 11:38:27 -0500 From: David Kastrup To: Noam Postavsky Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions References: <87mwaq74xg.fsf@fencepost.gnu.org> <87h7z86hs9.fsf@stefankangas.se> <86v9nooxcg.fsf@gmail.com> Date: Sun, 01 Mar 2020 17:38:24 +0100 In-Reply-To: <86v9nooxcg.fsf@gmail.com> (Noam Postavsky's message of "Sun, 01 Mar 2020 11:26:23 -0500") Message-ID: <87tv38kp33.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: Stefan Kangas , 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Noam Postavsky writes: > Stefan Kangas writes: > >> David Kastrup writes: > >>> It does not make sense at all for Emacs to ask >>> >>> smob-convert.sh changed on disk; really edit the buffer? (y, n, r or C-h) y >>> >>> as a reply to me typing C-x C-s since C-x C-s is _not_ a request to edit >>> the buffer. It is a request to save the file _after_ editing the >>> buffer, and I already discussed the consequences of editing and saving >>> with Emacs previously. > >> Maybe something has changed since you reported this, because I'm >> seeing the following messages: >> >> (New file) >> Saving file /tmp/foo.txt... >> Wrote /tmp/foo.txt >> foo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y >> File on disk now will become a backup file if you save these changes. >> Saving file /tmp/foo.txt... >> foo.txt has changed since visited or saved. Save anyway? (y or n) y >> >> This makes a lot of sense to me. The prompts are really about two >> different things, which seems to now be fully clear. >> >> Given the above, I don't see any need to do any further changes here. >> I'll close this bug in a couple of weeks unless there is more to >> discuss. > > I would agree with you that the second question is now more clear, but I > think the first question shouldn't be asked in this case, since there > was no edit attempt (as described in the original report). And it is still the same in that respect. [Original change behind Emacs' back, the trying to edit buffer] smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y File on disk now will become a backup file if you save these changes. [So far so good. Now pressing C-x C-s] Saving file /usr/local/tmp/lilypond/lily/smobs.cc... [That message is ok] smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y [That question is ludicrous. I am saving the file, not editing it.] File on disk now will become a backup file if you save these changes. [What does that even mean? I _am_ saving this file right now.] Wrote /usr/local/tmp/lilypond/lily/smobs.cc -- David Kastrup From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 12:09:57 2020 Received: (at 18336) by debbugs.gnu.org; 1 Mar 2020 17:09:57 +0000 Received: from localhost ([127.0.0.1]:36901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8S6H-00006y-Hn for submit@debbugs.gnu.org; Sun, 01 Mar 2020 12:09:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8S6G-00006i-NS for 18336@debbugs.gnu.org; Sun, 01 Mar 2020 12:09:57 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8S6B-0004My-AF; Sun, 01 Mar 2020 12:09:51 -0500 Received: from [176.228.60.248] (port=1542 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8S6A-0007ah-6j; Sun, 01 Mar 2020 12:09:50 -0500 Date: Sun, 01 Mar 2020 19:09:42 +0200 Message-Id: <83sgisypbd.fsf@gnu.org> From: Eli Zaretskii To: David Kastrup In-Reply-To: <87tv38kp33.fsf@fencepost.gnu.org> (message from David Kastrup on Sun, 01 Mar 2020 17:38:24 +0100) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions References: <87mwaq74xg.fsf@fencepost.gnu.org> <87h7z86hs9.fsf@stefankangas.se> <86v9nooxcg.fsf@gmail.com> <87tv38kp33.fsf@fencepost.gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: stefan@marxist.se, npostavs@gmail.com, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: David Kastrup > Date: Sun, 01 Mar 2020 17:38:24 +0100 > Cc: Stefan Kangas , 18336@debbugs.gnu.org > > And it is still the same in that respect. > > [Original change behind Emacs' back, the trying to edit buffer] > smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y > File on disk now will become a backup file if you save these changes. > [So far so good. Now pressing C-x C-s] > Saving file /usr/local/tmp/lilypond/lily/smobs.cc... > [That message is ok] > smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y > [That question is ludicrous. I am saving the file, not editing it.] > File on disk now will become a backup file if you save these changes. > [What does that even mean? I _am_ saving this file right now.] > Wrote /usr/local/tmp/lilypond/lily/smobs.cc Please try the latest pretest of Emacs 27, things are more reasonable now. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 12:46:03 2020 Received: (at 18336) by debbugs.gnu.org; 1 Mar 2020 17:46:03 +0000 Received: from localhost ([127.0.0.1]:36917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8SfD-0001Db-4j for submit@debbugs.gnu.org; Sun, 01 Mar 2020 12:46:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45993) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8SfA-0001Cy-8y for 18336@debbugs.gnu.org; Sun, 01 Mar 2020 12:46:01 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8Sf3-0006t5-Ly; Sun, 01 Mar 2020 12:45:53 -0500 Received: from x4e307dec.dyn.telefonica.de ([78.48.125.236]:57254 helo=lola) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8Ses-0002QA-Gx; Sun, 01 Mar 2020 12:45:51 -0500 From: David Kastrup To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions References: <87mwaq74xg.fsf@fencepost.gnu.org> <87h7z86hs9.fsf@stefankangas.se> <86v9nooxcg.fsf@gmail.com> <87tv38kp33.fsf@fencepost.gnu.org> <83sgisypbd.fsf@gnu.org> Date: Sun, 01 Mar 2020 18:45:33 +0100 In-Reply-To: <83sgisypbd.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 01 Mar 2020 19:09:42 +0200") Message-ID: <87pndwklz6.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: stefan@marxist.se, npostavs@gmail.com, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> From: David Kastrup >> Date: Sun, 01 Mar 2020 17:38:24 +0100 >> Cc: Stefan Kangas , 18336@debbugs.gnu.org >> >> And it is still the same in that respect. >> >> [Original change behind Emacs' back, the trying to edit buffer] >> smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y >> File on disk now will become a backup file if you save these changes. >> [So far so good. Now pressing C-x C-s] >> Saving file /usr/local/tmp/lilypond/lily/smobs.cc... >> [That message is ok] >> smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y >> [That question is ludicrous. I am saving the file, not editing it.] >> File on disk now will become a backup file if you save these changes. >> [What does that even mean? I _am_ saving this file right now.] >> Wrote /usr/local/tmp/lilypond/lily/smobs.cc > > Please try the latest pretest of Emacs 27, things are more reasonable > now. Uh, I compiled today from master. GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.12, cairo version 1.16.0) of 2020-03-01 Any changes since then? -- David Kastrup From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 12:59:05 2020 Received: (at 18336) by debbugs.gnu.org; 1 Mar 2020 17:59:05 +0000 Received: from localhost ([127.0.0.1]:36930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8Srp-0001Yq-9u for submit@debbugs.gnu.org; Sun, 01 Mar 2020 12:59:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47629) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8Srn-0001YI-7c for 18336@debbugs.gnu.org; Sun, 01 Mar 2020 12:59:03 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8Srh-0003Gc-PO; Sun, 01 Mar 2020 12:58:57 -0500 Received: from [176.228.60.248] (port=4663 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8Srf-00055J-Ux; Sun, 01 Mar 2020 12:58:56 -0500 Date: Sun, 01 Mar 2020 19:58:47 +0200 Message-Id: <83o8tgyn1k.fsf@gnu.org> From: Eli Zaretskii To: David Kastrup In-Reply-To: <87pndwklz6.fsf@fencepost.gnu.org> (message from David Kastrup on Sun, 01 Mar 2020 18:45:33 +0100) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: stefan@marxist.se, npostavs@gmail.com, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: David Kastrup > Cc: npostavs@gmail.com, stefan@marxist.se, 18336@debbugs.gnu.org > Date: Sun, 01 Mar 2020 18:45:33 +0100 > > > Please try the latest pretest of Emacs 27, things are more reasonable > > now. > > Uh, I compiled today from master. Then you see something very different from what I see on the emacs-27 branch, which is very strange. When I modify the file in Emacs, after it was modified by some other program, I see this: FILE changed on disk; really edit the buffer? (y, n, r or C-h) Pressing 'y' shows this: File on disk now will become a backup file if you save these changes. Typing C-x C-s then shows this: FILE has changed since visited or saved. Save anyway? (yes or no) Typing "yes" then says Wrote FILE That sounds reasonable to me. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 13:22:43 2020 Received: (at 18336) by debbugs.gnu.org; 1 Mar 2020 18:22:43 +0000 Received: from localhost ([127.0.0.1]:36945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8TEh-0002Qw-FY for submit@debbugs.gnu.org; Sun, 01 Mar 2020 13:22:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8TEg-0002Qd-39 for 18336@debbugs.gnu.org; Sun, 01 Mar 2020 13:22:42 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8TEa-0003JJ-Mu; Sun, 01 Mar 2020 13:22:36 -0500 Received: from x4e307dec.dyn.telefonica.de ([78.48.125.236]:57630 helo=lola) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8TEZ-0001jT-Tv; Sun, 01 Mar 2020 13:22:36 -0500 From: David Kastrup To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> Date: Sun, 01 Mar 2020 19:22:32 +0100 Message-ID: <874kv83pg7.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: stefan@marxist.se, npostavs@gmail.com, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> From: David Kastrup >> Cc: npostavs@gmail.com, stefan@marxist.se, 18336@debbugs.gnu.org >> Date: Sun, 01 Mar 2020 18:45:33 +0100 >> >> > Please try the latest pretest of Emacs 27, things are more reasonable >> > now. >> >> Uh, I compiled today from master. > > Then you see something very different from what I see on the emacs-27 > branch, which is very strange. > > When I modify the file in Emacs, after it was modified by some other > program, I see this: > > FILE changed on disk; really edit the buffer? (y, n, r or C-h) > > Pressing 'y' shows this: > > File on disk now will become a backup file if you save these changes. > > Typing C-x C-s then shows this: > > FILE has changed since visited or saved. Save anyway? (yes or no) > > Typing "yes" then says > > Wrote FILE > > That sounds reasonable to me. Well, I said that version control may be involved but this is the same using emacs -Q and on a file not under version control. Here is the current report-emacs-bug blurb for identification: In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.12, cairo version 1.16.0) of 2020-03-01 built on lola Repository revision: 279bf23695aff0f680fc846d285c5dc2b9596e76 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12005000 System Description: Ubuntu 19.10 This is actually commit e98ee8ddac24f7db3acfbbaadde5116d138bf698 (origin/master, origin/HEAD) Author: Stefan Kangas Date: Sun Mar 1 01:19:23 2020 +0100 Make 'load-dangerous-libraries' obsolete (Bug#37819) When 'load-dangerous-libraries' was t, Emacs allowed loading .elc files compiled by XEmacs. This patch removes the support for that use case, and declares the variable obsolete. * lisp/subr.el (load-dangerous-libraries): Declare obsolete. * src/lread.c (Fload): Ignore its value, and thereby refuse to load files byte compiled by XEmacs. (syms_of_lread): Update doc string of 'bytecomp-version-regexp' to not refer to it. * doc/emacs/building.texi (Lisp Libraries): Remove its documentation. with two unrelated commits of mine on top. -- David Kastrup From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 13:27:55 2020 Received: (at 18336) by debbugs.gnu.org; 1 Mar 2020 18:27:55 +0000 Received: from localhost ([127.0.0.1]:36949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8TJj-0002bB-4w for submit@debbugs.gnu.org; Sun, 01 Mar 2020 13:27:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8TJh-0002as-6p for 18336@debbugs.gnu.org; Sun, 01 Mar 2020 13:27:53 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8TJc-0004LL-0K; Sun, 01 Mar 2020 13:27:48 -0500 Received: from [176.228.60.248] (port=2444 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8TJT-0003Yo-JY; Sun, 01 Mar 2020 13:27:46 -0500 Date: Sun, 01 Mar 2020 20:27:30 +0200 Message-Id: <83lfokylpp.fsf@gnu.org> From: Eli Zaretskii To: David Kastrup In-Reply-To: <874kv83pg7.fsf@fencepost.gnu.org> (message from David Kastrup on Sun, 01 Mar 2020 19:22:32 +0100) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: stefan@marxist.se, npostavs@gmail.com, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: David Kastrup > Cc: npostavs@gmail.com, stefan@marxist.se, 18336@debbugs.gnu.org > Date: Sun, 01 Mar 2020 19:22:32 +0100 > > >> Uh, I compiled today from master. > > > > Then you see something very different from what I see on the emacs-27 > > branch, which is very strange. > > > > Well, I said that version control may be involved but this is the same > using emacs -Q and on a file not under version control. Here is the > current report-emacs-bug blurb for identification: > > In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.12, cairo version 1.16.0) > of 2020-03-01 built on lola > Repository revision: 279bf23695aff0f680fc846d285c5dc2b9596e76 > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.12005000 > System Description: Ubuntu 19.10 I tried the current master, and I see the same as on the emacs-27 branch, with a file not under any VCS. I have no idea how you see something so different. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 01 23:14:22 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 04:14:22 +0000 Received: from localhost ([127.0.0.1]:37142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8cTG-0003X1-8q for submit@debbugs.gnu.org; Sun, 01 Mar 2020 23:14:22 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:41058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8cTE-0003Wj-36 for 18336@debbugs.gnu.org; Sun, 01 Mar 2020 23:14:20 -0500 Received: by mail-qk1-f182.google.com with SMTP id b5so8816918qkh.8 for <18336@debbugs.gnu.org>; Sun, 01 Mar 2020 20:14:20 -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=X5glykZJBko2sPnLjQiKx6D8sUn9QGO2TLiLuoEwKJU=; b=I7RJhtkFxjXslbHzCT5lzm9l7FdRsPnsS+5TIMHioZzK6ilWowllrvLFPPFAf89o9p IH83xrNTpQ7yalcMgKQ1r8m8JxBLpzKYqtfe8cpvxQmYk8agbvIbJcd6HI1Ohs9KcWyP 2u8s60akfYK9o4wzKqClxsOAbCb65l+B2/BPWUIdyBRebPrIPrsaJAVYHCaFZgpLU/Wr HSBsgbk7G9/rM4OH/203VbTeXkz+Nu+nzBwuwBLAomDV4dcYgdfoZVc1ERZpdw7iqSQL 2yh/Fb4Tmsz92YITfaxoRogFie9JfI+Vrk0p3HgmDPOSBm4ro1RHUYlTs/bxTiRd/upa cGYQ== 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=X5glykZJBko2sPnLjQiKx6D8sUn9QGO2TLiLuoEwKJU=; b=d+1dgzn1kIYUEf/4w/GgmD7NbUwRiKKIZ8DndNdAM6pWcLJOI0MEtQAv8iQQ7xEZU5 T85idxPFozNzHHDRYGSaB2579FnUy1/x0avIeWeZXkkQWEr3W/nuAQ4Y/rwKj5mUeR4q i0b6VcPlTVVtugRVmqwifPMbpv1iMwl+7GTHn35L/1xuBojazWwPyEpXLspk9QlXwV3q lVG2WQRyEX5mWKQhbpI53lP2qnOL7vOhoCbSqJpuaJIw+nQR7U2Ye774rpyANxrlIfgG CccdHEIePyn7H9pg9e2Jmz0A3oRkL+ORRIVRZt1Ouhs/gusQf8rPiiYESo68jmUecb7k OicA== X-Gm-Message-State: ANhLgQ3agqd8TKAMdfbWByTTYtrO16X1m+uwLI2nVahiS23QcPS1vNPO HycFvLKk4qUtJDZZiHtrC2ERNxc5njo= X-Google-Smtp-Source: ADFU+vv3vrHg+c1NFX/1EfYXmxE9UrsjOYdU0/3UcVB980x7/+K+I1fSADNdOrzL25RL5qWi5cLE+w== X-Received: by 2002:a05:620a:13ca:: with SMTP id g10mr7202747qkl.385.1583122454419; Sun, 01 Mar 2020 20:14:14 -0800 (PST) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id k63sm5195977qtd.15.2020.03.01.20.14.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 01 Mar 2020 20:14:13 -0800 (PST) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> Date: Sun, 01 Mar 2020 23:14:12 -0500 In-Reply-To: <83lfokylpp.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 01 Mar 2020 20:27:30 +0200") Message-ID: <87r1yb8kbv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 18336 Cc: David Kastrup , stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.5 (--) Eli Zaretskii writes: >> From: David Kastrup >> Cc: npostavs@gmail.com, stefan@marxist.se, 18336@debbugs.gnu.org >> Date: Sun, 01 Mar 2020 19:22:32 +0100 >> >> >> Uh, I compiled today from master. >> > >> > Then you see something very different from what I see on the emacs-27 >> > branch, which is very strange. >> > >> >> Well, I said that version control may be involved but this is the same >> using emacs -Q and on a file not under version control. Here is the >> current report-emacs-bug blurb for identification: >> >> In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.12, cairo version 1.16.0) >> of 2020-03-01 built on lola >> Repository revision: 279bf23695aff0f680fc846d285c5dc2b9596e76 >> Repository branch: master >> Windowing system distributor 'The X.Org Foundation', version 11.0.12005000 >> System Description: Ubuntu 19.10 > > I tried the current master, and I see the same as on the emacs-27 > branch, with a file not under any VCS. > > I have no idea how you see something so different. I've tried this now too, and I see the same as Eli, even on Emacs 26.3. By the way, the "Save anyway?" question doesn't get logged to *Messages*. In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2019-09-07 built on minid Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd Windowing system distributor 'The X.Org Foundation', version 11.0.11902000 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: Beginning of history; no preceding item (Shell command succeeded with no output) A.txt changed on disk; really edit the buffer? (y, n, r or C-h) y File on disk now will become a backup file if you save these changes. Saving file /home/npostavs/tmp/A.txt... Wrote /home/npostavs/tmp/A.txt From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 03:28:08 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 08:28:09 +0000 Received: from localhost ([127.0.0.1]:37255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8gQq-00077g-LS for submit@debbugs.gnu.org; Mon, 02 Mar 2020 03:28:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8gQp-00077M-Ag for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 03:28:07 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8gQj-00042x-Ux; Mon, 02 Mar 2020 03:28:01 -0500 Received: from [176.228.60.248] (port=2516 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8gQi-00008k-Es; Mon, 02 Mar 2020 03:28:01 -0500 Date: Mon, 02 Mar 2020 10:27:54 +0200 Message-Id: <83eeubyxdh.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-Reply-To: <87r1yb8kbv.fsf@gmail.com> (message from Noam Postavsky on Sun, 01 Mar 2020 23:14:12 -0500) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Noam Postavsky > Cc: David Kastrup , stefan@marxist.se, 18336@debbugs.gnu.org > Date: Sun, 01 Mar 2020 23:14:12 -0500 > > > I tried the current master, and I see the same as on the emacs-27 > > branch, with a file not under any VCS. > > > > I have no idea how you see something so different. > > I've tried this now too, and I see the same as Eli, even on Emacs 26.3. The only idea I had meanwhile is that maybe David has some local code which redefines the functions involved in this use case. > By the way, the "Save anyway?" question doesn't get logged to > *Messages*. In Emacs 27 as well? Probably because we use there some API that doesn't log its text or something. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 03:39:24 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 08:39:24 +0000 Received: from localhost ([127.0.0.1]:37265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8gbk-0007Xi-CE for submit@debbugs.gnu.org; Mon, 02 Mar 2020 03:39:24 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:59506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8gbi-0007XQ-4t for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 03:39:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kO0UPmLbJx2QFWST/9zT5B+qxk37YpUjfka7k8x65Io=; b=LJpgeqW+d5XnIORZ0CJM7ujrTT SgOc24wgK+30Ogf54zgwjbA/z3L2ETyBnshJ7nbR8FTZzb6dL7RvUJzMSfh/wZPWDNw+I5JY43Tt+ l9Ccy10nq94qiBrxg5MnmMwoh6sq317KnmJeP4uDweFE6BqlZ4h18Uhe2+OlVML0dh183pcLOw7JJ jvsfTn8XoUyV2h0KGmg1KbiJkdQlaCx98TvcFow7sCf/XFDfnlPxTTqfLzMh/SIYo12ugvnkodKPr f0Gv8JRoI57PtHvAkG1B4I0WOFhh55Ph0ALwLA7Qdbwk0Vf+S8U0D2atb2OrgZyqgFuCo/IoFRp4M 5o8mCMLA==; Received: from h-4-70-69.a785.priv.bahnhof.se ([155.4.70.69]:49408 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1j8gbc-000rRz-BQ; Mon, 02 Mar 2020 03:39:16 -0500 From: Stefan Kangas To: Noam Postavsky Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions In-Reply-To: <87r1yb8kbv.fsf@gmail.com> (Noam Postavsky's message of "Sun, 01 Mar 2020 23:14:12 -0500") 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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Date: Mon, 02 Mar 2020 09:39:14 +0100 Message-ID: <87wo8340ct.fsf@stefankangas.se> MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18336 Cc: Eli Zaretskii , David Kastrup , 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Noam Postavsky writes: >> I tried the current master, and I see the same as on the emacs-27 >> branch, with a file not under any VCS. >> >> I have no idea how you see something so different. > > I've tried this now too, and I see the same as Eli, even on Emacs 26.3. > By the way, the "Save anyway?" question doesn't get logged to > *Messages*. OK, this is weird. I think I'm now seeing the same as David on current master. Note that this is different from what I saw earlier, when I saw exactly what Eli describes. 0. emacs -Q 1. C-x C-f /tmp/moo.txt RET 2. abc C-x C-s 3. From terminal: echo "foo" >> /tmp/moo.txt 4. type something, get these messages: moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y 5. Answer 'y', save the file, get: - do you really want to save? [not logged] - moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y I tried this several times and got the same result. In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.13, cairo version 1.16.0) of 2020-03-01 built on joffe Repository revision: d97688851bf5069430483c543032ef7cd0c9b5ef Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12007000 System Description: Debian GNU/Linux bullseye/sid Recent messages: (New file) Saving file /tmp/moo.txt... Wrote /tmp/moo.txt moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y File on disk now will become a backup file if you save these changes. Saving file /tmp/moo.txt... moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y File on disk now will become a backup file if you save these changes. Wrote /tmp/moo.txt --- OK, I tried saving a file in my home directory instead, and now I didn't see the second "changed on disk" message. (That is, I see the same thing that Eli described.) Testing it a bit more, I was able to trigger the second message again, but only once. --- Investigating even further (on current master), I think I now have that: a. In my home directory, I consistently see the message. (David's case) b. In "/tmp" I consistently do *not* see the message. (Eli's case) So I guess the second message is triggered only under specific circumstances? (But even the above conclusion is confusing, since I also saw the message (but only once) even when I saved in "/home". And I don't see why saving in a different directory should matter...) Does anyone have any idea what could be going on here? Have we found ourselves a heisenbug? Or have I thoroughly managed to confuse myself? Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 03:55:32 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 08:55:32 +0000 Received: from localhost ([127.0.0.1]:37286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8grM-00088D-2g for submit@debbugs.gnu.org; Mon, 02 Mar 2020 03:55:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8grK-00087o-N6 for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 03:55:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8grF-0006tg-Dc; Mon, 02 Mar 2020 03:55:25 -0500 Received: from [176.228.60.248] (port=4282 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8grE-0001YO-6M; Mon, 02 Mar 2020 03:55:24 -0500 Date: Mon, 02 Mar 2020 10:55:18 +0200 Message-Id: <838skjyw3t.fsf@gnu.org> From: Eli Zaretskii To: Stefan Kangas In-Reply-To: <87wo8340ct.fsf@stefankangas.se> (message from Stefan Kangas on Mon, 02 Mar 2020 09:39:14 +0100) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, npostavs@gmail.com, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Stefan Kangas > Cc: Eli Zaretskii , David Kastrup , 18336@debbugs.gnu.org > Date: Mon, 02 Mar 2020 09:39:14 +0100 > > 0. emacs -Q > 1. C-x C-f /tmp/moo.txt RET > 2. abc C-x C-s > 3. From terminal: echo "foo" >> /tmp/moo.txt > 4. type something, get these messages: > moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y > 5. Answer 'y', save the file, get: > - do you really want to save? [not logged] > - moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y First, this is not what David reported, see his description up-thread. And second: are you saying you get the question do you really want to save? [not logged] right after "C-x C-s", then the question moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) right after Emacs says "Wrote moo.txt"? That is, you didn't do anything after saving to get the last prompt? From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 04:04:15 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 09:04:15 +0000 Received: from localhost ([127.0.0.1]:37294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8gzn-0008SF-7l for submit@debbugs.gnu.org; Mon, 02 Mar 2020 04:04:15 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:33672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8gzl-0008Rw-WE for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 04:04:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JaanQFb8ZBtBCxv+4JpCkWSKMe4xV99A012ZFP+Fdrc=; b=rtzxsfqjlcZv9WLSJnvc5wzGpb +AuRzLIEThWme+Pthhndml+fbKiyn6UhDvdJ/EZ3vWCiKvA2BsicJNsttoQ67seOnsQONigrLWf2q 1vF2ND/xifKze7lRfZKzT6lTtowPNLYCyLD+O19epIawygpCKkm0ITHnbiORDW1m/ccQ/ZWdU0mmQ mjL/Bb0Cpe5NjNbTgoUa1toxKbOxBFL+AlJj2a9mKKyiYUa2hsyjvV512wJQpnNROR6zSGe/OslFl gqTpKsFccdSxuRJCLxrV+0dI//9McoDxm7eLPQKAD7AI61FIn5+etW0M67kBa7fVeIqZrZunEScL4 Ywjuzx3A==; Received: from h-4-70-69.a785.priv.bahnhof.se ([155.4.70.69]:45832 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1j8gzg-000wds-6V; Mon, 02 Mar 2020 04:04:08 -0500 From: Stefan Kangas To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions In-Reply-To: <838skjyw3t.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Mar 2020 10:55:18 +0200") 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> <838skjyw3t.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Date: Mon, 02 Mar 2020 10:04:06 +0100 Message-ID: <87tv373z7d.fsf@stefankangas.se> MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, npostavs@gmail.com, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Stefan Kangas >> Cc: Eli Zaretskii , David Kastrup , 18336@debbugs.gnu.org >> Date: Mon, 02 Mar 2020 09:39:14 +0100 >> >> 0. emacs -Q >> 1. C-x C-f /tmp/moo.txt RET >> 2. abc C-x C-s >> 3. From terminal: echo "foo" >> /tmp/moo.txt >> 4. type something, get these messages: >> moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y >> 5. Answer 'y', save the file, get: >> - do you really want to save? [not logged] >> - moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y > > First, this is not what David reported, see his description up-thread. Isn't it? He described: [Original change behind Emacs' back, the trying to edit buffer] smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y File on disk now will become a backup file if you save these changes. [So far so good. Now pressing C-x C-s] Saving file /usr/local/tmp/lilypond/lily/smobs.cc... [That message is ok] smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y [That question is ludicrous. I am saving the file, not editing it.] I don't think I see what the difference is from what I reported. (Or maybe my description wasn't clear?) > And second: are you saying you get the question > > do you really want to save? [not logged] > > right after "C-x C-s", then the question > > moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) > > right after Emacs says "Wrote moo.txt"? That is, you didn't do > anything after saving to get the last prompt? Yes. Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 04:43:06 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 09:43:06 +0000 Received: from localhost ([127.0.0.1]:37349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8hbN-00039j-Sd for submit@debbugs.gnu.org; Mon, 02 Mar 2020 04:43:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8hbK-000398-Os for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 04:43:03 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8hbF-00086J-Bf; Mon, 02 Mar 2020 04:42:57 -0500 Received: from x4e3058f3.dyn.telefonica.de ([78.48.88.243]:35730 helo=lola) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8hbE-0003ue-FJ; Mon, 02 Mar 2020 04:42:56 -0500 From: David Kastrup To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <83eeubyxdh.fsf@gnu.org> Date: Mon, 02 Mar 2020 10:42:53 +0100 In-Reply-To: <83eeubyxdh.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Mar 2020 10:27:54 +0200") Message-ID: <878skjozxe.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: stefan@marxist.se, Noam Postavsky , 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> From: Noam Postavsky >> Cc: David Kastrup , stefan@marxist.se, 18336@debbugs.gnu.org >> Date: Sun, 01 Mar 2020 23:14:12 -0500 >> >> > I tried the current master, and I see the same as on the emacs-27 >> > branch, with a file not under any VCS. >> > >> > I have no idea how you see something so different. >> >> I've tried this now too, and I see the same as Eli, even on Emacs 26.3. > > The only idea I had meanwhile is that maybe David has some local code > which redefines the functions involved in this use case. Nope. The two commits of my own do not touch anything even remotely in the vicinity. >> By the way, the "Save anyway?" question doesn't get logged to >> *Messages*. > > In Emacs 27 as well? Probably because we use there some API that > doesn't log its text or something. -- David Kastrup From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 04:53:58 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 09:53:58 +0000 Received: from localhost ([127.0.0.1]:37360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8hlu-0003Xb-6P for submit@debbugs.gnu.org; Mon, 02 Mar 2020 04:53:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8hlt-0003XH-9x for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 04:53:57 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8hln-0002tl-UX; Mon, 02 Mar 2020 04:53:51 -0500 Received: from x4e3058f3.dyn.telefonica.de ([78.48.88.243]:35734 helo=lola) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8hll-0004eM-FY; Mon, 02 Mar 2020 04:53:51 -0500 From: David Kastrup To: Stefan Kangas Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> Date: Mon, 02 Mar 2020 10:53:46 +0100 In-Reply-To: <87wo8340ct.fsf@stefankangas.se> (Stefan Kangas's message of "Mon, 02 Mar 2020 09:39:14 +0100") Message-ID: <874kv7ozf9.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: Eli Zaretskii , Noam Postavsky , 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Stefan Kangas writes: > OK, I tried saving a file in my home directory instead, and now I > didn't see the second "changed on disk" message. (That is, I see the > same thing that Eli described.) > > Testing it a bit more, I was able to trigger the second message again, > but only once. > > --- > > Investigating even further (on current master), I think I now have > that: > > a. In my home directory, I consistently see the message. (David's case) > b. In "/tmp" I consistently do *not* see the message. (Eli's case) > > So I guess the second message is triggered only under specific > circumstances? > > (But even the above conclusion is confusing, since I also saw the > message (but only once) even when I saved in "/home". And I don't see > why saving in a different directory should matter...) Mount options? Time stamp granularity? The file system I encountered this initially on is /dev/sda7 on /usr/local type ext4 (rw,noatime,discard,data=ordered) and my /tmp file system where I also saw this is /dev/sda5 on / type ext4 (rw,noatime,discard) I don't know whether Emacs uses /run/lock , if it does that would be tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k) The noatime option is because this is an SSD where I want to minimize write wear. -- David Kastrup From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 06:01:37 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 11:01:37 +0000 Received: from localhost ([127.0.0.1]:37405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8ipN-0007Hs-DZ for submit@debbugs.gnu.org; Mon, 02 Mar 2020 06:01:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8ipL-0007Cd-DL for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 06:01:36 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8ipF-0007FQ-Vt; Mon, 02 Mar 2020 06:01:30 -0500 Received: from [176.228.60.248] (port=3953 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8ipD-0000xc-Jn; Mon, 02 Mar 2020 06:01:28 -0500 Date: Mon, 02 Mar 2020 13:01:21 +0200 Message-Id: <837e03yq9q.fsf@gnu.org> From: Eli Zaretskii To: Stefan Kangas In-Reply-To: <87tv373z7d.fsf@stefankangas.se> (message from Stefan Kangas on Mon, 02 Mar 2020 10:04:06 +0100) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <838skjyw3t.fsf@gnu.org> <87tv373z7d.fsf@stefankangas.se> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, npostavs@gmail.com, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Stefan Kangas > Cc: dak@gnu.org, npostavs@gmail.com, 18336@debbugs.gnu.org > Date: Mon, 02 Mar 2020 10:04:06 +0100 > > >> 0. emacs -Q > >> 1. C-x C-f /tmp/moo.txt RET > >> 2. abc C-x C-s > >> 3. From terminal: echo "foo" >> /tmp/moo.txt > >> 4. type something, get these messages: > >> moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y > >> 5. Answer 'y', save the file, get: > >> - do you really want to save? [not logged] > >> - moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) y > > > > First, this is not what David reported, see his description up-thread. > > Isn't it? He described: > > [Original change behind Emacs' back, the trying to edit buffer] > smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y > File on disk now will become a backup file if you save these changes. > [So far so good. Now pressing C-x C-s] > Saving file /usr/local/tmp/lilypond/lily/smobs.cc... > [That message is ok] > smobs.cc changed on disk; really edit the buffer? (y, n, r or C-h) y > [That question is ludicrous. I am saving the file, not editing it.] > > I don't think I see what the difference is from what I reported. This part of your report is missing from David's: - do you really want to save? [not logged] And this part doesn't appear in your report: Saving file /usr/local/tmp/lilypond/lily/smobs.cc... > > And second: are you saying you get the question > > > > do you really want to save? [not logged] > > > > right after "C-x C-s", then the question > > > > moo.txt changed on disk; really edit the buffer? (y, n, r or C-h) > > > > right after Emacs says "Wrote moo.txt"? That is, you didn't do > > anything after saving to get the last prompt? > > Yes. Strange. Some debugging is required, I'd say. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 06:05:03 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 11:05:03 +0000 Received: from localhost ([127.0.0.1]:37413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8isg-000895-ST for submit@debbugs.gnu.org; Mon, 02 Mar 2020 06:05:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8isf-00088P-95 for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 06:05:01 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8isa-00041V-6M; Mon, 02 Mar 2020 06:04:56 -0500 Received: from [176.228.60.248] (port=4166 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8isZ-0000E3-5X; Mon, 02 Mar 2020 06:04:55 -0500 Date: Mon, 02 Mar 2020 13:04:50 +0200 Message-Id: <8336aryq3x.fsf@gnu.org> From: Eli Zaretskii To: David Kastrup In-Reply-To: <878skjozxe.fsf@fencepost.gnu.org> (message from David Kastrup on Mon, 02 Mar 2020 10:42:53 +0100) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <83eeubyxdh.fsf@gnu.org> <878skjozxe.fsf@fencepost.gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: stefan@marxist.se, npostavs@gmail.com, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: David Kastrup > Cc: Noam Postavsky , stefan@marxist.se, > 18336@debbugs.gnu.org > Date: Mon, 02 Mar 2020 10:42:53 +0100 > > > The only idea I had meanwhile is that maybe David has some local code > > which redefines the functions involved in this use case. > > Nope. The two commits of my own do not touch anything even remotely in > the vicinity. I meant something you load at startup (you didn't say it was in "emacs -Q"). From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 06:41:15 2020 Received: (at submit) by debbugs.gnu.org; 2 Mar 2020 11:41:15 +0000 Received: from localhost ([127.0.0.1]:37435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8jRi-0000kH-T2 for submit@debbugs.gnu.org; Mon, 02 Mar 2020 06:41:15 -0500 Received: from lists.gnu.org ([209.51.188.17]:48528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8jRh-0000kA-3D for submit@debbugs.gnu.org; Mon, 02 Mar 2020 06:41:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36992) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8jRg-0001kd-0E for bug-gnu-emacs@gnu.org; Mon, 02 Mar 2020 06:41:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j8jRf-0003BB-1u for bug-gnu-emacs@gnu.org; Mon, 02 Mar 2020 06:41:11 -0500 Received: from ciao.gmane.io ([159.69.161.202]:40778) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j8jRe-0003Ao-SW for bug-gnu-emacs@gnu.org; Mon, 02 Mar 2020 06:41:11 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1j8jRc-000PYg-V7 for bug-gnu-emacs@gnu.org; Mon, 02 Mar 2020 12:41:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: David Kastrup Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions Date: Mon, 02 Mar 2020 12:41:04 +0100 Organization: Organization?!? Message-ID: <87v9nnnfvz.fsf@fencepost.gnu.org> 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> <83eeubyxdh.fsf@gnu.org> <878skjozxe.fsf@fencepost.gnu.org> <8336aryq3x.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:/JC7Q0ZCQbzepM/XfYPJlOBaWkI= X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 159.69.161.202 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Eli Zaretskii writes: >> From: David Kastrup >> Cc: Noam Postavsky , stefan@marxist.se, >> 18336@debbugs.gnu.org >> Date: Mon, 02 Mar 2020 10:42:53 +0100 >> >> > The only idea I had meanwhile is that maybe David has some local code >> > which redefines the functions involved in this use case. >> >> Nope. The two commits of my own do not touch anything even remotely in >> the vicinity. > > I meant something you load at startup (you didn't say it was in "emacs -Q"). I did. To quote: "Well, I said that version control may be involved but this is the same using emacs -Q and on a file not under version control. Here is the current report-emacs-bug blurb for identification:" -- David Kastrup From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 06:51:19 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 11:51:19 +0000 Received: from localhost ([127.0.0.1]:37439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8jbS-0000zO-Ti for submit@debbugs.gnu.org; Mon, 02 Mar 2020 06:51:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8jbR-0000zA-Rq for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 06:51:18 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8jbM-0007Wf-Md for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 06:51:12 -0500 Received: from [176.228.60.248] (port=3156 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8jbL-00063h-Mg; Mon, 02 Mar 2020 06:51:12 -0500 Date: Mon, 02 Mar 2020 13:51:06 +0200 Message-Id: <83y2sjx9ed.fsf@gnu.org> From: Eli Zaretskii To: David Kastrup In-Reply-To: <87v9nnnfvz.fsf@fencepost.gnu.org> (message from David Kastrup on Mon, 02 Mar 2020 12:41:04 +0100) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <83eeubyxdh.fsf@gnu.org> <878skjozxe.fsf@fencepost.gnu.org> <8336aryq3x.fsf@gnu.org> <87v9nnnfvz.fsf@fencepost.gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: David Kastrup > Date: Mon, 02 Mar 2020 12:41:04 +0100 > > > I meant something you load at startup (you didn't say it was in "emacs -Q"). > > I did. To quote: > > "Well, I said that version control may be involved but this is the > same using emacs -Q and on a file not under version control. Here > is the current report-emacs-bug blurb for identification:" Right, so that theory eats dust. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 07:20:14 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 12:20:14 +0000 Received: from localhost ([127.0.0.1]:37468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8k3S-0001ix-8b for submit@debbugs.gnu.org; Mon, 02 Mar 2020 07:20:14 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:40073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8k3Q-0001iV-D1 for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 07:20:13 -0500 Received: by mail-qt1-f171.google.com with SMTP id o10so577248qtr.7 for <18336@debbugs.gnu.org>; Mon, 02 Mar 2020 04:20:12 -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=aIju8yam+X7nLUZaEu8CUeqT3mzaf+z8UtfYA5w/EXg=; b=RpTo0uEbxDPMv2o2qm1r37log8RyVQM30KDaldeHnpLZJez7saIVmsyvDpFYQ3FCdc tEdteDg6mPJkwRqxuSJWnR7fxKZ27kyLEYFdmCYpJSFWzEeW8TNi5bq9BOUe8cuqEtzM TvxpD/+slyTreRxA//tiUTh8Dar3iyKZ+/HjSYYSvtFUvfERSJM9Vqa9BFzmY51PPyRO 8BGmlxWU3zIENYI0+MiR9GRCeaP3Xdb2bUSzu8PNU4mOQcXsZCZ3o8tThJu+NWcx9Klc FVO8XyIf66ejzK4JyLixF2pwEwxkZZUqbcSgmSdlbBFf474wJEJXim5sd6c5Enn1Yp+j SOAA== 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=aIju8yam+X7nLUZaEu8CUeqT3mzaf+z8UtfYA5w/EXg=; b=CwP3aN0mu8PjXCTNiOXV4XylPcAnllZ0+L7U4+KyhpcJcdmKf0oltMDPKU0WR47W7g CN6BR6lJX6dvLlk8f9Z/fTTieP1Q1CRhXluf8G/O3jBcN5GQDISSTi2qyMeQ3cDLUv8+ e0KB9sCUebMZKbuWUGEsBMWZNI/KBIDFXa8E3xOC0lsl+5NduqEQjwqpCKlsrdwhAs+h mJ3TOURuU5GRit6Pk+5gSYpyypnZcL/UcK97uSRjRumxJ5l685UCeXMoUENSW5y9nhSq p9EO8ApvzGo+3Bvam1bXQsE/lC3z7A+n41C7hrXCdVTGZsLihWL+2Yx+zGhgz0xA3iSX hF+w== X-Gm-Message-State: ANhLgQ1prF3JnqN9v7v25OvE52KkMiyDEAlP+aFq2VWFZS4iyLN7mZzG EMNHguO/3Hncj/ZIglJkFYmRzjiqWuk= X-Google-Smtp-Source: ADFU+vtYKKhQRS8RspIEfX2CsNbigbDERl5UZT1lHFQcLz3DnEV30C1leeD/pwC/GRFSUNt/QHsNWA== X-Received: by 2002:ac8:6ec3:: with SMTP id f3mr493223qtv.328.1583151606711; Mon, 02 Mar 2020 04:20:06 -0800 (PST) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id 17sm7347897qkc.81.2020.03.02.04.20.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Mar 2020 04:20:05 -0800 (PST) From: Noam Postavsky To: David Kastrup Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> Date: Mon, 02 Mar 2020 07:20:04 -0500 In-Reply-To: <874kv7ozf9.fsf@fencepost.gnu.org> (David Kastrup's message of "Mon, 02 Mar 2020 10:53:46 +0100") Message-ID: <87o8tf7xu3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 18336 Cc: Eli Zaretskii , Stefan Kangas , 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.5 (--) David Kastrup writes: > Mount options? Time stamp granularity? > > The file system I encountered this initially on is > > /dev/sda7 on /usr/local type ext4 (rw,noatime,discard,data=ordered) > > and my /tmp file system where I also saw this is > > /dev/sda5 on / type ext4 (rw,noatime,discard) Aha, this seems to be the key. I ran my initial experiment in ~/tmp, which is mounted with relatime /dev/sda9 on /home type ext4 (rw,relatime,data=ordered) 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. /dev/sda8 on /tmp type ext4 (rw,noatime,data=ordered) From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 02 11:33:19 2020 Received: (at 18336) by debbugs.gnu.org; 2 Mar 2020 16:33:19 +0000 Received: from localhost ([127.0.0.1]:38294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8o0M-0001kC-PZ for submit@debbugs.gnu.org; Mon, 02 Mar 2020 11:33:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8o0L-0001jy-7q for 18336@debbugs.gnu.org; Mon, 02 Mar 2020 11:33:17 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j8o0F-0001Hr-Qj; Mon, 02 Mar 2020 11:33:11 -0500 Received: from [176.228.60.248] (port=4739 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j8o0E-000080-Ot; Mon, 02 Mar 2020 11:33:11 -0500 Date: Mon, 02 Mar 2020 18:33:05 +0200 Message-Id: <83mu8yyawu.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-Reply-To: <87o8tf7xu3.fsf@gmail.com> (message from Noam Postavsky on Mon, 02 Mar 2020 07:20:04 -0500) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Noam Postavsky > Cc: Stefan Kangas , Eli Zaretskii , 18336@debbugs.gnu.org > Date: Mon, 02 Mar 2020 07:20:04 -0500 > > > and my /tmp file system where I also saw this is > > > > /dev/sda5 on / type ext4 (rw,noatime,discard) > > Aha, this seems to be the key. I ran my initial experiment in ~/tmp, > which is mounted with relatime > > /dev/sda9 on /home type ext4 (rw,relatime,data=ordered) > > 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. > > /dev/sda8 on /tmp type ext4 (rw,noatime,data=ordered) This seems to point to the call to lock_file we make in write_region (which is called to save the buffer). 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. Or maybe the time is not the issue here, and the problem is with the check of the file's size that verify-visited-file-modtime performs? Can someone who sees this step with GDB through lock_file and its callees, and see what goes wrong there and why? From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 05 09:13:41 2020 Received: (at 18336) by debbugs.gnu.org; 5 Mar 2020 14:13:41 +0000 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 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 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) 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) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> Date: Thu, 05 Mar 2020 09:13:32 -0500 In-Reply-To: <83mu8yyawu.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 02 Mar 2020 18:33:05 +0200") Message-ID: <874kv299f7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.5 (--) 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). From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 05 10:07:22 2020 Received: (at 18336) by debbugs.gnu.org; 5 Mar 2020 15:07:22 +0000 Received: from localhost ([127.0.0.1]:43511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9s5q-0005vw-G7 for submit@debbugs.gnu.org; Thu, 05 Mar 2020 10:07:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56109) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9s5o-0005vj-6l for 18336@debbugs.gnu.org; Thu, 05 Mar 2020 10:07:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j9s5i-0006BK-SN; Thu, 05 Mar 2020 10:07:14 -0500 Received: from x2f36160.dyn.telefonica.de ([2.243.97.96]:49724 helo=lola) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j9s5h-0002MD-Ti; Thu, 05 Mar 2020 10:07:14 -0500 From: David Kastrup To: Noam Postavsky Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <874kv299f7.fsf@gmail.com> Date: Thu, 05 Mar 2020 16:07:11 +0100 In-Reply-To: <874kv299f7.fsf@gmail.com> (Noam Postavsky's message of "Thu, 05 Mar 2020 09:13:32 -0500") Message-ID: <87pndqet7k.fsf@fencepost.gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: Eli Zaretskii , stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Noam Postavsky writes: > 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. Sorry for the red herring. It was the thing that occured to me first. -- David Kastrup From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 05 11:03:18 2020 Received: (at 18336) by debbugs.gnu.org; 5 Mar 2020 16:03:18 +0000 Received: from localhost ([127.0.0.1]:43597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9sxy-0007Qe-7Z for submit@debbugs.gnu.org; Thu, 05 Mar 2020 11:03:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9sxw-0007QN-9v for 18336@debbugs.gnu.org; Thu, 05 Mar 2020 11:03:16 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j9sxq-0003lv-4S; Thu, 05 Mar 2020 11:03:10 -0500 Received: from [176.228.60.248] (port=4800 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j9sxp-0002K0-8t; Thu, 05 Mar 2020 11:03:09 -0500 Date: Thu, 05 Mar 2020 18:02:52 +0200 Message-Id: <83d09qvlg3.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-Reply-To: <874kv299f7.fsf@gmail.com> (message from Noam Postavsky on Thu, 05 Mar 2020 09:13:32 -0500) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <874kv299f7.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Noam Postavsky > Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org > Date: Thu, 05 Mar 2020 09:13:32 -0500 > > 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) Thanks. Any suggestions for how to fix this? A new argument to lock_file, perhaps? Or maybe some additional check in userlock--ask-user-about-supersession-threat to recognize the special situation where we are saving a file? From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 05 12:54:51 2020 Received: (at 18336) by debbugs.gnu.org; 5 Mar 2020 17:54:51 +0000 Received: from localhost ([127.0.0.1]:43699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9uhv-0001kD-9Q for submit@debbugs.gnu.org; Thu, 05 Mar 2020 12:54:51 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:32960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9uht-0001k1-OP for 18336@debbugs.gnu.org; Thu, 05 Mar 2020 12:54:50 -0500 Received: by mail-qk1-f169.google.com with SMTP id p62so6175233qkb.0 for <18336@debbugs.gnu.org>; Thu, 05 Mar 2020 09:54:49 -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=vDErV96Cx4WntFRWHXASXJwSnXS5sHaXr54bnwBY+eY=; b=A3S0IXAoSTzzO0nk/rDCEIjphBv3E04WbJmHj2OYtQsiNjZBu4DyRCpTzIxBG2TKft 1/oeznYpXNwae8MrhpxzzSwTygY/lfltPqI0NJqu7ByunW/c2JC7lsOcRSM/smKSU8jo ixSMnRZBPYMGANgdnxI9z8KLXhrKiefvEIJt6xBrab3cKFNfEAco+Ol/YXKuaL3InKv9 RZazlEmBzpIVd9hiMw3rXMA9h+aB8PsNjIhR0MOLUqQMIZTMIwd2DZfgyW5g0jKFkbiB mb8za218RKbAgQOjNTnFmaOGFI68uR/KBjUzF3PIBveayQ3lvFUzTTjgG9ZYwe9Lo01r 9G+A== 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=vDErV96Cx4WntFRWHXASXJwSnXS5sHaXr54bnwBY+eY=; b=Hbd6HSqbEqXMFKUUCumMxkYx8uioDMyvRXUkGaZ2TOWSghS7HouagOB53GWb7qL13g yLek7eqOilTjXc4TCVNx1iylxsdUblaXCmzoViNg2KCvU9WN73j82u92lg2A7KGYJs3K WwI+2B6iHuQFvidL3YTsNgD0BNd8Rvm8lRsaBMl2kZeFuZynTRvdJtwxzKXEHe938bhW DEEsS3my77BsXQ6RADicEYVYhOL4GR6i2/Z9JFZUYbVdaiBMhNerInEFDX5VMG/FN3dZ LJGwnKZDB13wGE69GQhrzHhQsaUcqy5ANjagaxfrChZVmTZ9ewLWNe52WZ8JjvQU/shR 1mGQ== X-Gm-Message-State: ANhLgQ3xfjsVkNA11RijUjomBY2ZNgO8fGqYi6BraN2q/EDe1FwmEY16 ZTO1JUq+cTWRdBwkAZLoVf3OCDuw X-Google-Smtp-Source: ADFU+vsslUJFJTP3iZNlkXGX5iLGMqLbIC3ul3LzZDk/dB83/LjsqF1vZWxihroGInuDfqo1a/1ewA== X-Received: by 2002:a05:620a:2116:: with SMTP id l22mr9175754qkl.311.1583430883953; Thu, 05 Mar 2020 09:54:43 -0800 (PST) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42]) by smtp.gmail.com with ESMTPSA id z2sm3066470qtn.23.2020.03.05.09.54.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Mar 2020 09:54:43 -0800 (PST) From: Noam Postavsky To: David Kastrup Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <874kv299f7.fsf@gmail.com> <87pndqet7k.fsf@fencepost.gnu.org> Date: Thu, 05 Mar 2020 12:54:41 -0500 In-Reply-To: <87pndqet7k.fsf@fencepost.gnu.org> (David Kastrup's message of "Thu, 05 Mar 2020 16:07:11 +0100") Message-ID: <8536amk7q6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 18336 Cc: Eli Zaretskii , stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.5 (--) David Kastrup writes: > Sorry for the red herring. It was the thing that occured to me first. No need to apologize, it was a reasonable guess. And anyway it led to the right answer in the end. Eli Zaretskii writes: >> 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. > Thanks. Any suggestions for how to fix this? A new argument to > lock_file, perhaps? Or maybe some additional check in > userlock--ask-user-about-supersession-threat to recognize the special > situation where we are saving a file? I'm not sure. Why exactly are we calling lock_file from write_region? The comment for lock_file says: Do not (normally) call this for a buffer already modified, as either the file is already locked, or the user has already decided to go ahead without locking. It seems we are doing exactly this, so I guess that makes save-buffer/write-region an "abnormal" situation? From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 05 14:31:49 2020 Received: (at 18336) by debbugs.gnu.org; 5 Mar 2020 19:31:49 +0000 Received: from localhost ([127.0.0.1]:43743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9wDk-00046Z-O5 for submit@debbugs.gnu.org; Thu, 05 Mar 2020 14:31:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9wDi-00046N-Io for 18336@debbugs.gnu.org; Thu, 05 Mar 2020 14:31:47 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j9wDd-0000x2-5Q; Thu, 05 Mar 2020 14:31:41 -0500 Received: from [176.228.60.248] (port=1539 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j9wDZ-00010Q-SD; Thu, 05 Mar 2020 14:31:38 -0500 Date: Thu, 05 Mar 2020 21:31:20 +0200 Message-Id: <838skevbsn.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-Reply-To: <8536amk7q6.fsf@gmail.com> (message from Noam Postavsky on Thu, 05 Mar 2020 12:54:41 -0500) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <874kv299f7.fsf@gmail.com> <87pndqet7k.fsf@fencepost.gnu.org> <8536amk7q6.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Noam Postavsky > Cc: Eli Zaretskii , stefan@marxist.se, 18336@debbugs.gnu.org > Date: Thu, 05 Mar 2020 12:54:41 -0500 > > > Thanks. Any suggestions for how to fix this? A new argument to > > lock_file, perhaps? Or maybe some additional check in > > userlock--ask-user-about-supersession-threat to recognize the special > > situation where we are saving a file? > > I'm not sure. Why exactly are we calling lock_file from write_region? Because write-region can be called from an unmodified buffer, I suppose, and from a buffer whose buffer-file-name is not the same as the file being written to. > Do not (normally) call this for a buffer already modified, > as either the file is already locked, or the user has already > decided to go ahead without locking. > > It seems we are doing exactly this, so I guess that makes > save-buffer/write-region an "abnormal" situation? Evidently, when we disabled backups in /tmp, we missed the fact that lock_file called from write-region will be affected. When backups are not disabled, this works correctly. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 21 21:14:09 2020 Received: (at 18336) by debbugs.gnu.org; 22 Mar 2020 01:14:09 +0000 Received: from localhost ([127.0.0.1]:48494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFpBp-000389-EV for submit@debbugs.gnu.org; Sat, 21 Mar 2020 21:14:09 -0400 Received: from mail-qt1-f177.google.com ([209.85.160.177]:38598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFpBn-00037o-2V; Sat, 21 Mar 2020 21:14:07 -0400 Received: by mail-qt1-f177.google.com with SMTP id z12so8656406qtq.5; Sat, 21 Mar 2020 18:14:07 -0700 (PDT) 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=EDeyoSFXTrn8Z6RQgdhE0ClAOJAe2ZZ6a09NvzjY9z8=; b=J1Gd4GqYf8HkdQ0lQmCRtj2SoucMlZdaHKOys7pK5nYkBTuq44Am/23AoqHk9aaxp4 0NsFudXyFutgSh1C/d+UAE9fV91Anhjw6VysHOsHRWszu2KJPCkJMARipB8G7oAzdHob fdWVsNFLplcW++NsBbyW1/6Og0VoznllDxNFaAwRyFZbKFZv4pV6SFo7bh6rNdmJu0v5 rVNwrdQfOJZKFhfu3M7ESYQmJOJ/Z21ttpB25SRMyruXUC+BA71P10FAl9KsnEG/wU9E KOOqnUkEZcZ7N42ElOdaphNonZF1ShptVtxTG8bbHb4nIiWjaAYclFnLycIdIcjRRLnh 7GdQ== 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=EDeyoSFXTrn8Z6RQgdhE0ClAOJAe2ZZ6a09NvzjY9z8=; b=lAt5NkJit3LV30ZZweA1Y2YxdBadbuJoiUVbpC0RxHP3zrOaF/P9M0HILfeHR2owwG LCvKwLIH+9vk8s6hAUvzB9VcQP7R2FyWX7ksOKK9qDNhI/HxppY1uLVAsrwiOJzVISkn P3b/1FQ87uWhYgfOYEPWoFI/m3Kha1gIL+zMNm0jJbij38Q2N+0VNXROFJ+VO0prrg17 0RUp3PNxiIIS9tQJTyAk4rUmRxpmdFv+LN10aRuKiCJuvERXxtq8fp0g2u5vumAFFcBR NEDx0F3QbrXIlwUQlVM4BnlrpA6nZWkPmWFLjUov7Y/xcB+MvEnReI6RgZL1HDJ59mvt xhfg== X-Gm-Message-State: ANhLgQ25NSkfAy+9cr2ODjn5CXEMWgTLVC9OWyqp3In1lTcNiszyynO+ 4LQ8QjM+T9H32O92HduLrxwxnvgi X-Google-Smtp-Source: ADFU+vtjTMdnm5GaqK2+I8ISuvlDaG37KM0V3aQe6RKBJfn/mdtQEaLpROA8R5cmMxbcKWutilqNLw== X-Received: by 2002:ac8:4549:: with SMTP id z9mr15651747qtn.274.1584839641437; Sat, 21 Mar 2020 18:14:01 -0700 (PDT) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id l13sm7925292qke.116.2020.03.21.18.14.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Mar 2020 18:14:00 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <874kv299f7.fsf@gmail.com> <87pndqet7k.fsf@fencepost.gnu.org> <8536amk7q6.fsf@gmail.com> <838skevbsn.fsf@gnu.org> Date: Sat, 21 Mar 2020 21:13:59 -0400 In-Reply-To: <838skevbsn.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Mar 2020 21:31:20 +0200") Message-ID: <87y2rtjinc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain tags 18336 + patch quit Eli Zaretskii writes: >> >> I'm not sure. Why exactly are we calling lock_file from write_region? > > Because write-region can be called from an unmodified buffer, I > suppose, and from a buffer whose buffer-file-name is not the same as > the file being written to. So maybe we could just check those conditions? Here's a patch, tentatively suggested for master. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Avoid-extra-changed-on-disk-prompt-in-save-buffer-Bu.patch Content-Description: patch >From ae6a82e1b10ce850731fbc7135611108cd2bd147 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 21 Mar 2020 21:00:08 -0400 Subject: [PATCH] Avoid extra "changed on disk" prompt in save-buffer (Bug#18336) * src/fileio.c (write_region): Only call lock_file is the buffer is unmodified or writing to some file other than the buffer's file. As mentioned in lock_file's commentary, calling it for modified buffers is redundant (this reasoning only applies when writing to the buffer's file). --- src/fileio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index 482f88627a..323faa2e77 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5123,7 +5123,12 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, = choose_write_coding_system (start, end, filename, append, visit, lockname, &coding); - if (open_and_close_file && !auto_saving) + if (open_and_close_file && !auto_saving && + /* Only call lock_file on unmodifed buffer (see lock_file + commentary). */ + (NILP (Fbuffer_modified_p (Qnil)) || + /* Or if we're not writing to the buffer's file. */ + NILP (Fstring_equal (visit_file, BVAR (current_buffer, filename))))) { lock_file (lockname); file_locked = 1; -- 2.11.0 --=-=-= Content-Type: text/plain > Evidently, when we disabled backups in /tmp, we missed the fact that > lock_file called from write-region will be affected. When backups are > not disabled, this works correctly. To me, the fact that it works with backups enabled seems like an accident. The connection between locking and backups isn't very obvious, and I don't see any commentary about it (which I would expect for such a subtle interaction if it was done on purpose). --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 22 10:35:07 2020 Received: (at 18336) by debbugs.gnu.org; 22 Mar 2020 14:35:08 +0000 Received: from localhost ([127.0.0.1]:50820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG1gx-0000et-H1 for submit@debbugs.gnu.org; Sun, 22 Mar 2020 10:35:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG1gw-0000eJ-71 for 18336@debbugs.gnu.org; Sun, 22 Mar 2020 10:35:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jG1gq-0004Yb-Ra; Sun, 22 Mar 2020 10:35:00 -0400 Received: from [176.228.60.248] (port=4766 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jG1gp-0005WY-RT; Sun, 22 Mar 2020 10:35:00 -0400 Date: Sun, 22 Mar 2020 16:35:02 +0200 Message-Id: <83k13ccvah.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-Reply-To: <87y2rtjinc.fsf@gmail.com> (message from Noam Postavsky on Sat, 21 Mar 2020 21:13:59 -0400) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <874kv299f7.fsf@gmail.com> <87pndqet7k.fsf@fencepost.gnu.org> <8536amk7q6.fsf@gmail.com> <838skevbsn.fsf@gnu.org> <87y2rtjinc.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Noam Postavsky > Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org > Date: Sat, 21 Mar 2020 21:13:59 -0400 > > >> Why exactly are we calling lock_file from write_region? > > > > Because write-region can be called from an unmodified buffer, I > > suppose, and from a buffer whose buffer-file-name is not the same as > > the file being written to. > > So maybe we could just check those conditions? Here's a patch, > tentatively suggested for master. Isn't it better to check whether the file is already locked? That way, we don't need any (error-prone) heuristics for when it's okay to ask the question and when it isn't. > > Evidently, when we disabled backups in /tmp, we missed the fact that > > lock_file called from write-region will be affected. When backups are > > not disabled, this works correctly. > > To me, the fact that it works with backups enabled seems like an > accident. It might be an accident, but it's the reason why the default paradigm works. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 22 11:45:33 2020 Received: (at 18336) by debbugs.gnu.org; 22 Mar 2020 15:45:33 +0000 Received: from localhost ([127.0.0.1]:50838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG2n7-0004lM-Gk for submit@debbugs.gnu.org; Sun, 22 Mar 2020 11:45:33 -0400 Received: from mail-qk1-f177.google.com ([209.85.222.177]:40324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG2n6-0004ku-3z for 18336@debbugs.gnu.org; Sun, 22 Mar 2020 11:45:33 -0400 Received: by mail-qk1-f177.google.com with SMTP id l25so7742704qki.7 for <18336@debbugs.gnu.org>; Sun, 22 Mar 2020 08:45:32 -0700 (PDT) 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=NnCXx5cTvrnurrUd1hEKLuywM4+jlbba42zEHnr8WQo=; b=ApY0OGbmi+lL8claiO7PJ5R949geWtQ1Pwfay5lprVIxYQee90DBYCQKcve+lYhQna HnVOtMH5zcX45f6j8k1tdH2c5p/+JoJf/n4lTRbVrzSaOlk7eo+VdgFnXVVw+pbrgnsC UHamgrwy0fiMqpX2hbhdB2kw7t5sH/GYCSB/KWAASH3dKue9G19YeoutCL9KcW++cGqI kQaM+R9F9C+Zt8cCUmZw8Sd72eEMalNXEQltZY337/WMOeLuzZvYK8ZZv3rB8A4/knsl WiLuPL53shA5xh2w3M+bIpT5eEUajSYhntnrY9gghGkIWZE0nRddRQz5wE58he6/AvzD YbeA== 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=NnCXx5cTvrnurrUd1hEKLuywM4+jlbba42zEHnr8WQo=; b=KXr8SlRKRSYkJeLiyln+CcmHx7mzPxvYEWG6BAqvTmi7SLTXkwGT/tfq3e6LCWsD/t HyUNj/7Dch6ejEmNd+d9UzkFBMLEQ/Aw2SasA8nyBSi+N29MHNY1GZikB6N7/ChPEvjX 6flj2zopnvaWSC8/g9l/h1c8sjQXsprW2mBmzvM7e+OQW2LfOiaJ7LQu2JaQKz+tUtnt h4Oe5Y/NDtGBNb8BcRYPYNato/WabNRcjQ2WJtWWK0xIJzapyyLPlCMRcf8pEKTXAa6h D6ERk8PUaOxiUid6/6ECQN3JpFJ6j+fjI4/t3q7pY4amcaEXV6IEXw1j249i+LiAA3mB +OAw== X-Gm-Message-State: ANhLgQ19FVbFVEu6H9lNvGfiplRtvxhWcj0B94nEOfg1jYuIqV4JYbow /MCq0uOoJ29DbQo3urByfeFrePgI X-Google-Smtp-Source: ADFU+vu7MNvmRmOwiqn6uxe6IRido5jhguoTb8Nf+FP85u5SAcuAgFEfMLJrO3SfP0/+Rs+s8xH46g== X-Received: by 2002:a37:4bd1:: with SMTP id y200mr15632977qka.205.1584891926434; Sun, 22 Mar 2020 08:45:26 -0700 (PDT) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id m18sm10500594qtc.89.2020.03.22.08.45.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 08:45:25 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <874kv299f7.fsf@gmail.com> <87pndqet7k.fsf@fencepost.gnu.org> <8536amk7q6.fsf@gmail.com> <838skevbsn.fsf@gnu.org> <87y2rtjinc.fsf@gmail.com> <83k13ccvah.fsf@gnu.org> Date: Sun, 22 Mar 2020 11:45:24 -0400 In-Reply-To: <83k13ccvah.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 22 Mar 2020 16:35:02 +0200") Message-ID: <87r1xkjsvf.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Noam Postavsky >> Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org >> Date: Sat, 21 Mar 2020 21:13:59 -0400 >> >> >> Why exactly are we calling lock_file from write_region? >> > >> > Because write-region can be called from an unmodified buffer, I >> > suppose, and from a buffer whose buffer-file-name is not the same as >> > the file being written to. >> >> So maybe we could just check those conditions? Here's a patch, >> tentatively suggested for master. > > Isn't it better to check whether the file is already locked? That > way, we don't need any (error-prone) heuristics for when it's okay to > ask the question and when it isn't. If I understand the code correctly, lock_file() already checks this (the '&& !NILP (Ffile_exists_p (fn))' part), but takes the wrong action in that case. So I'm not sure what we should do differently. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 22 13:09:53 2020 Received: (at 18336) by debbugs.gnu.org; 22 Mar 2020 17:09:53 +0000 Received: from localhost ([127.0.0.1]:50867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG46j-0007KZ-5w for submit@debbugs.gnu.org; Sun, 22 Mar 2020 13:09:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG46h-0007KN-Pw for 18336@debbugs.gnu.org; Sun, 22 Mar 2020 13:09:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jG46c-0000wQ-Ex; Sun, 22 Mar 2020 13:09:46 -0400 Received: from [176.228.60.248] (port=2213 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jG46U-00006R-M0; Sun, 22 Mar 2020 13:09:42 -0400 Date: Sun, 22 Mar 2020 19:09:39 +0200 Message-Id: <83d094co4s.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-Reply-To: <87r1xkjsvf.fsf@gmail.com> (message from Noam Postavsky on Sun, 22 Mar 2020 11:45:24 -0400) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions 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> <874kv299f7.fsf@gmail.com> <87pndqet7k.fsf@fencepost.gnu.org> <8536amk7q6.fsf@gmail.com> <838skevbsn.fsf@gnu.org> <87y2rtjinc.fsf@gmail.com> <83k13ccvah.fsf@gnu.org> <87r1xkjsvf.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Noam Postavsky > Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org > Date: Sun, 22 Mar 2020 11:45:24 -0400 > > > Isn't it better to check whether the file is already locked? That > > way, we don't need any (error-prone) heuristics for when it's okay to > > ask the question and when it isn't. > > If I understand the code correctly, lock_file() already checks this (the > '&& !NILP (Ffile_exists_p (fn))' part), but takes the wrong action in > that case. So I'm not sure what we should do differently. AFAIU, 'fn' in lock_file is the file we want to lock, not the file we create to indicate the lock. Am I missing something? From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 22 15:46:42 2020 Received: (at 18336) by debbugs.gnu.org; 22 Mar 2020 19:46:42 +0000 Received: from localhost ([127.0.0.1]:50932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG6YU-0003VV-0G for submit@debbugs.gnu.org; Sun, 22 Mar 2020 15:46:42 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:37985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG6YS-0003VI-Fb for 18336@debbugs.gnu.org; Sun, 22 Mar 2020 15:46:40 -0400 Received: by mail-qt1-f178.google.com with SMTP id z12so9923762qtq.5 for <18336@debbugs.gnu.org>; Sun, 22 Mar 2020 12:46:40 -0700 (PDT) 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=HKk4SHITqy61AzGEmdDQaWcgvHttd0cQKFWvlzvLenE=; b=O0UG3xEaJVtNsfVOHcudLTNcvXRLVLY6SitmRkxHJ4VrPgXGpuOt5/O95aUJwMFDvZ V7DIxcuxoZDz7Q4/dMZc0/op7rAmaLP5BHnrZX0W3aoOqxExKm4pDv5soeT9DRn/2kvP sS52EtjfFocb8yk0L+UF8x5P0k01Q4sLq7iBFqwMRydpDck3zdiaL93rNK6XQjN8aJV/ Hfdqj9KmxZFFIP8A6resugnPhXEVDhLdVfabMOV5qxlim1R6Z26r95P1RjzUl0gYHqcN n4dqua3TfMJgWPcW913v2YRGQ9w7chyh+mhxwCSnV0by3ZT6NE9P4qkeEkzsbrmm6FSe v1jQ== 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=HKk4SHITqy61AzGEmdDQaWcgvHttd0cQKFWvlzvLenE=; b=NRpo1Yeb/z92/VnD0lT59CyQZmfKb81kUxDSRnf8Zu0XYUdSXt/HDWNPvN+rfltVng hYA90hKCac1qtISjZfLQEsjJ9Ym1JixLsZhz+LqK8jVGxhYo2CdAMhkqlwhRZ5WWlJvV /YFY0UwShhJZuEXZWRn9EuyaSTQsLRBufE2gD7jUew0l6k/S0zOv09xSW0GELBWzFnSJ uD2oSwISlb895sg0muuVwzzLoTWWMWSGkGi3uHI34HTKffYA0+3AxivWutQNiTFfxKKx AbJhfAXGFkBBVlzG67Uro0p00JKHPJKYgOxt0YCUHuA9BYIOa1lTPH9/KdNnOg90sprL U4rw== X-Gm-Message-State: ANhLgQ06eAesU8u9r4u38HunL10MXkFDPymuev0sTNOT4iRrf8BPsc0b xxbFs0+GElW43kkJP5NdXhUWJ+vq X-Google-Smtp-Source: ADFU+vudtQgP0asqkZ2KXVuxblBirXe4ebrT5uzbxzxcLXkYjgIRFUlMMZm248DGN74wmyCGgBes6g== X-Received: by 2002:ac8:a8b:: with SMTP id d11mr17569476qti.94.1584906394734; Sun, 22 Mar 2020 12:46:34 -0700 (PDT) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id z23sm9653221qkg.21.2020.03.22.12.46.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 12:46:33 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions References: <87mwaq74xg.fsf@fencepost.gnu.org> <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> <874kv299f7.fsf@gmail.com> <87pndqet7k.fsf@fencepost.gnu.org> <8536amk7q6.fsf@gmail.com> <838skevbsn.fsf@gnu.org> <87y2rtjinc.fsf@gmail.com> <83k13ccvah.fsf@gnu.org> <87r1xkjsvf.fsf@gmail.com> <83d094co4s.fsf@gnu.org> Date: Sun, 22 Mar 2020 15:46:33 -0400 In-Reply-To: <83d094co4s.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 22 Mar 2020 19:09:39 +0200") Message-ID: <87o8sojhpi.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> > Isn't it better to check whether the file is already locked? That >> > way, we don't need any (error-prone) heuristics for when it's okay to >> > ask the question and when it isn't. >> >> If I understand the code correctly, lock_file() already checks this (the >> '&& !NILP (Ffile_exists_p (fn))' part), but takes the wrong action in >> that case. So I'm not sure what we should do differently. > > AFAIU, 'fn' in lock_file is the file we want to lock, not the file we > create to indicate the lock. Am I missing something? Oh, you're right, I was confused. The patch below seems to work. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Avoid-extra-changed-on-disk-prompt-in-save-buffer-Bu.patch Content-Description: patch >From 036eb17510ab63ce62aa858c9ff825b2ec5b5c7a Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 21 Mar 2020 21:00:08 -0400 Subject: [PATCH] Avoid extra "changed on disk" prompt in save-buffer (Bug#18336) * src/filelock.c (lock_file): Don't query the user if the current session already owns the lock. --- src/filelock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/filelock.c b/src/filelock.c index b28f16e9b5..5e14731ee8 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -679,6 +679,9 @@ lock_file (Lisp_Object fn) dostounix_filename (SSDATA (fn)); #endif encoded_fn = ENCODE_FILE (fn); + if (create_lockfiles) + /* Create the name of the lock-file for file fn */ + MAKE_LOCK_NAME (lfname, encoded_fn); /* See if this file is visited and has changed on disk since it was visited. */ @@ -689,7 +692,8 @@ lock_file (Lisp_Object fn) if (!NILP (subject_buf) && NILP (Fverify_visited_file_modtime (subject_buf)) - && !NILP (Ffile_exists_p (fn))) + && !NILP (Ffile_exists_p (fn)) + && (!create_lockfiles || current_lock_owner (NULL, lfname) != -2)) call1 (intern ("userlock--ask-user-about-supersession-threat"), fn); } @@ -697,10 +701,6 @@ lock_file (Lisp_Object fn) /* Don't do locking if the user has opted out. */ if (create_lockfiles) { - - /* Create the name of the lock-file for file fn */ - MAKE_LOCK_NAME (lfname, encoded_fn); - /* Try to lock the lock. FIXME: This ignores errors when lock_if_free returns a positive errno value. */ if (lock_if_free (&lock_info, lfname) < 0) -- 2.11.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 22 16:16:36 2020 Received: (at 18336) by debbugs.gnu.org; 22 Mar 2020 20:16:36 +0000 Received: from localhost ([127.0.0.1]:50948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG71Q-0004O5-Fz for submit@debbugs.gnu.org; Sun, 22 Mar 2020 16:16:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jG71P-0004Ns-4j for 18336@debbugs.gnu.org; Sun, 22 Mar 2020 16:16:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jG71J-00030t-EK; Sun, 22 Mar 2020 16:16:29 -0400 Received: from [176.228.60.248] (port=1913 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jG71I-000827-H4; Sun, 22 Mar 2020 16:16:28 -0400 Date: Sun, 22 Mar 2020 22:16:30 +0200 Message-Id: <83zhc8b0wx.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-Reply-To: <87o8sojhpi.fsf@gmail.com> (message from Noam Postavsky on Sun, 22 Mar 2020 15:46:33 -0400) Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions References: <87mwaq74xg.fsf@fencepost.gnu.org> <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> <874kv299f7.fsf@gmail.com> <87pndqet7k.fsf@fencepost.gnu.org> <8536amk7q6.fsf@gmail.com> <838skevbsn.fsf@gnu.org> <87y2rtjinc.fsf@gmail.com> <83k13ccvah.fsf@gnu.org> <87r1xkjsvf.fsf@gmail.com> <83d094co4s.fsf@gnu.org> <87o8sojhpi.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Noam Postavsky > Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org > Date: Sun, 22 Mar 2020 15:46:33 -0400 > > > AFAIU, 'fn' in lock_file is the file we want to lock, not the file we > > create to indicate the lock. Am I missing something? > > Oh, you're right, I was confused. The patch below seems to work. LGTM, thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 22 23:27:05 2020 Received: (at 18336) by debbugs.gnu.org; 23 Mar 2020 03:27:05 +0000 Received: from localhost ([127.0.0.1]:51328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGDk1-0002Up-5a for submit@debbugs.gnu.org; Sun, 22 Mar 2020 23:27:05 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]:32818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGDjy-0002U5-S5; Sun, 22 Mar 2020 23:27:03 -0400 Received: by mail-qt1-f181.google.com with SMTP id d22so10601670qtn.0; Sun, 22 Mar 2020 20:27:02 -0700 (PDT) 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=W+1PPGZncAoytLVAPTRId/ONItrCIF28T1PD+KnSZAc=; b=cJGhW4RCoCzEpGNBwD332PPHThT5JunvPL44+Sek5ysui/NREh50W8PNCGJTJPPVMM GvckUAqEMU4pGexGO0KSoyGImvQr58XMays910affRgF0Jc/j0bQn7INqjF+xgQqfyuL LDt+Z8Tx4pv+4R/lqF+OsKuTTls+MIR7b8XpQE5yR07F6wW6T9Ks0akShuAEOuKVKDsV PHJ1CsRsh/Kr7YVkQN9OAhGLlgWRBlMWbYsc+Cx4HHCBjKo63O0lwRLiVGBA+faxhRaq rCSM2F1uwoe7rZ0PjxbEPM5tyjvii3xBqltik4XGUyjlMSW9ynmESYbwoHVDuw21cps3 X/5Q== 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=W+1PPGZncAoytLVAPTRId/ONItrCIF28T1PD+KnSZAc=; b=NTJJb7dwHpoGg9T33XkCm1w0W2/PgVD5GXg0HyScd7kWtV/7RqWB4T9NaQyv2GoSG8 Dm9zim+qgLqeAsppcCBEncW+zOi4Xk+CR7HWIp8BYbkzbxTg5q6ojxzXjkP+Se4DP+2U 7vL2tcI3Z8Ipky6wYAfhuxXrxG3i3XZNHjLhS3n9VhYqeJCQCZs81Qm3guCZmU3HZsaZ Zekh++vRHfOibmyDIl8QLs+/w2+B/Gs6P1G/9TDghVSSwN34OOZQ484LDEaFmXnc5kAg mutXRe7TgBgzGbTKcayOuO28HOoldjloChP5GQGUqH2Gd0lEpsmDZla/byg5bVRlSlEb gnEg== X-Gm-Message-State: ANhLgQ1U/ZqDA2Qanlrx1FiBHS7Cr75nw8Y86N/M+U+2x6F/KB4AqEbH lgUSQhKrTk6jqKlEP/iPxuGKwKUt X-Google-Smtp-Source: ADFU+vtRNm4gn8jWWNoz77ti7aK2Q5BIcQoDNtvJngXMFeElMcv71QDrlkNxinr6RQCe1sOqR5pl/w== X-Received: by 2002:aed:21bc:: with SMTP id l57mr19166205qtc.218.1584934017091; Sun, 22 Mar 2020 20:26:57 -0700 (PDT) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id p38sm11442585qtf.50.2020.03.22.20.26.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 20:26:56 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions References: <87mwaq74xg.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> <874kv299f7.fsf@gmail.com> <87pndqet7k.fsf@fencepost.gnu.org> <8536amk7q6.fsf@gmail.com> <838skevbsn.fsf@gnu.org> <87y2rtjinc.fsf@gmail.com> <83k13ccvah.fsf@gnu.org> <87r1xkjsvf.fsf@gmail.com> <83d094co4s.fsf@gnu.org> <87o8sojhpi.fsf@gmail.com> <83zhc8b0wx.fsf@gnu.org> Date: Sun, 22 Mar 2020 23:26:55 -0400 In-Reply-To: <83zhc8b0wx.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 22 Mar 2020 22:16:30 +0200") Message-ID: <87ftdzkayo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 18336 Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 18336 fixed close 18336 28.1 quit Eli Zaretskii writes: >> From: Noam Postavsky >> Cc: dak@gnu.org, stefan@marxist.se, 18336@debbugs.gnu.org >> Date: Sun, 22 Mar 2020 15:46:33 -0400 >> >> > AFAIU, 'fn' in lock_file is the file we want to lock, not the file we >> > create to indicate the lock. Am I missing something? >> >> Oh, you're right, I was confused. The patch below seems to work. > > LGTM, thanks. Pushed to master. [1: 8f694831c0]: 2020-03-22 23:06:05 -0400 Avoid extra "changed on disk" prompt in save-buffer (Bug#18336) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8f694831c04b1fb9db81be72afdc1a1101d619c4 From unknown Sun Aug 17 09:10:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 20 Apr 2020 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator