File: ttyprint.sl

package info (click to toggle)
slrn 1.0.3%2Bdfsg-3
  • links: PTS
  • area: main
  • in suites: buster
  • size: 6,412 kB
  • sloc: ansic: 39,852; sh: 3,777; perl: 467; makefile: 229; sed: 24
file content (25 lines) | stat: -rw-r--r-- 510 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
% This function prints the currently selected article on a printer attached
% to the terminal.  It demonstates the 
define tty_print_article () 
{
   variable buf;

   art_select_article ();
   
   if (get_yes_no_cancel ("Are you sure you want to print article") <= 0)
     return;

   buf = article_as_string ();

   message ("printing...");
   update ();
   
   tt_send ("\e[5i");
   tt_send (buf);
   tt_send ("\e[4i");

   message ("printing...done");
}


definekey ("tty_print_article", "^P", "article");