"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "vil96w32/manpage.rc" of archive vile-w32.zip:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 ;;
    2 ;; Macros for obtaining manual pages and then attributing them.
    3 ;;
    4 ;; Author: Kevin Buettner
    5 ;;
    6 ;; $Header: /usr/build/vile/vile/macros/RCS/manpage.rc,v 1.24 2007/08/07 00:44:58 tom Exp $
    7 ;;
    8 
    9 store-procedure ShowManpage "Prompt for, and display a manual-page"
   10 	~local %filter %manpage %manpagebuf $error-buffer
   11 	set-variable %filter &pquote &lookup e+l+p &cat vile-manfilt $exec-suffix
   12 	~if &seq %filter ""
   13 		write-message "[Cannot find manpage-filter]"
   14 		~return
   15 	~endif
   16 	~force set-variable %manpage &query "man page? "
   17 	~if &or &error %manpage &seq %manpage ""
   18 		~return
   19 	~endif
   20 	set-variable %manpagebuf &cat "<" &cat %manpage ">"
   21 	set terse
   22 	~force select-buffer %manpagebuf
   23 	~if &not $status
   24 		edit-file &cat "!man " &cat %manpage &cat " | " %filter
   25 		~if &isa Majormode txt
   26 			setl txtmode
   27 		~endif
   28 		setl autocolor=0
   29 		~force rename-buffer %manpagebuf
   30 		~force error-buffer %manpagebuf
   31 		write-message "[Attaching bold and underline attributes...]"
   32 		goto-beginning-of-file
   33 		setl noview
   34 		attribute-cntl_a-sequences-til end-of-file
   35 		unmark-buffer
   36 		setl view
   37 		goto-beginning-of-file
   38 		unsetv $cfilname
   39 		write-message "[Done formatting manual page.]"
   40 	~endif
   41 	set noterse
   42 ~endm
   43 bind-key ShowManpage ^X-m
   44 
   45 store-procedure ShowFormatted "Render the current buffer with nroff -man or -ms"
   46 	~local %type %macros %table %nroff %filter %manpagesrc %manpagebuf $error-buffer
   47 
   48 	set-variable %filter &pquote &lookup e+l+p &cat vile-manfilt $exec-suffix
   49 	~if &seq %filter ""
   50 		write-message "[Cannot find manpage-filter]"
   51 		~return
   52 	~endif
   53 
   54 	~if &sin $cbufname "<"
   55 		set-variable %manpagebuf $cbufname
   56 		set-variable %manpagesrc &mid $cbufname 2 &sub &len $cbufname 2
   57 		~force select-buffer %manpagesrc
   58 		~if &not $status
   59 			write-message &cat "Buffer not found: " %manpagesrc
   60 			~return
   61 		~endif
   62 	~else
   63 		set-variable %manpagebuf &cat "<" &cat $cbufname ">"
   64 	~endif
   65 
   66 	setv %table &env 'VILE_TABLE_FILT'
   67 	~if &seq %table ''
   68 		~if &seq $pathlist-separator ":"
   69 			setv %table 'tbl'
   70 		~endif
   71 	~endif
   72 
   73 	setv %nroff &env 'VILE_NROFF_FILT'
   74 	~if &seq %nroff ''
   75 		~if &seq $pathlist-separator ":"
   76 			setv %nroff 'nroff'
   77 		~else
   78 			setv %nroff 'cawf'
   79 		~endif
   80 	~endif
   81 
   82 	set terse
   83 	~force kill-buffer %manpagebuf
   84 	setv %type &path end $cfilname
   85 	~if &or &seq $majormode "html" \
   86 		&seq $majormode "xml"
   87 		edit-file &cat "!lynx -force_html -with_backspaces -dump -width=" \
   88 			&cat $pagewid \
   89 			&cat " " \
   90 			&cat &pquote $cfilname \
   91 			&cat " | " %filter
   92 	~elseif &seq $majormode "perl"
   93 		~if &seq %table ''
   94 			edit-file &cat "!pod2text " \
   95 				&cat &pquote $cfilname \
   96 				&cat " | " %filter
   97 		~else
   98 			edit-file &cat "!pod2man " \
   99 				&cat &pquote $cfilname \
  100 				&cat " | " \
  101 				&cat %table \
  102 				&cat " | " \
  103 				&cat %nroff \
  104 				&cat " -man | " %filter
  105 		~endif
  106 	~else
  107 		~if &seq %type ".ms"
  108 			setv %macros="-ms"
  109 		~elseif &seq %type ".mm"
  110 			setv %macros="-mm"
  111 		~else
  112 			setv %macros="-man"
  113 		~endif
  114 		~if &seq %table ''
  115 			edit-file &cat "!" \
  116 				&cat %nroff \
  117 				&cat " " \
  118 				&cat %macros \
  119 				&cat " " \
  120 				&cat &pquote $cfilname \
  121 				&cat " | " %filter
  122 		~else
  123 			edit-file &cat "!" \
  124 				&cat %table \
  125 				&cat " " \
  126 				&cat &pquote $cfilname \
  127 				&cat " | " \
  128 				&cat %nroff \
  129 				&cat " " \
  130 				&cat %macros \
  131 				&cat " | " %filter
  132 		~endif
  133 	~endif
  134 
  135 	~if &isa Majormode txt
  136 		setl txtmode
  137 	~endif
  138 	setl autocolor=0
  139 	~force rename-buffer %manpagebuf
  140 	~force error-buffer %manpagebuf
  141 	write-message "[Attaching bold and underline attributes...]"
  142 	goto-beginning-of-file
  143 	setl noview
  144 	attribute-cntl_a-sequences-til end-of-file
  145 	unmark-buffer
  146 	setl view
  147 	goto-beginning-of-file
  148 	unsetv $cfilname
  149 	write-message "[Done formatting manual page.]"
  150 	set noterse
  151 ~endm
  152 bind-key ShowFormatted ^X-n