From: Richard Copley <rcopley@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 4673@debbugs.gnu.org
Subject: bug#4673: Not the same as 4674
Date: Tue, 7 Feb 2012 15:30:12 +0000 [thread overview]
Message-ID: <CAPM58ogjddwyMB-X5MPP59+FxB_ioTDX_yvUcXqqvGvxCGcd2w@mail.gmail.com> (raw)
In-Reply-To: <83aa4zdl3l.fsf@gnu.org>
On 4 February 2012 09:05, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Fri, 3 Feb 2012 12:17:31 +0000
>> From: Richard Copley <rcopley@gmail.com>
>> Cc: 4673@debbugs.gnu.org
>>
>> >> Visiting a Windows DFS share when ".." is not accessible still crashes
>> >> 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? I don't have access to such shares, so
> I cannot test it myself. TIA.
>
> 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.
>
> === modified file 'lisp/ChangeLog'
> --- lisp/ChangeLog 2012-02-04 02:10:22 +0000
> +++ lisp/ChangeLog 2012-02-04 09:00:52 +0000
> @@ -1,3 +1,9 @@
> +2012-02-04 Eli Zaretskii <eliz@gnu.org>
> +
> + * ls-lisp.el (ls-lisp-sanitize): New function.
> + (ls-lisp-insert-directory): Use it to fix or remove any elements
> + in file-alist with missing attributes. (Bug#4673)
> +
> 2012-02-04 Glenn Morris <rgm@gnu.org>
>
> * image.el (image-extension-data): Add obsolete alias.
>
> === modified file 'lisp/ls-lisp.el'
> --- lisp/ls-lisp.el 2012-01-19 07:21:25 +0000
> +++ lisp/ls-lisp.el 2012-02-04 08:55:21 +0000
> @@ -331,6 +331,7 @@ not contain `d', so that a full listing
> ;; do all bindings here for speed
> total-line files elt short file-size attr
> fuid fgid uid-len gid-len)
> + (setq file-alist (ls-lisp-sanitize file-alist))
> (cond ((memq ?A switches)
> (setq file-alist
> (ls-lisp-delete-matching "^\\.\\.?$" file-alist)))
> @@ -437,6 +438,22 @@ not contain `d', so that a full listing
> (message "%s: doesn't exist or is inaccessible" file)
> (ding) (sit-for 2))))) ; to show user the message!
>
> +(defun ls-lisp-sanitize (file-alist)
> + "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). This 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. Otherwise,
> +the offending element is removed from the list, as are any
> +elements for other directory entries with nil attributes."
> + (if (and (null (cdr (assoc ".." file-alist)))
> + (cdr (assoc "." file-alist)))
> + (setcdr (assoc ".." file-alist) (cdr (assoc "." file-alist))))
> + (rassq-delete-all nil file-alist))
> +
> (defun ls-lisp-column-format (file-alist)
> "Insert the file names (only) in FILE-ALIST into the current buffer.
> Format in columns, sorted vertically, following GNU ls -C.
>
I rebuilt from the patched sources, and (dired "//root/share") works
fine here now.
Thanks!
next prev parent reply other threads:[~2012-02-07 15:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-08 13:43 bug#4673: 23.1; UNC paths of the form "//DFSROOT/SHARE" Richard Copley
2012-01-31 11:51 ` bug#4673: Not the same as 4674 Richard Copley
2012-02-03 11:18 ` Eli Zaretskii
2012-02-03 12:17 ` Richard Copley
2012-02-04 9:05 ` Eli Zaretskii
2012-02-07 15:30 ` Richard Copley [this message]
2012-02-07 17:30 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPM58ogjddwyMB-X5MPP59+FxB_ioTDX_yvUcXqqvGvxCGcd2w@mail.gmail.com \
--to=rcopley@gmail.com \
--cc=4673@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.