From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20844: 25.0.50; Packages installed with package.el show up as status 'External' in the list-packages buffer Date: Fri, 19 Jun 2015 11:35:42 +0300 Message-ID: <83vbekjdsx.fsf@gnu.org> References: <83a8vxknad.fsf@gnu.org> <831th8lqpu.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1434703044 4501 80.91.229.3 (19 Jun 2015 08:37:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Jun 2015 08:37:24 +0000 (UTC) Cc: 20844@debbugs.gnu.org To: Bryan Childs Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 19 10:37:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z5rnT-0002l5-Kk for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jun 2015 10:37:11 +0200 Original-Received: from localhost ([::1]:56903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5rnS-0007TW-PQ for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jun 2015 04:37:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5rnP-0007TR-Fa for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 04:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5rnK-0007uz-QS for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 04:37:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5rnK-0007uW-GV for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 04:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z5rnK-00055s-3i for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 04:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Jun 2015 08:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20844 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20844-submit@debbugs.gnu.org id=B20844.143470296219502 (code B ref 20844); Fri, 19 Jun 2015 08:37:01 +0000 Original-Received: (at 20844) by debbugs.gnu.org; 19 Jun 2015 08:36:02 +0000 Original-Received: from localhost ([127.0.0.1]:51585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5rmK-00054L-I8 for submit@debbugs.gnu.org; Fri, 19 Jun 2015 04:36:02 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:50733) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5rmF-000545-Pn for 20844@debbugs.gnu.org; Fri, 19 Jun 2015 04:35:57 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NQ600K00NAFT400@mtaout24.012.net.il> for 20844@debbugs.gnu.org; Fri, 19 Jun 2015 11:27:20 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NQ600ILNNHKQA30@mtaout24.012.net.il>; Fri, 19 Jun 2015 11:27:20 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104115 Archived-At: [Please keep the bug address on the CC list.] > Date: Fri, 19 Jun 2015 08:27:11 +0100 > From: Bryan Childs > > Okay, the results of the four (file-attributes) calls : > > (file-attributes "~/.emacs.d/elpa/magit-20150608.1139" 'string) > > (t 1 "myuserid" "Domain Users" (21891 47052 0 0) (21889 5593 0 0) (21886 44757 > 0 0) 0 "drwxrwxrwx" t 0 4203876596) > > (file-attributes "~/.emacs.d/elpa" 'string) > > (t 1 "myuserid" "Domain Users" (21891 47051 0 0) (21889 7125 0 0) (21886 43973 > 0 0) 0 "drwxrwxrwx" t 0 4203876596) > > (file-attributes "~/.emacs.d" 'string) > > (t 1 "myuserid" "Domain Users" (21891 47351 0 0) (21890 58800 0 0) (21434 30664 > 0 0) 0 "drwxrwxrwx" t 0 4203876596) > > (file-attributes "~" 'string) > > (t 1 "myuserid" "Domain Users" (21889 6715 0 0) (21889 5641 0 0) (21416 1847 0 > 0) 16384 "drwxrwxrwx" t 0 4203876596) > > And yes, I still get nil when running the (file-in-directory-p) call from emacs > -Q > > As I said last night, my "~" directory is a UNC path, starting with an FQDN. > Based on the naming of that FQDN, I suspect it's a windows DFS share, rather > than going to a specific server. > > Hope that helps. Thanks. I think I see the problem, and it isn't really specific to MS-Windows. Please try the replacement for file-in-directory-p below. If it solves your problem, I will push the changes required to fix this. (defun file-in-directory-p (file dir) "Return non-nil if FILE is in DIR or a subdirectory of DIR. A directory is considered to be \"in\" itself. Return nil if DIR is not an existing directory." (let ((handler (or (find-file-name-handler file 'file-in-directory-p) (find-file-name-handler dir 'file-in-directory-p)))) (if handler (funcall handler 'file-in-directory-p file dir) (when (file-directory-p dir) ; DIR must exist. (setq file (file-truename file) dir (file-truename dir)) (let ((ls1 (split-string file "/" t)) (ls2 (split-string dir "/" t)) (root (cond ;; A UNC on Windows systems, or a "super-root" on Apollo. ((string-match "\\`//" file) "//") ((string-match "\\`/" file) "/") (t ""))) (mismatch nil)) (while (and ls1 ls2 (not mismatch)) (if (string-equal (car ls1) (car ls2)) (setq root (concat root (car ls1) "/")) (setq mismatch t)) (setq ls1 (cdr ls1) ls2 (cdr ls2))) (unless mismatch (file-equal-p root dir)))))))