lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev print/download: patch 3


From: Philip Webb
Subject: lynx-dev print/download: patch 3
Date: Mon, 24 Aug 1998 04:13:39 -0400 (EDT)

i hope this reponds to the various real-life comments offered:
apologies if i have missed something, thanx to those who tried.

no-one was able to explain the purpose of %s %s coherently,
but the idea -- somewhat non-standard, it seems to me -- is clear enough
& i have described it below: the Kermit example shows what's going on
& i tested that one with Lynx, using both orderings.
the duplication of sections for printing & downloading is unnecessary:
i believe i have reproduced everything from both below.
a couple of references to other software in the original version
should have been placed with the examples they refer to,
where i have now relocated them.

as one contributor pointed out, this section of  lynx.cfg  dates back
more than 3 1/2 years & was inserted hastily in response to a user.
by now, there may be quite a lot which needs updating elsewhere.

*** cfg281.mr   Sat Aug 22 20:15:13 1998
--- cfg281.d1   Mon Aug 24 03:45:41 1998
***************
*** 983,1102 ****
  # for the .mil domain as well as the .il domain.  If the entry is '.il' this
  # will not happen.
  
! # Printer definitions
! # any number of printers may be defined by using multiple
! # printer definition sets.  Printers may be any program
! # that could be useful to your users, they do not necessarily
! # have to print.
  #
! # the definition of a printer is of the form
! # PRINTER:<printer name>:<printer command>:<printer option>:<lines/page>
  #
! #    <printer name> is the name that the user will see.
! # <printer command> is the command line arguments for printing a file.
! #                   The %s will be replaced with the file being printed.
! #                   If a second %s is given the second %s will be replaced by
! #                   a suggested filename that is prettier than the tempfile
! #                   name given in the first %s.  This does not remove the 
first
! #                   %s from the command line in any manner.  If you need to
! #                   use only the second %s file name in your printer command,
! #                   then I suggest creating a script which will first copy the
! #                   first %s file name to the second %s file name, and then
! #                   executing your print command with the second %s file name.
! #  <printer option> specifies whether the printer should be disabled for
! #                   users without printing options.  The options are
! #                   TRUE or FALSE;
! #                   TRUE means the printer will always be ENABLED
! #                        regardless of printer or anonymous settings
! #                   FALSE means the printer will be DISABLED when
! #                         the -noprint option is on, or for anonymous
! #                         users which are not allowed to print
  #
! #  <lines/page>    is an optional parameter for indicating the number of
! #                  lines per page for the printer.  Defaults to 66.  Used
! #                  for computing the approximate number of pages and
! #                  generating a statusline query of whether to proceed if
! #                  the document is longer than 4 printer pages.  Uses the
! #                  current screen length for the computation when the
! #                  built in "print to screen" option is selected.
  #
! #  You must put the whole definition on one line.
  #
! #  If you must use a colon, precede it with a backslash!
  #
! #  If you have a very busy VMS print queue and Lynx deletes the temporary
! #  files before they have been queued, use the VMSPrint.com included in
! #  the distribution.
! #
! #    examples
  #PRINTER:Computer Center printer:lpr -Pccprt %s:FALSE
  #PRINTER:Office printer:lpr -POffprt %s:TRUE
  #PRINTER:VMS printer:print /queue=cc$print %s:FALSE:58
  #PRINTER:Busy VMS printer:@Lynx_Dir\:VMSPrint sys$print %s:FALSE:58
! #  Don't use the following printer on anonymous accounts since
! #  allowing shell input is very dangerous.
! #PRINTER:Specify your own print command:echo -n "Enter a print command\: "; 
rea
! d word; sh -c "$word %s":FALSE
! #  Pass to a sophisticated file viewer (sources for most are available in
! #  ftp://space.mit.edu/pub/davis/most).  The most -k switch suppresses the
! #  invocation of hexadecimal display mode if 8-bit or control characters
! #  are present.  The +s switch invokes secure mode.
  #PRINTER:Use Most to view:most -k +s %s:TRUE:23
- 
- # Downloader definitions
- # any number of downloaders may be defined by using multiple
- # downloader definition sets.  Downloaders may be any program
- # that could be useful to your users, they do not necessarily
- # have to be a download protocol program. The most common use
- # of a downloader is to use Ckermit or some other transfer
- # program so that the user may easily transfer files back to
- # their local machine over a serial link.
- #
- # the definition of a downloader is of the form
- # DOWNLOADER:<downloadername>:<downloader command>:<downloader option>
- #
- #    <downloader name> is the name that the user will see.
- # <downloader command> is the command line arguments for downloading a file.
- #                      The %s will be replaced with the file being downloaded.
- #                      If a second %s is given the second %s will be replaced
- #                      by a suggested filename that is nicer than the tempfile
- #                      name given in the first %s.  This does not replace the
- #                      first %s in the command line.  If your command needs
- #                      the suggest file name on the command line only, then
- #                      I suggest creating a script that will first copy the
- #                      first %s file name to the second %s file name, and then
- #                      execute the downloading command using the second %s 
file
- #                      name (e.g., 'sz' needs such a script interposed).
- #  <downloader option> specifies whether the downloader should be disabled for
- #                      anonymous users.  The options are
- #                      TRUE or FALSE;
- #                      TRUE means the downloader will always be ENABLED
- #                           regardless of the anonymous settings (however,
- #                           all downloading is disabled by -validate).
- #                      FALSE means the downloader will be DISABLED when
- #                            the user is anonymous.
- #
- #  You must put the whole definition on one line.
  #
! #  If you must use a colon, precede it with a backslash!
! #
! #    examples
  #DOWNLOADER:Use Most to view:most +s %s:TRUE
