diff options
| author | Stefan Monnier | 2011-09-06 21:06:09 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-09-06 21:06:09 -0400 |
| commit | 77694924d89ca42fbf115391baf26be00fd074ca (patch) | |
| tree | 6da7624a77e457f4bb3984d8881f2e0c91644010 | |
| parent | c8199d0f9eb45a99de074ec10b893f737f738cd8 (diff) | |
| download | emacs-77694924d89ca42fbf115391baf26be00fd074ca.tar.gz emacs-77694924d89ca42fbf115391baf26be00fd074ca.zip | |
* 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
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d82391d691a..979708e2c91 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-09-07 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/find-func.el (find-function-C-source): Only set | ||
| 4 | find-function-C-source-directory after checking that we found a source | ||
| 5 | file there (bug#9440). | ||
| 6 | |||
| 1 | 2011-09-06 Alan Mackenzie <acm@muc.de> | 7 | 2011-09-06 Alan Mackenzie <acm@muc.de> |
| 2 | 8 | ||
| 3 | * isearch.el (isearch-other-meta-char): Wherever a key list is | 9 | * isearch.el (isearch-other-meta-char): Wherever a key list is |
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 2c7208db8a3..08e73b32a15 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -198,13 +198,14 @@ If FUNC is not the symbol of an advised function, just returns FUNC." | |||
| 198 | (defun find-function-C-source (fun-or-var file type) | 198 | (defun find-function-C-source (fun-or-var file type) |
| 199 | "Find the source location where FUN-OR-VAR is defined in FILE. | 199 | "Find the source location where FUN-OR-VAR is defined in FILE. |
| 200 | TYPE should be nil to find a function, or `defvar' to find a variable." | 200 | TYPE should be nil to find a function, or `defvar' to find a variable." |
| 201 | (unless find-function-C-source-directory | 201 | (let ((dir (or find-function-C-source-directory |
| 202 | (setq find-function-C-source-directory | 202 | (read-directory-name "Emacs C source dir: " nil nil t)))) |
| 203 | (read-directory-name "Emacs C source dir: " nil nil t))) | 203 | (setq file (expand-file-name file dir)) |
| 204 | (setq file (expand-file-name file find-function-C-source-directory)) | 204 | (if (file-readable-p file) |
| 205 | (unless (file-readable-p file) | 205 | (if (null find-function-C-source-directory) |
| 206 | (error "The C source file %s is not available" | 206 | (setq find-function-C-source-directory dir)) |
| 207 | (file-name-nondirectory file))) | 207 | (error "The C source file %s is not available" |
| 208 | (file-name-nondirectory file)))) | ||
| 208 | (unless type | 209 | (unless type |
| 209 | ;; Either or both an alias and its target might be advised. | 210 | ;; Either or both an alias and its target might be advised. |
| 210 | (setq fun-or-var (find-function-advised-original | 211 | (setq fun-or-var (find-function-advised-original |