summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2001-11-27 00:26:41 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2001-11-27 00:26:41 +0000
commit3651915bf04424ee609cdf0ab389cd585ac5f037 (patch)
tree98a8801a5c50bd9c19a63a4e02e2b41b40e02a83 /lisp/help-fns.el
parent205e0d8bc3a5f642e804a92adbef31dbd9cbcbdb (diff)
downloademacs-3651915bf04424ee609cdf0ab389cd585ac5f037.tar.gz
(describe-categories, help-describe-category-set): New.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el31
1 files changed, 31 insertions, 0 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 366c798b137..21e3fa993dd 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -452,6 +452,37 @@ BUFFER defaults to the current buffer."
(insert "\nThe parent syntax table is:")
(describe-vector table 'internal-describe-syntax-value))))))
+(defun help-describe-category-set (value)
+ (insert (cond
+ ((null value) "default")
+ ((char-table-p value) "deeper char-table ...")
+ (t (condition-case err
+ (category-set-mnemonics value)
+ (error "invalid"))))))
+
+;;;###autoload
+(defun describe-categories (&optional buffer)
+ "Describe the category specifications in the current category table.
+The descriptions are inserted in a buffer, which is then displayed."
+ (interactive)
+ (setq buffer (or buffer (current-buffer)))
+ (help-setup-xref (list #'describe-categories buffer) (interactive-p))
+ (with-output-to-temp-buffer (help-buffer)
+ (let ((table (with-current-buffer buffer (category-table))))
+ (with-current-buffer standard-output
+ (describe-vector table 'help-describe-category-set)
+ (let ((docs (char-table-extra-slot table 0)))
+ (if (or (not (vectorp docs)) (/= (length docs) 95))
+ (insert "Invalid first extra slot in this char table\n")
+ (insert "Meanings of mnemonic characters are:\n")
+ (dotimes (i 95)
+ (let ((elt (aref docs i)))
+ (when elt
+ (insert (+ i ?\ ) ": " elt "\n"))))
+ (while (setq table (char-table-parent table))
+ (insert "\nThe parent category table is:")
+ (describe-vector table 'help-describe-category-set))))))))
+
(provide 'help-fns)
;;; help-fns.el ends here