jed-users mailing list

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

Re: [Jed-users-l] zz xx


On Thu 2012-09-13 (16:20), Facundo Bianco wrote:

> > I have written two small slang functions and bound them to keys, with I
> > can write a selection or the whole jed buffer to the zz clipboard or
> > import the zz clipboard.
> 
> Can you share those funcs?

I was just waiting for a request :-)

variable ZZ = dircat(HOME,".zz");

%!%S-Lang user function (0 args)
%!%Prototype: Void read_zz()
%!%This function reads the file clipboard ZZ into the current buffer
define read_zz() {
  variable n;
  push_spot;
  n = insert_file(ZZ);
  if (n) vmessage("%d lines included from %s",n,ZZ);
  pop_spot;
}


%!%S-Lang user function (0 args)
%!%Prototype: Void write_zz()
%!%This function writes the marked region (or the whole buffer) to the 
%!%file clipboard ZZ.
define write_zz() {
  variable n;
  push_spot;
  !if (markp()) mark_buffer();
  n = write_region_to_file(ZZ);
  if (n) vmessage("%d lines written to %s",n,ZZ);
  pop_spot;
}


I have inserted these lines with zz of course :-)


-- 
Ullrich Horlacher              Informationssysteme und Serverbetrieb
Rechenzentrum IZUS/TIK         E-Mail: horlacher@xxxxxxxxxxxxxxxxxxxx
Universitaet Stuttgart         Tel:    ++49-711-68565868
Allmandring 30a                Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.rus.uni-stuttgart.de/
REF: <20120913192027.GW17756@xxxxxxxxxxxxxx>
_______________________________________________
Jed-users-l mailing list
Jed-users-l@xxxxxxxx
http://mailman.jtan.com/mailman/listinfo/jed-users-l


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