diff options
| author | Glenn Morris | 2008-08-13 03:07:55 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-08-13 03:07:55 +0000 |
| commit | 6ad38dc0acb6370bf5a65688fc891e67ae789e5b (patch) | |
| tree | 685f0c5a320c8d467a69b23b68aed9c4deeff728 | |
| parent | 5ef52f40c528f519687623bea400ab0dd00e6422 (diff) | |
| download | emacs-6ad38dc0acb6370bf5a65688fc891e67ae789e5b.tar.gz emacs-6ad38dc0acb6370bf5a65688fc891e67ae789e5b.zip | |
(sync from trunk 2008-01-25)
Martin Rudalics <rudalics at gmx.at>
(find-library): Wrap search for library name in condition-case to
avoid reporting a scan-error. (Bug#563)
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 16 |
2 files changed, 17 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e4f7bb0f21..fa439380097 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2008-08-13 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * emacs-lisp/find-func.el (find-library): Wrap search for | ||
| 4 | library name in condition-case to avoid reporting a scan-error. | ||
| 5 | (Bug#563) (sync from trunk 2008-01-25) | ||
| 6 | |||
| 1 | 2008-08-12 Juanma Barranquero <lekktu@gmail.com> | 7 | 2008-08-12 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | * desktop.el (desktop-minor-mode-table): Add `savehist-mode'. | 9 | * desktop.el (desktop-minor-mode-table): Add `savehist-mode'. |
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 2022d3ab7d4..fc7ea2415e0 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -198,11 +198,17 @@ TYPE should be nil to find a function, or `defvar' to find a variable." | |||
| 198 | (let* ((path (cons (or find-function-source-path load-path) | 198 | (let* ((path (cons (or find-function-source-path load-path) |
| 199 | (find-library-suffixes))) | 199 | (find-library-suffixes))) |
| 200 | (def (if (eq (function-called-at-point) 'require) | 200 | (def (if (eq (function-called-at-point) 'require) |
| 201 | (save-excursion | 201 | ;; `function-called-at-point' may return 'require |
| 202 | (backward-up-list) | 202 | ;; with `point' anywhere on this line. So wrap the |
| 203 | (forward-char) | 203 | ;; `save-excursion' below in a `condition-case' to |
| 204 | (backward-sexp -2) | 204 | ;; avoid reporting a scan-error here. |
| 205 | (thing-at-point 'symbol)) | 205 | (condition-case nil |
| 206 | (save-excursion | ||
| 207 | (backward-up-list) | ||
| 208 | (forward-char) | ||
| 209 | (forward-sexp 2) | ||
| 210 | (thing-at-point 'symbol)) | ||
| 211 | (error nil)) | ||
| 206 | (thing-at-point 'symbol)))) | 212 | (thing-at-point 'symbol)))) |
| 207 | (when def | 213 | (when def |
| 208 | (setq def (and (locate-file-completion def path 'test) def))) | 214 | (setq def (and (locate-file-completion def path 'test) def))) |