emacs-devel
[Top][All Lists]
Advanced

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

Re: TODO: insert-file should warn if the file is modified


From: Pavel Janík
Subject: Re: TODO: insert-file should warn if the file is modified
Date: Sat, 20 Apr 2002 20:12:39 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i386-suse-linux-gnu)

   From: Richard Stallman <address@hidden>
   Date: Sat, 20 Apr 2002 11:26:30 -0600 (MDT)

   >       (let ((buffer (file-is-modified-somewhere filename)))
   >    (if (or (not buffer)
   >            (y-or-n-p (format "File %s is modified in buffer %s. Insert it? 
" filename buffer)))
   > 
   > The code looks good, but the message might be misunderstood.
   > "It" is ambiguous1  Be VERY careful about using pronouns
   > in writing, and especially in short statements like that one.
   > 
   >   File %s is being edited.  Insert the file anyway?
   > 
   > would be a clearer message.

Yes.

   > It is better not to include the buffer name, because that will usually
   > give no additional information and will make the message longer.  One
   > possible approach is to include the buffer name only when it is
   > different from the file's name.

I think that this is not enough. Try this:

address@hidden:/tmp/em> LANG=C ls -lR
.:
total 8
drwxr-xr-x    2 pavel    users        4096 Apr 20 20:07 1
drwxr-xr-x    2 pavel    users        4096 Apr 20 20:07 2

./1:
total 4
-rw-r--r--    1 pavel    users           3 Apr 20 20:07 file

./2:
total 0
lrwxrwxrwx    1 pavel    users           9 Apr 20 20:07 file -> ../1/file

User will edit 2/file in Emacs in buffer `file'. He can not insert file
1/file, because 2/file is edited in the buffer with the same name as the
filename and he will not be warned of the buffer. On the other hand: the
file can be edited in more than one buffer.

   > KFS suggested offering to insert the buffer.  That is a good idea
   > provided the questions asked seem natural and not inconvenient.

Which buffer? The first one we find is editing that file? There can be
many of them...
-- 
Pavel Janík

Buying an operating system without source is like buying a self-assembly
Space Shuttle with no instructions.
                  -- Jeremy Allison in linux-kernel



reply via email to

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