From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bryan Childs 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 08:57:40 +0000 Message-ID: References: <83a8vxknad.fsf@gnu.org> <831th8lqpu.fsf@gnu.org> <83vbekjdsx.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf304348426984a00518db1e90 X-Trace: ger.gmane.org 1434704316 24698 80.91.229.3 (19 Jun 2015 08:58:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Jun 2015 08:58:36 +0000 (UTC) Cc: 20844@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 19 10:58:26 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 1Z5s7o-0004jH-I3 for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jun 2015 10:58:12 +0200 Original-Received: from localhost ([::1]:56978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5s7n-000415-Mr for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jun 2015 04:58:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5s7i-00040t-Ar for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 04:58:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5s7e-00035p-Io for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 04:58:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5s7e-00035c-GO for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 04:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z5s7d-0005ZY-Vu for bug-gnu-emacs@gnu.org; Fri, 19 Jun 2015 04:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bryan Childs Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Jun 2015 08:58: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.143470427921412 (code B ref 20844); Fri, 19 Jun 2015 08:58:01 +0000 Original-Received: (at 20844) by debbugs.gnu.org; 19 Jun 2015 08:57:59 +0000 Original-Received: from localhost ([127.0.0.1]:51589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5s7a-0005ZH-V9 for submit@debbugs.gnu.org; Fri, 19 Jun 2015 04:57:59 -0400 Original-Received: from mail-ig0-f179.google.com ([209.85.213.179]:37429) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5s7Y-0005Z3-F3 for 20844@debbugs.gnu.org; Fri, 19 Jun 2015 04:57:57 -0400 Original-Received: by igblr2 with SMTP id lr2so9038683igb.0 for <20844@debbugs.gnu.org>; Fri, 19 Jun 2015 01:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=8vJ3aJh1stfYULX7JvIPE5cXDiU+bzwcnYlsHTt8LR8=; b=rQjqWTuA/X94wyhI9QoapqrkSLZ8pbpZXonsur4RL7m6E3uzlfpcXLmeaGrxkBZe5z AF+gkSeI/VuNAZZZA+Sn6AZeZZP6SWAkaAJlrWRzhXQ8fkYXQ6S1ZSSNk4gNj3eyhCE3 CpYY7WN+Xi+14IpQVheMOBrbLCOJQuU5sjKHubN2y6JzwzCiB6kShgA99cDAkiEBnVTp FbAlnISMwm97V/BPnjJx7se/0LbCJ4gspCOSJHB4tmTTN0SMfyqAznYMxWA6FiubwfT7 k2N5gFiMZHFzHsnegZAXbxklkLtY66GIOhLJkbaTA01RxONImRfWgCFy0QWX8J4Tvdba Klxw== X-Received: by 10.42.204.4 with SMTP id fk4mr10340887icb.72.1434704270687; Fri, 19 Jun 2015 01:57:50 -0700 (PDT) In-Reply-To: <83vbekjdsx.fsf@gnu.org> 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:104116 Archived-At: --20cf304348426984a00518db1e90 Content-Type: text/plain; charset=UTF-8 Apologies about the cc snafu! Your new defun does indeed fix the issue, I get t now, not nil anymore. Thanks for looking I to this! Bryan On Fri, 19 Jun 2015 09:35 Eli Zaretskii wrote: > [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))))))) > --20cf304348426984a00518db1e90 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Apologies about the cc snafu!

Your new defun does indeed fix the issue, I get t now, not n= il anymore.

Thanks for looking I to this!

Bryan


On Fri, 19 Jun 2015 09:35= =C2=A0Eli Zaretskii <eliz@gnu.org>= ; wrote:
[Please keep the bug addre= ss on the CC list.]

> Date: Fri, 19 Jun 2015 08:27:11 +0100
> From: Bryan Childs <godeater@gmail.com>
>
> 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) (2= 1889 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 f= rom emacs
> -Q
>
> As I said last night, my "~" directory is a UNC path, starti= ng with an FQDN.
> Based on the naming of that FQDN, I suspect it's a windows DFS sha= re, 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.<= br>
Please try the replacement for file-in-directory-p below.=C2=A0 If it
solves your problem, I will push the changes required to fix this.

(defun file-in-directory-p (file dir)
=C2=A0 "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."
=C2=A0 (let ((handler (or (find-file-name-handler file 'file-in-directo= ry-p)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(find-file-name-handler dir=C2=A0 'file-in-directory-p))))
=C2=A0 =C2=A0 (if handler
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (funcall handler 'file-in-directory-p file = dir)
=C2=A0 =C2=A0 =C2=A0 (when (file-directory-p dir) ; DIR must exist.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq file (file-truename file)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dir=C2=A0 (file-truename d= ir))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((ls1 (split-string file "/" t))=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ls2 (split-string dir=C2= =A0 "/" t))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (root
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cond
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; A UNC on Windows= systems, or a "super-root" on Apollo.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((string-match &quo= t;\\`//" file) "//")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((string-match &quo= t;\\`/" file) "/")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (t "")))<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mismatch nil))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (while (and ls1 ls2 (not mismatch))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (string-equal (car ls1) (car = ls2))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq root (concat = root (car ls1) "/"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq mismatch t))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq ls1 (cdr ls1)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ls2 (cdr ls2= )))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unless mismatch
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (file-equal-p root dir)))))))
--20cf304348426984a00518db1e90--