jed-users mailing list

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

Re: [jed-users] xjed STDIN?


Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx> wrote:
> Is it possible to use xjed as a GUI pager for STDIN?
> Something like:
>
> some commands ... | xjed -most

If you add

define read_from_stdin ()
{
   if (isatty (stdin))
     return;

   sw2buf ("*stdin*");
   array_map (Void_Type, &insert, fgetslines(stdin));
   bob ();
}

to your .jedrc file, then you can invoke xjed via:

  $ some-command ... | xjed --read-from-stdin -f most_mode

I use similar function:

define stdin_files ()
{
   ifnot (bufferp ("*stdin*"))
     return;

   setbuf ("*stdin*");
   bob ();

   do
     {
        variable file = line_as_string ();
        if (strlen (file))
          {
             () = find_file (file);
             setbuf ("*stdin*");
          }
     }
   while (down_1 ());
}

This function permits me to use jed as follows:

   $ grep -l pattern *.c *.h | jed --stdin-files

For xjed, you would need to combine the two functions:

   $ grep -l pattern *.c *.h | xjed --read-from-stdin --stdin-files

I hope this helps.
--John

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


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