From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 19 09:34:59 2017 Received: (at submit) by debbugs.gnu.org; 19 Jan 2017 14:34:59 +0000 Received: from localhost ([127.0.0.1]:35296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUDnn-00046L-1R for submit@debbugs.gnu.org; Thu, 19 Jan 2017 09:34:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUDnk-000467-AQ for submit@debbugs.gnu.org; Thu, 19 Jan 2017 09:34:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUDne-0001fe-5S for submit@debbugs.gnu.org; Thu, 19 Jan 2017 09:34:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40180) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cUDne-0001fa-2E for submit@debbugs.gnu.org; Thu, 19 Jan 2017 09:34:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUDnc-0004u0-R2 for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 09:34:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUDnX-0001c5-Ta for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 09:34:48 -0500 Received: from smtpbguseast2.qq.com ([54.204.34.130]:40761) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cUDnX-0001Z9-ON for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2017 09:34:43 -0500 X-QQ-mid: bizesmtp7t1484836473tpin1cjqu Received: from Chunyangs-MacBook-Air.local (unknown [49.83.128.199]) by esmtp4.qq.com (ESMTP) with SMTP id 0 for ; Thu, 19 Jan 2017 22:34:32 +0800 (CST) X-QQ-SSF: 0010000000000030F310B00A0000000 X-QQ-FEAT: 3CtJeSk7NKDT+d9TeCGvquLmZbYawqQ3Fn3f81kAx017L3k+MDKPgXTh/i1BN wdfmO3KLM9myB17r8oEabzae5wvJ4e/Qh6ljjQDkyJUkrpDw34JCQ7fNXN8jK46lJ3X/ZUo uAnQBDobsycxBCxypIqaolp6Fu1YvHjIgpKjF2A2meeDivGuZhm3OsoxnKDpANk7ca7ESai V+M1fTpgWShx4dXUP73uDBE/t4V4z2KGIJxrzG2xOFfGA1Rg/QwtIX6Wa5GhtYSFVPAbGis Sq1g== X-QQ-GoodBg: 0 From: Chunyang Xu To: bug-gnu-emacs@gnu.org Subject: 25.1; Having trouble setting --time-style in dired-listing-switches Date: Thu, 19 Jan 2017 22:34:31 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) I want to custom the file timestamps used in dired through the option: --time-style=3D'+%_m=E6=9C=88 %d %H:%M' then I adjust `dired-listing-switches' accordingly: (setq dired-listing-switches "-al --time-style=3D'+%_m=E6=9C=88 %d %H:%M'= ") However, it doesn't work, it signals an error, here is the Backtrace: Debugger entered--Lisp error: (error "Listing directory failed but `access-= file' worked") signal(error ("Listing directory failed but `access-file' worked")) error("Listing directory failed but `access-file' worked") insert-directory("/tmp/" "--dired -al --time-style=3D'+%_m=E6=9C=88 %d %H= :%M'" nil t) dired-insert-directory("/tmp/" "-al --time-style=3D'+%_m=E6=9C=88 %d %H:%= M'" nil nil t) dired-readin-insert() dired-readin() dired-internal-noselect("/tmp/" nil) dired-noselect("/tmp" nil) dired("/tmp" nil) funcall-interactively(dired "/tmp" nil) call-interactively(dired record nil) command-execute(dired record) helm-M-x(nil "dired") funcall-interactively(helm-M-x nil "dired") call-interactively(helm-M-x nil nil) command-execute(helm-M-x) I also try the following, they don't work either. (setq dired-listing-switches "-al --time-style=3D\"+%_m=E6=9C=88 %_d %H:%M\= "") (setq dired-listing-switches "-al --time-style=3D+%_m=E6=9C=88\\ %d\\ %H:%M= ") In GNU Emacs 25.1.1 (x86_64-apple-darwin16.3.0, Carbon Version 157 AppKit 1= 504.76) of 2017-01-15 built on sierra.internal.macports.net Windowing system distributor 'Apple Inc.', version 10.12.2 Configured using: 'configure --prefix=3D/opt/local --with-mac --enable-mac-app=3D/Applications/MacPorts --without-rsvg --without-imagemagick 'CFLAGS=3D-pipe -Os -fobjc-arc -arch x86_64' CPPFLAGS=3D-I/opt/local/include 'LDFLAGS=3D-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64'' From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 19 11:12:16 2017 Received: (at 25485) by debbugs.gnu.org; 19 Jan 2017 16:12:16 +0000 Received: from localhost ([127.0.0.1]:35706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUFJv-0006fN-Rh for submit@debbugs.gnu.org; Thu, 19 Jan 2017 11:12:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUFJu-0006fA-G9 for 25485@debbugs.gnu.org; Thu, 19 Jan 2017 11:12:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUFJl-0001Gd-Fb for 25485@debbugs.gnu.org; Thu, 19 Jan 2017 11:12:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUFJl-0001GU-Cb; Thu, 19 Jan 2017 11:12:05 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3368 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cUFJk-0003Uz-6b; Thu, 19 Jan 2017 11:12:05 -0500 Date: Thu, 19 Jan 2017 18:11:51 +0200 Message-Id: <83inpb6nco.fsf@gnu.org> From: Eli Zaretskii To: Chunyang Xu In-reply-to: (message from Chunyang Xu on Thu, 19 Jan 2017 22:34:31 +0800) Subject: Re: bug#25485: 25.1; Having trouble setting --time-style in dired-listing-switches References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25485 Cc: 25485@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Chunyang Xu > Date: Thu, 19 Jan 2017 22:34:31 +0800 > > I want to custom the file timestamps used in dired through the option: > > --time-style='+%_m月 %d %H:%M' > > then I adjust `dired-listing-switches' accordingly: > > (setq dired-listing-switches "-al --time-style='+%_m月 %d %H:%M'") > > However, it doesn't work, it signals an error, here is the Backtrace: Isn't --time-style a GNU ls extension? You are on Darwin, so do you have GNU ls installed? What happens if you use that option from the shell prompt? From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 19 12:21:06 2017 Received: (at 25485) by debbugs.gnu.org; 19 Jan 2017 17:21:06 +0000 Received: from localhost ([127.0.0.1]:35729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUGOY-0008J3-4H for submit@debbugs.gnu.org; Thu, 19 Jan 2017 12:21:06 -0500 Received: from smtpbgau1.qq.com ([54.206.16.166]:56497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUGOV-0008IA-Al for 25485@debbugs.gnu.org; Thu, 19 Jan 2017 12:21:04 -0500 X-QQ-mid: bizesmtp5t1484846446tph68guad Received: from Chunyangs-MacBook-Air.local (unknown [49.83.128.199]) by esmtp4.qq.com (ESMTP) with id ; Fri, 20 Jan 2017 01:20:45 +0800 (CST) X-QQ-SSF: 0010000000200030F310B00A0000000 X-QQ-FEAT: b5AhG0gMO10PEFIlFUwABAHn2N3KuQl2Rh1hXseI8ObawoQe4BDaUDHSiqWKh 0jA7/W+jzjFk5E+EK1riP6RMYBxJ5zH2AhwOZLTyReqE3A+EYqI27Qs5YKnKt2YDunsb77E 1M5sG1wmqCRxlunRewxfK3dv75v+PrSVK80U466pKSTca2rL5Ujj7nRMhNxLxD3MKYSdI1r SlgI64z49hWOwJ0ME8KMBWDSeVAaaHilIaLf9wZeuXNRWXybNSvmarrbdD8ZYQDYyE49OZ6 1QXw== X-QQ-GoodBg: 0 References: <83inpb6nco.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.1.1 From: Chunyang Xu To: Eli Zaretskii Subject: Re: bug#25485: 25.1; Having trouble setting --time-style in dired-listing-switches In-reply-to: <83inpb6nco.fsf@gnu.org> Date: Fri, 20 Jan 2017 01:20:45 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 25485 Cc: 25485@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.2 (-) Eli Zaretskii writes: >> From: Chunyang Xu >> Date: Thu, 19 Jan 2017 22:34:31 +0800 >> >> I want to custom the file timestamps used in dired through the option: >> >> --time-style='+%_m月 %d %H:%M' >> >> then I adjust `dired-listing-switches' accordingly: >> >> (setq dired-listing-switches "-al --time-style='+%_m月 %d %H:%M'") >> >> However, it doesn't work, it signals an error, here is the Backtrace: > > Isn't --time-style a GNU ls extension? You are on Darwin, so do you > have GNU ls installed? What happens if you use that option from the > shell prompt? Yes, and yes, and I have set shell and Emacs to use GNU ls, thus in shell (via M-x shell) it works like expected: ~$ cd /tmp /tmp$ ls -al --time-style='+%_m月 %d %H:%M' total 4 drwxrwxrwt 8 root wheel 272 1月 20 00:49 . drwxr-xr-x 6 root wheel 204 11月 15 13:17 .. -rw-rw-rw- 1 xcy wheel 0 1月 16 13:40 .keystone_install_lock drwx------ 3 xcy wheel 102 1月 16 13:40 com.apple.launchd.404wZSYm30 drwx------ 3 xcy wheel 102 1月 16 13:40 com.apple.launchd.ORTswTb0KX drwx------ 3 xcy wheel 102 1月 16 13:40 com.apple.launchd.WcFjcyxZ4I drwx------ 3 xcy wheel 102 1月 16 13:40 com.apple.launchd.g1ImzMVLVC -rw-r--r-- 1 xcy wheel 985 1月 20 01:10 mail.log /tmp$ From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 20 02:44:07 2017 Received: (at 25485) by debbugs.gnu.org; 20 Jan 2017 07:44:07 +0000 Received: from localhost ([127.0.0.1]:35992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUTri-0003Yt-TT for submit@debbugs.gnu.org; Fri, 20 Jan 2017 02:44:07 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUTrh-0003YI-Fu for 25485@debbugs.gnu.org; Fri, 20 Jan 2017 02:44:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUTrZ-0001r9-5T for 25485@debbugs.gnu.org; Fri, 20 Jan 2017 02:44:00 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUTrZ-0001r0-2P; Fri, 20 Jan 2017 02:43:57 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4093 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cUTrY-0002EM-Et; Fri, 20 Jan 2017 02:43:56 -0500 Date: Fri, 20 Jan 2017 09:43:47 +0200 Message-Id: <83efzy6urw.fsf@gnu.org> From: Eli Zaretskii To: Chunyang Xu In-reply-to: (message from Chunyang Xu on Fri, 20 Jan 2017 01:20:45 +0800) Subject: Re: bug#25485: 25.1; Having trouble setting --time-style in dired-listing-switches References: <83inpb6nco.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25485 Cc: 25485@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Chunyang Xu > Cc: 25485@debbugs.gnu.org > Date: Fri, 20 Jan 2017 01:20:45 +0800 > > >> I want to custom the file timestamps used in dired through the option: > >> > >> --time-style='+%_m月 %d %H:%M' > >> > >> then I adjust `dired-listing-switches' accordingly: > >> > >> (setq dired-listing-switches "-al --time-style='+%_m月 %d %H:%M'") > >> > >> However, it doesn't work, it signals an error, here is the Backtrace: > > > > Isn't --time-style a GNU ls extension? You are on Darwin, so do you > > have GNU ls installed? What happens if you use that option from the > > shell prompt? > > Yes, and yes, and I have set shell and Emacs to use GNU ls, thus in > shell (via M-x shell) it works like expected: What happens if you add --dired to dired-listing-switches? From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 08:54:25 2017 Received: (at 25485) by debbugs.gnu.org; 27 Jan 2017 13:54:25 +0000 Received: from localhost ([127.0.0.1]:47147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX6yv-0007En-JB for submit@debbugs.gnu.org; Fri, 27 Jan 2017 08:54:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX6yt-0007Ea-Db for 25485@debbugs.gnu.org; Fri, 27 Jan 2017 08:54:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cX6yi-0000Rj-Jd for 25485@debbugs.gnu.org; Fri, 27 Jan 2017 08:54:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cX6yi-0000Rd-GK; Fri, 27 Jan 2017 08:54:12 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4219 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cX6yg-0002IJ-9h; Fri, 27 Jan 2017 08:54:11 -0500 Date: Fri, 27 Jan 2017 15:53:54 +0200 Message-Id: <837f5g1udp.fsf@gnu.org> From: Eli Zaretskii To: Chunyang Xu In-reply-to: (message from Chunyang Xu on Fri, 20 Jan 2017 01:20:45 +0800) Subject: Re: bug#25485: 25.1; Having trouble setting --time-style in dired-listing-switches References: <83inpb6nco.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25485 Cc: 25485@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Chunyang Xu > Cc: 25485@debbugs.gnu.org > Date: Fri, 20 Jan 2017 01:20:45 +0800 > > > Eli Zaretskii writes: > > >> From: Chunyang Xu > >> Date: Thu, 19 Jan 2017 22:34:31 +0800 > >> > >> I want to custom the file timestamps used in dired through the option: > >> > >> --time-style='+%_m月 %d %H:%M' > >> > >> then I adjust `dired-listing-switches' accordingly: > >> > >> (setq dired-listing-switches "-al --time-style='+%_m月 %d %H:%M'") > >> > >> However, it doesn't work, it signals an error, here is the Backtrace: > > > > Isn't --time-style a GNU ls extension? You are on Darwin, so do you > > have GNU ls installed? What happens if you use that option from the > > shell prompt? > > Yes, and yes, and I have set shell and Emacs to use GNU ls, thus in > shell (via M-x shell) it works like expected: Your setting of dired-listing-switches assumes that the 'ls' command will be run by a shell: you use shell quoting. But that's not what Dired does, it in most cases invokes 'ls' directly, and for that it needs to split the switches into individual options. It does that by calling split-string on the value of dired-listing-switches, which of course knows nothing about the '..' quoting. That's why 'ls' fails: it gets the --time-style option split between several separate command-line arguments. What this means is that currently Dired doesn't support switches that include embedded whitespace at all. One way of lifting at least some of that limitation is the simple patch below; it will require you to format your switches like this: (setq dired-listing-switches "-al \"--time-style=+%_m月 %d %H:%M\"") The function combine-and-quote-strings can help in producing the correct format. Given that we document this, is this an acceptable solution? (It won't work on MS-Windows, but the default there is not to call external programs at all, so I think it's not a terrible loss, for those Windows users who set up their systems to use 'ls'.) Here's the proposed patch; comments are welcome: diff --git a/lisp/files.el b/lisp/files.el index 25392fd..0a7b6a2 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6572,7 +6572,7 @@ insert-directory (unless (equal switches "") ;; Split the switches at any spaces so we can ;; pass separate options as separate args. - (split-string switches))) + (split-string-and-unquote switches))) ;; Avoid lossage if FILE starts with `-'. '("--") (progn From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 27 20:01:33 2017 Received: (at 25485) by debbugs.gnu.org; 28 Jan 2017 01:01:33 +0000 Received: from localhost ([127.0.0.1]:48692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXHOX-0002Os-6V for submit@debbugs.gnu.org; Fri, 27 Jan 2017 20:01:33 -0500 Received: from smtpproxy19.qq.com ([184.105.206.84]:38201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXHOT-0002Ob-CO for 25485@debbugs.gnu.org; Fri, 27 Jan 2017 20:01:30 -0500 X-QQ-mid: bizesmtp2t1485565276txz312k56 Received: from Chunyangs-MacBook-Air.local (unknown [114.236.193.28]) by esmtp4.qq.com (ESMTP) with id ; Sat, 28 Jan 2017 09:01:16 +0800 (CST) X-QQ-SSF: 0010000000000040F310B00A0000000 X-QQ-FEAT: Q4mUGnBphwPi7Fo+a0RbgYAoJTxHtZqQo1rRXBYKWPgkqJGEy3V3WFaF90fFr /7uWyCKdFMSEwxBA33PD1sG0eRvqPHy+4i1i4ZMt8UHJ6JO2j2uGLFtZ+V1kEN0vthwrbfV RZm805mnONkbYnRLiv8IqHtYsOr752V8UT8C89iOCIMjOFHRlX8BoMs7As6cW0eX2TbawS0 xAXNMuAdafFZ1JOuONgRS8IdFstDPfFAUuEOuGHIHgY9Lq9ODl8UyEiwlr+aRGyaSKSciv1 ovbg== X-QQ-GoodBg: 0 References: <83inpb6nco.fsf@gnu.org> <837f5g1udp.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 25.1.1 From: Chunyang Xu To: Eli Zaretskii Subject: Re: bug#25485: 25.1; Having trouble setting --time-style in dired-listing-switches In-reply-to: <837f5g1udp.fsf@gnu.org> Date: Sat, 28 Jan 2017 09:01:15 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 25485 Cc: 25485@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.2 (-) Eli Zaretskii writes: >> From: Chunyang Xu >> Cc: 25485@debbugs.gnu.org >> Date: Fri, 20 Jan 2017 01:20:45 +0800 >> >> >> Eli Zaretskii writes: >> >> >> From: Chunyang Xu >> >> Date: Thu, 19 Jan 2017 22:34:31 +0800 >> >> >> >> I want to custom the file timestamps used in dired through the option: >> >> >> >> --time-style='+%_m月 %d %H:%M' >> >> >> >> then I adjust `dired-listing-switches' accordingly: >> >> >> >> (setq dired-listing-switches "-al --time-style='+%_m月 %d %H:%M'") >> >> >> >> However, it doesn't work, it signals an error, here is the Backtrace: >> > >> > Isn't --time-style a GNU ls extension? You are on Darwin, so do you >> > have GNU ls installed? What happens if you use that option from the >> > shell prompt? >> >> Yes, and yes, and I have set shell and Emacs to use GNU ls, thus in >> shell (via M-x shell) it works like expected: > > Your setting of dired-listing-switches assumes that the 'ls' command > will be run by a shell: you use shell quoting. But that's not what > Dired does, it in most cases invokes 'ls' directly, and for that it > needs to split the switches into individual options. It does that by > calling split-string on the value of dired-listing-switches, which of > course knows nothing about the '..' quoting. That's why 'ls' fails: > it gets the --time-style option split between several separate > command-line arguments. > > What this means is that currently Dired doesn't support switches that > include embedded whitespace at all. One way of lifting at least some > of that limitation is the simple patch below; it will require you to > format your switches like this: > > (setq dired-listing-switches "-al \"--time-style=+%_m月 %d %H:%M\"") > > The function combine-and-quote-strings can help in producing the > correct format. Given that we document this, is this an acceptable > solution? (It won't work on MS-Windows, but the default there is not > to call external programs at all, so I think it's not a terrible loss, > for those Windows users who set up their systems to use 'ls'.) > > Here's the proposed patch; comments are welcome: > > diff --git a/lisp/files.el b/lisp/files.el > index 25392fd..0a7b6a2 100644 > --- a/lisp/files.el > +++ b/lisp/files.el > @@ -6572,7 +6572,7 @@ insert-directory > (unless (equal switches "") > ;; Split the switches at any spaces so we can > ;; pass separate options as separate args. > - (split-string switches))) > + (split-string-and-unquote switches))) > ;; Avoid lossage if FILE starts with `-'. > '("--") > (progn I have tried the patch and changed dired-listing-switches accordingly, it works now. Thus the solution is acceptable to me. My first thought was, we can make dired-listing-switches also accepts a list of arguments, then something like this (setq dired-listing-switches (list "-al" "--time-style=+%_m月 %d %H:%M")) should just work. But it will require much more work and I have no idea how 'C-u M-x dired-sort-toggle-or-edit' can work as usual. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 02:23:03 2017 Received: (at 25485) by debbugs.gnu.org; 28 Jan 2017 07:23:04 +0000 Received: from localhost ([127.0.0.1]:48756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXNLj-0002hr-O8 for submit@debbugs.gnu.org; Sat, 28 Jan 2017 02:23:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXNLh-0002gd-Is for 25485@debbugs.gnu.org; Sat, 28 Jan 2017 02:23:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXNLY-0000AK-GD for 25485@debbugs.gnu.org; Sat, 28 Jan 2017 02:22:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXNLY-0000A7-Cb; Sat, 28 Jan 2017 02:22:52 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1433 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cXNLX-0000BI-3j; Sat, 28 Jan 2017 02:22:51 -0500 Date: Sat, 28 Jan 2017 09:22:43 +0200 Message-Id: <83vaszzm0s.fsf@gnu.org> From: Eli Zaretskii To: Chunyang Xu In-reply-to: (message from Chunyang Xu on Sat, 28 Jan 2017 09:01:15 +0800) Subject: Re: bug#25485: 25.1; Having trouble setting --time-style in dired-listing-switches References: <83inpb6nco.fsf@gnu.org> <837f5g1udp.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25485 Cc: 25485@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) > From: Chunyang Xu > Cc: 25485@debbugs.gnu.org > Date: Sat, 28 Jan 2017 09:01:15 +0800 > > I have tried the patch and changed dired-listing-switches accordingly, > it works now. Thus the solution is acceptable to me. Thanks for the feedback. > My first thought was, we can make dired-listing-switches also accepts a > list of arguments, then something like this > > (setq dired-listing-switches > (list "-al" "--time-style=+%_m月 %d %H:%M")) > > should just work. But it will require much more work and I have no idea > how 'C-u M-x dired-sort-toggle-or-edit' can work as usual. I thought about that as well, and the reason why I opted not to go that way was that it will be more complicated for users, especially those who are not very fluent in Lisp. But I'm open to hear other opinions on that. I'll wait for a few days for comments, and if no objections pop up, will commit the above change (and fix the documentation accordingly). From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 04 05:06:00 2017 Received: (at 25485-done) by debbugs.gnu.org; 4 Feb 2017 10:06:00 +0000 Received: from localhost ([127.0.0.1]:55506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZxEF-0006Rb-Sm for submit@debbugs.gnu.org; Sat, 04 Feb 2017 05:06:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZxEE-0006RO-Br for 25485-done@debbugs.gnu.org; Sat, 04 Feb 2017 05:05:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZxE5-000575-3O for 25485-done@debbugs.gnu.org; Sat, 04 Feb 2017 05:05:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZxE5-00056x-03; Sat, 04 Feb 2017 05:05:49 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4904 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cZxE4-0002iM-9k; Sat, 04 Feb 2017 05:05:48 -0500 Date: Sat, 04 Feb 2017 12:05:40 +0200 Message-Id: <83shnu8e4r.fsf@gnu.org> From: Eli Zaretskii To: mail@xuchunyang.me In-reply-to: <83vaszzm0s.fsf@gnu.org> (message from Eli Zaretskii on Sat, 28 Jan 2017 09:22:43 +0200) Subject: Re: bug#25485: 25.1; Having trouble setting --time-style in dired-listing-switches References: <83inpb6nco.fsf@gnu.org> <837f5g1udp.fsf@gnu.org> <83vaszzm0s.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 25485-done Cc: 25485-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sat, 28 Jan 2017 09:22:43 +0200 > From: Eli Zaretskii > Cc: 25485@debbugs.gnu.org > > I'll wait for a few days for comments, and if no objections pop up, > will commit the above change (and fix the documentation accordingly). Done. From unknown Thu Aug 21 12:10:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 04 Mar 2017 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator