From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Pavel@Janik.cz (Pavel =?iso-8859-2?q?Jan=EDk?=) Newsgroups: gmane.emacs.devel Subject: Re: TODO: insert-file should warn if the file is modified Date: Fri, 19 Apr 2002 17:07:19 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1019238868 30390 127.0.0.1 (19 Apr 2002 17:54:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 19 Apr 2002 17:54:28 +0000 (UTC) Cc: 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 16ycaZ-0007u3-00 for ; Fri, 19 Apr 2002 19:54:27 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16ycu1-0005u6-00 for ; Fri, 19 Apr 2002 20:14:34 +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 16ycaI-0001Xk-00; Fri, 19 Apr 2002 13:54:10 -0400 Original-Received: from p0274.as-l043.contactel.cz ([194.108.243.20] helo=SnowWhite.SuSE.cz) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16ycYL-0001Pz-00 for ; Fri, 19 Apr 2002 13:52:10 -0400 Original-Received: by SnowWhite.SuSE.cz (PJ, from userid 500) id AF81C183D6; Fri, 19 Apr 2002 17:43:33 +0200 (CEST) Original-To: Eli Zaretskii Mail-Copies-To: never X-Face: $"d&^B_IKlTHX!y2d,3;grhwjOBqOli]LV`6d]58%5'x/kBd7.MO&n3bJ@Zkf&RfBu|^qL+ ?/Re{MpTqanXS2'~Qp'J2p^M7uM:zp[1Xq#{|C!*'&NvCC[9!|=>#qHqIhroq_S"MH8nSH+d^9*BF: iHiAs(t(~b#1.{w.d[=Z In-Reply-To: (Eli Zaretskii's message of "Fri, 19 Apr 2002 09:47:06 -0400") User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i386-suse-linux-gnu) Original-Lines: 31 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:2794 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2794 From: Eli Zaretskii Date: Fri, 19 Apr 2002 09:47:06 -0400 Hi ELi, > What about buffer that visit the same file under a different name > (e.g., symlinks on Posix systems)? Don't we want to catch those as > well? Yes, we certainly want to catch those as well. Thank you for pointing this out. What about the following version? I'm checking if truename of the argument is the same as truename of any file visited: (defun file-is-modified-somewhere (filename) "Check if the file FILENAME is modified inside Emacs. Return buffer visiting the file FILENAME marked as modified. Otherwise, return nil." (let ((result) (true-filename (file-truename filename))) (dolist (buffer (buffer-list) result) (if (and (string=3D true-filename (file-truename (or (buffer-file-name buffer) ""))) (buffer-modified-p buffer)) (setq result buffer))))) --=20 Pavel Jan=EDk I remember when I lost an argument. Boy did that hurt! ;-) -- Richard Stallman in emacs-devel