Mercurial > emacs
comparison lisp/help.el @ 29629:855fe2e4005d
(describe-function-1): Kluge around cases of functions fset to subrs
whose doc doesn't match their symbol-name.
author | Dave Love <fx@gnu.org> |
---|---|
date | Tue, 13 Jun 2000 21:04:58 +0000 |
parents | 399be97ac189 |
children | 7507f083dcc5 |
comparison
equal
deleted
inserted
replaced
29628:4580fc7c0a80 | 29629:855fe2e4005d |
---|---|
722 (with-current-buffer standard-output | 722 (with-current-buffer standard-output |
723 (beginning-of-line) | 723 (beginning-of-line) |
724 ;; Builtins get the calling sequence at the end of | 724 ;; Builtins get the calling sequence at the end of |
725 ;; the doc string. Move it to the same place as | 725 ;; the doc string. Move it to the same place as |
726 ;; for other functions. | 726 ;; for other functions. |
727 (if (looking-at (format "(%S[ )]" function)) | 727 |
728 (let ((start (point-marker))) | 728 ;; In cases where `function' has been fset to a |
729 (goto-char (point-min)) | 729 ;; subr we can't search for function's name in |
730 (forward-paragraph) | 730 ;; the doc string. Kluge round that using the |
731 (insert-buffer-substring (current-buffer) start) | 731 ;; printed representation. The arg list then |
732 (insert ?\n) | 732 ;; shows the wrong function name, but that |
733 (delete-region (1- start) (point-max))) | 733 ;; might be a useful hint. |
734 (goto-char (point-min)) | 734 (let* ((rep (prin1-to-string def)) |
735 (forward-paragraph) | 735 (name (progn |
736 (insert | 736 (string-match " \\([^ ]+\\)>$" rep) |
737 "[Missing arglist. Please make a bug report.]\n")) | 737 (match-string 1 rep)))) |
738 (if (looking-at (format "(%s[ )]" name)) | |
739 (let ((start (point-marker))) | |
740 (goto-char (point-min)) | |
741 (forward-paragraph) | |
742 (insert-buffer-substring (current-buffer) start) | |
743 (insert ?\n) | |
744 (delete-region (1- start) (point-max))) | |
745 (goto-char (point-min)) | |
746 (forward-paragraph) | |
747 (insert | |
748 "[Missing arglist. Please make a bug report.]\n"))) | |
738 (goto-char (point-max)))) | 749 (goto-char (point-max)))) |
739 (help-setup-xref (list #'describe-function function) | 750 (help-setup-xref (list #'describe-function function) |
740 interactive-p)) | 751 interactive-p)) |
741 (princ "not documented"))))) | 752 (princ "not documented"))))) |
742 | 753 |