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#4673: Not the same as 4674 Date: Tue, 7 Feb 2012 15:30:12 +0000 Message-ID: References: <83vcnodv2j.fsf@gnu.org> <83aa4zdl3l.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1328628689 17794 80.91.229.3 (7 Feb 2012 15:31:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2012 15:31:29 +0000 (UTC) Cc: 4673@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 07 16:31:26 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Run0t-0007ZE-Vg for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Feb 2012 16:31:24 +0100 Original-Received: from localhost ([::1]:48902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Run0t-0000Eh-FU for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Feb 2012 10:31:23 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Run0l-0000DR-Ff for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2012 10:31:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Run0d-00033X-00 for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2012 10:31:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Run0c-00033M-M4 for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2012 10:31:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Run1W-00068y-BP for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2012 10:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Copley Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Feb 2012 15:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 4673 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 4673-submit@debbugs.gnu.org id=B4673.132862868323559 (code B ref 4673); Tue, 07 Feb 2012 15:32:02 +0000 Original-Received: (at 4673) by debbugs.gnu.org; 7 Feb 2012 15:31:23 +0000 Original-Received: from localhost ([127.0.0.1]:59127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Run0s-00067v-0x for submit@debbugs.gnu.org; Tue, 07 Feb 2012 10:31:22 -0500 Original-Received: from mail-ww0-f46.google.com ([74.125.82.46]:54205) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Run0k-00067e-J9 for 4673@debbugs.gnu.org; Tue, 07 Feb 2012 10:31:19 -0500 Original-Received: by wgbdt14 with SMTP id dt14so7032803wgb.15 for <4673@debbugs.gnu.org>; Tue, 07 Feb 2012 07:30:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=3V9tONJBpO2RRUtSnWPpS6WreUD07Gca9G2i0CKzJao=; b=kDqDKI7P5HS8uWt0Faxdoy14BNspebJWfxALShSSGhJfr6vTT4nkljbRaPAODGZ2pG vHyrhpL7ip5uEnO0QbK8bfQtBMd+Quxw53Q2DjRrx18ZF0ye2L1jxfjtm3Zv2mG6GcP5 qfCCI6a1Zks4ew5hIaigAd8fFvpDto1gxkpQA= Original-Received: by 10.180.101.101 with SMTP id ff5mr20456669wib.14.1328628612679; Tue, 07 Feb 2012 07:30:12 -0800 (PST) Original-Received: by 10.223.88.156 with HTTP; Tue, 7 Feb 2012 07:30:12 -0800 (PST) In-Reply-To: <83aa4zdl3l.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:56645 Archived-At: On 4 February 2012 09:05, Eli Zaretskii wrote: >> Date: Fri, 3 Feb 2012 12:17:31 +0000 >> From: Richard Copley >> Cc: 4673@debbugs.gnu.org >> >> >> Visiting a Windows DFS share when ".." is not accessible still crashe= s >> >> in `ls-lisp-insert-directory' in the trunk of Emacs, as the attribute >> >> list for ".." in the `file-alist' returned for by >> >> `directory-files-and-attributes' is empty. ... > Can you test the patch below? =A0I don't have access to such shares, so > I cannot test it myself. =A0TIA. > > Since ls-lisp.el is preloaded, you will either need to rebuild Emacs > (if you have the development environment and the Emacs sources), or > manually load the patched ls-lisp.el before invoking Dired. > > =3D=3D=3D modified file 'lisp/ChangeLog' > --- lisp/ChangeLog =A0 =A0 =A02012-02-04 02:10:22 +0000 > +++ lisp/ChangeLog =A0 =A0 =A02012-02-04 09:00:52 +0000 > @@ -1,3 +1,9 @@ > +2012-02-04 =A0Eli Zaretskii =A0 > + > + =A0 =A0 =A0 * ls-lisp.el (ls-lisp-sanitize): New function. > + =A0 =A0 =A0 (ls-lisp-insert-directory): Use it to fix or remove any ele= ments > + =A0 =A0 =A0 in file-alist with missing attributes. =A0(Bug#4673) > + > =A02012-02-04 =A0Glenn Morris =A0 > > =A0 =A0 =A0 =A0* image.el (image-extension-data): Add obsolete alias. > > =3D=3D=3D modified file 'lisp/ls-lisp.el' > --- lisp/ls-lisp.el =A0 =A0 2012-01-19 07:21:25 +0000 > +++ lisp/ls-lisp.el =A0 =A0 2012-02-04 08:55:21 +0000 > @@ -331,6 +331,7 @@ not contain `d', so that a full listing > =A0 =A0 =A0 =A0 =A0 =A0 ;; do all bindings here for speed > =A0 =A0 =A0 =A0 =A0 =A0 total-line files elt short file-size attr > =A0 =A0 =A0 =A0 =A0 =A0 fuid fgid uid-len gid-len) > + =A0 =A0 =A0 (setq file-alist (ls-lisp-sanitize file-alist)) > =A0 =A0 =A0 =A0(cond ((memq ?A switches) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq file-alist > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (ls-lisp-delete-matching "^\\.\\.= ?$" file-alist))) > @@ -437,6 +438,22 @@ not contain `d', so that a full listing > =A0 =A0 =A0 =A0(message "%s: doesn't exist or is inaccessible" file) > =A0 =A0 =A0 =A0(ding) (sit-for 2))))) =A0 =A0 =A0 =A0 =A0; to show user t= he message! > > +(defun ls-lisp-sanitize (file-alist) > + =A0"Sanitize the elements in FILE-ALIST. > +Fixes any elements in the alist for directory entries whose file > +attributes are nil (meaning that `file-attributes' failed for > +them). =A0This is known to happen for some network shares, in > +particular for the \"..\" directory entry. > + > +If the \"..\" directory entry has nil attributes, the attributes > +are copied from the \".\" entry, if they are non-nil. =A0Otherwise, > +the offending element is removed from the list, as are any > +elements for other directory entries with nil attributes." > + =A0(if (and (null (cdr (assoc ".." file-alist))) > + =A0 =A0 =A0 =A0 =A0(cdr (assoc "." file-alist))) > + =A0 =A0 =A0(setcdr (assoc ".." file-alist) (cdr (assoc "." file-alist))= )) > + =A0(rassq-delete-all nil file-alist)) > + > =A0(defun ls-lisp-column-format (file-alist) > =A0 "Insert the file names (only) in FILE-ALIST into the current buffer. > =A0Format in columns, sorted vertically, following GNU ls -C. > I rebuilt from the patched sources, and (dired "//root/share") works fine here now. Thanks!