bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: correct name for new buffer of same file


From: Dan Jacobson
Subject: Re: correct name for new buffer of same file
Date: 27 May 2001 04:22:28 +0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Eli" == Eli Zaretskii <address@hidden> writes:

>> From: Dan Jacobson <address@hidden>
>> Newsgroups: gnu.emacs.bug
>> Date: 23 May 2001 15:21:58 +0800
>> 
>> perhaps you do this several times.  Before long you will have
>> 
>> my_internal_links<3>  10890  Compilation /home/jidanni/my_internal_links
>> my_internal_links<2>  10544  Compilation /home/jidanni/my_internal_links
>> 
>> etc. etc. in the buffer list.  Nothing bad do far.  Well, there you
>> are viewing what you thought was that file and you make a little
>> adjustment and
>> 
>> my_internal_links changed on disk; really edit the buffer? (y, n, r or C-h) 
>> Please type y, n or r; or ? for help
>> 
>> Only now emacs tells me!  I've been looking at that file for a half an
>> hour already and only now does emacs tell me it is an old version.

Eli> This is a feature: it allows you to keep material in a buffer even
Eli> though it is long gone, by omission or by commission, from your hard
Eli> disk.  If you mistakenly wipe out your files one day, you will be
Eli> grateful that Emacs buffers aren't automatically synchronized with the
Eli> disk ;-)

I like that.  I just want their buffer names clearly marked as backup
buffers.

Eli> But if you want Emacs to alert you or even automatically sync with the
Eli> disk, look on the net for something called autorevert.el.

I don't need anything more that making sure I don't accidentally
switch to a backup buffer thinking it is the current version buffer.

>> As proof positive let me ask, for files on disk, does the original
>> version keep the same name while the newer versions have ~1~ ~2~ ~3~
>> appended?  No.  So why for buffer names do that (with <2> <3> ...)?

Eli> Because otherwise Emacs would confuse the user: users don't expect
Eli> buffers to change their names under their feet.

Wait a second, let's see how gnus does things:

 MR Buffer           Size  Mode         File
 -- ------           ----  ----         ----
.   *followup to Eli Zaretskii on gnu.emacs.bug*  2077 Message /home/jida...
 *% *Dead Summary comp.risks*  348 Summary 
    *sent followup to Eli Zaretskii on gnu.emacs.bug*  1894 Message /home/j...

I think it is great that it prepends "*sent ", "*Dead " etc.
Just think of the confusion if instead it just appended <2>:

    *followup to Eli Zaretskii on gnu.emacs.bug*  1894 Message /home/j...
.   *followup to Eli Zaretskii on gnu.emacs.bug*<2>  2077 Message /home/jida...

I would go crazy, because the size 1894 one is the one I already sent,
nice to keep around in a buffer, but should be clearly marked as
already sent, at least in the buffer name.

When using C-x b [switch-to-buffer] and TAB, or even picking from
buffer-list, one will surely not pick the last one of the <2> <3>
etc. versions unless one is very careful, therefore one will end up
reading old versions of buffers unaware of current versions.

I vote that "*Dead ", "*Old ", "*Backup " whatever, be prepended.
There can be "*Dead .... <2>, <3> also if needed.

You can look at any other model on the systems, be it file linking,
pointers or whatever.  In each case the main, official pointer to
something uses the main official name.  Former pointers are given
different names.  In this case emacs is saying "for the remainder of
this invocation I violate that rule".  One must exit and restart emacs
for the buffer name to once again match the filename.
-- 
http://www.geocities.com/jidanni Tel886-4-25854780 e-mail:restore .com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]