! #  (don't use most's -k switch, so that binaries will invoke hexadecimal mode)
! #DOWNLOADER:Use Kermit to download to the local terminal:kermit -i -s %s -a 
%s:
! TRUE
  #DOWNLOADER:Use Zmodem to download to the local terminal:sz %s:TRUE
  #DOWNLOADER:Use Zmodem to download to the local terminal:set %s 
%s;td=/tmp/Lsz$
  $;mkdir $td;ln -s $1 $td/"$2";sz $td/"$2";rm -r $td:TRUE
- #
- # Note for Zmodem: The first variant gives wrong filenames ("sz" doesn't 
suppor
- t
- # a suggested filename parameter, sorry). The second returns correct filenames
- # but may conflict with very strong security or permissions restrictions
- # (it uses the script to make a subdirectory in /tmp, see below).
- #    (example script in lieu of :sz %s: for offering a suggested filename)
- #  :set %s %s;td=/tmp/Lsz$$;mkdir $td;ln -s $1 $td/"$2";sz $td/"$2";rm -r $td:
- #
  
  # Unix ONLY:
  #===========
--- 983,1062 ----
  # for the .mil domain as well as the .il domain.  If the entry is '.il' this
  # will not happen.
  
! # PRINTER & DOWNLOADER DEFINITIONS:
! # Lynx has 4 pre-defined print options & 1 pre-defined download option,
! # which are called up on-screen when `p' or `d' are entered;
! # any number of options can be added by the user, as explained below.
  #
! # For `p' pre-defined options are: `Save to local file', `E-mail the file',
! # `Print to screen' and `Print to local printer attached to vt100'.
! # `Print to screen' allows file transfers in the absence of alternatives
! # and is often the only option allowed here for anonymous users;
! # the 3rd & 4th options are not pre-defined for DOS/WINDOWS versions of Lynx.
! # For `d' the pre-defined option is: `Download to local file'.
  #
! # To define your own print or download option use the following formats:
! # PRINTER:<name>:<command>:<option>:<lines/page>
! # DOWNLOADER:<name>:<command>:<option>
  #
! # <name>       is what you will see on the print/download screen.
! # <command>    is the command your system will execute:
! #              the 1st %s in the command will be replaced
! #              by the temporary filename used by Lynx;
! #              a 2nd %s will be replaced by a filename of your choice,
! #              for which Lynx will prompt, offering a suggestion;
! #              if the command format of your printer/downloader requires
! #              a different layout, you will need to use a script
! #              (see the last 2 download examples below).
! # <option>     TRUE : the printer/downloader will always be ENABLED,
! #              except that downloading is disabled when -validate is used;
! #              FALSE : both will be DISABLED for anonymous users
! #              and printing will be disabled when -noprint is used.
! # <lines/page> (printers: optional) the number of lines/page (default 66):
! #              used to compute the approximate output size
! #              and prompt if the document is > 4 printer pages;
! #              it uses current screen length for the computation
! #              when `Print to screen' is selected.
  #
! # You must put the whole definition on one line;
! # if you use a colon, precede it with a backslash.
  #
! # `Printer' can be any file-handling program you find useful,
! # even if it does not physically print anything.
! # Usually, downloading involves the use of (e.g.) Ckermit or ZModem
! # to transfer files to a user's local machine over a serial link,
! # but download options do not have to be download-protocol programs.
  #
! # Printer examples:
  #PRINTER:Computer Center printer:lpr -Pccprt %s:FALSE
  #PRINTER:Office printer:lpr -POffprt %s:TRUE
  #PRINTER:VMS printer:print /queue=cc$print %s:FALSE:58
+ # If you have a very busy VMS print queue
+ # and Lynx deletes the temporary files before they have been queued,
+ # use the VMSPrint.com included in the distribution:
  #PRINTER:Busy VMS printer:@Lynx_Dir\:VMSPrint sys$print %s:FALSE:58
! # To specify a print option at run-time:
! # NBB if you have ANONYMOUS users, DO NOT allow this option!
! #PRINTER:Specify at run-time:echo -n "Enter a print command\: "; read word; 
sh -c "$word %s":FALSE
! # To pass to a sophisticated file viewer: -k suppresses invocation
! # of hex display mode if 8-bit or control characters are present;
! # +s invokes secure mode (see ftp://space.mit.edu/pub/davis/most):
  #PRINTER:Use Most to view:most -k +s %s:TRUE:23
  #
! # Downloader examples:
! # in Kermit, -s %s is the filename sent, -a %s the filename on arrival
! # (if they are given in reverse order here, the command will fail):
! #DOWNLOADER:Use Kermit to download to the terminal:kermit -i -s %s -a %s:TRUE
! # NB don't use -k with Most, so that binaries will invoke hexadecimal mode:
  #DOWNLOADER:Use Most to view:most +s %s:TRUE
! # The following example gives wrong filenames
! # (`sz' doesn't support a suggested filename parameter):
  #DOWNLOADER:Use Zmodem to download to the local terminal:sz %s:TRUE
+ # The following example returns correct filenames
+ # by using a script to make a subdirectory in /tmp,
+ # but may conflict with very strong security or permissions restrictions:
  #DOWNLOADER:Use Zmodem to download to the local terminal:set %s 
%s;td=/tmp/Lsz$
  $;mkdir $td;ln -s $1 $td/"$2";sz $td/"$2";rm -r $td:TRUE
  
  # Unix ONLY:
  #===========

-- 
========================,,============================================
SUPPORT     ___________//___,  Philip Webb : address@hidden
ELECTRIC   /] [] [] [] [] []|  Centre for Urban & Community Studies
TRANSIT    `-O----------O---'  University of Toronto

reply via email to

[Prev in Thread] Current Thread [Next in Thread]