diff options
| author | Stefan Monnier | 2010-10-21 23:17:26 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-10-21 23:17:26 -0400 |
| commit | 7c23d9e85b58d0cc360c255ff86bd3e723259d7f (patch) | |
| tree | 99bb84d8d07c2322aa4743d02355fa53ca96e4de | |
| parent | e0da801ae4b5791480bce39e1d4337e02f3bcb7a (diff) | |
| download | emacs-7c23d9e85b58d0cc360c255ff86bd3e723259d7f.tar.gz emacs-7c23d9e85b58d0cc360c255ff86bd3e723259d7f.zip | |
* lisp/emacs-lisp/find-func.el (find-library): Use test-completion.
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 12 |
2 files changed, 14 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e29cf4a01f..4312c06dd05 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | 2010-10-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/find-func.el (find-library): Use test-completion. | ||
| 4 | |||
| 1 | 2010-10-21 Lars Magne Ingebrigtsen <larsi@gnus.org> | 5 | 2010-10-21 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 6 | ||
| 3 | * newcomment.el (comment-dwim): Fix the intentation in the doc | 7 | * newcomment.el (comment-dwim): Fix the intentation in the doc string. |
| 4 | string. | ||
| 5 | 8 | ||
| 6 | 010-10-21 Michael Albinus <michael.albinus@gmx.de> | 9 | 010-10-21 Michael Albinus <michael.albinus@gmx.de> |
| 7 | 10 | ||
| @@ -13,15 +16,15 @@ | |||
| 13 | 16 | ||
| 14 | 2010-10-21 Daiki Ueno <ueno@unixuser.org> | 17 | 2010-10-21 Daiki Ueno <ueno@unixuser.org> |
| 15 | 18 | ||
| 16 | * hexl.el (hexl-mode, hexl-mode-exit): Tweak | 19 | * hexl.el (hexl-mode, hexl-mode-exit): |
| 17 | revert-buffer-function to inhibit auto-mode-alist (Bug#7252). | 20 | Tweak revert-buffer-function to inhibit auto-mode-alist (Bug#7252). |
| 18 | (hexl-revert-buffer-function): New function. | 21 | (hexl-revert-buffer-function): New function. |
| 19 | (hexl-before-revert-hook, hexl-after-revert-hook): Abolish. | 22 | (hexl-before-revert-hook, hexl-after-revert-hook): Abolish. |
| 20 | 23 | ||
| 21 | 2010-10-19 Alan Mackenzie <acm@muc.de> | 24 | 2010-10-19 Alan Mackenzie <acm@muc.de> |
| 22 | 25 | ||
| 23 | * progmodes/cc-langs.el (c-type-decl-prefix-key): C++ bit: move | 26 | * progmodes/cc-langs.el (c-type-decl-prefix-key): C++ bit: |
| 24 | "\(const\|throw\|volatile\)\>" nearer the start of the regexp, so | 27 | Move "\(const\|throw\|volatile\)\>" nearer the start of the regexp, so |
| 25 | that these keywords aren't wrongly matched as identifiers. | 28 | that these keywords aren't wrongly matched as identifiers. |
| 26 | 29 | ||
| 27 | * progmodes/cc-mode.el (c-before-change, c-after-change): Move the | 30 | * progmodes/cc-mode.el (c-before-change, c-after-change): Move the |
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 216d91baa7b..9d59337a7c7 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -213,6 +213,8 @@ LIBRARY should be a string (the name of the library)." | |||
| 213 | (interactive | 213 | (interactive |
| 214 | (let* ((dirs (or find-function-source-path load-path)) | 214 | (let* ((dirs (or find-function-source-path load-path)) |
| 215 | (suffixes (find-library-suffixes)) | 215 | (suffixes (find-library-suffixes)) |
| 216 | (table (apply-partially 'locate-file-completion-table | ||
| 217 | dirs suffixes)) | ||
| 216 | (def (if (eq (function-called-at-point) 'require) | 218 | (def (if (eq (function-called-at-point) 'require) |
| 217 | ;; `function-called-at-point' may return 'require | 219 | ;; `function-called-at-point' may return 'require |
| 218 | ;; with `point' anywhere on this line. So wrap the | 220 | ;; with `point' anywhere on this line. So wrap the |
| @@ -226,16 +228,12 @@ LIBRARY should be a string (the name of the library)." | |||
| 226 | (thing-at-point 'symbol)) | 228 | (thing-at-point 'symbol)) |
| 227 | (error nil)) | 229 | (error nil)) |
| 228 | (thing-at-point 'symbol)))) | 230 | (thing-at-point 'symbol)))) |
| 229 | (when def | 231 | (when (and def (not (test-completion def table))) |
| 230 | (setq def (and (locate-file-completion-table | 232 | (setq def nil)) |
| 231 | dirs suffixes def nil 'lambda) | ||
| 232 | def))) | ||
| 233 | (list | 233 | (list |
| 234 | (completing-read (if def (format "Library name (default %s): " def) | 234 | (completing-read (if def (format "Library name (default %s): " def) |
| 235 | "Library name: ") | 235 | "Library name: ") |
| 236 | (apply-partially 'locate-file-completion-table | 236 | table nil nil nil nil def)))) |
| 237 | dirs suffixes) | ||
| 238 | nil nil nil nil def)))) | ||
| 239 | (let ((buf (find-file-noselect (find-library-name library)))) | 237 | (let ((buf (find-file-noselect (find-library-name library)))) |
| 240 | (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf))))) | 238 | (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf))))) |
| 241 | 239 | ||