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#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? Date: Sun, 20 Jul 2014 09:07:48 +0300 Message-ID: <8338dw5zrf.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <87tx6c7f5v.fsf@web.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1405836564 30298 80.91.229.3 (20 Jul 2014 06:09:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Jul 2014 06:09:24 +0000 (UTC) Cc: michael.albinus@gmx.de, 18051@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 20 08:09:17 2014 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 1X8kJB-0003KL-2f for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jul 2014 08:09:17 +0200 Original-Received: from localhost ([::1]:56480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8kJA-0003x8-Ef for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jul 2014 02:09:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8kJ2-0003n7-E7 for bug-gnu-emacs@gnu.org; Sun, 20 Jul 2014 02:09:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X8kIw-0004x3-ND for bug-gnu-emacs@gnu.org; Sun, 20 Jul 2014 02:09:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8kIw-0004wz-KC for bug-gnu-emacs@gnu.org; Sun, 20 Jul 2014 02:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X8kIw-00089u-1b for bug-gnu-emacs@gnu.org; Sun, 20 Jul 2014 02:09: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: Sun, 20 Jul 2014 06:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18051 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18051-submit@debbugs.gnu.org id=B18051.140583648431296 (code B ref 18051); Sun, 20 Jul 2014 06:09:01 +0000 Original-Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 06:08:04 +0000 Original-Received: from localhost ([127.0.0.1]:59929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8kHz-00088h-R3 for submit@debbugs.gnu.org; Sun, 20 Jul 2014 02:08:04 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:42334) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8kHw-000889-Lh for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 02:08:02 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N8Z00400XR48O00@mtaout24.012.net.il> for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 09:03:58 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8Z002V3Y6M2G40@mtaout24.012.net.il>; Sun, 20 Jul 2014 09:03:58 +0300 (IDT) In-reply-to: <87tx6c7f5v.fsf@web.de> 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:91681 Archived-At: > From: Michael Heerdegen > Cc: Michael Albinus , 18051@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.