Description

Access the CHICKEN manual from within the REPL

Author

Mario Goulart

Version

Usage

(require-extension man)

Download

man.egg

Documentation

This extension searches and displays entries in the CHICKEN User's Manual

Warning: the documentation used by this egg is old (from Chicken 2.49). When in doubt, consult the up-to-date documentation from the User's Manual at the Chicken wiki.

Procedures

procedure: (man:load [FILENAME])

Loads adoc file that has been previously prepared with thechicken-man program. If no filename is given, it defaults tochicken.man. The optional argument for man:load, a file, contains a list of items representing the documentation of an object. Each item (also a list) has the following format:("OBJECT NAME" "PROTOTYPE" "DESCRIPTION")

Example:

(("foo" "(foo FOO-ARG)" "My `foo' procedure.")
("bar" "(bar)" "This is the `bar' procedure."))

procedure: (man:help SYMBOL)

Displays the description for the string or symbolSYMBOL.

procedure: (man:search PATTERN)

Looks up any items that match the regular expressionPATTERN

procedure: (man:search-desc PATTERN)

Looks up any items whose descriptions match the regular expressionPATTERN

Creating prepared documentation from arbitrary texinfo files

You can use the chicken-man program to convert a .texi file into a document that can be searched with man:help:

$ chicken.man foo.texi
$ csi -quiet
#;1> (man:load "foo.doc")
#;2> (man:help ...)

Using man from Emacs

Put this code into your .emacs file to view the manual section for the current word (there must be a*scheme* buffer running somewhere):

(defun chicken-help ()
  (interactive)
  (let ((func (current-word)))
    (if func
	(process-send-string "*scheme*" (concat "(man:help \"" func "\")\n")))))

;; Binds F1 to chicken-help in the scheme-mode
;; (add-hook 'scheme-mode-hook (lambda () (local-set-key [f1] 'chicken-help)))

License

Copyright (c) 2005, Mario Goulart
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:

  Redistributions of source code must retain the above copyright notice, this list of conditions and the following
    disclaimer. 
  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
    disclaimer in the documentation and/or other materials provided with the distribution. 
  Neither the name of the author nor the names of its contributors may be used to endorse or promote
    products derived from this software without specific prior written permission. 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.