From: Stefan Monnier Date: Tue, 27 Nov 2001 00:26:41 +0000 (+0000) Subject: (describe-categories, help-describe-category-set): New. X-Git-Tag: ttn-vms-21-2-B4~18099 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=861d9ef6366a5f80cb0bc108792c751c22774eb8;p=emacs.git (describe-categories, help-describe-category-set): New. --- 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