summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/help-fns.el7
2 files changed, 11 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 767b00eae77..90dcebcc23e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * help-fns.el (help-C-file-name): File name must be in build-files
+ to be returned.
+
2004-11-09 Jay Belanger <belanger@truman.edu>
* calc/calc.el (calc-mode-hook, calc-trail-mode-hook)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 8f2a1b7fa6e..c06a7b1ee73 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -228,9 +228,14 @@ KIND should be `var' for a variable or `subr' for a subroutine."
(if (eobp)
(insert-file-contents-literally
(expand-file-name internal-doc-file-name doc-directory)))
- (search-forward (concat "" name "\n"))
+ (let ((file (catch 'loop
+ (while t
+ (let ((pnt (search-forward (concat "" name "\n"))))
(re-search-backward "S\\(.*\\)")
(let ((file (match-string 1)))
+ (if (member file build-files)
+ (throw 'loop file)
+ (goto-char pnt))))))))
(if (string-match "\\.\\(o\\|obj\\)\\'" file)
(setq file (replace-match ".c" t t file)))
(if (string-match "\\.c\\'" file)