Bug 504422 - xemacs dired not working
Summary: xemacs dired not working
Alias: None
Product: Fedora
Classification: Fedora
Component: xemacs
Version: 11
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
: 521534 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2009-06-06 19:57 UTC by Donald Cohen
Modified: 2009-09-10 03:45 UTC (History)
4 users (show)

Fixed In Version: 20090217-2.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-09-03 00:31:49 UTC

Attachments (Terms of Use)
dired.el patch (682 bytes, patch)
2009-06-24 15:18 UTC, Henrique Martins
no flags Details | Diff

Description Donald Cohen 2009-06-06 19:57:32 UTC
Description of problem:
Dired not working
(I don't know whether this should have been filed under sumo,
or under rawhide vs 11, etc.  Please forgive and correct as appropriate.)

Version-Release number of selected component (if applicable):

When I try a dired I get the following backtrace:

Debugger entered--Lisp error: (error "No file on this line")
  signal(error ("No file on this line"))
  cerror("No file on this line")
  apply(cerror "No file on this line" nil)
  error("No file on this line")
  dired-manual-move-to-end-of-filename(nil 16 71)
  dired-insert-set-properties(1 #<marker at 8546 in root 0x1a82c68>)
  dired-insert-directory("/root/" "-al" nil t)
  dired-readin-insert("/root/" nil)
  dired-readin("/root/" #<buffer "root"> nil)
  dired-internal-noselect("/root/" nil)
  dired-noselect("~/" nil)
  #<compiled-function (dirname &optional switches) "...(7)" [switches dirname switch-to-buffer dired-noselect] 4 ("/usr/share/xemacs/xemacs-packages/lisp/dired/dired.elc" . 34964) (dired-read-dir-and-switches "")>("~/" nil)

If I don't quit that buffer then I can do a dired, but then if I try to do another one I get the message (in minibuffer)
 dired-subdir-alist seems to be mangled
(Evaluating that in *scratch* gives nil.)
Also in that dired, trying to find a file by typing f gives me (minibuffer)
 No file on this line
even though there IS a file on that line.

Comment 1 Henrique Martins 2009-06-10 14:16:04 UTC
dired on xemacs is broken due to the new coreutils ls printing an additional character after the mode bits.  
  info coreutils 'What information is listed'

     Following the file mode bits is a single character that specifies
     whether an alternate access method such as an access control list
     applies to the file.  When the character following the file mode
     bits is a space, there is no alternate access method.  When it is
     a printing character, then there is such a method.

     GNU `ls' uses a `.' character to indicate a file with an SELinux
     security context, but no other alternate access method.

     A file with any other combination of alternate access methods is
     marked with a `+' character.

and this extra character doesn't play well with dired.

Temporary workaround.
Add to your xemacs init:
  (set-q dired-ls-program "ls.pl")
And create ls.pl in your path to something like:

open LS, join (" ", '/bin/ls', @ARGV, '|');
while (<LS>) {
  print substr ($_, 0, 10), substr ($_, 11), "\n";
close LS;

Comment 2 Donald Cohen 2009-06-10 20:20:32 UTC
(In reply to comment #1)
Thank you.  My quality of life has just improved significantly.

Comment 3 Henrique Martins 2009-06-10 20:44:30 UTC
Yes, couldn't leave the house this morning before fixing this.  F11 killed about 5 critical things on my home machine and without dired mode it is very hard to fix them :-)

Couple of typos in my comment#1 though.  Hope you caught them:
It should be:
  (setq dired-ls "ls.pl")
i.e. extra - on first line, missing \ on \r on second.

Obviously someone needs to fix dired for xemacs.  I'll peek tonight whether this has been fixed on the emacs branch and if not I'll try my lisp skills.  Seems idiotic that this was added to ls without a flag to turn it off.

Comment 4 Donald Cohen 2009-06-10 21:02:20 UTC
(In reply to comment #3)
> Couple of typos in my comment#1 though.  Hope you caught them:
> It should be:
>   (setq dired-ls "ls.pl")
> and
>   s/[\r\n]+$//g;
> i.e. extra - on first line, missing \ on \r on second.
I fixed the first.  Dired seemed to work without fixing the second.
I now see that, while dired works, s (sort by time) in dired mode still does not. 
It says in minibuffer "dired-subdir-alist seems to be mangled".

Comment 5 Henrique Martins 2009-06-10 21:09:44 UTC
Just tried and dired/sort-by-time works fine on my home machine.

Comment 6 Donald Cohen 2009-06-10 21:12:04 UTC
(In reply to comment #5)
> Just tried and dired/sort-by-time works fine on my home machine.  

Ok, the problem was that I was using an old dired buffer that I managed to create before your fix.  Now I create a new one and it works.  Whew!

Comment 7 Fedora Admin XMLRPC Client 2009-06-15 17:59:50 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 8 Henrique Martins 2009-06-24 04:16:49 UTC
My ls.pl above doesn't work if file names have spaces.  This one does (but it can probably be written a bit better,...)

$cmd = '/bin/ls '; 
while ($arg = shift @ARGV) { 
  if ($arg =~ /^-/) { 
    $cmd .= "$arg "; 
  } else { 
    $cmd .= '"'. $arg; 
$cmd .= join (' ', @ARGV) . '"|'; 
open LS, $cmd; 
while (<LS>) { 
  print substr ($_, 0, 10), substr ($_, 11), "\n"; 
close LS;

Comment 9 Jerry James 2009-06-24 14:41:36 UTC
I have asked the dired maintainer for advice on how to fix this in the dired code itself, so that ls.pl is not necessary.  Thank you for providing that workaround in the meantime.

Comment 10 Henrique Martins 2009-06-24 15:18:25 UTC
Created attachment 349255 [details]
dired.el patch

Ok, so  my perl above is a bit too verbose.  Even shorter version:


open LS, join (' ', '/bin/ls', map ({ "\"$_\""} @ARGV), '|');
map { s/[\r\n]+$//g; print substr ($_, 0, 10), substr ($_, 11), "\n" } <LS>;
close LS;

which I wrote on the bus in to work, and I'm pretty sure this can be made one liner.

HOWEVER the dired fix is much simpler, it just took me longer to find the problem as my ELISP capabilities were never very good.  It turns out that one can add a single "." in a strategic place of dired.el and fix the whole thing.

Edit /usr/share/xemacs/xemacs-packages/lisp/dired/dired.el
Look for the following line
	       "[^ ][-r][-w][^ ][-r][-w][^ ][-r][-w][^ ][-+ 0-9@]"
and add a "." to the last bracketed sequence, i.e. make it
	       "[^ ][-r][-w][^ ][-r][-w][^ ][-r][-w][^ ][-+ 0-9@.]"
Patch attached.

Byte compile the .el (as root), unset the dired-ls-program in your init, restart xemacs (well...) and there you go.  Or copy/paste the definition of
dired-manual-move-to-end-of-filename to your init  apply the fix and reload it after loading dired.el, maybe via after-load-alist entry.  Or whatever way you like to do these things.

Is there a dired bugzilla bug I can post my patch to, if needed?

Comment 11 Jerry James 2009-06-24 15:27:21 UTC
M-x dired-report-bug will create a mail message with some information already filled in for you.  Thanks for figuring this out.  I'm working on fixing a couple of other bugs, and will then roll new packages.

Comment 12 Fedora Update System 2009-08-24 22:41:30 UTC
xemacs-packages-base-20090217-2.fc11 has been submitted as an update for Fedora 11.

Comment 13 Fedora Update System 2009-08-25 22:12:29 UTC
xemacs-packages-base-20090217-2.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update xemacs-packages-base'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-9006

Comment 14 Fedora Update System 2009-09-03 00:31:44 UTC
xemacs-packages-base-20090217-2.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2009-09-03 22:37:49 UTC
xemacs-packages-extra-20090217-2.fc11 has been submitted as an update for Fedora 11.

Comment 16 Jerry James 2009-09-07 17:21:49 UTC
*** Bug 521534 has been marked as a duplicate of this bug. ***

Comment 17 Ram Bhamidipaty 2009-09-07 17:43:40 UTC
I believe this problem is still not fixed. My xemacs package list:


I used the yum command in comment #13 and it did not update any rpm's - so
either the command is wrong or that is an RPM I already have.

In either case dired still does not work.

Comment 18 Jerry James 2009-09-08 14:08:54 UTC
The bug is fixed by the package in comment 15, which is still in testing.  If you would like to help test it, please install it from the testing repository and submit your feedback via the karma system.  Thank you.

Comment 19 Henrique Martins 2009-09-08 14:26:52 UTC
Comment 15 points to a ...-2.fc11 packages, but there's a ...-3.fc11 package in testing, and that one includes the fix for dired

Comment 20 Jerry James 2009-09-08 16:09:52 UTC
I seem to have successfully confused everyone.  Sorry, folks!  Let's try to straighten this out.

xemacs-packages-base-20090217-2.fc11 or later plus xemacs-packages-extra-20090217-2.fc11 is needed to solve the dired bug.  The former has already been pushed to stable (and I mistakenly allowed the push to close this bug).  The latter is currently in testing, and is the package referred to in comment 15.

Meanwhile xemacs-packages-base-20090217-3.fc11 (note that it is *base*, not *extra*) has been pushed to testing to solve a different bug.  That package is not needed to fix the dired bug.

I usually leave a package in testing for at least a week to give people a chance to try it out.  However, I also use the karma system.  Please note on https://admin.fedoraproject.org/updates/F11/FEDORA-2009-9310 whether this update solves your problem or not.  Karma of 3 will immediately push the update to stable; karma of -3 will immediately unpush the update.

Comment 21 Fedora Update System 2009-09-10 03:45:32 UTC
xemacs-packages-extra-20090217-2.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.