unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Shigeru Fukaya <shfukaya@yahoo.co.jp>
Subject: ls-lisp, likely bug
Date: Wed, 02 Jun 2004 01:04:13 +0900	[thread overview]
Message-ID: <70C447F2152D2Bshfukaya@yahoo.co.jp> (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/

                 reply	other threads:[~2004-06-01 16:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=70C447F2152D2Bshfukaya@yahoo.co.jp \
    --to=shfukaya@yahoo.co.jp \
    /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 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).