* ls-lisp, likely bug
@ 2004-06-01 16:04 Shigeru Fukaya
0 siblings, 0 replies; only message in thread
From: Shigeru Fukaya @ 2004-06-01 16:04 UTC (permalink / raw)
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/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-06-01 16:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-01 16:04 ls-lisp, likely bug Shigeru Fukaya
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).