- Subject: [jed-users] ignoring non-files on command line
- From: Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 4 Nov 2016 08:42:22 +0100
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.
-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@xxxxxxxxxxxxxxxxxxxx
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<20161104074222.GA8375@xxxxxxxxxxxxxxxxxxxx>
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
  [2016 date index]
  [2016 thread index]
  
  [Thread Prev] [Thread Next]
      
  [Date Prev] [Date Next]