GNU bug report logs - #18051
24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function?

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Fri, 18 Jul 2014 06:24:01 UTC

Severity: wishlist

Found in version 24.3.92

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #65 received at 18051 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 18051 <at> debbugs.gnu.org, michael.albinus <at> gmx.de
Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting;
 make ls-lisp-string-lessp a normal function?
Date: Sun, 20 Jul 2014 09:07:48 +0300
> From: Michael Heerdegen <michael_heerdegen <at> web.de>
> Cc: Michael Albinus <michael.albinus <at> gmx.de>,  18051 <at> debbugs.gnu.org
> Date: Sun, 20 Jul 2014 07:49:48 +0200
> 
> There are other things.  What I don't like from ls is that it shows
> symlinks like this:
> 
>    lrwxrwxrwx ... ...
> 
> rwxrwxrwx is redundant.

It's what 'lstat' returns.

> When you use M on a link in dired, you actually
> set the modes of the target.  I want to see the target file's modes, so
> I use this:
> 
> ,----------------------------------------------------------------------
> | (defun my-ls-lisp-treat-symlinks-ad (file-alist &rest _)
> |   "Make it show modes of truenames for symlinks."
> |   (mapc (lambda (file-line)
> |           (let ((filename (expand-file-name (car file-line)
> |                                             default-directory))
> |                 modes-string)
> |             (when (file-symlink-p filename)
> |               (setq modes-string (nth 8 (file-attributes
> |                                          (file-truename filename))))
> |               (if (not modes-string) ;; link could be dead!
> |                   (setq modes-string "l?????????")
> |                 (aset modes-string 0 ?l))
> |               (setf (nth 9 file-line) modes-string))))
> |         file-alist)
> |   file-alist)
> | 
> | (advice-add 'ls-lisp-handle-switches :after #'my-ls-lisp-treat-symlinks-ad)
> `----------------------------------------------------------------------
> 
> AFAIK this can't be reached with ls.

Doesn't "ls -L" give you that?

> Just one example.  Trying to do such things with Tramp would
> probably indeed slow it down.

IMO, the right way to do this is to have an additional argument to
file-attributes, follow-symlinks, with the obvious semantics.




This bug report was last modified 10 years and 224 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.