From unknown Fri Aug 15 16:19:57 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#2261 <2261@debbugs.gnu.org> To: bug#2261 <2261@debbugs.gnu.org> Subject: Status: Dired with long ls switches Reply-To: bug#2261 <2261@debbugs.gnu.org> Date: Fri, 15 Aug 2025 23:19:57 +0000 retitle 2261 Dired with long ls switches reassign 2261 emacs submitter 2261 severity 2261 normal thanks From dmbrown@icubed.com Mon Feb 9 22:07:21 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 10 Feb 2009 06:07:21 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.6 required=4.0 tests=BOUNDARYID,MULTALT autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1A67HLx005637 for ; Mon, 9 Feb 2009 22:07:18 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWlm8-0006Nk-HZ for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 01:07:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWlm6-0006MV-Rp for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 01:07:15 -0500 Received: from [199.232.76.173] (port=60428 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWlm6-0006M8-Gd for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 01:07:14 -0500 Received: from vms173017pub.verizon.net ([206.46.173.17]:37866) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LWlm5-0005VO-OD for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 01:07:14 -0500 Received: from North ([71.182.143.222]) by vms173017.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-2.01 (built Jun 13 2007; 32bit)) with ESMTPA id <0KEU00CZZ6AW68N0@vms173017.mailsrvcs.net> for bug-gnu-emacs@gnu.org; Tue, 10 Feb 2009 00:06:33 -0600 (CST) Date: Tue, 10 Feb 2009 01:06:48 -0500 From: "David Brown" Subject: Dired with long ls switches To: Reply-to: Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1933 X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Content-type: multipart/alternative; boundary="Boundary_(ID_4RiJQz+AOviGH8E7kr/9jg)" Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (1203?) This is a multi-part message in MIME format. --Boundary_(ID_4RiJQz+AOviGH8E7kr/9jg) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: QUOTED-PRINTABLE I have "GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.14.1) of 2008-09-05 on vernadsky, modified by Ubuntu," known as emacs22-gtk by= my distro. I like --group-directories-first as an ls switch: (setq dired-listing-switches "-al --group-directories-first") In dired, when I do a file operation such as R-rename or M-chmod, the= system file operation works, but the dired buffer does not update properly, = giving: Listing directory failed but `access-file' worked This is because a character "d" is being appended to dired-actual-swi= tches about 50 lines into dired-add-entry: (dired-insert-directory directory (concat dired-actual-switches "d") (list filename))) Just concatenating "d" assumes short switches. For example "-ald" wo= rks fine. But "-al --group-directories-firstd" fails. I fixed my installation by putting " -d" instead of "d". This seems = to work just fine for files and directories Here is the debugger 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("foobar" "--dired -al --group-directories-firstd" = nil nil) dired-insert-directory("/home/dmb/bin/" "-al --group-directories-fi= rstd" ("foobar")) (let ((default-directory directory)) (dired-insert-directory direct= ory (concat dired-actual-switches "d") (list filename))) (let (buffer-read-only opoint) (beginning-of-line) (setq opoint (po= int)) (let (...) (dired-insert-directory directory ... ...)) (goto-char opo= int) (when marker-char (let ... ...)) (goto-char opoint) (let (...) (if ..= . ... =2E..)) (forward-line -1) (if dired-after-readin-hook (save-excursion= ...)) (dired-move-to-filename)) (catch (quote not-found) (if (string=3D directory cur-dir) (progn .= .. ... =2E..) (if ... ... ...)) (let (buffer-read-only opoint) (beginning-of= -line) (setq opoint ...) (let ... ... ...) (goto-char opoint) (when marker-c= har =2E..) (goto-char opoint) (let ... ...) (forward-line -1) (if dired-after-readin-hook ...) (dired-move-to-filename)) nil) (setq filename (if relative (file-relative-name filename directory) (file-name-nondirectory filename)) reason (catch (quote not-found) (i= f ... =2E.. ...) (let ... ... ... ... ... ... ... ... ... ... ...) nil)) (let* ((opoint ...) (cur-dir ...) (orig-file-name filename) (direct= ory =2E..) reason) (setq filename (if relative ... ...) reason (catch ...= ... ... nil)) (if reason (goto-char opoint)) (not reason)) dired-add-entry("/home/dmb/bin/foobar" nil) apply(dired-add-entry ("/home/dmb/bin/foobar" nil)) dired-fun-in-all-buffers("/home/dmb/bin/" "foobar" dired-add-entry "/home/dmb/bin/foobar" nil) dired-add-file("/home/dmb/bin/foobar" nil) byte-code("=08 \n=0B#=88\f=83=0E --Boundary_(ID_4RiJQz+AOviGH8E7kr/9jg) Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: quoted-printable
I=20 have "GNU Emacs = 22.2.1=20 (i486-pc-linux-gnu, GTK+ Version 2.14.1)=20 of 2008-09-05 on vernadsky, modified by Ubuntu," known as emacs22-gtk by my=20 distro.
 
