summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2001-10-11 23:34:07 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2001-10-11 23:34:07 +0000
commit8422a3b87df3de700b7884abc74d5bf12ccca772 (patch)
tree379b37607dab18d32e0c72e8340d2f43c8aa6729 /lisp
parent89f5b33fc70bdc2f0edc4a0ef75542a1a12bc133 (diff)
downloademacs-8422a3b87df3de700b7884abc74d5bf12ccca772.tar.gz
(describe-function-1): Remove unused `parens' arg.
Don't call help-setup-xref anymore and remove its `interactive-p' arg. Autoload and cleanup. (describe-function): Call help-setup-xref. (describe-variable): Call help-setup-xref earlier.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/help-funs.el42
1 files changed, 20 insertions, 22 deletions
diff --git a/lisp/help-funs.el b/lisp/help-funs.el
index 6f84bc512bf..73cde500543 100644
--- a/lisp/help-funs.el
+++ b/lisp/help-funs.el
@@ -33,6 +33,9 @@
;;; Code:
+(require 'help-mode)
+
+
;;;###autoload
(defun help-with-tutorial (&optional arg)
"Select the Emacs learn-by-doing tutorial.
@@ -144,23 +147,24 @@ and the file name is displayed in the echo area."
fn (intern val)))))
(if (null function)
(message "You didn't specify a function")
- (with-output-to-temp-buffer "*Help*"
+ (help-setup-xref (list #'describe-function function) (interactive-p))
+ (with-output-to-temp-buffer (help-buffer)
(prin1 function)
;; Use " is " instead of a colon so that
;; it is easier to get out the function name using forward-sexp.
(princ " is ")
- (describe-function-1 function nil (interactive-p))
+ (describe-function-1 function)
(print-help-return-message)
- (save-excursion
- (set-buffer standard-output)
- ;; Return the text we displayed.
+ (with-current-buffer standard-output
+ ;; Return the text we displayed.
(buffer-string)))))
-(defun describe-function-1 (function parens interactive-p)
+;;;###autoload
+(defun describe-function-1 (function)
(let* ((def (if (symbolp function)
(symbol-function function)
function))
- file-name string need-close
+ file-name string
(beg (if (commandp def) "an interactive " "a ")))
(setq string
(cond ((or (stringp def)
@@ -202,30 +206,26 @@ and the file name is displayed in the echo area."
"a full keymap"
"a sparse keymap")))
(t "")))
- (when (and parens (not (equal string "")))
- (setq need-close t)
- (princ "("))
(princ string)
- (with-current-buffer "*Help*"
+ (with-current-buffer standard-output
(save-excursion
(save-match-data
(if (re-search-backward "alias for `\\([^`']+\\)'" nil t)
(help-xref-button 1 'help-function def)))))
(or file-name
(setq file-name (symbol-file function)))
- (if file-name
- (progn
+ (cond
+ (file-name
(princ " in `")
;; We used to add .el to the file name,
;; but that's completely wrong when the user used load-file.
(princ file-name)
(princ "'")
;; Make a hyperlink to the library.
- (with-current-buffer "*Help*"
+ (with-current-buffer standard-output
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
- (help-xref-button 1 'help-function-def function file-name)))))
- (if need-close (princ ")"))
+ (help-xref-button 1 'help-function-def function file-name)))))
(princ ".")
(terpri)
(when (commandp function)
@@ -294,9 +294,7 @@ and the file name is displayed in the echo area."
(forward-paragraph)
(insert
"[Missing arglist. Please make a bug report.]\n")))
- (goto-char (point-max))))
- (help-setup-xref (list #'describe-function function)
- interactive-p))
+ (goto-char (point-max)))))
(princ "not documented")))))
@@ -341,8 +339,10 @@ it is displayed along with the global value."
(if (not (symbolp variable))
(message "You did not specify a variable")
(let (valvoid)
+ (help-setup-xref (list #'describe-variable variable buffer)
+ (interactive-p))
+ (with-output-to-temp-buffer (help-buffer)
(with-current-buffer buffer
- (with-output-to-temp-buffer "*Help*"
(prin1 variable)
(if (not (boundp variable))
(progn
@@ -407,8 +407,6 @@ it is displayed along with the global value."
(terpri)
(let ((doc (documentation-property variable 'variable-documentation)))
(princ (or doc "not documented as a variable.")))
- (help-setup-xref (list #'describe-variable variable (current-buffer))
- (interactive-p))
;; Make a link to customize if this variable can be customized.
;; Note, it is not reliable to test only for a custom-type property