jed-users mailing list

[2016 Date Index] [2016 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [jed-users] Dired fails on directory or file names with spaces?


Darn, not sure how I missed your reply John, but I was just messing around
with this again after quite a while and came up with this for the Unix
verison of dired_point:

   bol ();
   if (looking_at_char ('D') or looking_at_char ('%')) go_right_1 ();
   skip_white ();
   variable i;
   for (i = 0; i < 8; i++) {
       skip_chars ("^ \t");
       skip_white ();
   }

Along with adding quoting of the directory name in the ls command (media
files that use apostrophe in the name, sweet merciless Cthulhu!):

shell_cmd (sprintf ("ls -al '%s' 2>/dev/null", str_replace_all(dir, "'",
"'\\''")));

It's not the most elegant solution but it seems to be working. I tried
using a _for but it seemed to leave trash on the stack in some cases.


On Sun, Apr 26, 2015 at 10:29 PM, John E. Davis <jed@xxxxxxxxxxx> wrote:

> Tom Culliton <tom.culliton@xxxxxxxxx> wrote:
> > The problem with the code in dired.sl comes down to the following two
> lines
> > at the end of dired_point:
> >
> >    eol ();
> >    bskip_chars ("^ \n");
>
> Yes, that is correct.  I just pushed an update to the git repository
> that avoids the use of ls and dir.  It also encodes any filenames that
> contain spaces, newlines, etc.
>
> I have not tested it thoroughly, but it does seem to work on the tests
> that I have performed.  I have not tested it at all on VMS/Windows,
> and it may require some tweaks on those systems.
>
> Please consider it to be experimental.
>
> Thanks,
> --John
>

[2016 date index] [2016 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]