Mercurial > emacs
comparison lisp/help.el @ 29370:399be97ac189
(describe-function-1): Distinguish special form from
builtin function. Sanity-check presence of arglist for builtins.
author | Dave Love <fx@gnu.org> |
---|---|
date | Thu, 01 Jun 2000 18:27:31 +0000 |
parents | 5a2cce141ebb |
children | 855fe2e4005d |
comparison
equal
deleted
inserted
replaced
29369:48dc52f114f3 | 29370:399be97ac189 |
---|---|
619 (setq string | 619 (setq string |
620 (cond ((or (stringp def) | 620 (cond ((or (stringp def) |
621 (vectorp def)) | 621 (vectorp def)) |
622 "a keyboard macro") | 622 "a keyboard macro") |
623 ((subrp def) | 623 ((subrp def) |
624 (concat beg "built-in function")) | 624 (if (eq 'unevalled (cdr (subr-arity def))) |
625 (concat beg "special form") | |
626 (concat beg "built-in function"))) | |
625 ((byte-code-function-p def) | 627 ((byte-code-function-p def) |
626 (concat beg "compiled Lisp function")) | 628 (concat beg "compiled Lisp function")) |
627 ((symbolp def) | 629 ((symbolp def) |
628 (while (symbolp (symbol-function def)) | 630 (while (symbolp (symbol-function def)) |
629 (setq def (symbol-function def))) | 631 (setq def (symbol-function def))) |
714 (terpri)))) | 716 (terpri)))) |
715 (let ((doc (documentation function))) | 717 (let ((doc (documentation function))) |
716 (if doc | 718 (if doc |
717 (progn (terpri) | 719 (progn (terpri) |
718 (princ doc) | 720 (princ doc) |
719 (with-current-buffer standard-output | 721 (if (subrp (symbol-function function)) |
720 (beginning-of-line) | 722 (with-current-buffer standard-output |
721 ;; Builtins get the calling sequence at the end of | 723 (beginning-of-line) |
722 ;; the doc string. Move it to the same place as | 724 ;; Builtins get the calling sequence at the end of |
723 ;; for other functions. | 725 ;; the doc string. Move it to the same place as |
724 (when (looking-at (format "(%S[ )]" function)) | 726 ;; for other functions. |
725 (let ((start (point-marker))) | 727 (if (looking-at (format "(%S[ )]" function)) |
726 (goto-char (point-min)) | 728 (let ((start (point-marker))) |
727 (forward-paragraph) | 729 (goto-char (point-min)) |
728 (insert-buffer-substring (current-buffer) start) | 730 (forward-paragraph) |
729 (insert ?\n) | 731 (insert-buffer-substring (current-buffer) start) |
730 (delete-region (1- start) (point-max)) | 732 (insert ?\n) |
731 (goto-char (point-max))))) | 733 (delete-region (1- start) (point-max))) |
734 (goto-char (point-min)) | |
735 (forward-paragraph) | |
736 (insert | |
737 "[Missing arglist. Please make a bug report.]\n")) | |
738 (goto-char (point-max)))) | |
732 (help-setup-xref (list #'describe-function function) | 739 (help-setup-xref (list #'describe-function function) |
733 interactive-p)) | 740 interactive-p)) |
734 (princ "not documented"))))) | 741 (princ "not documented"))))) |
735 | 742 |
736 (defun variable-at-point () | 743 (defun variable-at-point () |