From unknown Sat Jun 21 10:33:42 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4674: 23.1; UNC paths and file-relative-directory Reply-To: Richard Copley , 4674@debbugs.gnu.org Resent-From: Richard Copley Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 08 Oct 2009 14:00:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 4674 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125501008723359 (code B ref -1); Thu, 08 Oct 2009 14:00:06 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 8 Oct 2009 13:54:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.1 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 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 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 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 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 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 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= MIME-Version: 1.0 Received: by 10.102.177.33 with SMTP id z33mr521547mue.87.1255010078266; Thu, 08 Oct 2009 06:54:38 -0700 (PDT) Date: Thu, 8 Oct 2009 14:54:38 +0100 Message-ID: From: Richard Copley To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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" From unknown Sat Jun 21 10:33:42 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4674: 23.1; UNC paths and file-relative-directory Reply-To: Richard Copley , 4674@debbugs.gnu.org Resent-From: Richard Copley Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 09 Oct 2009 16:35:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 4674 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 4674-submit@emacsbugs.donarmstrong.com id=B4674.125510569931607 (code B ref 4674); Fri, 09 Oct 2009 16:35:05 +0000 Received: (at 4674) by emacsbugs.donarmstrong.com; 9 Oct 2009 16:28:19 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-bw0-f226.google.com (mail-bw0-f226.google.com [209.85.218.226]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n99GSHE7031589 for <4674@emacsbugs.donarmstrong.com>; Fri, 9 Oct 2009 09:28:18 -0700 Received: by bwz26 with SMTP id 26so892360bwz.1 for <4674@emacsbugs.donarmstrong.com>; Fri, 09 Oct 2009 09:28:11 -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=yQ9QafwlnxBx22dDKvdLVm5CVoSznCfUxmAQVVXxpsw=; b=tELDYuw6NmfSVnsA3eaDK10S9lerCAwcZapZKRdsiwSaKsQyCsiWoUxkHPKUOEfB1W 7jgAw9NBSjCoAnHJBLiwMEZPQGmFZ9aykpqk8d2uNJB4m+zlUZzYErAYnFMCi0heYP1T Tz7AgRf42DuzTjjueX0tvn6LfqOA9gEzq/7Fs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=nmJJilA/bg3mw4ObU2iGfebp5gJC6anK2N2PTEg/yRtETmezj8FbSJSDa3Blr5cDsg IPbolyY81S/2BaDxsNNkyX+RAsZOmO9eodApONpb4BxUfsXlRuaXRO6wajDrD73x6GuR MufejPxUV0In0hVet70BAB65pZJeVBSco+BO8= MIME-Version: 1.0 Received: by 10.103.126.9 with SMTP id d9mr1186165mun.103.1255105691435; Fri, 09 Oct 2009 09:28:11 -0700 (PDT) Date: Fri, 9 Oct 2009 17:28:11 +0100 Message-ID: From: Richard Copley To: 4674@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Thinking about it, that advice can be changed so that it only returns the server name, since "../SHARE2" is a valid relative path from "//SERVER/SHARE1" to "//SERVER/SHARE2": change the regexp to something more like "\\`\\(//[^:/\\]+\\)/[^:/\\]+". I'm reconsidering my "I don't think that's wise" attitude towards this workaround. It's probably not illogical to treat files on UNC paths as remote files (even in the case when the server name resolves to the local computer anyway), and the old piece of advice has worked okay for me so far. Apologies for sending this message to the wrong place yesterday (see bug #4763). From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 04 07:45:39 2010 Received: (at control) by debbugs.gnu.org; 4 Dec 2010 12:45:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1POrUh-00085A-ME for submit@debbugs.gnu.org; Sat, 04 Dec 2010 07:45:39 -0500 Received: from mtaout23.012.net.il ([80.179.55.175]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1POrUe-00084x-Qn for control@debbugs.gnu.org; Sat, 04 Dec 2010 07:45:38 -0500 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LCW00H00M9G4700@a-mtaout23.012.net.il> for control@debbugs.gnu.org; Sat, 04 Dec 2010 14:50:19 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.69.203]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LCW00HK4MBU2R60@a-mtaout23.012.net.il> for control@debbugs.gnu.org; Sat, 04 Dec 2010 14:50:19 +0200 (IST) Date: Sat, 04 Dec 2010 14:50:24 +0200 From: Eli Zaretskii X-012-Sender: halo1@inter.net.il To: control@debbugs.gnu.org Message-id: <8339qd8zxr.fsf@gnu.org> X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.4 (/) merge 4674 4673 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 31 06:17:49 2012 Received: (at control) by debbugs.gnu.org; 31 Jan 2012 11:17:49 +0000 Received: from localhost ([127.0.0.1]:46365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RsBia-0003R7-Al for submit@debbugs.gnu.org; Tue, 31 Jan 2012 06:17:48 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:46555) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RsBiY-0003Qs-PG for control@debbugs.gnu.org; Tue, 31 Jan 2012 06:17:43 -0500 Received: by werm10 with SMTP id m10so3975123wer.3 for ; Tue, 31 Jan 2012 03:17:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=ZrRSUj4fRQwHSr4lbdukjgsGds/vB018ohLom+05/vs=; b=PIIRpP5ABNeToaRiBjJtNme8eD5eJSOJNl4QldTvZ98LNyyc6nZTZbcRidhXHdrbTC +W9dMpOM6RyirmxuKpkWAMYhvk+nlfl72wMfjbVILcFk+XJfWRlJuXiiHEWfunrLDtYF rBeezJe+hEh/34DnVSSvI5MgD/CzAqjRFi1B0= MIME-Version: 1.0 Received: by 10.216.132.4 with SMTP id n4mr765554wei.19.1328008641984; Tue, 31 Jan 2012 03:17:21 -0800 (PST) Received: by 10.223.88.156 with HTTP; Tue, 31 Jan 2012 03:17:21 -0800 (PST) Date: Tue, 31 Jan 2012 11:17:21 +0000 Message-ID: Subject: unarchive 4673 From: Richard Copley To: control@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) unarchive 4673 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 31 15:16:14 2012 Received: (at control) by debbugs.gnu.org; 31 Jan 2012 20:16:14 +0000 Received: from localhost ([127.0.0.1]:47639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RsK7i-0003GE-3P for submit@debbugs.gnu.org; Tue, 31 Jan 2012 15:16:14 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:34028) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RsK7f-0003Fx-Oa for control@debbugs.gnu.org; Tue, 31 Jan 2012 15:16:12 -0500 Received: by wibhm9 with SMTP id hm9so329320wib.3 for ; Tue, 31 Jan 2012 12:15:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=/aslxR+SZSvhXowUfCJbVwZz/fNtjFaAQAKVDZ1l0qQ=; b=gcHqFhlgxXNlUycNip+A889eFMbEkookRDVm4T/i1uEytfL+P2VhMcuICQ5r+xlzTM RAZc4k5CpM7MrJBsoVzjp71zQq/GdZfa6kOonLpKJabK2LlbW1WWosMlTOYhUaxqYYgc yWP6+KPo7DqS2f6trnP+QXAxFf0wHc7BQqqBs= MIME-Version: 1.0 Received: by 10.180.101.101 with SMTP id ff5mr6277388wib.14.1328040948940; Tue, 31 Jan 2012 12:15:48 -0800 (PST) Received: by 10.223.88.156 with HTTP; Tue, 31 Jan 2012 12:15:48 -0800 (PST) Date: Tue, 31 Jan 2012 20:15:48 +0000 Message-ID: Subject: unmerge 4673 From: Richard Copley To: control@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) unmerge 4673