jed-users mailing list

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

Re: [jed-users] ignoring non-files on command line


On  4.11.16, Ulli Horlacher wrote:
> I often edit more than one file with jed.
> Typically I call something like: jed x*

> But if one of these x* files is not a regular file (directory, fifo, etc),
> I get the error message:

> File /export/home/framstag/xbin not readable.

> and jed has an empty buffer associated with that file (directory) which is
> NOT what I want!

> My solution: I copied the function command_line_hook() from site.sl to
> defaults.sl and substituted:

>           {
>              flush ("Reading " + file);
>              () = find_file(patch_cmdline_file (file));  ++n; --i;
>           }

> with:

> 	  {
>              if (is_file(file)) {
>                file = expand_symlink(file); 
> 	       flush("Reading " + file);
> 	       () = find_file(patch_cmdline_file(file));
>              } else {
> 	       flush(file + " is not a regular file, skipping");
>              }
>              ++n; --i;
> 	  }


> Now jed only loads regular files on the command line.

Alternatively, if you want to open directories in "filelist mode", you can
install filelist.sl from jedmodes.sf.net.

Günter
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


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