all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lin Sun <sunlin7.mail@gmail.com>
To: 70271@debbugs.gnu.org
Subject: bug#70271: 30.0.50; [PATCH] * lisp/ls-lisp.el (ls-lisp--sanitize-switches): support more
Date: Mon, 8 Apr 2024 05:10:22 +0000	[thread overview]
Message-ID: <CABCREdrp7ArT1y7k_=ATrdH5F2qKpS86KK5b4K53P8v5VxYzhA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

Hi,

The dired ignored the options like "--time=ctime" in the variable
`dired-listing-switches' on Windows OS.

 I traced the code and found dired will use the functions in the
`ls-lisp.el' instead of calling the real command "/usr/bin/ls", and
the "ls-lisp.el" didn't process the "--time=ctime" option.

The attached PATCH will convert the "--time=ctime" to "-c"... in the
"ls-lisp.el", and then the dired will display the desired time in its
time column.

Here is the verification code (on Windows OS), try it one line and
close the dired buffer then try next line.

(dired "/tmp/aa" "-al --sort=time") ; as "-al -t"

(dired "/tmp/aa" "-al --time=ctime") ; as "al -c"

(dired "/tmp/aa" "-al --time=atime") ; as "al -u"

Please help review the changes and approve them. Thanks

[-- Attachment #2: 0001-lisp-ls-lisp.el-ls-lisp-sanitize-switches-support-mo.patch --]
[-- Type: text/x-patch, Size: 1222 bytes --]

From 2044be09357c46af13ed341bafbcc5737bd40c42 Mon Sep 17 00:00:00 2001
From: Lin Sun <sunlin7@hotmail.com>
Date: Mon, 8 Apr 2024 06:59:21 +0000
Subject: [PATCH] * lisp/ls-lisp.el (ls-lisp--sanitize-switches): support more
 time options

---
 lisp/ls-lisp.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index d09b53b1cc..ae4a43797f 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -873,6 +873,7 @@ ls-lisp--sanitize-switches
   (let ((lsflags '(("-a" . "--all")
                    ("-A" . "--almost-all")
                    ("-B" . "--ignore-backups")
+                   ("-c" . "--time=ctime")
                    ("-C" . "--color")
                    ("-F" . "--classify")
                    ("-G" . "--no-group")
@@ -883,7 +884,9 @@ ls-lisp--sanitize-switches
                    ("-r" . "--reverse")
                    ("-R" . "--recursive")
                    ("-s" . "--size")
+                   ("-t" . "--sort=time")
                    ("-S" . "--sort.*[ \\\t]")
+                   ("-u" . "--time=atime")
                    (""   . "--group-directories-first")
                    (""   . "--author")
                    (""   . "--escape")
-- 
2.20.5


             reply	other threads:[~2024-04-08  5:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08  5:10 Lin Sun [this message]
2024-04-08 11:25 ` bug#70271: 30.0.50; [PATCH] * lisp/ls-lisp.el (ls-lisp--sanitize-switches): support more Eli Zaretskii
2024-04-08 20:43   ` Lin Sun
2024-04-09  3:24     ` Eli Zaretskii
2024-04-09  4:10       ` Lin Sun

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

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

  git send-email \
    --in-reply-to='CABCREdrp7ArT1y7k_=ATrdH5F2qKpS86KK5b4K53P8v5VxYzhA@mail.gmail.com' \
    --to=sunlin7.mail@gmail.com \
    --cc=70271@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.