bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ls-lisp, likely bug


From: Shigeru Fukaya
Subject: ls-lisp, likely bug
Date: Wed, 02 Jun 2004 01:04:13 +0900

Hello,

I found ls-lisp is not compatible with the ls command when -c or -u is
specified in sort and displayed information.  

% ls --help
  -c       with -lt: sort by, and show, ctime (time of last
           modification of file status information)
           with -l: show ctime and sort by name
           otherwise: sort by ctime
  -t       sort by modification time
  -u       with -lt: sort by, and show, access time
           with -l: show access time and sort by name
           otherwise: sort by access time

To correct it:

ls-lisp.el (emacs 21.1.1 through 21.3)

(1) ls-lisp-handle-switches
original: (always sorted by creation/modification time)
           ((setq index (ls-lisp-time-index switches))
            (lambda (x y) ; sorted on time
              (ls-lisp-time-lessp (nth index (cdr y))

revised:
           ((and (setq index (ls-lisp-time-index switches))
                 (or (memq ?t switches) (null (memq ?l switches))))
            (lambda (x y) ; sorted on time
              (ls-lisp-time-lessp (nth index (cdr y))
                                  (nth index (cdr x)))))

(2) ls-lisp-time-index
original:
  (cond ((memq ?c switches) 6)          ; last mode change
        ((memq ?t switches) 5)          ; last modtime
        ((memq ?u switches) 4)))        ; last access

revised: (things go better when -t is the last choice)
  (cond ((memq ?c switches) 6)          ; last mode change
        ((memq ?u switches) 4)          ; last access
        ((memq ?t switches) 5)          ; last modtime
        ))


Regards,
Shigeru
__________________________________________________
Do You Yahoo!?
http://bb.yahoo.co.jp/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]