/[cmucl]/src/hemlock/unixcoms.lisp
ViewVC logotype

Diff of /src/hemlock/unixcoms.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by ram, Fri Feb 8 16:39:03 1991 UTC revision 1.3 by chiles, Mon Jul 29 11:23:34 1991 UTC
# Line 221  Line 221 
221            (return))            (return))
222          (setf lastpos (1+ pos))))          (setf lastpos (1+ pos))))
223      (nreverse result)))      (nreverse result)))
224    
225    
226    
227    ;;;; Man pages.
228    
229    (defcommand "Manual Page" (p)
230      "Read the Unix manual pages in a View buffer.
231       If given an argument, this will put the man page in a Po-pup display."
232      "Read the Unix manual pages in a View buffer.
233       If given an argument, this will put the man page in a Pop-up display."
234      (let ((topic (prompt-for-string :prompt "Read what man page: ")))
235        (if p
236            (with-pop-up-display (stream)
237              (execute-man topic stream))
238            (let* ((buf-name (format nil "Man Page ~a" topic))
239                   (new-buffer (make-buffer buf-name
240                                            :modes '("Fundamental" "View")))
241                   (buffer (or new-buffer
242                               (getstring buf-name *buffer-names*)))
243                   (point (buffer-point buffer)))
244              (when new-buffer
245                (setf (variable-value 'view-return-function :buffer buffer)
246                      #'(lambda ()))
247                (with-writable-buffer (buffer)
248                  (ext:run-program
249                   "/bin/sh"
250                   (list "-c"
251                         (format nil "man ~a|cat -s|sed -e 's/_//g' -e 's/o//g'"
252                                 topic))
253                   :output (make-hemlock-output-stream point :full))))
254              (buffer-start point buffer)
255              (change-to-buffer buffer)))))

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.5