;ELC ;;; Compiled by jpff@codemist.co.uk on Sat Jan 12 17:33:19 2002 ;;; from file /home/jpff/GNU_21/local-lisp/csound-doc.el ;;; in Emacs version 21.1.1 ;;; with bytecomp version 2.85 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`csound-doc.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'csound-doc nil "Utilities for on-line Csound documentation" :group 'convenience :prefix "csdoc-") #@71 Install items in the Csound/Orc menu for browsing HTML documentation. (custom-declare-variable 'csdoc-use-html 'nil '(#$ . 732) :type 'boolean :group 'csound-doc) #@101 Weither w3 should be invoked to browse the HTML docs. If nil, the default external browser is used. (custom-declare-variable 'csdoc-use-w3 'nil '(#$ . 902) :type 'boolean :group 'csound-doc) #@54 Directory containing the HTML version of Csound docs (custom-declare-variable 'csdoc-html-directory '"c:/Csound/html" '(#$ . 1099) :type 'directory :group 'csound-doc) #@61 The starting page of your choice for browsing the HTML docs (custom-declare-variable 'csdoc-html-entry-point '"c:/Csound/html/manual.htm" '(#$ . 1273) :type 'file :group 'csound-doc) #@70 Install items in the Csound/Orc menu for browsing text documentation (custom-declare-variable 'csdoc-use-text 't '(#$ . 1462) :type 'boolean :group 'csound-doc) #@103 Directory containing the pretty printed version of Csound docs (this should be a bunch of .txt files) (custom-declare-variable 'csdoc-directory '"/usr/local/doc/csound-txt" '(#$ . 1630) :type 'directory :group 'csound-doc) (add-hook 'csound-orc-mode-hook 'csound-doc-install) (defalias 'csound-doc-install #[nil "\303\304\305#\210 \203 \303\306\307#\210\303\310\311#\210\n\205+ \303\312\313#\210\303\314\315#\210\303\316\317#\207" [csound-orc-mode-map csdoc-use-text csdoc-use-html define-key [menu-bar csound-orc docseparator] ("--") [menu-bar csound-orc Insert-Opcode-Template] ("Insert Opcode Template" . csdoc-insert-opcode-template) [menu-bar csound-orc Document-Opcode] ("Document Opcode" . csdoc-document-opcode) [menu-bar csound-orc Insert-Opcode-Html-Template] ("Insert Opcode Template" . csdoc-insert-opcode-html-template) [menu-bar csound-orc HTML-Document-Opcode] ("Document Opcode" . csdoc-html-document-opcode) [menu-bar csound-orc Fetch-HTML-Doc] ("Browse HTML Documentation" . csdoc-browse-html)] 4]) (defalias 'csdoc-scan-txt-files #[nil "\306\307!\310 \311\312#\313\211\203h @\314\315\316!!\317\216r\fq\210\320\n!\210\321 \210\322\323\313\311#\203` o\204` \324y\210\325\326\327!\330\"\313\211\203\\ @\211\331\232\204S \332 \n#\210A\211\204C *\202. +A\211\204 *)\207" [table csdoc-directory txt-file #1=#:--dolist-temp-- #2=#:temp-buffer opcode makehash equal directory-files t "\\.txt" nil get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#2# buffer-name kill-buffer] 2)) insert-file beginning-of-buffer re-search-forward "^Name" -1 split-string thing-at-point line "[ ,_ \n]" "" puthash #3=#:--dolist-temp--] 5]) #@59 Hash table associating each documented opcode to its file (defvar csdoc-opcodes (csdoc-scan-txt-files) (#$ . 3347)) (defalias 'csdoc-refresh-info #[nil "\301 \211\207" [csdoc-opcodes csdoc-scan-txt-files] 2 nil nil]) #@53 Pop-up the documentation related to opcode at point (defalias 'csdoc-document-opcode #[(opcode) "\304\232\203 \305\306\307\310!\"\311 \"\211\205. \312\n!\205. \313\314\315!!\210\304\316 \210\317\n!\210\320\211)\207" [opcode csdoc-opcodes source buffer-read-only nil read-from-minibuffer "Opcode: " thing-at-point word gethash file-readable-p pop-to-buffer get-buffer-create "*Csound Documentation*" erase-buffer insert-file t] 5 (#$ . 3571) "P"]) #@104 Insert the documentation template related to opcode at point warning:this replaces the line at point ! (defalias 'csdoc-insert-opcode-template #[(opcode) "\305\232\203 \306\307\310\311!\"\312 \"\211\205R \313\n!\205R \314\315\316\317!!\320\216r\fq\210\321\n!\210\322 \210\323\324\305\325#\203H \326\327\327Q\305\325#\203H \310\330!+\331 \210\332 \210c))\207" [opcode csdoc-opcodes source opcode-template #1=#:temp-buffer nil read-from-minibuffer "Opcode: " thing-at-point word gethash file-readable-p "" get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) insert-file beginning-of-buffer re-search-forward "^Syntax" t search-forward " " line beginning-of-line kill-line] 5 (#$ . 4032) "P"]) #@93 Browse the HTML documentation (starting with the file pointed at by csdoc-html-entry-point) (defalias 'csdoc-browse-html #[nil "\203 \302 !\207\303 !\207" [csdoc-use-w3 csdoc-html-entry-point w3-open-local browse-url-of-file] 2 (#$ . 4820) nil]) (defalias 'csdoc-scan-html-files #[nil "\306\307!\310 \311\"\312\211\203\230 @\313\n!\203\221 \n\314\312O\315\232\204\221 \n\316\312O\317\232\204\221 \310\n\311\320#\312\211\203\220 @\321\322\323!! \324\216r q\210\325\f!\210\326 \210\327\330\312\311#\203\210 \331\332\333!\334\"\312!\211\"\203\207 \"@\211!\335\232\204~ !\336\232\204~ \337!\f#\210\"A\211\"\204e *+ A\211\2046 *A\211\204 *)\207" [table csdoc-html-directory sub-dir #1=#:--dolist-temp-- html-file #2=#:--dolist-temp-- makehash equal directory-files t nil file-directory-p -2 "/." -3 "/.." "\\.htm" get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#3=#:temp-buffer buffer-name kill-buffer] 2)) insert-file beginning-of-buffer re-search-forward "^