311 |
;; Return value is like the one from help-split-fundoc, but highlighted |
;; Return value is like the one from help-split-fundoc, but highlighted |
312 |
(cons usage doc)) |
(cons usage doc)) |
313 |
|
|
314 |
|
(defun describe-simplify-lib-file-name (file) |
315 |
|
"Simplify a library name FILE to a relative name, and make it a source file." |
316 |
|
(if file |
317 |
|
;; Try converting the absolute file name to a library name. |
318 |
|
(let ((libname (file-name-nondirectory file))) |
319 |
|
;; Now convert that back to a file name and see if we get |
320 |
|
;; the original one. If so, they are equivalent. |
321 |
|
(if (equal file (locate-file libname load-path '(""))) |
322 |
|
(if (string-match "[.]elc?\\'" libname) |
323 |
|
(substring libname 0 -1) |
324 |
|
libname) |
325 |
|
file)))) |
326 |
|
|
327 |
;;;###autoload |
;;;###autoload |
328 |
(defun describe-function-1 (function) |
(defun describe-function-1 (function) |
329 |
(let* ((def (if (symbolp function) |
(let* ((def (if (symbolp function) |
376 |
(help-xref-button 1 'help-function def))))) |
(help-xref-button 1 'help-function def))))) |
377 |
(or file-name |
(or file-name |
378 |
(setq file-name (symbol-file function 'defun))) |
(setq file-name (symbol-file function 'defun))) |
379 |
|
(setq file-name (describe-simplify-lib-file-name file-name)) |
380 |
(when (equal file-name "loaddefs.el") |
(when (equal file-name "loaddefs.el") |
381 |
;; Find the real def site of the preloaded function. |
;; Find the real def site of the preloaded function. |
382 |
;; This is necessary only for defaliases. |
;; This is necessary only for defaliases. |
545 |
;; change the format of the buffer's initial line in case |
;; change the format of the buffer's initial line in case |
546 |
;; anything expects the current format.) |
;; anything expects the current format.) |
547 |
(let ((file-name (symbol-file variable 'defvar))) |
(let ((file-name (symbol-file variable 'defvar))) |
548 |
|
(setq file-name (describe-simplify-lib-file-name file-name)) |
549 |
(when (equal file-name "loaddefs.el") |
(when (equal file-name "loaddefs.el") |
550 |
;; Find the real def site of the preloaded variable. |
;; Find the real def site of the preloaded variable. |
551 |
(let ((location |
(let ((location |