I like=20 --group-directories-first as an ls switch:  (setq = dired-listing-switches=20 "-al --group-directories-first")
 
In dired, when I do a file operation such as = R-rename=20 or M-chmod, the system file operation works, but the dired buffer does = not=20 update properly, giving:  Listing directory failed but = `access-file'=20 worked
 
This = is because a=20 character "d" is being appended to dired-actual-switches about 50 lines = into=20 dired-add-entry:
  (dired-insert-directory=20 directory
     (concat dired-actual-switches = "d")
     (list=20 filename)))
Just = concatenating=20 "d" assumes short switches.  For example "-ald" works fine.  = But "-al=20 --group-directories-firstd" fails.
 
I fixed my installation by putting=20 " -d" instead of "d".  This seems = to work=20 just fine for files and directories
 
Here = is the debugger=20 backtrace:
 
Debugger=20 entered--Lisp error: (error "Listing directory failed but `access-file'=20 worked")
  signal(error ("Listing directory failed but = `access-file'=20 worked"))
  error("Listing directory failed but `access-file'=20 worked")
  insert-directory("foobar" "--dired -al=20 --group-directories-firstd" nil nil)
 =20 dired-insert-directory("/home/dmb/bin/" "-al --group-directories-firstd" = ("foobar"))
  (let ((default-directory directory))=20 (dired-insert-directory directory (concat dired-actual-switches "d") = (list=20 filename)))
  (let (buffer-read-only opoint) (beginning-of-line) = (setq=20 opoint (point)) (let (...)=20 (dired-insert-directory directory ... ...)) (goto-char opoint) (when = marker-char=20 (let ... ...)) (goto-char opoint) (let (...) (if ... ... ...)) = (forward-line -1)=20 (if dired-after-readin-hook (save-excursion ...))=20 (dired-move-to-filename))
  (catch (quote not-found) (if = (string=3D=20 directory cur-dir) (progn ... ... ...) (if ... ... ...)) (let = (buffer-read-only=20 opoint) (beginning-of-line) (setq opoint ...) (let ... ... ...) = (goto-char=20 opoint) (when marker-char ...) (goto-char opoint) (let ... ...) = (forward-line=20 -1) (if dired-after-readin-hook ...) (dired-move-to-filename)) = nil)
 =20 (setq filename (if relative (file-relative-name filename directory)=20 (file-name-nondirectory filename)) reason (catch (quote not-found) (if = ... ...=20 ...) (let ... ... ... ... ... ... ... ... ... ... ...) nil))
  = (let*=20 ((opoint ...) (cur-dir ...) (orig-file-name filename) (directory ...) = reason)=20 (setq filename (if relative ... ...) reason (catch ... ... ... nil)) (if = reason=20 (goto-char opoint)) (not reason))
 =20 dired-add-entry("/home/dmb/bin/foobar" nil)
  = apply(dired-add-entry=20 ("/home/dmb/bin/foobar" nil))
 =20 dired-fun-in-all-buffers("/home/dmb/bin/" "foobar" dired-add-entry=20 "/home/dmb/bin/foobar" nil)
  = dired-add-file("/home/dmb/bin/foobar"=20 nil)
  byte-code("=08 \n=0B#=88\f=83=0E
 
 
--Boundary_(ID_4RiJQz+AOviGH8E7kr/9jg)-- From cyd@stupidchicken.com Wed Feb 11 06:47:08 2009 Received: (at 2261-done) by emacsbugs.donarmstrong.com; 11 Feb 2009 14:47:09 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1BEl6si006099 for <2261-done@emacsbugs.donarmstrong.com>; Wed, 11 Feb 2009 06:47:07 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 964B557E20C; Wed, 11 Feb 2009 09:47:52 -0500 (EST) From: Chong Yidong To: "David Brown" Cc: 2261-done@debbugs.gnu.org Subject: Re: Dired with long ls switches Date: Wed, 11 Feb 2009 09:47:52 -0500 Message-ID: <87wsbx1147.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > In dired, when I do a file operation such as R-rename or M-chmod, the > system file operation works, but the dired buffer does not update > properly, giving: Listing directory failed but `access-file' worked > > This is because a character "d" is being appended to > dired-actual-switches about 50 lines into dired-add-entry: Thanks for spotting and analyzing this bug. I've checked a fix into CVS. From unknown Fri Aug 15 16:19:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 Mar 2009 14:24:10 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator