From: Pavel@Janik.cz (Pavel Janík)
Cc: emacs-devel@gnu.org
Subject: Re: TODO: insert-file should warn if the file is modified
Date: Sat, 20 Apr 2002 20:12:39 +0200 [thread overview]
Message-ID: <m3znzy9r3c.fsf@Janik.cz> (raw)
In-Reply-To: <200204201726.g3KHQUs01285@aztec.santafe.edu> (Richard Stallman's message of "Sat, 20 Apr 2002 11:26:30 -0600 (MDT)")
From: Richard Stallman <rms@gnu.org>
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:
pavel@SnowWhite:/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
next prev parent reply other threads:[~2002-04-20 18:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-19 12:58 TODO: insert-file should warn if the file is modified Pavel Janík
2002-04-19 13:47 ` Eli Zaretskii
2002-04-19 14:33 ` Andreas Schwab
2002-04-19 15:08 ` Pavel Janík
2002-04-19 15:07 ` Pavel Janík
2002-04-19 14:16 ` Kim F. Storm
2002-04-19 14:53 ` Pavel Janík
2002-04-20 17:26 ` Richard Stallman
2002-04-20 18:12 ` Pavel Janík [this message]
2002-04-21 13:29 ` Kim F. Storm
2002-04-22 7:46 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3znzy9r3c.fsf@Janik.cz \
--to=pavel@janik.cz \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).