From: Stefan Monnier Date: Sun, 25 Nov 2001 22:03:45 +0000 (+0000) Subject: (describe-syntax): New fun. X-Git-Tag: ttn-vms-21-2-B4~18172 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c477f6880fca3bf593c6e02eb7fcdc6057dfac78;p=emacs.git (describe-syntax): New fun. --- diff --git a/lisp/help-funs.el b/lisp/help-funs.el index 3aaf58c9052..62049971d3f 100644 --- a/lisp/help-funs.el +++ b/lisp/help-funs.el @@ -436,6 +436,22 @@ it is displayed along with the global value." (buffer-string))))))) +;;;###autoload +(defun describe-syntax (&optional buffer) + (interactive) + "Describe the syntax specifications in the syntax table of BUFFER. +The descriptions are inserted in a help buffer, which is then displayed. +BUFFER defaults to the current buffer." + (setq buffer (or buffer (current-buffer))) + (help-setup-xref (list #'describe-syntax buffer) (interactive-p)) + (with-output-to-temp-buffer (help-buffer) + (let ((table (with-current-buffer buffer (syntax-table)))) + (with-current-buffer standard-output + (describe-vector table 'internal-describe-syntax-value) + (while (setq table (char-table-parent table)) + (insert "\nThe parent syntax table is:") + (describe-vector table 'internal-describe-syntax-value)))))) + (provide 'help-funs) ;;; help-funs.el ends here