Commit 77694924 authored by Stefan Monnier's avatar Stefan Monnier

* lisp/emacs-lisp/find-func.el (find-function-C-source): Only set

find-function-C-source-directory after checking that we found a source
file there.

Fixes: debbugs:9440
parent c8199d0f
2011-09-07 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/find-func.el (find-function-C-source): Only set
find-function-C-source-directory after checking that we found a source
file there (bug#9440).
2011-09-06 Alan Mackenzie <acm@muc.de>
* isearch.el (isearch-other-meta-char): Wherever a key list is
......
......@@ -198,13 +198,14 @@ If FUNC is not the symbol of an advised function, just returns FUNC."
(defun find-function-C-source (fun-or-var file type)
"Find the source location where FUN-OR-VAR is defined in FILE.
TYPE should be nil to find a function, or `defvar' to find a variable."
(unless find-function-C-source-directory
(setq find-function-C-source-directory
(read-directory-name "Emacs C source dir: " nil nil t)))
(setq file (expand-file-name file find-function-C-source-directory))
(unless (file-readable-p file)
(error "The C source file %s is not available"
(file-name-nondirectory file)))
(let ((dir (or find-function-C-source-directory
(read-directory-name "Emacs C source dir: " nil nil t))))
(setq file (expand-file-name file dir))
(if (file-readable-p file)
(if (null find-function-C-source-directory)
(setq find-function-C-source-directory dir))
(error "The C source file %s is not available"
(file-name-nondirectory file))))
(unless type
;; Either or both an alias and its target might be advised.
(setq fun-or-var (find-function-advised-original
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment