From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: TODO: insert-file should warn if the file is modified Date: 21 Apr 2002 15:29:17 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xsn5p18pe.fsf@kfs2.cua.dk> References: <200204201726.g3KHQUs01285@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1019392237 19632 127.0.0.1 (21 Apr 2002 12:30:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 21 Apr 2002 12:30:37 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16zGUH-00056X-00 for ; Sun, 21 Apr 2002 14:30:37 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16zGUU-0005YV-00 for ; Sun, 21 Apr 2002 14:30:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16zGU6-0004GQ-00; Sun, 21 Apr 2002 08:30:26 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16zGSD-0003k6-00; Sun, 21 Apr 2002 08:28:30 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id C3BF87C04E; Sun, 21 Apr 2002 12:28:27 +0000 (GMT) Original-To: Pavel@Janik.cz (Pavel =?iso-8859-2?q?Jan=EDk?=) In-Reply-To: Original-Lines: 63 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2927 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2927 Pavel@Janik.cz (Pavel Jan=EDk) writes: > From: Richard Stallman > Date: Sat, 20 Apr 2002 11:26:30 -0600 (MDT) >=20 > > (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))) > >=20 > > 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. > >=20 > > File %s is being edited. Insert the file anyway? > >=20 > > would be a clearer message. >=20 > Yes. >=20 > > It is better not to include the buffer name, because that will usual= ly > > 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. >=20 > I think that this is not enough. Try this: >=20 > pavel@SnowWhite:/tmp/em> LANG=3DC 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 >=20 > ./1: > total 4 > -rw-r--r-- 1 pavel users 3 Apr 20 20:07 file >=20 > ./2: > total 0 > lrwxrwxrwx 1 pavel users 9 Apr 20 20:07 file -> ../1/file >=20 > 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. >=20 > > KFS suggested offering to insert the buffer. That is a good idea > > provided the questions asked seem natural and not inconvenient. >=20 > Which buffer? The first one we find is editing that file? There can be > many of them... I think that in practice, there is rarely more than one buffer. The response could be more advanced, like File %s is being edited. Insert file anyway? [ynvb?] where answering y inserts the file, n doesn't, v visits the buffer containing the edited file, b inserts the edited buffer, and ? explains these options. --=20 Kim F. Storm http://www.cua.dk