3 (defun update-lispdoc-tags ()
6 (goto-char (point-min))
7 (while (re-search-forward "^@c lispfun \\(.+\\)" nil t)
8 (let ((name (match-string 1)) begin end)
9 (message "Update lispdoc for function '%s'" name)
10 (if (re-search-forward (concat "^@defun " name) nil t)
11 (setq begin (match-beginning 0)))
12 (if (re-search-forward "^@end defun" nil t)
13 (setq end (match-end 0)))
15 (delete-region begin end))
16 (let* ((sym (or (intern-soft name)
17 (signal 'wrong-type-argument
18 (list 'functionp name))))
19 (data (let ((func (symbol-function sym)))
21 (setq func (symbol-function func)))
23 (args (pp-to-string (if (listp data)
26 (doc (documentation sym)))
27 (if (or (null doc) (= (length doc) 0))
28 (message "warning: no documentation available for '%s'" name)
29 (unless (and begin end)
31 (insert (format "@defun %s %s\n" name
32 (substring args 1 (- (length args) 2))))
36 (narrow-to-region begin (point))
37 (goto-char (point-min))
38 (let ((case-fold-search nil))
39 (while (re-search-forward "[A-Z][A-Z-]+" nil t)
40 (replace-match (format "@var{%s}"
41 (downcase (match-string 0))) t t)))
42 (goto-char (point-max)))
43 (insert "@end defun")))))))
45 (defun chess-undocd-functions ()
48 (dolist (func (apropos-internal "^chess-" 'functionp))
49 (goto-char (point-min))
50 (unless (search-forward (concat "@c lispfun " (symbol-name func)) nil t)
51 (message "Missing documentation for '%s'" (symbol-name func))))))