From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?6Lev5a6i?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs does not detect a buffered file got deleted Date: Tue, 9 Aug 2016 09:02:00 +0800 Message-ID: References: <83twevia3v.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113fb33aeb2ea505399916e6 X-Trace: blaine.gmane.org 1470704614 3733 195.159.176.226 (9 Aug 2016 01:03:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 Aug 2016 01:03:34 +0000 (UTC) Cc: Andreas Schwab , Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 09 03:03:29 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWvS5-0000qu-Ar for ged-emacs-devel@m.gmane.org; Tue, 09 Aug 2016 03:03:29 +0200 Original-Received: from localhost ([::1]:32832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWvS1-0005BK-WD for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2016 21:03:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWvRO-0005Ak-Sw for emacs-devel@gnu.org; Mon, 08 Aug 2016 21:02:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWvRM-0002As-KX for emacs-devel@gnu.org; Mon, 08 Aug 2016 21:02:45 -0400 Original-Received: from mail-io0-x22c.google.com ([2607:f8b0:4001:c06::22c]:35753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWvRJ-0002AL-GG; Mon, 08 Aug 2016 21:02:41 -0400 Original-Received: by mail-io0-x22c.google.com with SMTP id m101so373413235ioi.2; Mon, 08 Aug 2016 18:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CW/LOr4nr1vVhSySpfSE2n4l/emrRTMWLmAT7uxQKBE=; b=Y22MSsm4AddNmo4JPANPaV+YPtq34E039C2t61tz6/qDGzSMW8sU7TABqEAr8OZyMP LZXVkYFqdW8YTxvp+DJf/D7hjuqn4OHmjYyGW45FaZWspGnhhWZuQH1o6SgjGUa1PFEZ Zh+68THLujsLZbgrFuy6lM7g/Ec6sSpdxY4t9yRDRJNSEVcumTIZ+Vh67dSSobrZYNEw 7P2TFkGdH4li+SeCbG3RqvvGDI0uwaKcurtKrqNWfbyWKP7XMIl6Gwr19TYtBaPY7W/g 2OhHLWI7DpFIEH2sOL2Ya7++YBK+PmfyiSFhW9po30nabbD1WipDDxmctshpLZNFauHo hPvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CW/LOr4nr1vVhSySpfSE2n4l/emrRTMWLmAT7uxQKBE=; b=duyH7IG/vnbsIQfT8IHOMpdVhyeLj6xpUtlVyaV+iQT1fd6TDv94oKlzDt5laHADp8 Km4pmaMPZogh4a2FUrLwnqMYLbKD34UXs+yrAGOckOi8tF9BKYOaDCcDOrKPS9rlpruD 8GLFL2BdG4/F7bsPyMQFz5WT4ezkcuLZSup5Tk9GON/3elgKOrif2uek3EqqjlS+iKlW FrBAFS860ZEUiLxIb3CCOUGe0t1xwTRxgl99I6eO7Uthm/317Nc/Y2oDVwfc97dLl/1M SNIwQATtf8Oz1PuT2Gilp8P9n/DicEJKbfNs1V0AxZbzCRVQEcnLOmU3+7xNubhpYF3q GM5g== X-Gm-Message-State: AEkoousm6hc7SnERFch2YjP8EeVC/fOvFIkSsqB4/Kg9lRuAG1uCUjCAeMQaZEFKmOlDq57fBBVl2DYh1a21ug== X-Received: by 10.107.14.4 with SMTP id 4mr98367165ioo.160.1470704560842; Mon, 08 Aug 2016 18:02:40 -0700 (PDT) Original-Received: by 10.107.2.76 with HTTP; Mon, 8 Aug 2016 18:02:00 -0700 (PDT) In-Reply-To: <83twevia3v.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c06::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206501 Archived-At: --001a113fb33aeb2ea505399916e6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Nope, it's not an issue at all; it's just for user-convenience. Whether convenient or not is of course personal but some modern editors like notepad++, ultraedit ... already doing this for some time. VIM does not detect that either, but gvim did give us a warning about file no longer there. Here I'm just trying to match some modern editor behavior. One sample issue is that when switching between git branches I sometimes find I'm still editing a file that's already not there (moved/deleted/included-into-other-file by others), till I do "git status" or "git add" and then find out the fact. Of course it won't be difficult to add an extra mode to do that but I'm just thinking it should be easier to fix it from the origin. Remove that test condition and modify `ask-user-about-supersession-threat' to detect file deletion. Well, if no one think it's a good idea I will draw back my proposal then and patch it in my own local system, or maybe a minor mode then. Thanks! 2016-08-08 22:55 GMT+08:00 Eli Zaretskii : > > From: =E8=B7=AF=E5=AE=A2 > > Date: Mon, 8 Aug 2016 16:55:55 +0800 > > Cc: Emacs developers > > > > Yes, I understood that. My intention is to notify the user about the > deletion but not > > really want to revert the file. Emacs provide other options other than > reverting. A > > "revert" here might mean "close this buffer". However,this might need > further > > modification to notify the user about the deletion instead of the norma= l > modification > > notification. Using the original `ask-user-about-supersession-threat' > might be a bit > > confusing if file is deleted. What do you think? > > Emacs doesn't do anything like that anywhere else, AFAIK. Not even > auto-revert mode does something like that for deleted files. I'm not > sure I see good reasons to do anything in this particular case. > > Let me turn the table and ask you what kind of trouble you saw with > buffers whose files were deleted by Git (or any other VCS)? Why would > you like Emacs to do something special in this case? An extra buffer > is a non-issue in Emacs. > > Thanks. > --=20 Best regards, Luke Lee --001a113fb33aeb2ea505399916e6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Nope, it's not an issue at all; it's jus= t for user-convenience. Whether convenient or not is of course personal but= some modern editors like notepad++, ultraedit ... already doing this for s= ome time. VIM does not detect that either, but gvim did give us a warning a= bout file no longer there. Here I'm just trying to match some modern ed= itor behavior. One sample issue is that when switching between git branches= I sometimes find I'm still editing a file that's already not there= (moved/deleted/included-into-other-file by others), till I do "git st= atus" or "git add" and then find out the fact.

Of co= urse it won't be difficult to add an extra mode to do that but I'm = just thinking it should be easier to fix it from the origin. Remove that te= st condition and modify `ask-user-about-supersession-threat' to detect = file deletion.

Well, if no one think it's a good ide= a I will draw back my proposal then and patch it in my own local system, or= maybe a minor mode then. Thanks!

=
2016-08-08 22:55 GMT+08:00 Eli Zaretskii <eliz@gnu.o= rg>:
> From: =E8=B7=AF= =E5=AE=A2 <luke.yx.lee@gmail.co= m>
> Date: Mon, 8 Aug 2016 16:55:55 +0800
> Cc: Emacs developers <emacs-= devel@gnu.org>
>
> Yes, I understood that. My intention is to notify the user about the d= eletion but not
> really want to revert the file. Emacs provide other options other than= reverting. A
> "revert" here might mean "close this buffer". Howe= ver,this might need further
> modification to notify the user about the deletion instead of the norm= al modification
> notification. Using the original `ask-user-about-supersession-thr= eat' might be a bit
> confusing if file is deleted. What do you think?

Emacs doesn't do anything like that anywhere else, AFAIK.=C2=A0 = Not even
auto-revert mode does something like that for deleted files.=C2=A0 I'm = not
sure I see good reasons to do anything in this particular case.

Let me turn the table and ask you what kind of trouble you saw with
buffers whose files were deleted by Git (or any other VCS)?=C2=A0 Why would=
you like Emacs to do something special in this case?=C2=A0 An extra buffer<= br> is a non-issue in Emacs.

Thanks.



--
Best regards,
Luke Lee
=

--001a113fb33aeb2ea505399916e6--