emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/help-fns.el


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/help-fns.el
Date: Sun, 23 Oct 2005 15:12:10 -0400

Index: emacs/lisp/help-fns.el
diff -c emacs/lisp/help-fns.el:1.75 emacs/lisp/help-fns.el:1.76
*** emacs/lisp/help-fns.el:1.75 Tue Sep 13 14:58:35 2005
--- emacs/lisp/help-fns.el      Sun Oct 23 19:12:10 2005
***************
*** 311,316 ****
--- 311,329 ----
    ;; Return value is like the one from help-split-fundoc, but highlighted
    (cons usage doc))
  
+ (defun describe-simplify-lib-file-name (file)
+   "Simplify a library name FILE to a relative name, and make it a source 
file."
+   (if file
+       ;; Try converting the absolute file name to a library name.
+       (let ((libname (file-name-nondirectory file)))
+       ;; Now convert that back to a file name and see if we get
+       ;; the original one.  If so, they are equivalent.
+       (if (equal file (locate-file libname load-path '("")))
+           (if (string-match "[.]elc?\\'" libname)
+               (substring libname 0 -1)
+             libname)
+         file))))
+ 
  ;;;###autoload
  (defun describe-function-1 (function)
    (let* ((def (if (symbolp function)
***************
*** 363,368 ****
--- 376,382 ----
              (help-xref-button 1 'help-function def)))))
      (or file-name
        (setq file-name (symbol-file function 'defun)))
+     (setq file-name (describe-simplify-lib-file-name file-name))
      (when (equal file-name "loaddefs.el")
        ;; Find the real def site of the preloaded function.
        ;; This is necessary only for defaliases.
***************
*** 531,536 ****
--- 545,551 ----
            ;; change the format of the buffer's initial line in case
            ;; anything expects the current format.)
            (let ((file-name (symbol-file variable 'defvar)))
+             (setq file-name (describe-simplify-lib-file-name file-name))
              (when (equal file-name "loaddefs.el")
                ;; Find the real def site of the preloaded variable.
                (let ((location




reply via email to

[Prev in Thread] Current Thread [Next in Thread]