".elc"))
load-path))
(str (if (and elc-file (file-readable-p elc-file))
- (with-temp-buffer
+ (with-temp-buffer
(insert-file-contents-literally elc-file nil 0 256)
(buffer-string))))
(src-file (and str
;;;###autoload
(defun describe-function-1 (function)
- (let* ((def (if (symbolp function)
- (symbol-function function)
+ (let* ((advised (and (featurep 'advice) (ad-get-advice-info function)))
+ ;; If the function is advised, use the symbol that has the
+ ;; real definition, if that symbol is already set up.
+ (real-function
+ (or (and advised
+ (cdr (assq 'origname advised))
+ (fboundp (cdr (assq 'origname advised)))
+ (cdr (assq 'origname advised)))
+ function))
+ ;; Get the real definition.
+ (def (if (symbolp real-function)
+ (symbol-function real-function)
function))
file-name string
(beg (if (commandp def) "an interactive " "a ")))
(with-current-buffer standard-output
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
- (help-xref-button 1 'help-function-def function file-name))))
+ (help-xref-button 1 'help-function-def real-function file-name))))
(princ ".")
(terpri)
(when (commandp function)
((listp arglist)
(format "%S" (help-make-usage function arglist)))
((stringp arglist) arglist)
- ;; Maybe the arglist is in the docstring of the alias.
- ((let ((fun function))
+ ;; Maybe the arglist is in the docstring of a symbol
+ ;; this one is aliased to.
+ ((let ((fun real-function))
(while (and (symbolp fun)
(setq fun (symbol-function fun))
(not (setq usage (help-split-fundoc
;; See previous comment for this function.
;; (help-xref-on-pp from (point))
(if (< (point) (+ from 20))
- (delete-region (1- from) from)))))))
+ (delete-region (1- from) from))))))
+ (terpri))
;; If the value is large, move it to the end.
(with-current-buffer standard-output
(setq extra-line t)
(princ " This variable is obsolete")
(if (cdr obsolete) (princ (format " since %s" (cdr obsolete))))
- (princ ";") (terpri)
+ (princ ";\n ")
(princ (if (stringp (car obsolete)) (car obsolete)
(format "use `%s' instead." (car obsolete))))
(terpri))