From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.bugs Subject: bug#4674: 23.1; UNC paths and file-relative-directory Date: Thu, 8 Oct 2009 14:54:38 +0100 Message-ID: Reply-To: Richard Copley , 4674@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1255010856 5918 80.91.229.12 (8 Oct 2009 14:07:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Oct 2009 14:07:36 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 08 16:07:26 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MvteO-0001NV-T1 for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2009 16:07:25 +0200 Original-Received: from localhost ([127.0.0.1]:52317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvteO-00063v-7D for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2009 10:07:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvteI-0005z3-0F for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 10:07:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvteD-0005nf-0r for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 10:07:17 -0400 Original-Received: from [199.232.76.173] (port=49276 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvteC-0005nO-S7 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 10:07:12 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:52434) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MvteC-0003Z1-0N for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 10:07:12 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n98E79gn026335; Thu, 8 Oct 2009 07:07:09 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n98E07f8024285; Thu, 8 Oct 2009 07:00:07 -0700 Resent-Date: Thu, 8 Oct 2009 07:00:07 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Richard Copley Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 08 Oct 2009 14:00:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4674 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125501008723359 (code B ref -1); Thu, 08 Oct 2009 14:00:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 8 Oct 2009 13:54:47 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n98Dsjh0023356 for ; Thu, 8 Oct 2009 06:54:46 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvtS9-0005zq-2A for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 09:54:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvtS4-0005xD-D6 for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 09:54:44 -0400 Original-Received: from [199.232.76.173] (port=54878 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvtS4-0005x5-2o for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 09:54:40 -0400 Original-Received: from mail-bw0-f220.google.com ([209.85.218.220]:38023) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvtS3-0000hZ-Km for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2009 09:54:39 -0400 Original-Received: by bwz20 with SMTP id 20so5736785bwz.42 for ; Thu, 08 Oct 2009 06:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=gg3aWaupLKnlErmN0uTFzYhIUIzlFnHDn03If9Fd8M4=; b=Z8zndjIF0/cThimnoIYP2DkGS3zp+DpTvL437WrwH+2B0fmt2CtZRcuq0Yo2DuSRTE 7XjU596jwSvnfRqfg9AZY/Vr6O81DgfZwg0UbVlci13w9UT6xRxkxIjm5P6xcTzz3/3G pe6CreRP0g+syZVlQsQzjh7Ftb0ojFqemBnX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UpgKraq8zzVcS/SvlwSX3ZiZUQf6UQkd6RFeIePqqZCOutkSyD5/cmshN/J0bwUTLg DwiLqh0zfAfCF1i4a4cg6qjZcEM7lTntAL1zBwKcNXqh3GmQv8NFw9ru3UOgR9VvQLbe 8LaZa63VhcebWxJFAVtw8HsvROpfcyAjqEE8g= Original-Received: by 10.102.177.33 with SMTP id z33mr521547mue.87.1255010078266; Thu, 08 Oct 2009 06:54:38 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 08 Oct 2009 10:07:17 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31784 Archived-At: The function `file-relative-directory' has logic to detect when the two given paths are part of two separate directory trees, and to return the absolute file name in such cases. That logic does not catch the case when the two given paths are UNC paths on different servers. For example, on my present network (where there are computers named IOBATES and KERES), the form (file-relative-name "//iobates/e/temp" "//keres/e/temp") returns "../../../iobates/e/temp", which is not a valid relative path to "//iobates/e/temp" from "//keres/e/temp". This is therefore a bug. As a workaround, I have the following piece of advice in my site-start. However I'm not sure that it is wise to mess with remote file handling in this way. (defadvice file-remote-p (around unc-host-and-share activate) "For UNC paths, return the first two components." (let ((file (ad-get-arg 0))) (save-match-data (if (and (eq system-type 'windows-nt) (string-match "\\`\\(//[^:/\\\\]+/[^:/\\\\]+\\)" file)) (setq ad-return-value (match-string 1 file)) ad-do-it)))) In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-30 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENG value of $XMODIFIERS: nil locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-: ( f i l e - r e l a t i v e - n a m e SPC " / / i o b a t e s / e / t e m p " SPC " / / k e r e s / e / t e m p " ) M-x r e p o r t - e m a c s - b u g Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. "../../../iobates/e/temp"